From ba5c1649465d40a0557e67bc9819ef687a7d99f4 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 19 Feb 2021 13:00:22 +0100 Subject: drm: Rename plane atomic_check state names Most drivers call the argument to the plane atomic_check hook simply state, which is going to conflict with the global atomic state in a later rework. Let's rename it to new_plane_state (or new_state depending on the convention used in the driver). This was done using the coccinelle script below, and built tested: @ plane_atomic_func @ identifier helpers; identifier func; @@ static const struct drm_plane_helper_funcs helpers = { .atomic_check = func, }; @ has_old_state @ identifier plane_atomic_func.func; identifier plane; expression e; symbol old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { ... struct drm_plane_state *old_state = e; ... } @ depends on has_old_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *state + struct drm_plane_state *new_state ) { <+... - state + new_state ...+> } @ has_state @ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { ... } @ depends on has_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *state + struct drm_plane_state *new_plane_state ) { <+... - state + new_plane_state ...+> } Reviewed-by: Laurent Pinchart Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210219120032.260676-2-maxime@cerno.tech --- drivers/gpu/drm/stm/ltdc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/drm/stm') diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 0967cd9190a2..f61c0086415a 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -749,9 +749,9 @@ static const struct drm_crtc_funcs ltdc_crtc_funcs = { */ static int ltdc_plane_atomic_check(struct drm_plane *plane, - struct drm_plane_state *state) + struct drm_plane_state *new_plane_state) { - struct drm_framebuffer *fb = state->fb; + struct drm_framebuffer *fb = new_plane_state->fb; u32 src_w, src_h; DRM_DEBUG_DRIVER("\n"); @@ -760,11 +760,11 @@ static int ltdc_plane_atomic_check(struct drm_plane *plane, return 0; /* convert src_ from 16:16 format */ - src_w = state->src_w >> 16; - src_h = state->src_h >> 16; + src_w = new_plane_state->src_w >> 16; + src_h = new_plane_state->src_h >> 16; /* Reject scaling */ - if (src_w != state->crtc_w || src_h != state->crtc_h) { + if (src_w != new_plane_state->crtc_w || src_h != new_plane_state->crtc_h) { DRM_ERROR("Scaling is not supported"); return -EINVAL; } -- cgit v1.2.3