modesetting: fix compile error when --disable-glamor
Move ms_flush_drm_events out of GLAMOR ifdef. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97586 Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d81f9ce12a
commit
7f6fa4e449
|
@ -161,8 +161,6 @@ typedef void (*ms_pageflip_handler_proc)(modesettingPtr ms,
|
|||
|
||||
typedef void (*ms_pageflip_abort_proc)(modesettingPtr ms, void *data);
|
||||
|
||||
int ms_flush_drm_events(ScreenPtr screen);
|
||||
|
||||
Bool ms_do_pageflip(ScreenPtr screen,
|
||||
PixmapPtr new_front,
|
||||
void *event,
|
||||
|
@ -172,3 +170,5 @@ Bool ms_do_pageflip(ScreenPtr screen,
|
|||
ms_pageflip_abort_proc pageflip_abort);
|
||||
|
||||
#endif
|
||||
|
||||
int ms_flush_drm_events(ScreenPtr screen);
|
||||
|
|
|
@ -29,6 +29,40 @@
|
|||
|
||||
#include "driver.h"
|
||||
|
||||
/*
|
||||
* Flush the DRM event queue when full; makes space for new events.
|
||||
*
|
||||
* Returns a negative value on error, 0 if there was nothing to process,
|
||||
* or 1 if we handled any events.
|
||||
*/
|
||||
int
|
||||
ms_flush_drm_events(ScreenPtr screen)
|
||||
{
|
||||
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
|
||||
modesettingPtr ms = modesettingPTR(scrn);
|
||||
|
||||
struct pollfd p = { .fd = ms->fd, .events = POLLIN };
|
||||
int r;
|
||||
|
||||
do {
|
||||
r = xserver_poll(&p, 1, 0);
|
||||
} while (r == -1 && (errno == EINTR || errno == EAGAIN));
|
||||
|
||||
/* If there was an error, r will be < 0. Return that. If there was
|
||||
* nothing to process, r == 0. Return that.
|
||||
*/
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
/* Try to handle the event. If there was an error, return it. */
|
||||
r = drmHandleEvent(ms->fd, &ms->event_context);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
/* Otherwise return 1 to indicate that we handled an event. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef GLAMOR
|
||||
|
||||
/*
|
||||
|
@ -125,40 +159,6 @@ ms_pageflip_abort(void *data)
|
|||
ms_pageflip_free(flip);
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush the DRM event queue when full; makes space for new events.
|
||||
*
|
||||
* Returns a negative value on error, 0 if there was nothing to process,
|
||||
* or 1 if we handled any events.
|
||||
*/
|
||||
int
|
||||
ms_flush_drm_events(ScreenPtr screen)
|
||||
{
|
||||
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
|
||||
modesettingPtr ms = modesettingPTR(scrn);
|
||||
|
||||
struct pollfd p = { .fd = ms->fd, .events = POLLIN };
|
||||
int r;
|
||||
|
||||
do {
|
||||
r = xserver_poll(&p, 1, 0);
|
||||
} while (r == -1 && (errno == EINTR || errno == EAGAIN));
|
||||
|
||||
/* If there was an error, r will be < 0. Return that. If there was
|
||||
* nothing to process, r == 0. Return that.
|
||||
*/
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
/* Try to handle the event. If there was an error, return it. */
|
||||
r = drmHandleEvent(ms->fd, &ms->event_context);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
/* Otherwise return 1 to indicate that we handled an event. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Bool
|
||||
queue_flip_on_crtc(ScreenPtr screen, xf86CrtcPtr crtc,
|
||||
struct ms_flipdata *flipdata,
|
||||
|
|
Loading…
Reference in New Issue
Block a user