summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-09-19 13:00:15 -0400
committerLeo Liu <[email protected]>2017-09-25 09:42:14 -0400
commit169c077d1d10db9e4938bae193fbd14b25cc5795 (patch)
tree20863e483b03779ea039db9295d50faa1a9a0345 /src/gallium/state_trackers
parent1d1299f8a41edbf6373222eda5708af5a5390d3c (diff)
st/va/postproc: use progressive target buffer for scaling
Scaling between interlaced buffers, esp. for scale-up, because blit will scale up top filed and bottom field separately. it'll result in the weaving for these buffer with lack of accuracy. So use shader deint for the case. Acked-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/va/postproc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/postproc.c b/src/gallium/state_trackers/va/postproc.c
index 44491263167..d3eafe9b53b 100644
--- a/src/gallium/state_trackers/va/postproc.c
+++ b/src/gallium/state_trackers/va/postproc.c
@@ -118,15 +118,33 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
struct pipe_surface **dst_surfaces;
struct u_rect src_rect;
struct u_rect dst_rect;
+ bool scale = false;
unsigned i;
if (src->interlaced != dst->interlaced && dst->interlaced)
return VA_STATUS_ERROR_INVALID_SURFACE;
+ if ((src->width != dst->width || src->height != dst->height) &&
+ (src->interlaced && dst->interlaced))
+ scale = true;
+
src_surfaces = src->get_surfaces(src);
if (!src_surfaces || !src_surfaces[0])
return VA_STATUS_ERROR_INVALID_SURFACE;
+ if (scale) {
+ vlVaSurface *surf;
+
+ surf = handle_table_get(drv->htab, context->target_id);
+ surf->templat.interlaced = false;
+ dst->destroy(dst);
+
+ if (vlVaHandleSurfaceAllocate(drv, surf, &surf->templat) != VA_STATUS_SUCCESS)
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+
+ dst = context->target = surf->buffer;
+ }
+
dst_surfaces = dst->get_surfaces(dst);
if (!dst_surfaces || !dst_surfaces[0])
return VA_STATUS_ERROR_INVALID_SURFACE;