vl/vdpau: fix PresentationQueueQuerySurfaceStatus
authorChristian König <christian.koenig@amd.com>
Wed, 8 May 2013 15:03:01 +0000 (17:03 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 14 May 2013 13:16:15 +0000 (15:16 +0200)
The last queued surface always keeps displaying.

Fixing a problem with XBMC.

Signed-off-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/vdpau/presentation.c
src/gallium/state_trackers/vdpau/vdpau_private.h

index a5466cd378a85836f57fb249104d98affa7b3d4a..c9f8ea70ecc5103838a17d7167757f81c3a6004b 100644 (file)
@@ -238,8 +238,6 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
    surf_templ.format = tex->format;
    surf_draw = pipe->create_surface(pipe, tex, &surf_templ);
 
-   surf->timestamp = (vlVdpTime)earliest_presentation_time;
-
    dst_clip.x0 = 0;
    dst_clip.y0 = 0;
    dst_clip.x1 = clip_width ? clip_width : surf_draw->width;
@@ -276,6 +274,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
 
    pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL);
    pipe->flush(pipe, &surf->fence, 0);
+   pq->last_surf = surf;
 
    if (dump_window == -1) {
       dump_window = debug_get_num_option("VDPAU_DUMP", 0);
@@ -360,7 +359,10 @@ vlVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue
    *first_presentation_time = 0;
 
    if (!surf->fence) {
-      *status = VDP_PRESENTATION_QUEUE_STATUS_IDLE;
+      if (pq->last_surf == surf)
+         *status = VDP_PRESENTATION_QUEUE_STATUS_VISIBLE;
+      else
+         *status = VDP_PRESENTATION_QUEUE_STATUS_IDLE;
    } else {
       pipe_mutex_lock(pq->device->mutex);
       screen = pq->device->vscreen->pscreen;
index 918a6c20a09294a9ccd42a9e02ab5103bcedd7f9..716d2180a6e765afe9f5242616caa497941fda0b 100644 (file)
@@ -320,19 +320,6 @@ typedef struct
    } delayed_rendering;
 } vlVdpDevice;
 
-typedef struct
-{
-   vlVdpDevice *device;
-   Drawable drawable;
-} vlVdpPresentationQueueTarget;
-
-typedef struct
-{
-   vlVdpDevice *device;
-   Drawable drawable;
-   struct vl_compositor_state cstate;
-} vlVdpPresentationQueue;
-
 typedef struct
 {
    vlVdpDevice *device;
@@ -375,7 +362,6 @@ typedef uint64_t vlVdpTime;
 
 typedef struct
 {
-   vlVdpTime timestamp;
    vlVdpDevice *device;
    struct pipe_surface *surface;
    struct pipe_sampler_view *sampler_view;
@@ -384,6 +370,20 @@ typedef struct
    struct u_rect dirty_area;
 } vlVdpOutputSurface;
 
+typedef struct
+{
+   vlVdpDevice *device;
+   Drawable drawable;
+} vlVdpPresentationQueueTarget;
+
+typedef struct
+{
+   vlVdpDevice *device;
+   Drawable drawable;
+   struct vl_compositor_state cstate;
+   vlVdpOutputSurface *last_surf;
+} vlVdpPresentationQueue;
+
 typedef struct
 {
    vlVdpDevice *device;