diff mbox series

[RESEND,1/2] drm/bridge: lt9611: Switch to atomic operations

Message ID 20220331153923.14314-1-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series [RESEND,1/2] drm/bridge: lt9611: Switch to atomic operations | expand

Commit Message

Marek Vasut March 31, 2022, 3:39 p.m. UTC
Use the atomic version of the enable/disable operations to continue the
transition to the atomic API. This will be needed to access the mode
from the atomic state.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

Comments

Robert Foss March 31, 2022, 3:43 p.m. UTC | #1
On Thu, 31 Mar 2022 at 17:39, Marek Vasut <marex@denx.de> wrote:
>
> Use the atomic version of the enable/disable operations to continue the
> transition to the atomic API. This will be needed to access the mode
> from the atomic state.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Maxime Ripard <maxime@cerno.tech>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/bridge/lontium-lt9611.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
> index 63df2e8a8abc..9b3ac3794a2c 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9611.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
> @@ -700,7 +700,9 @@ lt9611_connector_mode_valid(struct drm_connector *connector,
>  }
>
>  /* bridge funcs */
> -static void lt9611_bridge_enable(struct drm_bridge *bridge)
> +static void
> +lt9611_bridge_atomic_enable(struct drm_bridge *bridge,
> +                           struct drm_bridge_state *old_bridge_state)
>  {
>         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
>
> @@ -721,7 +723,9 @@ static void lt9611_bridge_enable(struct drm_bridge *bridge)
>         regmap_write(lt9611->regmap, 0x8130, 0xea);
>  }
>
> -static void lt9611_bridge_disable(struct drm_bridge *bridge)
> +static void
> +lt9611_bridge_atomic_disable(struct drm_bridge *bridge,
> +                            struct drm_bridge_state *old_bridge_state)
>  {
>         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
>         int ret;
> @@ -856,7 +860,9 @@ static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
>         lt9611->sleep = false;
>  }
>
> -static void lt9611_bridge_post_disable(struct drm_bridge *bridge)
> +static void
> +lt9611_bridge_atomic_post_disable(struct drm_bridge *bridge,
> +                                 struct drm_bridge_state *old_bridge_state)
>  {
>         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
>
> @@ -919,13 +925,17 @@ static void lt9611_bridge_hpd_enable(struct drm_bridge *bridge)
>  static const struct drm_bridge_funcs lt9611_bridge_funcs = {
>         .attach = lt9611_bridge_attach,
>         .mode_valid = lt9611_bridge_mode_valid,
> -       .enable = lt9611_bridge_enable,
> -       .disable = lt9611_bridge_disable,
> -       .post_disable = lt9611_bridge_post_disable,
>         .mode_set = lt9611_bridge_mode_set,
>         .detect = lt9611_bridge_detect,
>         .get_edid = lt9611_bridge_get_edid,
>         .hpd_enable = lt9611_bridge_hpd_enable,
> +
> +       .atomic_enable = lt9611_bridge_atomic_enable,
> +       .atomic_disable = lt9611_bridge_atomic_disable,
> +       .atomic_post_disable = lt9611_bridge_atomic_post_disable,
> +       .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 lt9611_parse_dt(struct device *dev,
> --
> 2.35.1
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Robert Foss March 31, 2022, 3:45 p.m. UTC | #2
On Thu, 31 Mar 2022 at 17:43, Robert Foss <robert.foss@linaro.org> wrote:
>
> On Thu, 31 Mar 2022 at 17:39, Marek Vasut <marex@denx.de> wrote:
> >
> > Use the atomic version of the enable/disable operations to continue the
> > transition to the atomic API. This will be needed to access the mode
> > from the atomic state.
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: John Stultz <john.stultz@linaro.org>
> > Cc: Maxime Ripard <maxime@cerno.tech>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > ---
> >  drivers/gpu/drm/bridge/lontium-lt9611.c | 22 ++++++++++++++++------
> >  1 file changed, 16 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
> > index 63df2e8a8abc..9b3ac3794a2c 100644
> > --- a/drivers/gpu/drm/bridge/lontium-lt9611.c
> > +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
> > @@ -700,7 +700,9 @@ lt9611_connector_mode_valid(struct drm_connector *connector,
> >  }
> >
> >  /* bridge funcs */
> > -static void lt9611_bridge_enable(struct drm_bridge *bridge)
> > +static void
> > +lt9611_bridge_atomic_enable(struct drm_bridge *bridge,
> > +                           struct drm_bridge_state *old_bridge_state)
> >  {
> >         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
> >
> > @@ -721,7 +723,9 @@ static void lt9611_bridge_enable(struct drm_bridge *bridge)
> >         regmap_write(lt9611->regmap, 0x8130, 0xea);
> >  }
> >
> > -static void lt9611_bridge_disable(struct drm_bridge *bridge)
> > +static void
> > +lt9611_bridge_atomic_disable(struct drm_bridge *bridge,
> > +                            struct drm_bridge_state *old_bridge_state)
> >  {
> >         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
> >         int ret;
> > @@ -856,7 +860,9 @@ static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
> >         lt9611->sleep = false;
> >  }
> >
> > -static void lt9611_bridge_post_disable(struct drm_bridge *bridge)
> > +static void
> > +lt9611_bridge_atomic_post_disable(struct drm_bridge *bridge,
> > +                                 struct drm_bridge_state *old_bridge_state)
> >  {
> >         struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
> >
> > @@ -919,13 +925,17 @@ static void lt9611_bridge_hpd_enable(struct drm_bridge *bridge)
> >  static const struct drm_bridge_funcs lt9611_bridge_funcs = {
> >         .attach = lt9611_bridge_attach,
> >         .mode_valid = lt9611_bridge_mode_valid,
> > -       .enable = lt9611_bridge_enable,
> > -       .disable = lt9611_bridge_disable,
> > -       .post_disable = lt9611_bridge_post_disable,
> >         .mode_set = lt9611_bridge_mode_set,
> >         .detect = lt9611_bridge_detect,
> >         .get_edid = lt9611_bridge_get_edid,
> >         .hpd_enable = lt9611_bridge_hpd_enable,
> > +
> > +       .atomic_enable = lt9611_bridge_atomic_enable,
> > +       .atomic_disable = lt9611_bridge_atomic_disable,
> > +       .atomic_post_disable = lt9611_bridge_atomic_post_disable,
> > +       .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 lt9611_parse_dt(struct device *dev,
> > --
> > 2.35.1
> >
>
> Reviewed-by: Robert Foss <robert.foss@linaro.org>


Applied to drm-misc-next.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
index 63df2e8a8abc..9b3ac3794a2c 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
@@ -700,7 +700,9 @@  lt9611_connector_mode_valid(struct drm_connector *connector,
 }
 
 /* bridge funcs */
-static void lt9611_bridge_enable(struct drm_bridge *bridge)
+static void
+lt9611_bridge_atomic_enable(struct drm_bridge *bridge,
+			    struct drm_bridge_state *old_bridge_state)
 {
 	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
@@ -721,7 +723,9 @@  static void lt9611_bridge_enable(struct drm_bridge *bridge)
 	regmap_write(lt9611->regmap, 0x8130, 0xea);
 }
 
-static void lt9611_bridge_disable(struct drm_bridge *bridge)
+static void
+lt9611_bridge_atomic_disable(struct drm_bridge *bridge,
+			     struct drm_bridge_state *old_bridge_state)
 {
 	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 	int ret;
@@ -856,7 +860,9 @@  static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
 	lt9611->sleep = false;
 }
 
-static void lt9611_bridge_post_disable(struct drm_bridge *bridge)
+static void
+lt9611_bridge_atomic_post_disable(struct drm_bridge *bridge,
+				  struct drm_bridge_state *old_bridge_state)
 {
 	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
@@ -919,13 +925,17 @@  static void lt9611_bridge_hpd_enable(struct drm_bridge *bridge)
 static const struct drm_bridge_funcs lt9611_bridge_funcs = {
 	.attach = lt9611_bridge_attach,
 	.mode_valid = lt9611_bridge_mode_valid,
-	.enable = lt9611_bridge_enable,
-	.disable = lt9611_bridge_disable,
-	.post_disable = lt9611_bridge_post_disable,
 	.mode_set = lt9611_bridge_mode_set,
 	.detect = lt9611_bridge_detect,
 	.get_edid = lt9611_bridge_get_edid,
 	.hpd_enable = lt9611_bridge_hpd_enable,
+
+	.atomic_enable = lt9611_bridge_atomic_enable,
+	.atomic_disable = lt9611_bridge_atomic_disable,
+	.atomic_post_disable = lt9611_bridge_atomic_post_disable,
+	.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 lt9611_parse_dt(struct device *dev,