[kernel/f17] Fix breakage in nouveau with nv_two_heads (rhbz 830359)

Josh Boyer jwboyer at fedoraproject.org
Thu Jul 5 17:51:05 UTC 2012


commit 55271253c5a4de1276680db4e4b663dac6d6ad16
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Thu Jul 5 13:50:37 2012 -0400

    Fix breakage in nouveau with nv_two_heads (rhbz 830359)

 ...-fbcon-using-nv_two_heads-is-not-a-good-i.patch |   40 ++++++++++++++++++++
 kernel.spec                                        |    7 +++
 2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch b/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
new file mode 100644
index 0000000..2b16475
--- /dev/null
+++ b/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
@@ -0,0 +1,40 @@
+From 9bd0c15fcfb42f6245447c53347d65ad9e72080b Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs at redhat.com>
+Date: Tue, 26 Jun 2012 12:12:30 +1000
+Subject: [PATCH] drm/nouveau/fbcon: using nv_two_heads is not a good idea
+
+nv_two_heads() was never meant to be used outside of pre-nv50 code.  The
+code checks for >= NV_10 for 2 CRTCs, then downgrades a few specific
+chipsets to 1 CRTC based on (pci_device & 0x0ff0).
+
+The breakage example seen is on GTX 560Ti, with a pciid of 0x1200, which
+gets detected as an NV20 (0x020x) with 1 CRTC by nv_two_heads(), causing
+memory corruption because there's actually 2 CRTCs..
+
+This switches fbcon to use the CRTC count directly from the mode_config
+structure, which will also fix the same issue on Kepler boards which have
+4 CRTCs.
+
+Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
+Cc: stable at vger.kernel.org
+Signed-off-by: Dave Airlie <airlied at redhat.com>
+---
+ drivers/gpu/drm/nouveau/nouveau_fbcon.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+index 153b9a1..1074bc5 100644
+--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+@@ -467,7 +467,7 @@ int nouveau_fbcon_init(struct drm_device *dev)
+ 	nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
+ 
+ 	ret = drm_fb_helper_init(dev, &nfbdev->helper,
+-				 nv_two_heads(dev) ? 2 : 1, 4);
++				 dev->mode_config.num_crtc, 4);
+ 	if (ret) {
+ 		kfree(nfbdev);
+ 		return ret;
+-- 
+1.7.10.2
+
diff --git a/kernel.spec b/kernel.spec
index 1ab3d5d..83b71bd 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -810,6 +810,9 @@ Patch22043: rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch
 #rhbz 825123
 Patch22044: tg3-Apply-short-DMA-frag-workaround-to-5906.patch
 
+#rhbz 830359
+Patch22045: drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
@@ -1558,6 +1561,9 @@ ApplyPatch rt2x00usb-fix-indexes-ordering-on-RX-queue-kick.patch
 #rhbz 825123
 ApplyPatch tg3-Apply-short-DMA-frag-workaround-to-5906.patch
 
+#rhbz 830359
+ApplyPatch drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-i.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2419,6 +2425,7 @@ fi
 #              '-'
 %changelog
 * Thu Jul 05 2012 Josh Boyer <jwboyer at redhat.com>
+- Fix breakage in nouveau with nv_two_heads (rhbz 830359)
 - Apply patch to fix tg3 watchdog hangs on BCM5906 devices (rhbz 825123)
 - Move sch_htb module into main kernel package (rhbz 836185)
 


More information about the scm-commits mailing list