diff options
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r-- | src/sna/gen6_render.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 64830925..801236f0 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -186,10 +186,6 @@ static const struct blendinfo { #define FILL_FLAGS(op, format) GEN6_SET_FLAGS(FILL_SAMPLER, gen6_get_blend((op), false, (format)), GEN6_WM_KERNEL_NOMASK, FILL_VERTEX) #define FILL_FLAGS_NOBLEND GEN6_SET_FLAGS(FILL_SAMPLER, NO_BLEND, GEN6_WM_KERNEL_NOMASK, FILL_VERTEX) -#define VIDEO_SAMPLER \ - SAMPLER_OFFSET(SAMPLER_FILTER_BILINEAR, SAMPLER_EXTEND_PAD, \ - SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE) - #define GEN6_SAMPLER(f) (((f) >> 16) & 0xfff0) #define GEN6_BLEND(f) (((f) >> 0) & 0xfff0) #define GEN6_KERNEL(f) (((f) >> 16) & 0xf) @@ -1986,6 +1982,7 @@ gen6_render_video(struct sna *sna, int nbox, dxo, dyo, pix_xoff, pix_yoff; float src_scale_x, src_scale_y; struct sna_pixmap *priv; + unsigned filter; BoxPtr box; DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n", @@ -2014,8 +2011,15 @@ gen6_render_video(struct sna *sna, tmp.floats_per_vertex = 3; tmp.floats_per_rect = 9; + if (src_w == drw_w && src_h == drw_h) + filter = SAMPLER_FILTER_NEAREST; + else + filter = SAMPLER_FILTER_BILINEAR; + tmp.u.gen6.flags = - GEN6_SET_FLAGS(VIDEO_SAMPLER, NO_BLEND, + GEN6_SET_FLAGS(SAMPLER_OFFSET(filter, SAMPLER_EXTEND_PAD, + SAMPLER_FILTER_NEAREST, SAMPLER_EXTEND_NONE), + NO_BLEND, is_planar_fourcc(frame->id) ? GEN6_WM_KERNEL_VIDEO_PLANAR : GEN6_WM_KERNEL_VIDEO_PACKED, |