Skip to contentSkip to conversation

drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx

PATCH Applied Michel Dänzer 3 participants 5 messages Nov 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx

From: Michel Dänzer <[email protected]>

They reportedly cause random GPU hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91268

---
 drivers/gpu/drm/radeon/radeon_object.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +6 -0
index d302488..a35f5af 100644
@@ -221,6 +221,12 @@ int radeon_bo_create(struct radeon_device *rdev,
 	if (!(rdev->flags & RADEON_IS_PCIE))
 		bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
 
+	/* Write-combined CPU mappings of GTT cause GPU hangs with RV6xx
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=91268
+	 */
+	if (rdev->family >= CHIP_RV610 && rdev->family <= CHIP_RV635)
+		bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
+
 #ifdef CONFIG_X86_32
 	/* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
 	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/3 drm/radeon: Always disable RADEON_GEM_GTT_UC along with RADEON_GEM_GTT_WC

From: Michel Dänzer <[email protected]>

Write-combining is a CPU feature. From the GPU POV, these both simply mean no GPU<->CPU cache coherency.

---
 drivers/gpu/drm/radeon/radeon_object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_object.c +2 -2
index a35f5af..dda2ecf 100644
@@ -231,7 +231,7 @@ int radeon_bo_create(struct radeon_device *rdev,
 	/* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
 	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
 	 */
-	bo->flags &= ~RADEON_GEM_GTT_WC;
+	bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
 #elif defined(CONFIG_X86) && !defined(CONFIG_X86_PAT)
 	/* Don't try to enable write-combining when it can't work, or things
 	 * may be slow
@@ -243,7 +243,7 @@ int radeon_bo_create(struct radeon_device *rdev,
 
 	DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
 		      "better performance thanks to write-combining\n");
-	bo->flags &= ~RADEON_GEM_GTT_WC;
+	bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
 #endif
 
 	radeon_ttm_placement_from_domain(bo, domain);
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 3/3 drm/radeon: Only prompt for enabling PAT when we'd allow write-combining

In reply to Michel Dänzer

From: Michel Dänzer <[email protected]>

No use bothering users about this for whom we disable write-combining for other reasons anyway.

---
 drivers/gpu/drm/radeon/radeon_object.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_object.c +3 -2
index dda2ecf..84d4563 100644
@@ -241,8 +241,9 @@ int radeon_bo_create(struct radeon_device *rdev,
 #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \
 	 thanks to write-combining
 
-	DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
-		      "better performance thanks to write-combining\n");
+	if (bo->flags & RADEON_GEM_GTT_WC)
+		DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
+			      "better performance thanks to write-combining\n");
 	bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
 #endif
 
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
In reply to Michel Dänzer
Quoted 8 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

They reportedly cause random GPU hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91268

For this series Reviewed-by: Christian König <[email protected]>

Quoted 11 lines
---
  drivers/gpu/drm/radeon/radeon_object.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +0 -0
index d302488..a35f5af 100644
@@ -221,6 +221,12 @@ int radeon_bo_create(struct radeon_device *rdev,
  	if (!(rdev->flags & RADEON_IS_PCIE))
  		bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);

drivers/gpu/drm/radeon/radeon_object.c int radeon_bo_create(struct radeon_device *rdev, · line 232

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_object.c +6 -0
 
+	/* Write-combined CPU mappings of GTT cause GPU hangs with RV6xx
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=91268
+	 */
+	if (rdev->family >= CHIP_RV610 && rdev->family <= CHIP_RV635)
+		bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
+
  #ifdef CONFIG_X86_32
  	/* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
  	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#4 lore raw
Quoted 6 lines · Christian König
Quoted 5 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

They reportedly cause random GPU hangs.

Quoted 7 lines
Quoted 4 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91268

For this series Reviewed-by: Christian König <[email protected]>

Applied. thanks!

Alex

Quoted 20 lines
Quoted 20 lines
---
  drivers/gpu/drm/radeon/radeon_object.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +5 -0
index d302488..a35f5af 100644
@@ -221,6 +221,12 @@ int radeon_bo_create(struct radeon_device *rdev,
        if (!(rdev->flags & RADEON_IS_PCIE))
                bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
  +     /* Write-combined CPU mappings of GTT cause GPU hangs with RV6xx
+        * See https://bugs.freedesktop.org/show_bug.cgi?id=91268
+        */
+       if (rdev->family >= CHIP_RV610 && rdev->family <= CHIP_RV635)
+               bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
+
  #ifdef CONFIG_X86_32
Quoted 8 lines

drivers/gpu/drm/radeon/radeon_object.c int radeon_bo_create(struct radeon_device *rdev, · line 232

Quoted 2 lines
drivers/gpu/drm/radeon/radeon_object.c +0 -0
        /* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
         * See https://bugs.freedesktop.org/show_bug.cgi?id=84627

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel