From b4b74617ae5a2854910ace547b5d2b25fc5705a1 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 15 Oct 2024 18:59:01 +0200 Subject: [PATCH] frontends/vdpau: Support skip clear on surface creation Reviewed-by: Leo Liu Part-of: --- src/gallium/frontends/vdpau/surface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/vdpau/surface.c b/src/gallium/frontends/vdpau/surface.c index de092ecfe1b..46747f437e4 100644 --- a/src/gallium/frontends/vdpau/surface.c +++ b/src/gallium/frontends/vdpau/surface.c @@ -94,9 +94,14 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, ); if (p_surf->templat.buffer_format != PIPE_FORMAT_NONE) p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); - /* do not mandate early allocation of a video buffer */ - vlVdpVideoSurfaceClear(p_surf); + + if (!pipe->screen->get_video_param(pipe->screen, + PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_UNKNOWN, + PIPE_VIDEO_CAP_SKIP_CLEAR_SURFACE)) + vlVdpVideoSurfaceClear(p_surf); + mtx_unlock(&dev->mutex); *surface = vlAddDataHTAB(p_surf);