]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M
authorRichard Thier <u9vata@gmail.com>
Mon, 17 Jun 2019 21:46:27 +0000 (23:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:47:36 +0000 (12:47 +0100)
commit 29ffeb73b216ce3eff10229eb077cf9b7812119d upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/rs400.c

index 73f67bf222e1648894f58224f1f72b6a2dc4016c..7474fa2123a7861c8965c8b0e051d1684498b8af 100644 (file)
@@ -361,7 +361,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;
 
index a74fa18cd27b5989d9497f2130e9413159bb198a..e5a85950d801e9f35c06c04bbba9744473175750 100644 (file)
@@ -165,6 +165,7 @@ void r200_set_safe_registers(struct radeon_device *rdev);
  */
 extern int r300_init(struct radeon_device *rdev);
 extern void r300_fini(struct radeon_device *rdev);
+extern void r300_gpu_init(struct radeon_device *rdev);
 extern int r300_suspend(struct radeon_device *rdev);
 extern int r300_resume(struct radeon_device *rdev);
 extern int r300_asic_reset(struct radeon_device *rdev, bool hard);
index 117f60af1ee4d0db988860d46ce003897e46c139..7c2715f93064c10edc4a19a2d19b25b7009e020c 100644 (file)
@@ -257,8 +257,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));