Now that atomic_check takes the global atomic state as a parameter, we
don't need to go through the pointer in the CRTC state.
This was done using the following coccinelle script:
@ crtc_atomic_func @
identifier helpers;
identifier func;
@@
static struct drm_crtc_helper_funcs helpers = {
...,
.atomic_check = func,
...,
};
@@
identifier crtc_atomic_func.func;
identifier crtc, state;
@@
func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
...
- struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
... when != crtc_state
- crtc_state->state
+ state
...
}
@@
struct drm_crtc_state *crtc_state;
identifier crtc_atomic_func.func;
identifier crtc, state;
@@
func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
...
- crtc_state->state
+ state
...
}
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102133834.1176740-3-maxime@cerno.tech
if (has_primary != crtc_state->enable)
return -EINVAL;
- return drm_atomic_add_affected_planes(crtc_state->state, crtc);
+ return drm_atomic_add_affected_planes(state, crtc);
}
static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc,
return -EINVAL;
/* TODO: Is this needed ? */
- return drm_atomic_add_affected_planes(crtc_state->state, crtc);
+ return drm_atomic_add_affected_planes(state, crtc);
}
static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc,
return -EINVAL;
}
- pri_state = drm_atomic_get_new_plane_state(crtc_state->state,
+ pri_state = drm_atomic_get_new_plane_state(state,
crtc->primary);
if (pri_state) {
struct omap_crtc_state *omap_crtc_state =
if (!crtc_state->active)
return 0;
- if (crtc_state->state->planes[0].ptr != crtc->primary ||
- crtc_state->state->planes[0].state == NULL ||
- crtc_state->state->planes[0].state->crtc != crtc) {
+ if (state->planes[0].ptr != crtc->primary ||
+ state->planes[0].state == NULL ||
+ state->planes[0].state->crtc != crtc) {
dev_dbg(crtc->dev->dev, "CRTC primary plane must be present");
return -EINVAL;
}
if (ret)
return ret;
- for_each_new_connector_in_state(crtc_state->state, conn, conn_state,
+ for_each_new_connector_in_state(state, conn, conn_state,
i) {
if (conn_state->crtc != crtc)
continue;
static int zynqmp_disp_crtc_atomic_check(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
- struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
- crtc);
- return drm_atomic_add_affected_planes(crtc_state->state, crtc);
+ return drm_atomic_add_affected_planes(state, crtc);
}
static void