drm/i915: Call drm helpers when duplicating crtc and plane states
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 21 Apr 2015 14:12:58 +0000 (17:12 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 8 May 2015 11:03:58 +0000 (13:03 +0200)
Use the helpers introduced by the commit below to properly initialize
the duplicated states.

commit f5e7840b0c4368f8cdbb055188c2a0eef50c3052
Author: Thierry Reding <treding@nvidia.com>
Date:   Wed Jan 28 14:54:32 2015 +0100

    drm/atomic: Add helpers for state-subclassing drivers

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>
drivers/gpu/drm/i915/intel_atomic.c
drivers/gpu/drm/i915/intel_atomic_plane.c

index cb6d5f2d9b6071a783223ab2065e5c69f31b86ea..7ed8033aae6097af69d90e83bb6c97f7dc6f7225 100644 (file)
@@ -250,8 +250,12 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
                crtc_state = kmemdup(intel_crtc->config,
                                     sizeof(*intel_crtc->config), GFP_KERNEL);
 
-       if (crtc_state)
-               crtc_state->base.crtc = crtc;
+       if (!crtc_state)
+               return NULL;
+
+       __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
+
+       crtc_state->base.crtc = crtc;
 
        return &crtc_state->base;
 }
index dc8e1360fb2056916fbd4af0fd6756be13b09c6d..77462e1360bc4aa2e1c6ac6f1af0f88dba3004d4 100644 (file)
@@ -85,8 +85,8 @@ intel_plane_duplicate_state(struct drm_plane *plane)
                return NULL;
 
        state = &intel_state->base;
-       if (state->fb)
-               drm_framebuffer_reference(state->fb);
+
+       __drm_atomic_helper_plane_duplicate_state(plane, state);
 
        return state;
 }