[Intel-gfx] [PATCH 06/15] drm/i915: Force NV12 coordinates to be a multiple of 2

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Sep 19 13:56:35 UTC 2018


We can't make NV12 work any other way. The scaler doesn't handle odd
coordinates well, and we will get visual corruption on the screen.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5a77d7615fa0..122f3f4cfc53 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3072,6 +3072,15 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
 static int
 skl_check_nv12_surface(struct intel_plane_state *plane_state)
 {
+	if ((plane_state->base.src.x1 >> 16) % 2 ||
+	    (plane_state->base.src.y1 >> 16) % 2 ||
+	    (drm_rect_width(&plane_state->base.src) >> 16) % 2 ||
+	    (drm_rect_height(&plane_state->base.src) >> 16) % 2) {
+		DRM_DEBUG_KMS("src coordinates and width/height must be a multiple of 2\n");
+
+		return -EINVAL;
+	}
+
 	/* Display WA #1106 */
 	if (plane_state->base.rotation !=
 	    (DRM_MODE_REFLECT_X | DRM_MODE_ROTATE_90) &&
-- 
2.18.0



More information about the Intel-gfx mailing list