[PATCH v1 05/12] drm/bridge: sii8620: Use drm_bridge_funcs.atomic_check
Dave Stevenson
dave.stevenson at raspberrypi.com
Tue Jul 19 13:59:48 UTC 2022
On Sun, 17 Jul 2022 at 18:45, Sam Ravnborg <sam at ravnborg.org> wrote:
>
> Replace the deprecated drm_bridge_funcs.mode_fixup() with
> drm_bridge_funcs.atomic_check().
>
> drm_bridge_funcs.atomic_check() requires the atomic state operations,
> update these to the default implementations.
>
> Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Reviewed-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
> Cc: Andrzej Hajda <andrzej.hajda at intel.com>
> Cc: Neil Armstrong <narmstrong at baylibre.com>
> Cc: Robert Foss <robert.foss at linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart at ideasonboard.com>
> Cc: Jonas Karlman <jonas at kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec at gmail.com>
> ---
> drivers/gpu/drm/bridge/sil-sii8620.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c
> index ab0bce4a988c..b6e5c285c8ea 100644
> --- a/drivers/gpu/drm/bridge/sil-sii8620.c
> +++ b/drivers/gpu/drm/bridge/sil-sii8620.c
> @@ -8,6 +8,7 @@
>
> #include <asm/unaligned.h>
>
> +#include <drm/drm_atomic_state_helper.h>
> #include <drm/bridge/mhl.h>
> #include <drm/drm_bridge.h>
> #include <drm/drm_crtc.h>
> @@ -2262,26 +2263,30 @@ static enum drm_mode_status sii8620_mode_valid(struct drm_bridge *bridge,
> }
> }
>
> -static bool sii8620_mode_fixup(struct drm_bridge *bridge,
> - const struct drm_display_mode *mode,
> - struct drm_display_mode *adjusted_mode)
> +static int sii8620_atomic_check(struct drm_bridge *bridge,
> + struct drm_bridge_state *bridge_state,
> + struct drm_crtc_state *crtc_state,
> + struct drm_connector_state *conn_state)
> {
> struct sii8620 *ctx = bridge_to_sii8620(bridge);
>
> mutex_lock(&ctx->lock);
>
> - ctx->use_packed_pixel = sii8620_is_packing_required(ctx, adjusted_mode);
> + ctx->use_packed_pixel = sii8620_is_packing_required(ctx, &crtc_state->adjusted_mode);
>
> mutex_unlock(&ctx->lock);
>
> - return true;
> + return 0;
> }
>
> static const struct drm_bridge_funcs sii8620_bridge_funcs = {
> .attach = sii8620_attach,
> .detach = sii8620_detach,
> - .mode_fixup = sii8620_mode_fixup,
> + .atomic_check = sii8620_atomic_check,
> .mode_valid = sii8620_mode_valid,
> + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> + .atomic_reset = drm_atomic_helper_bridge_reset,
> };
>
> static int sii8620_probe(struct i2c_client *client,
> --
> 2.34.1
>
More information about the dri-devel
mailing list