diff options
author | Leo Liu <[email protected]> | 2017-09-19 10:16:36 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-09-25 09:42:13 -0400 |
commit | eb518387710e027a6f38f0e096f014b9db1db8a7 (patch) | |
tree | e56860e6f91e1ae0ef9c93f0253c89ff79655fbd /src | |
parent | 3e685ec9836a274805f5e8aa146754fc3ac5d8fa (diff) |
st/va/postproc: use video original size for postprocessing
Otherwise the aligned size will make video scaled
Cc: [email protected]
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/va/postproc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/va/postproc.c b/src/gallium/state_trackers/va/postproc.c index 5b23891c377..6349691f4b0 100644 --- a/src/gallium/state_trackers/va/postproc.c +++ b/src/gallium/state_trackers/va/postproc.c @@ -35,7 +35,7 @@ #include "va_private.h" static const VARectangle * -vlVaRegionDefault(const VARectangle *region, struct pipe_video_buffer *buf, +vlVaRegionDefault(const VARectangle *region, vlVaSurface *surf, VARectangle *def) { if (region) @@ -43,8 +43,8 @@ vlVaRegionDefault(const VARectangle *region, struct pipe_video_buffer *buf, def->x = 0; def->y = 0; - def->width = buf->width; - def->height = buf->height; + def->width = surf->templat.width; + def->height = surf->templat.height; return def; } @@ -230,7 +230,7 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex const VARectangle *src_region, *dst_region; VAProcPipelineParameterBuffer *param; struct pipe_video_buffer *src; - vlVaSurface *src_surface; + vlVaSurface *src_surface, *dst_surface; unsigned i; if (!drv || !context) @@ -245,6 +245,8 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex param = buf->data; src_surface = handle_table_get(drv->htab, param->surface); + dst_surface = handle_table_get(drv->htab, context->target_id); + if (!src_surface || !src_surface->buffer) return VA_STATUS_ERROR_INVALID_SURFACE; @@ -290,8 +292,8 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex } } - src_region = vlVaRegionDefault(param->surface_region, src_surface->buffer, &def_src_region); - dst_region = vlVaRegionDefault(param->output_region, context->target, &def_dst_region); + src_region = vlVaRegionDefault(param->surface_region, src_surface, &def_src_region); + dst_region = vlVaRegionDefault(param->output_region, dst_surface, &def_dst_region); if (context->target->buffer_format != PIPE_FORMAT_NV12 && context->target->buffer_format != PIPE_FORMAT_P016) |