* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = tex->format;
- surf_templ.usage = PIPE_BIND_RENDER_TARGET;
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;
vl_compositor_clear_layers(cstate);
vl_compositor_set_rgba_layer(cstate, compositor, 0, surf->sampler_view, &src_rect, NULL, NULL);
vl_compositor_set_dst_clip(cstate, &dst_clip);
- vl_compositor_render(cstate, compositor, surf_draw, dirty_area);
+ vl_compositor_render(cstate, compositor, surf_draw, dirty_area, true);
}
vl_screen_set_next_timestamp(pq->device->vscreen, earliest_presentation_time);
pipe->screen->flush_frontbuffer
(
pipe->screen, tex, 0, 0,
- vl_screen_get_private(pq->device->vscreen)
+ vl_screen_get_private(pq->device->vscreen), NULL
);
pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL);
- pipe->flush(pipe, &surf->fence);
+ pipe->flush(pipe, &surf->fence, 0);
+ pq->last_surf = surf;
if (dump_window == -1) {
dump_window = debug_get_num_option("VDPAU_DUMP", 0);
static unsigned int framenum = 0;
char cmd[256];
- sprintf(cmd, "xwd -id %d -out vdpau_frame_%08d.xwd", (int)pq->drawable, ++framenum);
- if (system(cmd) != 0)
- VDPAU_MSG(VDPAU_ERR, "[VDPAU] Dumping surface %d failed.\n", surface);
+ if (framenum) {
+ sprintf(cmd, "xwd -id %d -silent -out vdpau_frame_%08d.xwd", (int)pq->drawable, framenum);
+ if (system(cmd) != 0)
+ VDPAU_MSG(VDPAU_ERR, "[VDPAU] Dumping surface %d failed.\n", surface);
+ }
+ framenum++;
}
pipe_resource_reference(&tex, NULL);
pipe_mutex_lock(pq->device->mutex);
if (surf->fence) {
screen = pq->device->vscreen->pscreen;
- screen->fence_finish(screen, surf->fence, 0);
+ screen->fence_finish(screen, surf->fence, PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, &surf->fence, NULL);
}
pipe_mutex_unlock(pq->device->mutex);
*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;
if (screen->fence_signalled(screen, surf->fence)) {
screen->fence_reference(screen, &surf->fence, NULL);
*status = VDP_PRESENTATION_QUEUE_STATUS_VISIBLE;
+ pipe_mutex_unlock(pq->device->mutex);
// We actually need to query the timestamp of the last VSYNC event from the hardware
vlVdpPresentationQueueGetTime(presentation_queue, first_presentation_time);
*first_presentation_time += 1;
} else {
*status = VDP_PRESENTATION_QUEUE_STATUS_QUEUED;
+ pipe_mutex_unlock(pq->device->mutex);
}
- pipe_mutex_unlock(pq->device->mutex);
}
return VDP_STATUS_OK;