diff mbox series

drm/bridge: adv7511: Switch to atomic operations

Message ID 20250104181908.15141-1-jesseevg@gmail.com (mailing list archive)
State Superseded, archived
Headers show
Series drm/bridge: adv7511: Switch to atomic operations | expand

Commit Message

Jesse Van Gavere Jan. 4, 2025, 6:19 p.m. UTC
Use the atomic version of enable/disable.

Doing so enables it to work in a chain where atomic operations are expected
such as TIDSS

Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Dmitry Baryshkov Jan. 5, 2025, 10:43 p.m. UTC | #1
On Sat, Jan 04, 2025 at 07:19:08PM +0100, Jesse Van Gavere wrote:
> Use the atomic version of enable/disable.
> 
> Doing so enables it to work in a chain where atomic operations are expected
> such as TIDSS

The patch LGTM, but the commit message needs some work. Why/how does
TIDSS require bridges to use atomic ops?

> 
> Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
Jesse Van Gavere Jan. 6, 2025, 11:57 a.m. UTC | #2
Hello Dmitry,

> The patch LGTM, but the commit message needs some work. Why/how does
> TIDSS require bridges to use atomic ops?

In hindsight that indeed could've been worded better, the approach
here was as a stepping stone to implementing the input bus formats,
which is what TIDSS needs, so I'll reword the commit as to make clear
that this is done so the bus formats can be implemented to support
bridges where this is required.

Best regards,
Jesse
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index eb5919b38263..19c14916ded4 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -910,14 +910,16 @@  static struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge)
 	return container_of(bridge, struct adv7511, bridge);
 }
 
-static void adv7511_bridge_enable(struct drm_bridge *bridge)
+static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
+					 struct drm_bridge_state *bridge_state)
 {
 	struct adv7511 *adv = bridge_to_adv7511(bridge);
 
 	adv7511_power_on(adv);
 }
 
-static void adv7511_bridge_disable(struct drm_bridge *bridge)
+static void adv7511_bridge_atomic_disable(struct drm_bridge *bridge,
+					  struct drm_bridge_state *bridge_state)
 {
 	struct adv7511 *adv = bridge_to_adv7511(bridge);
 
@@ -996,14 +998,18 @@  static void adv7511_bridge_hpd_notify(struct drm_bridge *bridge,
 }
 
 static const struct drm_bridge_funcs adv7511_bridge_funcs = {
-	.enable = adv7511_bridge_enable,
-	.disable = adv7511_bridge_disable,
 	.mode_set = adv7511_bridge_mode_set,
 	.mode_valid = adv7511_bridge_mode_valid,
 	.attach = adv7511_bridge_attach,
 	.detect = adv7511_bridge_detect,
 	.edid_read = adv7511_bridge_edid_read,
 	.hpd_notify = adv7511_bridge_hpd_notify,
+
+	.atomic_enable = adv7511_bridge_atomic_enable,
+	.atomic_disable = adv7511_bridge_atomic_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,
 };
 
 /* -----------------------------------------------------------------------------