From 6710e690f6ccd2c917d6a39be7d55a037470fccb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Fri, 8 Apr 2011 20:03:35 +0200 Subject: [PATCH] vdpau: add compositor to presentation queue --- src/gallium/state_trackers/vdpau/presentation.c | 19 ++++++++++++++++--- src/gallium/state_trackers/vdpau/vdpau_private.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index d4f6737..fadc57e 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -41,9 +41,11 @@ vlVdpPresentationQueueCreate(VdpDevice device, VdpPresentationQueueTarget presentation_queue_target, VdpPresentationQueue *presentation_queue) { - debug_printf("[VDPAU] Creating PresentationQueue\n"); - VdpStatus ret; vlVdpPresentationQueue *pq = NULL; + struct pipe_video_context *context; + VdpStatus ret; + + _debug_printf("[VDPAU] Creating PresentationQueue\n"); if (!presentation_queue) return VDP_STATUS_INVALID_POINTER; @@ -59,10 +61,19 @@ vlVdpPresentationQueueCreate(VdpDevice device, if (dev != pqt->device) return VDP_STATUS_HANDLE_DEVICE_MISMATCH; + context = dev->context->vpipe; + pq = CALLOC(1, sizeof(vlVdpPresentationQueue)); if (!pq) return VDP_STATUS_RESOURCES; + pq->device = dev; + pq->compositor = context->create_compositor(context); + if (!pq->compositor) { + ret = VDP_STATUS_ERROR; + goto no_compositor; + } + *presentation_queue = vlAddDataHTAB(pq); if (*presentation_queue == 0) { ret = VDP_STATUS_ERROR; @@ -71,6 +82,7 @@ vlVdpPresentationQueueCreate(VdpDevice device, return VDP_STATUS_OK; no_handle: +no_compositor: FREE(pq); return ret; } @@ -129,7 +141,8 @@ vlVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_qu if (!first_presentation_time) return VDP_STATUS_INVALID_POINTER; - return VDP_STATUS_NO_IMPLEMENTATION; + //return VDP_STATUS_NO_IMPLEMENTATION; + return VDP_STATUS_OK; } VdpStatus diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index dca755e..f1f94ea 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -183,7 +183,7 @@ typedef struct typedef struct { vlVdpDevice *device; - Drawable drawable; + struct pipe_video_compositor *compositor; } vlVdpPresentationQueue; typedef struct -- 2.7.4