Skip to content

Commit

Permalink
drm: check that planes types are correct while initializing CRTC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Gaignard authored and Daniel Vetter committed Mar 17, 2015
1 parent 0388df0 commit 522cf91
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 522cf91

Please sign in to comment.