drm: check that planes types are correct while initializing CRTC
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 17 Mar 2015 11:05:29 +0000 (12:05 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Mar 2015 13:03:04 +0000 (14:03 +0100)
Be warned if primary or cursor planes haven't the correct type

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index 5785336695ca5330641e4362940b16a8dfe0483b..111849c4c8c2925f6fb4e3e845c685f3e74437c9 100644 (file)
@@ -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;