diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-05-29 08:06:51 -0700 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-05 08:52:43 +0200 |
commit | 7f994f3fc4f44365a953dbcac55131b7160750ea (patch) | |
tree | 15a2c7cdcf7f131b5d5fd59a23c868671b0f6f50 /drivers/gpu/drm/drm_crtc.c | |
parent | 27da3bdfcf7f5233cdfe4563f53edf1ecab7cea0 (diff) | |
download | op-kernel-dev-7f994f3fc4f44365a953dbcac55131b7160750ea.zip op-kernel-dev-7f994f3fc4f44365a953dbcac55131b7160750ea.tar.gz |
drm: Check CRTC compatibility in setplane
The DRM core setplane code should check that the plane is usable on the
specified CRTC before calling into the driver.
Prior to this patch, a plane's possible_crtcs field was purely
informational for userspace and was never actually verified at the
kernel level (aside from the primary plane helper).
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Chon Ming Lee <chon.ming.lee@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 43735f3..b8cc4fe 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2178,6 +2178,13 @@ int drm_mode_setplane(struct drm_device *dev, void *data, goto out; } + /* Check whether this plane is usable on this CRTC */ + if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) { + DRM_DEBUG_KMS("Invalid crtc for plane\n"); + ret = -EINVAL; + goto out; + } + fb = drm_framebuffer_lookup(dev, plane_req->fb_id); if (!fb) { DRM_DEBUG_KMS("Unknown framebuffer ID %d\n", |