summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-21 12:33:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-21 12:33:29 +0100
commitd39197bb10b7d88cb4c456e7a5e8d34c1dc6eeaf (patch)
tree720d0ee1448b12072f43660305925773fc3fb072 /src
parent4eaab17aec8ea66428087065901324f56df9020e (diff)
legacy/i810: Fix compilation with Video ABI 23 changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/legacy/i810/i810_video.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index be49b91d..af683c81 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;