mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-24 01:24:43 +00:00
Create drmmode_crtc_wait_pending_event helper macro
Preparation for following change, no functional change intended yet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
99f1d7a474
commit
f87acdbfb1
@@ -99,6 +99,14 @@ RADEONZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, char *output_name)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Wait for the boolean condition to be FALSE */
|
||||
#define drmmode_crtc_wait_pending_event(drmmode_crtc, fd, condition) \
|
||||
do {} while ((condition) && \
|
||||
drmHandleEvent(fd, &drmmode_crtc->drmmode->event_context) \
|
||||
> 0);
|
||||
|
||||
|
||||
static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
|
||||
int width, int height,
|
||||
int depth, int bpp,
|
||||
@@ -951,10 +959,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Wait for any pending flip to finish */
|
||||
do {} while (drmmode_crtc->flip_pending &&
|
||||
drmHandleEvent(pRADEONEnt->fd,
|
||||
&drmmode->event_context) > 0);
|
||||
drmmode_crtc_wait_pending_event(drmmode_crtc, pRADEONEnt->fd,
|
||||
drmmode_crtc->flip_pending);
|
||||
|
||||
if (drmModeSetCrtc(pRADEONEnt->fd,
|
||||
drmmode_crtc->mode_crtc->crtc_id,
|
||||
|
||||
Reference in New Issue
Block a user