summaryrefslogtreecommitdiff
path: root/src/uxa/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uxa/intel_display.c')
-rw-r--r--src/uxa/intel_display.c17
1 files changed, 15 insertions, 2 deletions
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