summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-05-29 21:33:14 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2018-05-31 20:35:43 +0100
commitbb5ee1adea838b99d60e18523c3632eb02fb04d8 (patch)
treeb3107a9359850dc4a4f13bcad326a0a5d99b4501 /src
parent13ac0a81a6c77b801623b2c0e47398a7aa099730 (diff)
sna/video/sprite: Make NV12 take the GPU scaling fallback
Even unscaled NV12 needs the plane scaler on SKL+, so when unscaled NV12 setplane fails we should still take the GPU scaling fallback path. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_video_sprite.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index f6d6f0b4..0f52f032 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -415,6 +415,15 @@ sna_video_sprite_show(struct sna *sna,
return true;
}
+static bool need_scaling(const struct sna_video_frame *frame,
+ const BoxRec *dst)
+{
+ /* SKL+ need the plane scaler even for unscaled NV12 */
+ return frame->id == FOURCC_NV12 ||
+ frame->src.x2 - frame->src.x1 != dst->x2 - dst->x1 ||
+ frame->src.y2 - frame->src.y1 != dst->y2 - dst->y1;
+}
+
static int sna_video_sprite_put_image(ddPutImage_ARGS)
{
struct sna_video *video = port->devPriv.ptr;
@@ -562,8 +571,7 @@ off:
}
if (!hw_scaling && sna->render.video &&
- !((frame.src.x2 - frame.src.x1) == (dst.x2 - dst.x1) &&
- (frame.src.y2 - frame.src.y1) == (dst.y2 - dst.y1))) {
+ need_scaling(&frame, &dst)) {
ScreenPtr screen = to_screen_from_sna(sna);
PixmapPtr scaled;
RegionRec r;