Skip to contentSkip to conversation

drm/radeon: Don't try to enable write-combining without PAT

PATCH Applied Michel Dänzer 3 participants 4 messages Feb 4, 2015 – Feb 5, 2015

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

PATCH 1/1 drm/radeon: Don't try to enable write-combining without PAT

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

Doing so can cause things to become slow.

Print a warning at compile time and an informative message at runtime in that case.

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

---
 drivers/gpu/drm/radeon/radeon_object.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +12 -0
index 7d68223..bd3df10 100644
@@ -238,6 +238,18 @@ int radeon_bo_create(struct radeon_device *rdev,
 	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
 	 */
 	bo->flags &= ~RADEON_GEM_GTT_WC;
+#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
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
+	 */
+
+#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");
+	bo->flags &= ~RADEON_GEM_GTT_WC;
 #endif
 
 	radeon_ttm_placement_from_domain(bo, domain);
Signature · 6 lines
2.1.4

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

Am 04.02.2015 um 02:19 schrieb Michel Dänzer:

Quoted 10 lines

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

Doing so can cause things to become slow.

Print a warning at compile time and an informative message at runtime in that case.

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

Interesting I wonder what the rational behind this is. I mean CONFIG_X86_PAT will obviously affect write combining, but why does it slow down things if we request something that the kernel isn't configured for?

Anyway, patch is Reviewed-by: Christian König <[email protected]>

Regards,
Christian.

Quoted 17 lines
---
  drivers/gpu/drm/radeon/radeon_object.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +5 -0
index 7d68223..bd3df10 100644
@@ -238,6 +238,18 @@ int radeon_bo_create(struct radeon_device *rdev,
  	 * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
  	 */
  	bo->flags &= ~RADEON_GEM_GTT_WC;
+#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
+	 * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
+	 */

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

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_object.c +7 -0
+
+#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");
+	bo->flags &= ~RADEON_GEM_GTT_WC;
  #endif
 
  	radeon_ttm_placement_from_domain(bo, domain);

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

Applied
#2 lore raw
Quoted 14 lines · Christian König

Am 04.02.2015 um 02:19 schrieb Michel Dänzer:

Quoted 11 lines

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

Doing so can cause things to become slow.

Print a warning at compile time and an informative message at runtime in that case.

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

Quoted 5 lines

Interesting I wonder what the rational behind this is. I mean CONFIG_X86_PAT will obviously affect write combining, but why does it slow down things if we request something that the kernel isn't configured for?

Anyway, patch is Reviewed-by: Christian König <[email protected]>

Applied to my 3.20 tree.

Thanks!

Alex

Quoted 32 lines

Regards,
Christian.

Quoted 27 lines
---
  drivers/gpu/drm/radeon/radeon_object.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)
drivers/gpu/drm/radeon/radeon_object.c +2 -0
index 7d68223..bd3df10 100644
@@ -238,6 +238,18 @@ int radeon_bo_create(struct radeon_device *rdev,
         * See https://bugs.freedesktop.org/show_bug.cgi?id=84627
         */
        bo->flags &= ~RADEON_GEM_GTT_WC;
+#elif defined(CONFIG_X86) && !defined(CONFIG_X86_PAT)
+       /* Don't try to enable write-combining when it can't work, or

things

drivers/gpu/drm/radeon/radeon_object.c +5 -0
+        * may be slow
+        * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
+        */
+
+#warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better

performance \

drivers/gpu/drm/radeon/radeon_object.c +5 -0
+        thanks to write-combining
+
+       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;
Quoted 8 lines
Quoted 2 lines
  #endif
        radeon_ttm_placement_from_domain(bo, domain);

_______________________________________________
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

#3 lore raw
In reply to Christian König
Quoted 8 lines · Christian König

Am 04.02.2015 um 02:19 schrieb Michel Dänzer:

Quoted 7 lines

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

Doing so can cause things to become slow.

Print a warning at compile time and an informative message at runtime in that case.

Quoted 8 lines
Quoted 3 lines

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

Interesting I wonder what the rational behind this is. I mean CONFIG_X86_PAT will obviously affect write combining, but why does it slow down things if we request something that the kernel isn't configured for?

Yeah, I'm not sure exactly what happens in that case, but I don't care too much, since PAT is clearly desirable anyway.

Quoted 1 line

Anyway, patch is Reviewed-by: Christian König <[email protected]>

Thanks!

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel