Re: [PATCH v1 07/12] drm/bridge: tc358767: Use drm_bridge_funcs.atomic_check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 17 Jul 2022 at 18:45, Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:
>
> When atomic_check() is defined, then mode_fixup() is ignored,
> so it had no effect that drm_bridge_funcs.mode_fixup was assigned.
> Embed the original implementation in the caller and drop the function.
>
> Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>

Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>

(There was a point when drm_bridge_chain_mode_fixup still existed, but
that's gone/going now).

> Cc: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
> Cc: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
> Cc: Robert Foss <robert.foss@xxxxxxxxxx>
> Cc: Laurent Pinchart <Laurent.pinchart@xxxxxxxxxxxxxxxx>
> Cc: Jonas Karlman <jonas@xxxxxxxxx>
> Cc: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
> ---
>  drivers/gpu/drm/bridge/tc358767.c | 21 ++++++---------------
>  1 file changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 02bd757a8987..b2ab967504af 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -1496,26 +1496,18 @@ tc_edp_bridge_atomic_disable(struct drm_bridge *bridge,
>                 dev_err(tc->dev, "main link disable error: %d\n", ret);
>  }
>
> -static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,
> -                                const struct drm_display_mode *mode,
> -                                struct drm_display_mode *adj)
> -{
> -       /* Fixup sync polarities, both hsync and vsync are active low */
> -       adj->flags = mode->flags;
> -       adj->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
> -       adj->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
> -
> -       return true;
> -}
> -
>  static int tc_common_atomic_check(struct drm_bridge *bridge,
>                                   struct drm_bridge_state *bridge_state,
>                                   struct drm_crtc_state *crtc_state,
>                                   struct drm_connector_state *conn_state,
>                                   const unsigned int max_khz)
>  {
> -       tc_bridge_mode_fixup(bridge, &crtc_state->mode,
> -                            &crtc_state->adjusted_mode);
> +       struct drm_display_mode *adj = &crtc_state->adjusted_mode;
> +
> +       /* Fixup sync polarities, both hsync and vsync are active low */
> +       adj->flags = crtc_state->mode.flags;
> +       adj->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
> +       adj->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
>
>         if (crtc_state->adjusted_mode.clock > max_khz)
>                 return -EINVAL;
> @@ -1783,7 +1775,6 @@ static const struct drm_bridge_funcs tc_edp_bridge_funcs = {
>         .atomic_check = tc_edp_atomic_check,
>         .atomic_enable = tc_edp_bridge_atomic_enable,
>         .atomic_disable = tc_edp_bridge_atomic_disable,
> -       .mode_fixup = tc_bridge_mode_fixup,
>         .detect = tc_bridge_detect,
>         .get_edid = tc_get_edid,
>         .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> --
> 2.34.1
>



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux