aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2015-03-03 08:21:55 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-17 17:29:53 -0400
commita91572f35bda9c39f3d3ac89f0d6e84ae75ae02e (patch)
treefe02b934637dde463d68b33c70160f8299a4a6c3
parent17fe10218be4663b0be1cf27805c32741eae48a8 (diff)
drm/i915: Set crtc backpointer when duplicating crtc state
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>
-rw-r--r--drivers/gpu/drm/i915/intel_atomic.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 011b8960fd75..3903b90fb64e 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -214,12 +214,18 @@ struct drm_crtc_state *
214intel_crtc_duplicate_state(struct drm_crtc *crtc) 214intel_crtc_duplicate_state(struct drm_crtc *crtc)
215{ 215{
216 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 216 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
217 struct intel_crtc_state *crtc_state;
217 218
218 if (WARN_ON(!intel_crtc->config)) 219 if (WARN_ON(!intel_crtc->config))
219 return kzalloc(sizeof(*intel_crtc->config), GFP_KERNEL); 220 crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
221 else
222 crtc_state = kmemdup(intel_crtc->config,
223 sizeof(*intel_crtc->config), GFP_KERNEL);
220 224
221 return kmemdup(intel_crtc->config, sizeof(*intel_crtc->config), 225 if (crtc_state)
222 GFP_KERNEL); 226 crtc_state->base.crtc = crtc;
227
228 return &crtc_state->base;
223} 229}
224 230
225/** 231/**