drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M
Subsystems (2)
PATCH 1/1 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.
See: https://bugs.freedesktop.org/show_bug.cgi?id=110897
--- drivers/gpu/drm/radeon/r300.c | 3 ++- drivers/gpu/drm/radeon/rs400.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/r300.c +2 -1
@@ -355,7 +355,8 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)return -1 ; } -static void r300_gpu_init (struct radeon_device *rdev) +/* rs400_gpu_init also calls this! */ +void r300_gpu_init (struct radeon_device *rdev) {uint32_t gb_tile_config, tmp;
drivers/gpu/drm/radeon/rs400.c +19 -2
@@ -32,6 +32,9 @@#include "radeon_asic.h" #include "rs400d.h" +/* Needed for rs400_gpu_init that forwards to the r300 one */ +void r300_gpu_init (struct radeon_device *rdev); +/* This files gather functions specifics to : rs400,rs480 */ static int rs400_debugfs_pcie_gart_info_init (struct radeon_device *rdev);
@@ -252,8 +255,22 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev)static void rs400_gpu_init (struct radeon_device *rdev) { -/* FIXME: is this correct ? */ -r420_pipes_init (rdev); +/* Earlier code was calling r420_pipes_init and then +* rs400_mc_wait_for_idle(rdev). The problem is that +* at least on my Mobility Radeon Xpress 200M RC410 card +* that ends up in this code path ends up num_gb_pipes == 3 +* while the card seems to have only one pipe. With the +* r420 pipe initialization method. +* +* Problems shown up as HyperZ glitches, see: +* https://bugs.freedesktop.org/show_bug.cgi?id=110897 +* +* Delegating initialization to r300 code seems to work +* and results in proper pipe numbers. The rs400 cards +* are said to be not r400, but r300 kind of cards. +*/ +r300_gpu_init (rdev); +if (rs400_mc_wait_for_idle (rdev)) {pr_warn ("rs400: Failed to wait MC idle while programming pipes. Bad things might happen. %08x\n" ,RREG32 (RADEON_MC_STATUS ));
Signature · 6 lines
2.21.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 74 lines · Richard Thier
num_gb_pipeswas set to a wrong value usingr420_pipe_configThis have lead to HyperZ glitches on fast Z clearing.
See: https://bugs.freedesktop.org/show_bug.cgi?id=110897
Signed-off-by Richard Thier <[email protected]>--- drivers/gpu/drm/radeon/r300.c | 3 ++- drivers/gpu/drm/radeon/rs400.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-)drivers/gpu/drm/radeon/r300.c +2
-1@@ -355,7 +355,8 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)return -1 ; } -static void r300_gpu_init (struct radeon_device *rdev) +/* rs400_gpu_init also calls this! */ +void r300_gpu_init (struct radeon_device *rdev) {uint32_t gb_tile_config, tmp;drivers/gpu/drm/radeon/rs400.c +19
-2@@ -32,6 +32,9 @@#include "radeon_asic.h" #include "rs400d.h" +/* Needed for rs400_gpu_init that forwards to the r300 one */ +void r300_gpu_init (struct radeon_device *rdev); +/* This files gather functions specifics to : rs400,rs480 */ static int rs400_debugfs_pcie_gart_info_init (struct radeon_device *rdev);@@ -252,8 +255,22 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev)static void rs400_gpu_init (struct radeon_device *rdev) { -/* FIXME: is this correct ? */ -r420_pipes_init (rdev); +/* Earlier code was calling r420_pipes_init and then +* rs400_mc_wait_for_idle(rdev). The problem is that +* at least on my Mobility Radeon Xpress 200M RC410 card +* that ends up in this code path ends up num_gb_pipes == 3 +* while the card seems to have only one pipe. With the +* r420 pipe initialization method. +* +* Problems shown up as HyperZ glitches, see: +* https://bugs.freedesktop.org/show_bug.cgi?id=110897 +* +* Delegating initialization to r300 code seems to work +* and results in proper pipe numbers. The rs400 cards +* are said to be not r400, but r300 kind of cards. +*/ +r300_gpu_init (rdev); +if (rs400_mc_wait_for_idle (rdev)) { pr_warn("rs400: Failed to wait MC idle while programming pipes. Bad things might happen. %08x\n",RREG32(RADEON_MC_STATUS));--
2.21.0_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied with a small tweak to fix a warning.
Thanks,
Alex
Quoted 77 lines · Marek Olšák
Reviewed-by Marek Olšák <[email protected]>Quoted 73 lines · Richard Thier
num_gb_pipeswas set to a wrong value usingr420_pipe_configThis have lead to HyperZ glitches on fast Z clearing.
See: https://bugs.freedesktop.org/show_bug.cgi?id=110897
Signed-off-by Richard Thier <[email protected]>--- drivers/gpu/drm/radeon/r300.c | 3 ++- drivers/gpu/drm/radeon/rs400.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-)drivers/gpu/drm/radeon/r300.c +2
-1@@ -355,7 +355,8 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)return -1 ; } -static void r300_gpu_init (struct radeon_device *rdev) +/* rs400_gpu_init also calls this! */ +void r300_gpu_init (struct radeon_device *rdev) {uint32_t gb_tile_config, tmp;drivers/gpu/drm/radeon/rs400.c +19
-3@@ -32,6 +32,9 @@#include "radeon_asic.h" #include "rs400d.h" +/* Needed for rs400_gpu_init that forwards to the r300 one */ +void r300_gpu_init (struct radeon_device *rdev); +/* This files gather functions specifics to : rs400,rs480 */ static int rs400_debugfs_pcie_gart_info_init (struct radeon_device *rdev);@@ -252,8 +255,22 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev)static void rs400_gpu_init (struct radeon_device *rdev) { -/* FIXME: is this correct ? */ -r420_pipes_init (rdev); +/* Earlier code was calling r420_pipes_init and then +* rs400_mc_wait_for_idle(rdev). The problem is that +* at least on my Mobility Radeon Xpress 200M RC410 card +* that ends up in this code path ends up num_gb_pipes == 3 +* while the card seems to have only one pipe. With the +* r420 pipe initialization method. +* +* Problems shown up as HyperZ glitches, see: +* https://bugs.freedesktop.org/show_bug.cgi?id=110897 +* +* Delegating initialization to r300 code seems to work +* and results in proper pipe numbers. The rs400 cards +* are said to be not r400, but r300 kind of cards. +*/ +r300_gpu_init (rdev); +if (rs400_mc_wait_for_idle (rdev)) {pr_warn ("rs400: Failed to wait MC idle while programming pipes. Bad things might happen. %08x\n" ,RREG32 (RADEON_MC_STATUS )); --2.21.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx