Skip to content

Commit

Permalink
drm/i915: Use crtc->state for duplication.
Browse files Browse the repository at this point in the history
In async mode crtc->config can be updated after the locks are released,
resulting in the wrong state being duplicated.

Note that this also removes a spurious assignment of crtc_state->crtc
introduced in

commit f0c6057
Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Date:   Tue Apr 21 17:12:58 2015 +0300

    drm/i915: Call drm helpers when duplicating crtc and plane states

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Maarten Lankhorst authored and Daniel Vetter committed Sep 10, 2015
1 parent bca8013 commit f2a066f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/gpu/drm/i915/intel_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,14 @@ intel_connector_atomic_get_property(struct drm_connector *connector,
struct drm_crtc_state *
intel_crtc_duplicate_state(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_crtc_state *crtc_state;

if (WARN_ON(!intel_crtc->config))
crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
else
crtc_state = kmemdup(intel_crtc->config,
sizeof(*intel_crtc->config), GFP_KERNEL);

crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL);
if (!crtc_state)
return NULL;

__drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);

crtc_state->base.crtc = crtc;

return &crtc_state->base;
}

Expand Down

0 comments on commit f2a066f

Please sign in to comment.