vdpau: add compositor to presentation queue
authorChristian König <deathsimple@vodafone.de>
Fri, 8 Apr 2011 18:03:35 +0000 (20:03 +0200)
committerChristian König <deathsimple@vodafone.de>
Fri, 8 Apr 2011 18:03:35 +0000 (20:03 +0200)
src/gallium/state_trackers/vdpau/presentation.c
src/gallium/state_trackers/vdpau/vdpau_private.h

index d4f67379ed25013070a15488769f014e09c5d5c8..fadc57e70c024137ce3eeb3eebe96b72db18e16f 100644 (file)
@@ -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
index dca755eb8d44224eb394e5b0acf4dd143164dede..f1f94ea92ac811ee12fc6855bc4ddc25959c5c3e 100644 (file)
@@ -183,7 +183,7 @@ typedef struct
 typedef struct
 {
    vlVdpDevice *device;
-   Drawable drawable;
+   struct pipe_video_compositor *compositor;
 } vlVdpPresentationQueue;
 
 typedef struct