]> git.ipfire.org Git - people/ms/linux.git/commitdiff
drm/radeon: Don't try to enable write-combining without PAT
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 4 Feb 2015 01:19:51 +0000 (10:19 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:10:56 +0000 (14:10 +0100)
commit a53fa43873b88bad15a2eb1f01dc5efa689625ce upstream.

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
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_object.c

index 86fc56434b2875435aaf9b7dab85fdac3e39e7e9..040d2847f8e844bc28cd6308c7b7119ff4e41a27 100644 (file)
@@ -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);