diff mbox series

[1/2] drm/bridge: chipone-icn6211: Switch to atomic operations

Message ID 20211119145325.1775046-1-jagan@amarulasolutions.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/bridge: chipone-icn6211: Switch to atomic operations | expand

Commit Message

Jagan Teki Nov. 19, 2021, 2:53 p.m. UTC
Replace atomic version of the pre_enable/enable/post_disable
operations to continue the transition to the atomic API.

Also added default drm atomic operations for duplicate, destroy
and reset state API's in order to have smooth transition on
atomic API's.

Tested on Allwinner R16/R40 DSI.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/gpu/drm/bridge/chipone-icn6211.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Comments

Jagan Teki Dec. 19, 2021, 4:41 p.m. UTC | #1
On Fri, Nov 19, 2021 at 8:23 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Replace atomic version of the pre_enable/enable/post_disable
> operations to continue the transition to the atomic API.
>
> Also added default drm atomic operations for duplicate, destroy
> and reset state API's in order to have smooth transition on
> atomic API's.
>
> Tested on Allwinner R16/R40 DSI.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---

Gentle ping!
Robert Foss Jan. 4, 2022, 1:23 p.m. UTC | #2
On Sun, 19 Dec 2021 at 17:41, Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, Nov 19, 2021 at 8:23 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Replace atomic version of the pre_enable/enable/post_disable
> > operations to continue the transition to the atomic API.
> >
> > Also added default drm atomic operations for duplicate, destroy
> > and reset state API's in order to have smooth transition on
> > atomic API's.
> >
> > Tested on Allwinner R16/R40 DSI.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
>
> Gentle ping!

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Robert Foss Jan. 4, 2022, 1:30 p.m. UTC | #3
Applied to drm-misc-next
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
index a6151db95586..77b3e2c29461 100644
--- a/drivers/gpu/drm/bridge/chipone-icn6211.c
+++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
@@ -4,6 +4,7 @@ 
  * Author: Jagan Teki <jagan@amarulasolutions.com>
  */
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_mipi_dsi.h>
@@ -61,7 +62,8 @@  static inline int chipone_dsi_write(struct chipone *icn,  const void *seq,
 		chipone_dsi_write(icn, d, ARRAY_SIZE(d));	\
 	}
 
-static void chipone_enable(struct drm_bridge *bridge)
+static void chipone_atomic_enable(struct drm_bridge *bridge,
+				  struct drm_bridge_state *old_bridge_state)
 {
 	struct chipone *icn = bridge_to_chipone(bridge);
 	struct drm_display_mode *mode = bridge_to_mode(bridge);
@@ -114,7 +116,8 @@  static void chipone_enable(struct drm_bridge *bridge)
 	usleep_range(10000, 11000);
 }
 
-static void chipone_pre_enable(struct drm_bridge *bridge)
+static void chipone_atomic_pre_enable(struct drm_bridge *bridge,
+				      struct drm_bridge_state *old_bridge_state)
 {
 	struct chipone *icn = bridge_to_chipone(bridge);
 	int ret;
@@ -145,7 +148,8 @@  static void chipone_pre_enable(struct drm_bridge *bridge)
 	usleep_range(10000, 11000);
 }
 
-static void chipone_post_disable(struct drm_bridge *bridge)
+static void chipone_atomic_post_disable(struct drm_bridge *bridge,
+					struct drm_bridge_state *old_bridge_state)
 {
 	struct chipone *icn = bridge_to_chipone(bridge);
 
@@ -169,10 +173,13 @@  static int chipone_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flag
 }
 
 static const struct drm_bridge_funcs chipone_bridge_funcs = {
-	.attach = chipone_attach,
-	.post_disable = chipone_post_disable,
-	.pre_enable = chipone_pre_enable,
-	.enable = chipone_enable,
+	.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,
+	.atomic_pre_enable	= chipone_atomic_pre_enable,
+	.atomic_enable		= chipone_atomic_enable,
+	.atomic_post_disable	= chipone_atomic_post_disable,
+	.attach			= chipone_attach,
 };
 
 static int chipone_parse_dt(struct chipone *icn)