We are currently experiencing downtime impacting viewing & cloning the Mesa repo, and some GitLab pages returning 503. Please see #freedesktop on IRC for more updates.

Commit 36709c64 authored by Keith Packard's avatar Keith Packard

Use NotifyFd for drm fd

NotifyFd is available after API 22, and must be used after API 23.
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent 58a04ad9
......@@ -77,7 +77,12 @@
#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22,0)
#define HAVE_NOTIFY_FD 1
#endif
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
#define RELOAD_CURSORS_DEPRECATED 1
#define BLOCKHANDLER_ARGS_DECL \
ScreenPtr arg, pointer pTimeout
#define BLOCKHANDLER_ARGS arg, pTimeout
......
......@@ -410,9 +410,11 @@ done_setting:
drmmode_output_dpms(output, DPMSModeOn);
}
#if !RELOAD_CURSORS_DEPRECATED
/* if hw cursor is initialized, reload it */
if (drmmode->cursor)
xf86_reload_cursors(pScrn->pScreen);
#endif
cleanup:
if (newcrtc)
......@@ -1889,6 +1891,13 @@ drmmode_uevent_fini(ScrnInfoPtr pScrn)
TRACE_EXIT();
}
#if HAVE_NOTIFY_FD
static void
drmmode_notify_fd(int fd, int notify, void *data)
{
drmHandleEvent(fd, &event_context);
}
#else
static void
drmmode_wakeup_handler(pointer data, int err, pointer p)
{
......@@ -1902,19 +1911,28 @@ drmmode_wakeup_handler(pointer data, int err, pointer p)
if (FD_ISSET(fd, read_mask))
drmHandleEvent(fd, &event_context);
}
#endif
void drmmode_init_wakeup_handler(struct ARMSOCRec *pARMSOC)
{
#if HAVE_NOTIFY_FD
SetNotifyFd(pARMSOC->drmFD, drmmode_notify_fd, X_NOTIFY_READ, pARMSOC);
#else
AddGeneralSocket(pARMSOC->drmFD);
RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
drmmode_wakeup_handler, pARMSOC);
#endif
}
void drmmode_fini_wakeup_handler(struct ARMSOCRec *pARMSOC)
{
#if HAVE_NOTIFY_FD
RemoveNotifyFd(pARMSOC->drmFD);
#else
RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
drmmode_wakeup_handler, pARMSOC);
RemoveGeneralSocket(pARMSOC->drmFD);
#endif
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment