linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: Check that the plane coordinates are not negative
@ 2016-09-30 14:33 Maxime Ripard
  2016-09-30 16:08 ` Boris Brezillon
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Ripard @ 2016-09-30 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

Our planes cannot be set at negative coordinates. Make sure we reject such
configuration.

Reported-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index f0035bf5efea..f5463c4c2cde 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -29,6 +29,9 @@ struct sun4i_plane_desc {
 static int sun4i_backend_layer_atomic_check(struct drm_plane *plane,
 					    struct drm_plane_state *state)
 {
+	if ((state->crtc_x < 0) || (state->crtc_y < 0))
+		return -EINVAL;
+
 	return 0;
 }
 
-- 
2.9.3

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

end of thread, other threads:[~2016-10-12 21:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-30 14:33 [PATCH] drm/sun4i: Check that the plane coordinates are not negative Maxime Ripard
2016-09-30 16:08 ` Boris Brezillon
2016-09-30 16:22   ` Ville Syrjälä
2016-09-30 16:33     ` Boris Brezillon
2016-09-30 20:42       ` Ville Syrjälä
2016-10-03 12:58   ` Maxime Ripard
2016-10-03 16:18     ` Boris Brezillon
2016-10-12 21:09       ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).