dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: check that planes types are correct while initializing CRTC
@ 2015-03-17 11:05 Benjamin Gaignard
  2015-03-17 13:03 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2015-03-17 11:05 UTC (permalink / raw)
  To: daniel.vetter; +Cc: linaro-mm-sig, Benjamin Gaignard, dri-devel

Be warned if primary or cursor planes haven't the correct type

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/gpu/drm/drm_crtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 5785336..111849c4 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -659,6 +659,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
 	struct drm_mode_config *config = &dev->mode_config;
 	int ret;
 
+	WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY);
+	WARN_ON(cursor && cursor->type != DRM_PLANE_TYPE_CURSOR);
+
 	crtc->dev = dev;
 	crtc->funcs = funcs;
 	crtc->invert_dimensions = false;
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: check that planes types are correct while initializing CRTC
  2015-03-17 11:05 [PATCH] drm: check that planes types are correct while initializing CRTC Benjamin Gaignard
@ 2015-03-17 13:03 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2015-03-17 13:03 UTC (permalink / raw)
  To: Benjamin Gaignard; +Cc: linaro-mm-sig, daniel.vetter, dri-devel

On Tue, Mar 17, 2015 at 12:05:29PM +0100, Benjamin Gaignard wrote:
> Be warned if primary or cursor planes haven't the correct type
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Yeah that's a useful self-check to make sure universal plane conversions
are done correctly. Merged to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 5785336..111849c4 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -659,6 +659,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
>  	struct drm_mode_config *config = &dev->mode_config;
>  	int ret;
>  
> +	WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY);
> +	WARN_ON(cursor && cursor->type != DRM_PLANE_TYPE_CURSOR);
> +
>  	crtc->dev = dev;
>  	crtc->funcs = funcs;
>  	crtc->invert_dimensions = false;
> -- 
> 1.9.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-03-17 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 11:05 [PATCH] drm: check that planes types are correct while initializing CRTC Benjamin Gaignard
2015-03-17 13:03 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox