@@ -2149,10 +2149,10 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_reset);
* Copies atomic state from a CRTC's current state and resets inferred values.
* This is useful for drivers that subclass the CRTC state.
*/
-void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
+void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc_state *from,
struct drm_crtc_state *state)
{
- memcpy(state, crtc->state, sizeof(*state));
+ memcpy(state, from, sizeof(*state));
if (state->mode_blob)
drm_property_reference_blob(state->mode_blob);
@@ -2181,7 +2181,7 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc)
state = kmalloc(sizeof(*state), GFP_KERNEL);
if (state)
- __drm_atomic_helper_crtc_duplicate_state(crtc, state);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, state);
return state;
}
@@ -2248,10 +2248,10 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
* Copies atomic state from a plane's current state. This is useful for
* drivers that subclass the plane state.
*/
-void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
+void __drm_atomic_helper_plane_duplicate_state(struct drm_plane_state *from,
struct drm_plane_state *state)
{
- memcpy(state, plane->state, sizeof(*state));
+ memcpy(state, from, sizeof(*state));
if (state->fb)
drm_framebuffer_reference(state->fb);
@@ -2275,7 +2275,7 @@ drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane)
state = kmalloc(sizeof(*state), GFP_KERNEL);
if (state)
- __drm_atomic_helper_plane_duplicate_state(plane, state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, state);
return state;
}
@@ -97,7 +97,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
if (!crtc_state)
return NULL;
- __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, &crtc_state->base);
crtc_state->base.crtc = crtc;
@@ -87,7 +87,7 @@ intel_plane_duplicate_state(struct drm_plane *plane)
state = &intel_state->base;
- __drm_atomic_helper_plane_duplicate_state(plane, state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, state);
return state;
}
@@ -258,7 +258,7 @@ omap_plane_atomic_duplicate_state(struct drm_plane *plane)
if (copy == NULL)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->base);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->base);
return ©->base;
}
@@ -310,7 +310,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
if (copy == NULL)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->state);
return ©->state;
}
@@ -455,7 +455,7 @@ static struct drm_plane_state *tegra_plane_atomic_duplicate_state(struct drm_pla
if (!copy)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->base);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->base);
copy->tiling = state->tiling;
copy->format = state->format;
copy->swap = state->swap;
@@ -1036,7 +1036,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
if (!copy)
return NULL;
- __drm_atomic_helper_crtc_duplicate_state(crtc, ©->base);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, ©->base);
copy->clk = state->clk;
copy->pclk = state->pclk;
copy->div = state->div;
@@ -93,7 +93,7 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
/* default implementations for state handling */
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
-void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
+void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc_state *from,
struct drm_crtc_state *state);
struct drm_crtc_state *
drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
@@ -103,7 +103,7 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void drm_atomic_helper_plane_reset(struct drm_plane *plane);
-void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
+void __drm_atomic_helper_plane_duplicate_state(struct drm_plane_state *from,
struct drm_plane_state *state);
struct drm_plane_state *
drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
Drivers may wish to duplicate in-flight states internally, but the __drm_atomic_helper_{crtc,plane}_duplicate_state helper functions can only be used to make a copy of state that has already been committed to obj->state. Let's update the helpers to take any existing state object as their first parameter rather than the DRM object pointer. We can update handful of existing callsites to just pass obj->state for it. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Matt Roper <matthew.d.roper@intel.com> --- drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++------ drivers/gpu/drm/i915/intel_atomic.c | 2 +- drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 2 +- drivers/gpu/drm/tegra/dc.c | 4 ++-- include/drm/drm_atomic_helper.h | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-)