summaryrefslogtreecommitdiff
path: root/src/amdgpu_present.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-18 17:18:00 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-23 18:58:26 +0900
commitb9d00fa7aaf946d985897380bfa42faafbf1b3fb (patch)
treec5af283703ec553fba494609135108952fac793d /src/amdgpu_present.c
parente0ed26151bfeadf309da53d001751c0a014dbd24 (diff)
Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr based
This allows for a minor simplification of the code. (Ported from radeon commit f5d968cbba3c9b7ec202161f2157d8d64778c817) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_present.c')
-rw-r--r--src/amdgpu_present.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 73ebb4c..5de1d19 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -50,7 +50,7 @@
struct amdgpu_present_vblank_event {
uint64_t event_id;
- xf86CrtcPtr crtc;
+ Bool unflip;
};
static uint32_t crtc_select(int crtc_id)
@@ -125,7 +125,7 @@ amdgpu_present_flush_drm_events(ScreenPtr screen)
* Called when the queued vblank event has occurred
*/
static void
-amdgpu_present_vblank_handler(ScrnInfoPtr scrn, unsigned int msc,
+amdgpu_present_vblank_handler(xf86CrtcPtr crtc, unsigned int msc,
uint64_t usec, void *data)
{
struct amdgpu_present_vblank_event *event = data;
@@ -138,7 +138,7 @@ amdgpu_present_vblank_handler(ScrnInfoPtr scrn, unsigned int msc,
* Called when the queued vblank is aborted
*/
static void
-amdgpu_present_vblank_abort(ScrnInfoPtr scrn, void *data)
+amdgpu_present_vblank_abort(xf86CrtcPtr crtc, void *data)
{
struct amdgpu_present_vblank_event *event = data;
@@ -166,7 +166,7 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
if (!event)
return BadAlloc;
event->event_id = event_id;
- queue = amdgpu_drm_queue_alloc(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
+ queue = amdgpu_drm_queue_alloc(xf86_crtc, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
event_id, event,
amdgpu_present_vblank_handler,
amdgpu_present_vblank_abort);
@@ -257,12 +257,12 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
* extension code telling it when that happened
*/
static void
-amdgpu_present_flip_event(ScrnInfoPtr scrn, uint32_t msc, uint64_t ust, void *pageflip_data)
+amdgpu_present_flip_event(xf86CrtcPtr crtc, uint32_t msc, uint64_t ust, void *pageflip_data)
{
- AMDGPUInfoPtr info = AMDGPUPTR(scrn);
+ AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
struct amdgpu_present_vblank_event *event = pageflip_data;
- if (!event->crtc)
+ if (event->unflip)
info->drmmode.present_flipping = FALSE;
present_event_notify(event->event_id, ust, msc);
@@ -273,7 +273,7 @@ amdgpu_present_flip_event(ScrnInfoPtr scrn, uint32_t msc, uint64_t ust, void *pa
* The flip has been aborted, free the structure
*/
static void
-amdgpu_present_flip_abort(ScrnInfoPtr scrn, void *pageflip_data)
+amdgpu_present_flip_abort(xf86CrtcPtr crtc, void *pageflip_data)
{
struct amdgpu_present_vblank_event *event = pageflip_data;
@@ -304,7 +304,6 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
return FALSE;
event->event_id = event_id;
- event->crtc = xf86_crtc;
ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
pixmap, event_id, event, crtc_id,
@@ -341,6 +340,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
}
event->event_id = event_id;
+ event->unflip = TRUE;
if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
event_id, event, -1, amdgpu_present_flip_event,