Skip to content

Commit

Permalink
drm/i915: Set crtc backpointer when duplicating crtc state
Browse files Browse the repository at this point in the history
In the path were there is no state to duplicate, the allocated crtc
state wouldn't have the crtc backpointer initialized.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ander Conselvan de Oliveira authored and Daniel Vetter committed Mar 17, 2015
1 parent 17fe102 commit a91572f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/gpu/drm/i915/intel_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,18 @@ 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))
return kzalloc(sizeof(*intel_crtc->config), GFP_KERNEL);
crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
else
crtc_state = kmemdup(intel_crtc->config,
sizeof(*intel_crtc->config), GFP_KERNEL);

return kmemdup(intel_crtc->config, sizeof(*intel_crtc->config),
GFP_KERNEL);
if (crtc_state)
crtc_state->base.crtc = crtc;

return &crtc_state->base;
}

/**
Expand Down

0 comments on commit a91572f

Please sign in to comment.