Skip to content

Commit a91572f

Browse files
Ander Conselvan de Oliveiradanvet
authored andcommitted
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>
1 parent 17fe102 commit a91572f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/gpu/drm/i915/intel_atomic.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,18 @@ struct drm_crtc_state *
214214
intel_crtc_duplicate_state(struct drm_crtc *crtc)
215215
{
216216
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
217+
struct intel_crtc_state *crtc_state;
217218

218219
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);
220224

221-
return kmemdup(intel_crtc->config, sizeof(*intel_crtc->config),
222-
GFP_KERNEL);
225+
if (crtc_state)
226+
crtc_state->base.crtc = crtc;
227+
228+
return &crtc_state->base;
223229
}
224230

225231
/**

0 commit comments

Comments
 (0)