summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorJiang, Sonny <[email protected]>2019-04-02 17:44:12 +0000
committerMarek Olšák <[email protected]>2019-04-24 15:47:41 -0400
commit69430d7e59e8b4b38567cd1f8bb6d4e747b2650c (patch)
tree928f3cb0b8b9da5b2ac79292bcf3f666880c95a9 /src/gallium/state_trackers/va
parent7fc3d21646ca1ad37eae61363b418bdab55cb599 (diff)
va: use a compute shader for the blit
Signed-off-by: Sonny Jiang <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/context.c2
-rw-r--r--src/gallium/state_trackers/va/postproc.c7
-rw-r--r--src/gallium/state_trackers/va/va_private.h1
3 files changed, 9 insertions, 1 deletions
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 {