diff options
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_uapi.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_uapi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index a1e5e262bae2..25c269bc4681 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -522,6 +522,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, if (property == config->prop_fb_id) { struct drm_framebuffer *fb; + fb = drm_framebuffer_lookup(dev, file_priv, val); drm_atomic_set_fb_for_plane(state, fb); if (fb) @@ -539,6 +540,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, } else if (property == config->prop_crtc_id) { struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); + if (val && !crtc) return -EACCES; return drm_atomic_set_crtc_for_plane(state, crtc); @@ -681,6 +683,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, if (property == config->prop_crtc_id) { struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); + if (val && !crtc) return -EACCES; return drm_atomic_set_crtc_for_connector(state, crtc); @@ -754,6 +757,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, } else if (property == config->writeback_fb_id_property) { struct drm_framebuffer *fb; int ret; + fb = drm_framebuffer_lookup(dev, file_priv, val); ret = drm_atomic_set_writeback_fb_for_connector(state, fb); if (fb) @@ -861,6 +865,7 @@ int drm_atomic_get_property(struct drm_mode_object *obj, switch (obj->type) { case DRM_MODE_OBJECT_CONNECTOR: { struct drm_connector *connector = obj_to_connector(obj); + WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); ret = drm_atomic_connector_get_property(connector, connector->state, property, val); @@ -868,6 +873,7 @@ int drm_atomic_get_property(struct drm_mode_object *obj, } case DRM_MODE_OBJECT_CRTC: { struct drm_crtc *crtc = obj_to_crtc(obj); + WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); ret = drm_atomic_crtc_get_property(crtc, crtc->state, property, val); @@ -875,6 +881,7 @@ int drm_atomic_get_property(struct drm_mode_object *obj, } case DRM_MODE_OBJECT_PLANE: { struct drm_plane *plane = obj_to_plane(obj); + WARN_ON(!drm_modeset_is_locked(&plane->mutex)); ret = drm_atomic_plane_get_property(plane, plane->state, property, val); |