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>
This commit is contained in:
Ville Syrjälä 2018-05-29 21:33:14 +03:00 committed by Chris Wilson
parent 13ac0a81a6
commit bb5ee1adea
1 changed files with 10 additions and 2 deletions

View File

@ -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;