xf86-video-intel: 2 commits - src/legacy/i810 src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 21 11:54:13 UTC 2016


 src/legacy/i810/i810_video.c |   44 ++++++++++++++++++++++++++++++++++++++++++-
 src/sna/sna_driver.c         |    6 +++++
 2 files changed, 49 insertions(+), 1 deletion(-)

New commits:
commit 6988b873b041130d88dd0aae70c10f86550ee2b3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 21 12:34:28 2016 +0100

    sna: Unregister the BlockHandler on close
    
    Now that we register a callback with an external stack and not the
    screen, we have to remove it when the screen is destroyed.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 60a5a97..841ccd1 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -949,6 +949,12 @@ static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL)
 
 	/* XXX Note that we will leak kernel resources if !vtSema */
 
+#if HAVE_NOTIFY_FD
+	RemoveBlockAndWakeupHandlers(sna_block_handler,
+				     (ServerWakeupHandlerProcPtr)NoopDDA,
+				     sna);
+#endif
+
 	sna_uevent_fini(sna);
 	sna_mode_close(sna);
 
commit d39197bb10b7d88cb4c456e7a5e8d34c1dc6eeaf
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 21 12:33:29 2016 +0100

    legacy/i810: Fix compilation with Video ABI 23 changes
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index be49b91..af683c8 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -77,7 +77,11 @@ static int I810PutImage( ScrnInfoPtr,
 static int I810QueryImageAttributes(ScrnInfoPtr, 
 	int, unsigned short *, unsigned short *,  int *, int *);
 
+#if !HAVE_NOTIFY_FD
 static void I810BlockHandler(BLOCKHANDLER_ARGS_DECL);
+#else
+static void I810BlockHandler(void *data, void *_timeout);
+#endif
 
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
 
@@ -418,8 +422,14 @@ I810SetupImageVideo(ScreenPtr screen)
 
     pI810->adaptor = adapt;
 
+#if !HAVE_NOTIFY_FD
     pI810->BlockHandler = screen->BlockHandler;
     screen->BlockHandler = I810BlockHandler;
+#else
+    RegisterBlockAndWakeupHandlers(I810BlockHandler,
+				   (ServerWakeupHandlerProcPtr)NoopDDA,
+				   pScrn);
+#endif
 
     xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
     xvContrast   = MAKE_ATOM("XV_CONTRAST");
@@ -1135,6 +1145,7 @@ I810QueryImageAttributes(
     return size;
 }
 
+#if !HAVE_NOTIFY_FD
 static void
 I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
 {
@@ -1172,6 +1183,38 @@ I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
         }
     }
 }
+#else
+static void
+I810BlockHandler(void *data, void *_timeout)
+{
+    ScrnInfoPtr pScrn = data;
+    I810Ptr      pI810 = I810PTR(pScrn);
+    I810PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
+    I810OverlayRegPtr overlay = (I810OverlayRegPtr) (pI810->FbBase + pI810->OverlayStart);
+
+    if(pPriv->videoStatus & TIMER_MASK) {
+	UpdateCurrentTime();
+	if(pPriv->videoStatus & OFF_TIMER) {
+	    if(pPriv->offTime < currentTime.milliseconds) {
+		/* Turn off the overlay */
+		overlay->OV0CMD &= 0xFFFFFFFE;
+		OVERLAY_UPDATE(pI810->OverlayPhysical);
+
+		pPriv->videoStatus = FREE_TIMER;
+		pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+	    }
+	} else {  /* FREE_TIMER */
+	    if(pPriv->freeTime < currentTime.milliseconds) {
+		if(pPriv->linear) {
+		   xf86FreeOffscreenLinear(pPriv->linear);
+		   pPriv->linear = NULL;
+		}
+		pPriv->videoStatus = 0;
+	    }
+        }
+    }
+}
+#endif
 
 
 /***************************************************************************
@@ -1373,7 +1416,6 @@ I810DisplaySurface(
       UpdateCurrentTime();
       pI810Priv->videoStatus = FREE_TIMER;
       pI810Priv->freeTime = currentTime.milliseconds + FREE_DELAY;
-      pScrn->pScreen->BlockHandler = I810BlockHandler;
     }
 
     return Success;


More information about the xorg-commit mailing list