diff options
author | Daniel Stone <daniels@collabora.com> | 2015-05-25 14:11:51 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-05-26 09:50:38 -0400 |
commit | 99cf4a29fa24461bbfe22125967188a18383eb5c (patch) | |
tree | 3f07dc47f09b2454c697832f16436479d98a8619 /drivers/gpu/drm/drm_atomic_helper.c | |
parent | 819364da20fd914aba2fd03e95ee0467286752f5 (diff) |
drm/atomic: Add current-mode blob to CRTC state
Add a blob property tracking the current mode to the CRTC state, and
ensure it is properly updated and referenced.
v2: Continue using crtc_state->mode inside getcrtc, instead of reading
out the mode blob. Use IS_ERR and PTR_ERR from create_blob. Move
set_mode_prop_for_crtc to later patch where it actually gets used.
Enforce !!state->enable == !!state->mode_blob inside
drm_atomic_crtc_check.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index e69d4847e237..a900858fa265 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -2044,6 +2044,8 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); | |||
2044 | */ | 2044 | */ |
2045 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) | 2045 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) |
2046 | { | 2046 | { |
2047 | if (crtc->state && crtc->state->mode_blob) | ||
2048 | drm_property_unreference_blob(crtc->state->mode_blob); | ||
2047 | kfree(crtc->state); | 2049 | kfree(crtc->state); |
2048 | crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL); | 2050 | crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL); |
2049 | 2051 | ||
@@ -2065,6 +2067,8 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, | |||
2065 | { | 2067 | { |
2066 | memcpy(state, crtc->state, sizeof(*state)); | 2068 | memcpy(state, crtc->state, sizeof(*state)); |
2067 | 2069 | ||
2070 | if (state->mode_blob) | ||
2071 | drm_property_reference_blob(state->mode_blob); | ||
2068 | state->mode_changed = false; | 2072 | state->mode_changed = false; |
2069 | state->active_changed = false; | 2073 | state->active_changed = false; |
2070 | state->planes_changed = false; | 2074 | state->planes_changed = false; |
@@ -2107,11 +2111,8 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state); | |||
2107 | void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, | 2111 | void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, |
2108 | struct drm_crtc_state *state) | 2112 | struct drm_crtc_state *state) |
2109 | { | 2113 | { |
2110 | /* | 2114 | if (state->mode_blob) |
2111 | * This is currently a placeholder so that drivers that subclass the | 2115 | drm_property_unreference_blob(state->mode_blob); |
2112 | * state will automatically do the right thing if code is ever added | ||
2113 | * to this function. | ||
2114 | */ | ||
2115 | } | 2116 | } |
2116 | EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state); | 2117 | EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state); |
2117 | 2118 | ||