BACKPORT: drm/i915: Handle YUV subpixel support better

Y41x formats is a 4:4:4 format, so it can be addressed with pixel level accuracy.
Meanwhile it seems that while rotating YUYV 4:2:2 formats need a multiple of 2
for width and height, otherwise corruption occurs.

For YUV 4:2:2, the spec says that w/h should always be even, but we get
away with odd height while unrotated. When rotating it seems corruption
occurs with an odd x/y, and w/h should always be even.
Just to be completely paranoid, reject odd x/y w/h when rotating 90/270.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322135954.20434-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

(cherry picked from commit 3bd02fa4be3aba778cd5aa0ca9e072244ce45a74)

Conflicts:
	drivers/gpu/drm/i915/intel_sprite.c

[frkoenig: the logic for plane checking has been moved upstream into
 intel_sprite.c (intel_plane_check_src_coordinates).  to resolve the
 conflict the functionality was merged into one that already exists
 in intel_display.c (skl_check_nv12_surface)]

BUG=crbug:1057015
BUG=b:151143892
BUG=b:152133219
TEST=display odd sized videos on soraka
Signed-off-by: Fritz Koenig <frkoenig@chromium.org>
Signed-off-by: Andres Calderon Jaramillo <andrescj@chromium.org>

Change-Id: I3d169046e406ea4423e5609c0cbd8552cbb69a1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2134796
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Auto-Submit: Fritz Koenig <frkoenig@chromium.org>
(cherry picked from commit cb1a6347f61dd0694454c99fffb72b310975d056)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2158868
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Tested-by: Andres Calderon Jaramillo <andrescj@google.com>
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
1 file changed