The sdi bridge still uses the deprecated non-atomic bridge
callbacks.

Switch to their atomic counterparts, adding the bridge state
handlers if not already present.

Generated by the following Coccinelle script:

@ is_bridge @
identifier funcs;
@@

 struct drm_bridge_funcs funcs = {
        ...,
 };

@ has_create_state depends on is_bridge @
identifier funcs, f;
@@

struct drm_bridge_funcs funcs = {
  ...,
  .atomic_create_state = f,
  ...,
};

@ update_struct depends on (is_bridge && !has_create_state) @
identifier is_bridge.funcs;
identifier f;
@@

 struct drm_bridge_funcs funcs = {
+       .atomic_create_state = drm_atomic_helper_bridge_create_state,
+       .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+       .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
        ...,
 };

@ update_pre_enable_struct depends on (is_bridge && !has_create_state) @
identifier is_bridge.funcs;
identifier f;
@@

 struct drm_bridge_funcs funcs = {
        ...,
-       .pre_enable = f,
+       .atomic_pre_enable = f,
        ...,
 };

@ update_pre_enable_impl depends on update_pre_enable_struct @
identifier update_pre_enable_struct.f;
identifier b;
@@

-void f(struct drm_bridge *b)
+void f(struct drm_bridge *b, struct drm_atomic_commit *commit)
 {
        ...
 }

@ update_enable_struct depends on (is_bridge && !has_create_state) @
identifier is_bridge.funcs;
identifier f;
@@

 struct drm_bridge_funcs funcs = {
        ...,
-       .enable = f,
+       .atomic_enable = f,
        ...,
 };

@ update_enable_impl depends on update_enable_struct @
identifier update_enable_struct.f;
identifier b;
@@

-void f(struct drm_bridge *b)
+void f(struct drm_bridge *b, struct drm_atomic_commit *commit)
 {
        ...
 }

@ update_disable_struct depends on (is_bridge && !has_create_state) @
identifier is_bridge.funcs;
identifier f;
@@

 struct drm_bridge_funcs funcs = {
        ...,
-       .disable = f,
+       .atomic_disable = f,
        ...,
 };

@ update_disable_impl depends on update_disable_struct @
identifier update_disable_struct.f;
identifier b;
@@

-void f(struct drm_bridge *b)
+void f(struct drm_bridge *b, struct drm_atomic_commit *commit)
 {
        ...
 }

@ update_post_disable_struct depends on (is_bridge && !has_create_state) @
identifier is_bridge.funcs;
identifier f;
@@

 struct drm_bridge_funcs funcs = {
        ...,
-       .post_disable = f,
+       .atomic_post_disable = f,
        ...,
 };

@ update_post_disable_impl depends on update_post_disable_struct @
identifier update_post_disable_struct.f;
identifier b;
@@

-void f(struct drm_bridge *b)
+void f(struct drm_bridge *b, struct drm_atomic_commit *commit)
 {
        ...
 }

Signed-off-by: Maxime Ripard <[email protected]>

---
To: Tomi Valkeinen <[email protected]>
---
 drivers/gpu/drm/omapdrm/dss/sdi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c 
b/drivers/gpu/drm/omapdrm/dss/sdi.c
index df4cbc683e2c..d4a3c0ecaaf2 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -14,10 +14,11 @@
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/string.h>
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_bridge.h>
 
 #include "dss.h"
 #include "omapdss.h"
 
@@ -195,11 +196,12 @@ static void sdi_bridge_mode_set(struct drm_bridge *bridge,
        struct sdi_device *sdi = drm_bridge_to_sdi(bridge);
 
        sdi->pixelclock = adjusted_mode->clock * 1000;
 }
 
-static void sdi_bridge_enable(struct drm_bridge *bridge)
+static void sdi_bridge_enable(struct drm_bridge *bridge,
+                             struct drm_atomic_commit *commit)
 {
        struct sdi_device *sdi = drm_bridge_to_sdi(bridge);
        struct dispc_clock_info dispc_cinfo;
        unsigned long fck;
        int r;
@@ -258,11 +260,12 @@ static void sdi_bridge_enable(struct drm_bridge *bridge)
        dispc_runtime_put(sdi->dss->dispc);
 err_get_dispc:
        regulator_disable(sdi->vdds_sdi_reg);
 }
 
-static void sdi_bridge_disable(struct drm_bridge *bridge)
+static void sdi_bridge_disable(struct drm_bridge *bridge,
+                              struct drm_atomic_commit *commit)
 {
        struct sdi_device *sdi = drm_bridge_to_sdi(bridge);
 
        dss_mgr_disable(&sdi->output);
 
@@ -272,16 +275,19 @@ static void sdi_bridge_disable(struct drm_bridge *bridge)
 
        regulator_disable(sdi->vdds_sdi_reg);
 }
 
 static const struct drm_bridge_funcs sdi_bridge_funcs = {
+       .atomic_create_state = drm_atomic_helper_bridge_create_state,
+       .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+       .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
        .attach = sdi_bridge_attach,
        .mode_valid = sdi_bridge_mode_valid,
        .mode_fixup = sdi_bridge_mode_fixup,
        .mode_set = sdi_bridge_mode_set,
-       .enable = sdi_bridge_enable,
-       .disable = sdi_bridge_disable,
+       .atomic_enable = sdi_bridge_enable,
+       .atomic_disable = sdi_bridge_disable,
 };
 
 static void sdi_bridge_init(struct sdi_device *sdi)
 {
        sdi->bridge.of_node = sdi->pdev->dev.of_node;

-- 
2.54.0

Reply via email to