Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M

num_gb_pipes was set to a wrong value using r420_pipe_config

This have lead to HyperZ glitches on fast Z clearing.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=110897
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Richard Thier <u9vata@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 044e59a85c4d84e3c8d004c486e5c479640563a6)
Cc: stable@vger.kernel.org

authored by

Richard Thier and committed by
Alex Deucher
29ffeb73 fd617ea3

+19 -3
+2 -1
drivers/gpu/drm/radeon/r300.c
··· 359 359 return -1; 360 360 } 361 361 362 - static void r300_gpu_init(struct radeon_device *rdev) 362 + /* rs400_gpu_init also calls this! */ 363 + void r300_gpu_init(struct radeon_device *rdev) 363 364 { 364 365 uint32_t gb_tile_config, tmp; 365 366
+1
drivers/gpu/drm/radeon/radeon_asic.h
··· 165 165 */ 166 166 extern int r300_init(struct radeon_device *rdev); 167 167 extern void r300_fini(struct radeon_device *rdev); 168 + extern void r300_gpu_init(struct radeon_device *rdev); 168 169 extern int r300_suspend(struct radeon_device *rdev); 169 170 extern int r300_resume(struct radeon_device *rdev); 170 171 extern int r300_asic_reset(struct radeon_device *rdev, bool hard);
+16 -2
drivers/gpu/drm/radeon/rs400.c
··· 256 256 257 257 static void rs400_gpu_init(struct radeon_device *rdev) 258 258 { 259 - /* FIXME: is this correct ? */ 260 - r420_pipes_init(rdev); 259 + /* Earlier code was calling r420_pipes_init and then 260 + * rs400_mc_wait_for_idle(rdev). The problem is that 261 + * at least on my Mobility Radeon Xpress 200M RC410 card 262 + * that ends up in this code path ends up num_gb_pipes == 3 263 + * while the card seems to have only one pipe. With the 264 + * r420 pipe initialization method. 265 + * 266 + * Problems shown up as HyperZ glitches, see: 267 + * https://bugs.freedesktop.org/show_bug.cgi?id=110897 268 + * 269 + * Delegating initialization to r300 code seems to work 270 + * and results in proper pipe numbers. The rs400 cards 271 + * are said to be not r400, but r300 kind of cards. 272 + */ 273 + r300_gpu_init(rdev); 274 + 261 275 if (rs400_mc_wait_for_idle(rdev)) { 262 276 pr_warn("rs400: Failed to wait MC idle while programming pipes. Bad things might happen. %08x\n", 263 277 RREG32(RADEON_MC_STATUS));