drm/i915: Take ownership of atomic state on success in intel_set_mode()

To match the behavior of ->atomic_commit().

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Ander Conselvan de Oliveira 2015-04-21 17:13:20 +03:00 committed by Daniel Vetter
parent 8c7b5ccb72
commit 2bfb462758
1 changed files with 11 additions and 7 deletions

View File

@ -9968,9 +9968,9 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
if (ret)
goto fail;
intel_set_mode(crtc, state);
drm_atomic_state_free(state);
ret = intel_set_mode(crtc, state);
if (ret)
goto fail;
if (old->release_fb) {
drm_framebuffer_unregister_private(old->release_fb);
@ -12425,6 +12425,8 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc,
intel_crtc->config = crtc_state_copy;
intel_crtc->base.state = &crtc_state_copy->base;
drm_atomic_state_free(state);
return 0;
}
@ -12470,6 +12472,7 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)
struct intel_connector *connector;
struct drm_connector_state *connector_state;
struct intel_crtc_state *crtc_state;
int ret;
state = drm_atomic_state_alloc(dev);
if (!state) {
@ -12528,9 +12531,9 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)
intel_modeset_setup_plane_state(state, crtc, &crtc->mode,
crtc->primary->fb, crtc->x, crtc->y);
intel_set_mode(crtc, state);
drm_atomic_state_free(state);
ret = intel_set_mode(crtc, state);
if (ret)
drm_atomic_state_free(state);
}
#undef for_each_intel_crtc_masked
@ -12759,7 +12762,8 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
}
out:
drm_atomic_state_free(state);
if (ret)
drm_atomic_state_free(state);
return ret;
}