rpms/kernel/F-12 drm-r600-lenovo-w500-fix.patch, 1.1, 1.2 kernel.spec, 1.1897, 1.1898

Dave Airlie airlied at fedoraproject.org
Tue Nov 3 05:00:38 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3720

Modified Files:
	drm-r600-lenovo-w500-fix.patch kernel.spec 
Log Message:
* Tue Nov 03 2009 Dave Airlie <airlied at redhat.com> 2.6.31.5-112
- drm-r600-lenovo-w500-fix.patch: add second patch from upstream fix


drm-r600-lenovo-w500-fix.patch:
 r600.c  |   45 +++++++++++++++++++--------------------------
 rv515.c |    3 ++-
 2 files changed, 21 insertions(+), 27 deletions(-)

Index: drm-r600-lenovo-w500-fix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/drm-r600-lenovo-w500-fix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- drm-r600-lenovo-w500-fix.patch	3 Nov 2009 03:38:38 -0000	1.1
+++ drm-r600-lenovo-w500-fix.patch	3 Nov 2009 05:00:37 -0000	1.2
@@ -28,3 +28,84 @@ index 41a34c2..03c052d 100644
 -- 
 1.6.5.1
 
+From dec3349eafc083eaeeae97590ceea6ca569b87aa Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied at linux.ie>
+Date: Tue, 3 Nov 2009 14:54:36 +1000
+Subject: [PATCH] drm/radeon/kms: stop putting VRAM at 0 in MC space on r600s.
+
+The Lenovo W500 laptop hangs inside an SMI on brightness changes,
+I thought it just needed the VGA disable but it turned out to require
+slightly more work, setting the MC locations up just like the IGP
+chip requirements seems to make it all happy again and I can boot
+and play with brightness.
+
+We should probably just do this for all chips and give up the VRAM
+at 0x0 idea, it never seems to buy us anything but pain.
+
+Signed-off-by: Dave Airlie <airlied at redhat.com>
+---
+ drivers/gpu/drm/radeon/r600.c |   44 +++++++++++++++++-----------------------
+ 1 files changed, 19 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
+index e87475c..6bbb3cb 100644
+--- a/drivers/gpu/drm/radeon/r600.c
++++ b/drivers/gpu/drm/radeon/r600.c
+@@ -409,35 +409,29 @@ int r600_mc_init(struct radeon_device *rdev)
+ 			rdev->mc.gtt_location = rdev->mc.mc_vram_size;
+ 		}
+ 	} else {
+-		if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
+-			rdev->mc.vram_location = (RREG32(MC_VM_FB_LOCATION) &
+-								0xFFFF) << 24;
+-			rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
+-			tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size;
+-			if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) {
+-				/* Enough place after vram */
+-				rdev->mc.gtt_location = tmp;
+-			} else if (rdev->mc.vram_location >= rdev->mc.gtt_size) {
+-				/* Enough place before vram */
++		rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
++		rdev->mc.vram_location = (RREG32(MC_VM_FB_LOCATION) &
++							0xFFFF) << 24;
++		tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size;
++		if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) {
++			/* Enough place after vram */
++			rdev->mc.gtt_location = tmp;
++		} else if (rdev->mc.vram_location >= rdev->mc.gtt_size) {
++			/* Enough place before vram */
++			rdev->mc.gtt_location = 0;
++		} else {
++			/* Not enough place after or before shrink
++			 * gart size
++			 */
++			if (rdev->mc.vram_location > (0xFFFFFFFFUL - tmp)) {
+ 				rdev->mc.gtt_location = 0;
++				rdev->mc.gtt_size = rdev->mc.vram_location;
+ 			} else {
+-				/* Not enough place after or before shrink
+-				 * gart size
+-				 */
+-				if (rdev->mc.vram_location > (0xFFFFFFFFUL - tmp)) {
+-					rdev->mc.gtt_location = 0;
+-					rdev->mc.gtt_size = rdev->mc.vram_location;
+-				} else {
+-					rdev->mc.gtt_location = tmp;
+-					rdev->mc.gtt_size = 0xFFFFFFFFUL - tmp;
+-				}
++				rdev->mc.gtt_location = tmp;
++				rdev->mc.gtt_size = 0xFFFFFFFFUL - tmp;
+ 			}
+-			rdev->mc.gtt_location = rdev->mc.mc_vram_size;
+-		} else {
+-			rdev->mc.vram_location = 0x00000000UL;
+-			rdev->mc.gtt_location = rdev->mc.mc_vram_size;
+-			rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
+ 		}
++		rdev->mc.gtt_location = rdev->mc.mc_vram_size;
+ 	}
+ 	rdev->mc.vram_start = rdev->mc.vram_location;
+ 	rdev->mc.vram_end = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
+-- 
+1.6.5.1
+


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1897
retrieving revision 1.1898
diff -u -p -r1.1897 -r1.1898
--- kernel.spec	3 Nov 2009 03:38:39 -0000	1.1897
+++ kernel.spec	3 Nov 2009 05:00:37 -0000	1.1898
@@ -2112,6 +2112,9 @@ fi
 # and build.
 
 %changelog
+* Tue Nov 03 2009 Dave Airlie <airlied at redhat.com> 2.6.31.5-112
+- drm-r600-lenovo-w500-fix.patch: add second patch from upstream fix
+
 * Tue Nov 03 2009 Dave Airlie <airlied at redhat.com> 2.6.31.5-111
 - drm-r600-lenovo-w500-fix.patch: fix lenovo w500 acpi video kill laptop dead
 - drop aspm r600 patch as correct fix should be in 110




More information about the scm-commits mailing list