summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/presentation.c
diff options
context:
space:
mode:
authorNayan Deshmukh <[email protected]>2017-01-19 14:59:28 +0530
committerChristian König <[email protected]>2017-01-19 15:34:02 +0100
commit31908d6a4a3309f4cd4b953d6eecdf41595b1299 (patch)
treeab10cdb0153ca3dacde051b5dc1da1cc9a69f140 /src/gallium/state_trackers/vdpau/presentation.c
parent3cd092c41508dde2e6259f09df1736911a828548 (diff)
st/vdpau: only send buffers with B8G8R8A8 format to X
PresentPixmap only works if the pixmap depth matches with the window depth, otherwise it returns a BadMatch protocol error. Even if the depths match, the result won't look correctly if the VDPAU RGB component order doesn't match the X11 one so we only allow the X11 format. For other buffers we copy them to a buffer which is send to X. v2: only send buffers with format VDP_RGBA_FORMAT_B8G8R8A8 v3: reword commit message v4: add comment explaining the code Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/presentation.c')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index d4793692f90..78cafc81afe 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -231,7 +231,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
vscreen = pq->device->vscreen;
pipe_mutex_lock(pq->device->mutex);
- if (vscreen->set_back_texture_from_output)
+ if (vscreen->set_back_texture_from_output && surf->send_to_X)
vscreen->set_back_texture_from_output(vscreen, surf->surface->texture, clip_width, clip_height);
tex = vscreen->texture_from_drawable(vscreen, (void *)pq->drawable);
if (!tex) {
@@ -239,7 +239,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
return VDP_STATUS_INVALID_HANDLE;
}
- if (!vscreen->set_back_texture_from_output) {
+ if (!vscreen->set_back_texture_from_output || !surf->send_to_X) {
dirty_area = vscreen->get_dirty_area(vscreen);
memset(&surf_templ, 0, sizeof(surf_templ));
@@ -289,7 +289,7 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
framenum++;
}
- if (!vscreen->set_back_texture_from_output) {
+ if (!vscreen->set_back_texture_from_output || !surf->send_to_X) {
pipe_resource_reference(&tex, NULL);
pipe_surface_reference(&surf_draw, NULL);
}