diff options
Diffstat (limited to 'src/uxa')
-rw-r--r-- | src/uxa/intel.h | 2 | ||||
-rw-r--r-- | src/uxa/intel_display.c | 17 | ||||
-rw-r--r-- | src/uxa/intel_driver.c | 25 |
3 files changed, 40 insertions, 4 deletions
diff --git a/src/uxa/intel.h b/src/uxa/intel.h index 054b626f..a5e77af4 100644 --- a/src/uxa/intel.h +++ b/src/uxa/intel.h @@ -196,7 +196,9 @@ typedef struct intel_screen_private { int colorKey; XF86VideoAdaptorPtr adaptor; +#if !HAVE_NOTIFY_FD ScreenBlockHandlerProcPtr BlockHandler; +#endif Bool overlayOn; struct { diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c index fa371c61..809cda1d 100644 --- a/src/uxa/intel_display.c +++ b/src/uxa/intel_display.c @@ -2089,6 +2089,7 @@ intel_pageflip_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data) /* * Check for pending DRM events and process them. */ +#if !HAVE_NOTIFY_FD static void drm_wakeup_handler(pointer data, int err, pointer p) { @@ -2103,6 +2104,14 @@ drm_wakeup_handler(pointer data, int err, pointer p) if (FD_ISSET(mode->fd, read_mask)) drmHandleEvent(mode->fd, &mode->event_context); } +#else +static void +drm_notify_fd(int fd, int ready, void *data) +{ + struct intel_mode *mode = data; + drmHandleEvent(mode->fd, &mode->event_context); +} +#endif /* * If there are any available, read drm_events @@ -2263,9 +2272,11 @@ intel_mode_init(struct intel_screen_private *intel) * registration within ScreenInit and not PreInit. */ mode->flip_count = 0; - AddGeneralSocket(mode->fd); + SetNotifyFd(mode->fd, drm_notify_fd, X_NOTIFY_READ, mode); +#if !HAVE_NOTIFY_FD RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, drm_wakeup_handler, mode); +#endif } void @@ -2289,9 +2300,11 @@ intel_mode_close(intel_screen_private *intel) intel_drm_abort_scrn(intel->scrn); +#if !HAVE_NOTIFY_FD RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, drm_wakeup_handler, mode); - RemoveGeneralSocket(mode->fd); +#endif + RemoveNotifyFd(mode->fd); } void diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c index 62abdd2f..3703c412 100644 --- a/src/uxa/intel_driver.c +++ b/src/uxa/intel_driver.c @@ -652,8 +652,9 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) } static void -intel_dirty_update(ScreenPtr screen) +intel_dirty_update(intel_screen_private *intel) { + ScreenPtr screen = xf86ScrnToScreen(intel->scrn); RegionPtr region; PixmapDirtyUpdatePtr ent; @@ -670,6 +671,7 @@ intel_dirty_update(ScreenPtr screen) } #endif +#if !HAVE_NOTIFY_FD static void I830BlockHandler(BLOCKHANDLER_ARGS_DECL) { @@ -687,9 +689,22 @@ I830BlockHandler(BLOCKHANDLER_ARGS_DECL) intel_uxa_block_handler(intel); intel_video_block_handler(intel); #ifdef INTEL_PIXMAP_SHARING - intel_dirty_update(screen); + intel_dirty_update(intel); #endif } +#else +static void +I830BlockHandler(void *data, void *timeout) +{ + intel_screen_private *intel = data; + + intel_uxa_block_handler(intel); + intel_video_block_handler(intel); +#ifdef INTEL_PIXMAP_SHARING + intel_dirty_update(intel); +#endif +} +#endif static Bool intel_init_initial_framebuffer(ScrnInfoPtr scrn) @@ -947,8 +962,14 @@ I830ScreenInit(SCREEN_INIT_ARGS_DECL) "Hardware cursor initialization failed\n"); } +#if !HAVE_NOTIFY_FD intel->BlockHandler = screen->BlockHandler; screen->BlockHandler = I830BlockHandler; +#else + RegisterBlockAndWakeupHandlers(I830BlockHandler, + (ServerWakeupHandlerProcPtr)NoopDDA, + intel); +#endif #ifdef INTEL_PIXMAP_SHARING screen->StartPixmapTracking = PixmapStartDirtyTracking; |