diff options
author | Dave Airlie <airlied@redhat.com> | 2015-01-28 09:34:27 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-01-28 09:34:27 +1000 |
commit | 21773f16f2cb3c056051c679da542f0b494252e2 (patch) | |
tree | 362e701c962f8a78978775ff3e4093b490ee0cd1 /drivers/gpu/drm/drm_atomic.c | |
parent | 2f5b4ef15c60bc5292a3f006c018acb3da53737b (diff) | |
parent | 9469244d869623e8b54d9f3d4d00737e377af273 (diff) | |
download | op-kernel-dev-21773f16f2cb3c056051c679da542f0b494252e2.zip op-kernel-dev-21773f16f2cb3c056051c679da542f0b494252e2.tar.gz |
Merge tag 'topic/atomic-core-2015-01-27' of git://anongit.freedesktop.org/drm-intel into drm-next
* tag 'topic/atomic-core-2015-01-27' of git://anongit.freedesktop.org/drm-intel:
drm/atomic: Fix potential use of state after free
drm/atomic-helper: debug output for modesets
drm/atomic-helpers: Saner encoder/crtc callbacks
drm/atomic-helpers: Recover full cursor plane behaviour
drm/atomic-helper: add connector->dpms() implementation
drm/atomic: Add drm_crtc_state->active
drm: Add standardized boolean props
drm/plane-helper: Fix transitional helper kerneldocs
drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
Conflicts:
include/drm/drm_crtc_helper.h
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 4c5c9c3..c2e9c52 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -134,6 +134,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) connector->funcs->atomic_destroy_state(connector, state->connector_states[i]); + state->connector_states[i] = NULL; } for (i = 0; i < config->num_crtc; i++) { @@ -144,6 +145,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) crtc->funcs->atomic_destroy_state(crtc, state->crtc_states[i]); + state->crtc_states[i] = NULL; } for (i = 0; i < config->num_total_plane; i++) { @@ -154,6 +156,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) plane->funcs->atomic_destroy_state(plane, state->plane_states[i]); + state->plane_states[i] = NULL; } } EXPORT_SYMBOL(drm_atomic_state_clear); @@ -241,7 +244,13 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, struct drm_crtc_state *state, struct drm_property *property, uint64_t val) { - if (crtc->funcs->atomic_set_property) + struct drm_device *dev = crtc->dev; + struct drm_mode_config *config = &dev->mode_config; + + /* FIXME: Mode prop is missing, which also controls ->enable. */ + if (property == config->prop_active) { + state->active = val; + } else if (crtc->funcs->atomic_set_property) return crtc->funcs->atomic_set_property(crtc, state, property, val); return -EINVAL; } @@ -282,6 +291,13 @@ static int drm_atomic_crtc_check(struct drm_crtc *crtc, * * TODO: Add generic modeset state checks once we support those. */ + + if (state->active && !state->enable) { + DRM_DEBUG_KMS("[CRTC:%d] active without enabled\n", + crtc->base.id); + return -EINVAL; + } + return 0; } @@ -978,7 +994,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) if (!crtc) continue; - if (crtc_state->mode_changed) { + if (crtc_state->mode_changed || + crtc_state->active_changed) { DRM_DEBUG_KMS("[CRTC:%d] requires full modeset\n", crtc->base.id); return -EINVAL; |