All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix for vblank on nvc0
@ 2012-11-06 14:48 Kelly Doran
  2012-11-06 18:30 ` Maarten Lankhorst
  0 siblings, 1 reply; 12+ messages in thread
From: Kelly Doran @ 2012-11-06 14:48 UTC (permalink / raw)
  To: nouveau, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 206 bytes --]

The vblank on nvc0 was not working correctly and would freeze X, I managed
to track it down and fix it with some help from m.b.lankhorst, see
https://bugs.freedesktop.org/show_bug.cgi?id=56692 for details.

[-- Attachment #1.2: Type: text/html, Size: 272 bytes --]

[-- Attachment #2: nvc0_vblank_fix.patch --]
[-- Type: application/octet-stream, Size: 1648 bytes --]

diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index 16a9afb..4c971b8 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -22,6 +22,8 @@
  * Authors: Ben Skeggs
  */
 
+#include <subdev/bar.h>
+
 #include <engine/software.h>
 #include <engine/disp.h>
 
@@ -37,6 +39,7 @@ nv50_disp_sclass[] = {
 static void
 nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc)
 {
+	struct nouveau_bar *bar = nouveau_bar(priv);
 	struct nouveau_disp *disp = &priv->base;
 	struct nouveau_software_chan *chan, *temp;
 	unsigned long flags;
@@ -46,18 +49,19 @@ nv50_disp_intr_vblank(struct nv50_disp_priv *priv, int crtc)
 		if (chan->vblank.crtc != crtc)
 			continue;
 
-		nv_wr32(priv, 0x001704, chan->vblank.channel);
-		nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
-
 		if (nv_device(priv)->chipset == 0x50) {
+			nv_wr32(priv, 0x001704, chan->vblank.channel);
+			nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
+			bar->flush(bar);
 			nv_wr32(priv, 0x001570, chan->vblank.offset);
 			nv_wr32(priv, 0x001574, chan->vblank.value);
 		} else {
-			if (nv_device(priv)->chipset >= 0xc0) {
-				nv_wr32(priv, 0x06000c,
-					upper_32_bits(chan->vblank.offset));
-			}
-			nv_wr32(priv, 0x060010, chan->vblank.offset);
+			nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel);
+			bar->flush(bar);
+			nv_wr32(priv, 0x06000c,
+				upper_32_bits(chan->vblank.offset));
+			nv_wr32(priv, 0x060010, 
+				lower_32_bits(chan->vblank.offset));
 			nv_wr32(priv, 0x060014, chan->vblank.value);
 		}
 

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-11-15 15:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 14:48 Fix for vblank on nvc0 Kelly Doran
2012-11-06 18:30 ` Maarten Lankhorst
2012-11-11 18:26   ` Marcin Slusarz
2012-11-11 18:35     ` Marcin Slusarz
     [not found]       ` <20121111183519.GA2959-OI9uyE9O0yo@public.gmane.org>
2012-11-11 18:51         ` Kelly Doran
     [not found]           ` <CAES2CiZMtsZB6wcAerURtLnTY-F6U8CSrL6YGg0p0A+Zt+SbCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-12 12:14             ` Kelly Doran
     [not found]               ` <CAES2Cia3Z21ZPmpOA3B1fB5sDv4urHL8pbW+6u7AzPdbHPur4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-12 23:01                 ` Marcin Slusarz
2012-11-11 20:25       ` Maarten Lankhorst
2012-11-12 16:43         ` Sven Joachim
     [not found]         ` <50A009B8.2080107-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2012-11-12 21:30           ` Kelly Doran
2012-11-12 21:52             ` Maarten Lankhorst
     [not found]               ` <50A16FA6.5040002-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2012-11-15 15:40                 ` Sven Joachim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.