summaryrefslogtreecommitdiff
path: root/src/amdgpu_present.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-02-23 18:10:29 +0900
committerMichel Dänzer <michel@daenzer.net>2016-02-27 15:24:25 +0900
commite463b849f3e9d7b69e64a65619a22e00e78d297b (patch)
treeb6c3150e42a12a0fe6589051cd65eb205b2f146f /src/amdgpu_present.c
parent1ee341f9d909f3b7ba2984fc912dabdb98c34b19 (diff)
Make amdgpu_do_pageflip take a pixmap instead of a BO
(inspired by radeon commit 7b4fc4a677d252d01c2bf80d162bc35814059eaa) 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, 3 insertions, 15 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 07d7ef7..73ebb4c 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -294,16 +294,11 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
struct amdgpu_present_vblank_event *event;
xf86CrtcPtr xf86_crtc = crtc->devPrivate;
int crtc_id = xf86_crtc ? drmmode_get_crtc_id(xf86_crtc) : -1;
- struct amdgpu_buffer *bo;
Bool ret;
if (!amdgpu_present_check_flip(crtc, screen->root, pixmap, sync_flip))
return FALSE;
- bo = amdgpu_get_pixmap_bo(pixmap);
- if (!bo)
- return FALSE;
-
event = calloc(1, sizeof(struct amdgpu_present_vblank_event));
if (!event)
return FALSE;
@@ -311,8 +306,8 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
event->event_id = event_id;
event->crtc = xf86_crtc;
- ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, bo,
- event_id, event, crtc_id,
+ ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
+ pixmap, event_id, event, crtc_id,
amdgpu_present_flip_event,
amdgpu_present_flip_abort);
if (!ret)
@@ -334,18 +329,11 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
struct amdgpu_present_vblank_event *event;
PixmapPtr pixmap = screen->GetScreenPixmap(screen);
- struct amdgpu_buffer *bo;
int i;
if (!amdgpu_present_check_flip(NULL, screen->root, pixmap, TRUE))
goto modeset;
- bo = amdgpu_get_pixmap_bo(pixmap);
- if (!bo) {
- ErrorF("%s: amdgpu_get_pixmap_bo failed, display might freeze\n", __func__);
- goto modeset;
- }
-
event = calloc(1, sizeof(struct amdgpu_present_vblank_event));
if (!event) {
ErrorF("%s: calloc failed, display might freeze\n", __func__);
@@ -354,7 +342,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
event->event_id = event_id;
- if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, bo,
+ if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
event_id, event, -1, amdgpu_present_flip_event,
amdgpu_present_flip_abort))
return;