All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Reject NV12 planes with odd width/start position
@ 2018-05-17 19:07 Fritz Koenig
  2018-05-18 10:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fritz Koenig @ 2018-05-17 19:07 UTC (permalink / raw)
  To: intel-gfx

Planes with an odd width will appear to have an incorrect
stride. When the start position is odd the controller
can lock up.

Signed-off-by: Fritz Koenig <frkoenig@google.com>
---

Hi,

This appears to be a limitation of the hardware that is not being
checked. Is this supported and am I not enabling it correctly?


 drivers/gpu/drm/i915/intel_atomic_plane.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 7481ce85746b..ca4553592ab9 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -188,6 +188,21 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
 	else
 		crtc_state->active_planes &= ~BIT(intel_plane->id);
 
+	/*
+	 * NV12 plane is not allowed to start from an odd position or
+	 * end on an odd position.
+	 */
+	if (state->fb && (DRM_FORMAT_NV12 == state->fb->format->format)) {
+		if ((intel_state->base.src_w >> 16) & 1) {
+			DRM_DEBUG_KMS("Invalid Source: Yuv format does not support odd width\n");
+			return -EINVAL;
+		}
+		if ((intel_state->base.src_x >> 16) & 1) {
+			DRM_DEBUG_KMS("Invalid Source: Yuv format does not support odd x pos\n");
+			return -EINVAL;
+		}
+	}
+
 	return intel_plane_atomic_calc_changes(old_crtc_state,
 					       &crtc_state->base,
 					       old_plane_state,
-- 
2.17.0.441.gb46fe60e1d-goog

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-18 17:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 19:07 [PATCH] drm/i915: Reject NV12 planes with odd width/start position Fritz Koenig
2018-05-18 10:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-05-18 12:25 ` [PATCH] " Ville Syrjälä
2018-05-18 14:15   ` Ville Syrjälä
2018-05-18 17:10     ` Fritz Koenig
2018-05-18 14:20 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.