summaryrefslogtreecommitdiff
path: root/src/sna/gen3_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-12 12:03:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-12 11:59:01 +0000
commit9001263b32efde1361555432914d9ac3ee780511 (patch)
tree7868054dbfd37db2ee9593015f1dc96c2555b9d6 /src/sna/gen3_render.c
parent2dbe7d91a7f15a3a9ddad696c5088ca98898fca2 (diff)
sna/gen3+: Use nearest for unscaled videos
If the output is unscaled, then we do not require pixel interpolation (and planar formats are exactly subsampled). References: https://bugs.freedesktop.org/show_bug.cgi?id=58185 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen3_render.c')
-rw-r--r--src/sna/gen3_render.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index b092976f..f203e7ec 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3528,7 +3528,8 @@ gen3_emit_video_state(struct sna *sna,
struct sna_video_frame *frame,
PixmapPtr pixmap,
struct kgem_bo *dst_bo,
- int width, int height)
+ int width, int height,
+ bool bilinear)
{
struct gen3_render_state *state = &sna->render_state.gen3;
uint32_t id, ms3, rewind;
@@ -3887,6 +3888,7 @@ gen3_render_video(struct sna *sna,
float src_scale_x, src_scale_y;
int pix_xoff, pix_yoff;
struct kgem_bo *dst_bo;
+ bool bilinear;
int copy = 0;
DBG(("%s: %dx%d -> %dx%d\n", __FUNCTION__, src_w, src_h, drw_w, drw_h));
@@ -3927,6 +3929,8 @@ gen3_render_video(struct sna *sna,
#endif
}
+ bilinear = src_w != drw_w || src_h != drw_h;
+
src_scale_x = ((float)src_w / frame->width) / drw_w;
src_scale_y = ((float)src_h / frame->height) / drw_h;
@@ -3936,13 +3940,13 @@ gen3_render_video(struct sna *sna,
gen3_video_get_batch(sna, dst_bo);
gen3_emit_video_state(sna, video, frame, pixmap,
- dst_bo, width, height);
+ dst_bo, width, height, bilinear);
do {
int nbox_this_time = gen3_get_inline_rectangles(sna, nbox, 4);
if (nbox_this_time == 0) {
gen3_video_get_batch(sna, dst_bo);
gen3_emit_video_state(sna, video, frame, pixmap,
- dst_bo, width, height);
+ dst_bo, width, height, bilinear);
nbox_this_time = gen3_get_inline_rectangles(sna, nbox, 4);
}
nbox -= nbox_this_time;