From 69430d7e59e8b4b38567cd1f8bb6d4e747b2650c Mon Sep 17 00:00:00 2001 From: "Jiang, Sonny" Date: Tue, 2 Apr 2019 17:44:12 +0000 Subject: va: use a compute shader for the blit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sonny Jiang Signed-off-by: Marek Olšák --- src/gallium/state_trackers/va/context.c | 2 ++ src/gallium/state_trackers/va/postproc.c | 7 ++++++- src/gallium/state_trackers/va/va_private.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/va') diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 47a5e7be230..9176b7e8c5d 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -364,6 +364,8 @@ vlVaDestroyContext(VADriverContextP ctx, VAContextID context_id) } context->decoder->destroy(context->decoder); } + if (context->blit_cs) + drv->pipe->delete_compute_state(drv->pipe, context->blit_cs); if (context->deint) { vl_deint_filter_cleanup(context->deint); FREE(context->deint); diff --git a/src/gallium/state_trackers/va/postproc.c b/src/gallium/state_trackers/va/postproc.c index 21d316c7e97..fbc55b7714b 100644 --- a/src/gallium/state_trackers/va/postproc.c +++ b/src/gallium/state_trackers/va/postproc.c @@ -27,6 +27,7 @@ #include "util/u_handle_table.h" #include "util/u_memory.h" +#include "util/u_compute.h" #include "vl/vl_defines.h" #include "vl/vl_video_buffer.h" @@ -220,7 +221,11 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context, blit.mask = PIPE_MASK_RGBA; blit.filter = PIPE_TEX_MIPFILTER_LINEAR; - drv->pipe->blit(drv->pipe, &blit); + if (drv->pipe->screen->get_param(drv->pipe->screen, + PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA)) + util_compute_blit(drv->pipe, &blit, &context->blit_cs); + else + drv->pipe->blit(drv->pipe, &blit); } // TODO: figure out why this is necessary for DMA-buf sharing diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index c4b49e30509..b2b997d4799 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -312,6 +312,7 @@ typedef struct { bool first_single_submitted; int gop_coeff; bool needs_begin_frame; + void *blit_cs; } vlVaContext; typedef struct { -- cgit v1.2.3