[PATCH v2 5/7] drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_from()

2025-10-03 Thread Luca Ceresoli
handled by a separate commit. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 35 --- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index d2ab7cef0b768b0ff674a77977833d

[PATCH v2 6/7] drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_reverse()

2025-10-03 Thread Luca Ceresoli
converted. drm_atomic_bridge_chain_pre_enable() and drm_atomic_bridge_chain_post_disable() are handled by a separate commit. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drive

[PATCH v2 4/7] drm/bridge: lock the encoder chain in scoped for_each loops

2025-10-03 Thread Luca Ceresoli
more. In fact all bridges in the encoder chain are refcounted already thanks to the drm_bridge_get() in drm_bridge_attach() and the drm_bridge_put() in drm_bridge_detach(). So while iterating with the mutex held the list cannot change _and_ the refcount of all bridges in the list cannot drop to z

Re: [PATCH v2] drm/display: bridge_connector: get/put the stored bridges

2025-10-03 Thread Luca Ceresoli
On Fri, 26 Sep 2025 16:59:40 +0200, Luca Ceresoli wrote: > drm_bridge_connector_init() takes eight pointers to various bridges, some > of which can be identical, and stores them in pointers inside struct > drm_bridge_connector. Get a reference to each of the taken bridges and put > i

[PATCH v2 0/7] drm/bridge: protect encoder bridge chain with a mutex

2025-10-03 Thread Luca Ceresoli
ly exclusive. [1] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/#t Signed-off-by: Luca Ceresoli --- Changes in v2: - Improve commit messages and add documentation as per v1 review - Patch 4: fixed infinite loop when encoder->bridge_chain is empty - Link to v1

[PATCH v2 1/7] drm/encoder: add mutex to protect the bridge chain

2025-10-03 Thread Luca Ceresoli
over the chain. Add a mutex to be taken whenever looping or changing the encoder chain. Also add two APIs to lock/unlock the mutex without the need to manipulate internal struct drm_encoder fields. Signed-off-by: Luca Ceresoli --- Changes in v2: - Added documentation to new APIs --- drivers

[PATCH v2 7/7] drm/bridge: prevent encoder chain changes in pre_enable/post_disable

2025-10-03 Thread Luca Ceresoli
king around the outer loop. Thankfully there are no return points inside the loops, so the change is trivial and readable. Signed-off-by: Luca Ceresoli --- Changes in v2: - Improved commit message --- drivers/gpu/drm/drm_bridge.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/d

[PATCH v2 3/7] drm/bridge: lock the encoder bridge chain mutex during insertion

2025-10-03 Thread Luca Ceresoli
drm_bridge_attach() modifies the encoder bridge chain, so take a mutex around such operations to allow users of the chain to protect themselves from chain modifications while iterating. Signed-off-by: Luca Ceresoli --- Changes in v2: - Removed comment before on drm_bridge_detach() --- drivers

[PATCH v2 2/7] drm/encoder: drm_encoder_cleanup: take chain mutex while tearing down

2025-10-03 Thread Luca Ceresoli
op 2nd time, do something with *pos (bridge 2) 6. loop iteration 2 finishes, list_for_each_entry_safe() sets: pos = n = LIST_POISON1 ==> bug! Signed-off-by: Luca Ceresoli --- Changes in v2: - Expanded commit messge with rationale, as discussed --- drivers/gpu/drm/drm_encoder.c | 2 +

[PATCH 1/4] drm/sti: hda: add bridge before attaching

2025-10-03 Thread Luca Ceresoli
DRM bridges should be always added to the global bridge list before being attached. Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd8@houat/ Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/sti/sti_hda.c | 5 + 1 file changed, 5 insertions(+) diff --git a

[PATCH 0/4] drm/bridge: enforce drm_bridge_add() before drm_bridge_attach()

2025-10-03 Thread Luca Ceresoli
ase they will be fixed as they are found. [0] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/#t [1] https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd8@houat/ Signed-off-by: Luca Ceresoli --- Luca Ceresoli (4): drm/sti: hda: ad

[PATCH 4/4] drm/bridge: add warning for bridges attached without being added

2025-10-03 Thread Luca Ceresoli
houat/ Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 1246a52f8767b52c5f10139aa897824b3c2f28da..6dba601a056bb3cff8b8dd5b1ec46299235b2d85 100644 --- a/drivers/gp

Re: [PATCH v6 11/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities

2025-10-03 Thread Luca Ceresoli
Hello Damon, On Wed, 1 Oct 2025 18:09:22 +0200 Luca Ceresoli wrote: > Another thing to note is that this patch conflicts with [0], which I > plan to apply in the next few days. The two patches are orthogonal but > they insist on the same lines (those assigning > bridge_connec

Re: [PATCH] drm/bridge: refcount last_bridge in drm_atomic_bridge_chain_select_bus_fmts()

2025-10-03 Thread Luca Ceresoli
On Wed, 24 Sep 2025 17:11:01 +0200, Luca Ceresoli wrote: > Get a reference for the last_bridge when it is obtained and release it > using a cleanup action. > > Applied, thanks! [1/1] drm/bridge: refcount last_bridge in drm_atomic_bridge_chain_select_bus_fmts()

Re: [PATCH 4/7] drm/bridge: lock the encoder chain in scoped for_each loops

2025-10-02 Thread Luca Ceresoli
bridge __free(drm_bridge_encoder_chain_unlock) =\ - list_first_entry(&drm_encoder_chain_lock(encoder)->bridge_chain, \ + list_first_entry_or_null(&drm_encoder_chain_lock(encoder)->bridge_chain, \ Fix queued for v2. Luca -- Luca Ce

Re: [PATCH 1/7] drm/encoder: add mutex to protect the bridge chain

2025-09-29 Thread Luca Ceresoli
Hi Maxime, On Mon, 29 Sep 2025 14:43:46 +0200 Maxime Ripard wrote: > On Fri, Sep 26, 2025 at 05:59:42PM +0200, Luca Ceresoli wrote: > > The per-encoder bridge chain is currently assumed to be static once it is > > fully initialized. Work is in progress to add hot-pluggable bridge

Re: [PATCH 2/7] drm/encoder: drm_encoder_cleanup: take chain mutex while tearing down

2025-09-29 Thread Luca Ceresoli
Hi Maxime, On Mon, 29 Sep 2025 14:45:10 +0200 Maxime Ripard wrote: > On Fri, Sep 26, 2025 at 05:59:43PM +0200, Luca Ceresoli wrote: > > drm_encoder_cleanup() modifies the encoder chain by removing bridges via > > drm_bridge_detach(). Protect this whole operation by taking the mu

[PATCH 3/7] drm/bridge: lock the encoder bridge chain mutex during insertion

2025-09-26 Thread Luca Ceresoli
be needed to avoid deadlocks Add a comment to clarify that is intended. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index

[PATCH 7/7] drm/bridge: prevent encoder chain changes while iterating in drm_atomic_bridge_chain_post_disable/pre_enable()

2025-09-26 Thread Luca Ceresoli
change is trivial and readable. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 66c0a80db8426ffb360248895cfe2a11d6007ed7..00e0a88128d0eeabf25911591ad8c482d6c1ca

[PATCH v2 0/2] drm/bridge: handle gracefully atomic updates during bridge removal

2025-09-26 Thread Luca Ceresoli
6-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/#t [1] https://lore.kernel.org/all/20250106-vigorous-talented-viper-fa49d9@houat/ Signed-off-by: Luca Ceresoli --- Changes in v2: - No changes to patch 1, discussion pending - Use devres instead of a flag in patch 2 - Link to v1: https://lore.kernel.

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-26 Thread Luca Ceresoli
Hi Maxime, On Mon, 15 Sep 2025 16:51:56 +0200 Luca Ceresoli wrote: > I'm going to send soon a v2 with my devres changes so we can continue > this discussion on actual code. v2 sent, with the devres changes. Discussion con continue there. Best regards, Luca -- Luca Ceresoli, Bootl

[PATCH v2 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-26 Thread Luca Ceresoli
ng the critical section (drm_bridge_enter() returns nonzero), so sn65dsi83_atomic_disable() cannot release and execute the devres action * the devres action is executed at the end of sn65dsi83_remove() Signed-off-by: Luca Ceresoli --- Changed in v2: - Use a devres action instead of

[PATCH 5/7] drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_from()

2025-09-26 Thread Luca Ceresoli
handled by a separate commit. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 35 --- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 90e467cf91a134342c80d2f958b928

[PATCH 1/7] drm/encoder: add mutex to protect the bridge chain

2025-09-26 Thread Luca Ceresoli
over the chain. Add a mutex to be taken whenever looping or changing the encoder chain. Also add two APIs to lock/unlock the mutex without the need to manipulate internal struct drm_encoder fields. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_encoder.c | 2 ++ include/drm

[PATCH 2/7] drm/encoder: drm_encoder_cleanup: take chain mutex while tearing down

2025-09-26 Thread Luca Ceresoli
drm_encoder_cleanup() modifies the encoder chain by removing bridges via drm_bridge_detach(). Protect this whole operation by taking the mutex, so any users iterating over the chain will not access it during the change. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_encoder.c | 2 ++ 1

[PATCH 0/7] drm/bridge: protect encoder bridge chain with a mutex

2025-09-26 Thread Luca Ceresoli
sult in disruption of the code iterating over the chain. Avoid it by introducing a mutex to make list insertion, removal and iterations mutually exclusive. [1] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/#t Signed-off-by: Luca Ceresoli --- Luca Cereso

[PATCH v2] drm/display: bridge_connector: get/put the stored bridges

2025-09-26 Thread Luca Ceresoli
assignment. Add a drm_bridge_put() before writing them to handle this. Finally, there is also a function-local panel_bridge pointer taken inside the loop and used after the loop. Use a cleanup action as well to ensure it is put on return. Signed-off-by: Luca Ceresoli --- This series ensures the bridge

Re: [PATCH 1/2] drm/connector: allow a .destroy callback for drmm-allocated connectors

2025-09-26 Thread Luca Ceresoli
Hi Dmitry, On Fri, 26 Sep 2025 01:07:26 +0300 Dmitry Baryshkov wrote: > On Thu, Sep 25, 2025 at 07:19:49PM +0200, Luca Ceresoli wrote: > > Some code is going to need connector-specific cleanup actions (namely > > drm_bridge_connector will need to put refcounted bridges). > &

[PATCH 0/2] drm/bridge: bridge-connector: get/put the stored bridges

2025-09-25 Thread Luca Ceresoli
s on disposal (handled by patch 1) and because of the complex code flow of drm_bridge_connector_init() (handled by patch 2). Signed-off-by: Luca Ceresoli --- Luca Ceresoli (2): drm/connector: allow a .destroy callback for drmm-allocated connectors drm/display: bridge-connector: get/put the

[PATCH 2/2] drm/display: bridge-connector: get/put the stored bridges

2025-09-25 Thread Luca Ceresoli
assignment. Add a drm_bridge_put() before writing them to handle this. Finally, there is also a function-local panel_bridge pointer taken inside the loop and used after the loop. Due to the various return points, use a __free() cleanup action to ensure it is put on return. Signed-off-by: Luca Ceresoli

[PATCH 1/2] drm/connector: allow a .destroy callback for drmm-allocated connectors

2025-09-25 Thread Luca Ceresoli
Some code is going to need connector-specific cleanup actions (namely drm_bridge_connector will need to put refcounted bridges). The .destroy callback is appropriate for this task but it is currently forbidden by drmm_connector_init(). Relax this limitation and document it. Signed-off-by: Luca

[PATCH] drm/bridge: refcount last_bridge in drm_atomic_bridge_chain_select_bus_fmts()

2025-09-24 Thread Luca Ceresoli
Get a reference for the last_bridge when it is obtained and release it using a cleanup action. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c

Re: [PATCH v9 0/3] drm/bridge: debugfs: show refcount and list removed bridges

2025-09-23 Thread Luca Ceresoli
On Mon, 15 Sep 2025 12:12:45 +0200, Luca Ceresoli wrote: > This series shows removed bridges to the global /dri/bridges file. > Removed bridges are bridges after drm_bridges_remove() but before they are > eventually freed on the last drm_bridge_put(). > > This is part of t

Re: [PATCH v2 05/23] staging: media: tegra-video: expand VI and VIP support to Tegra30

2025-09-20 Thread Luca Ceresoli
Hello Svyatoslav, On Sat, 6 Sep 2025 16:53:26 +0300 Svyatoslav Ryhel wrote: > Existing VI and VIP implementation for Tegra20 is fully compatible with > Tegra30. > > Signed-off-by: Svyatoslav Ryhel Tested-by: Luca Ceresoli # Tegra20 VIP Reviewed-by: Luca Ceresoli -- L

Re: [PATCH v1 09/19] staging: media: tegra-video: vi: add flip controls only if no source controls are provided

2025-09-20 Thread Luca Ceresoli
Hello Svyatoslav, On Fri, 5 Sep 2025 19:05:16 +0300 Svyatoslav Ryhel wrote: > пт, 5 вер. 2025 р. о 18:59 Luca Ceresoli пише: > > > > Hello Svyatoslav, > > > > On Tue, 19 Aug 2025 15:16:21 +0300 > > Svyatoslav Ryhel wrote: > > > > > Add HFLIP a

[PATCH v8 3/3] drm/bridge: adapt drm_bridge_add/remove() docs, mention the lingering list

2025-09-20 Thread Luca Ceresoli
just the type of container used to implement such (de)registration. Signed-off-by: Luca Ceresoli --- Changes in v8: - extracted to an ad-hoc patch from the v7 patch "drm/bridge: add list of removed refcounted bridges" --- drivers/gpu/drm/drm_bridge.c | 12 ++-- 1 file c

Re: [PATCH v5 4/7] drm/bridge: dw-hdmi: Add API dw_hdmi_set_sample_iec958() for iec958 format

2025-09-20 Thread Luca Ceresoli
gt; > > > On Wed, Sep 03, 2025 at 06:41:05PM +0800, Shengjiu Wang wrote: > > > > On Tue, Sep 2, 2025 at 12:52 AM Luca Ceresoli > > > > wrote: > > > > > > > > > > Hello Shengjiu, > > > > > > > > > > On Th

Re: (subset) [PATCH v2 0/9] drm/bridge: get/put the bridge returned by drm_bridge_get_next_bridge()

2025-09-18 Thread Luca Ceresoli
Hello, On Tue, 02 Sep 2025 15:25:31 +0200 Luca Ceresoli wrote: > On Fri, 01 Aug 2025 19:05:22 +0200, Luca Ceresoli wrote: > > Note: the cover in v1 was mentioning by mistake > > drm_bridge_get_last_bridge() instead of drm_bridge_get_next_bridge(). > >

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-17 Thread Luca Ceresoli
Hi Maxime, On Wed, 27 Aug 2025 09:46:03 +0200 Maxime Ripard wrote: > On Wed, Aug 20, 2025 at 01:13:02PM +0200, Luca Ceresoli wrote: > > Hello Maxime, > > > > On Tue, 19 Aug 2025 14:29:32 +0200 > > Maxime Ripard wrote: > > > > > > @@ -1005,7 +1

Re: [PATCH v2 11/23] staging: media: tegra-video: csi: add a check to tegra_channel_get_remote_csi_subdev

2025-09-17 Thread Luca Ceresoli
Hello Svyatoslav, On Tue, 16 Sep 2025 19:24:52 +0300 Svyatoslav Ryhel wrote: > вт, 16 вер. 2025 р. о 19:04 Luca Ceresoli пише: > > > > Hello Svyatoslav, > > > > On Sat, 6 Sep 2025 16:53:32 +0300 > > Svyatoslav Ryhel wrote: > > > > > By def

Re: [PATCH v2 13/23] staging: media: tegra-video: csi: move avdd-dsi-csi-supply from VI to CSI

2025-09-17 Thread Luca Ceresoli
On Sat, 6 Sep 2025 16:53:34 +0300 Svyatoslav Ryhel wrote: > The avdd-dsi-csi-supply is CSI power supply not VI, hence move it to > proper place. > > Signed-off-by: Svyatoslav Ryhel Tested-by: Luca Ceresoli # Tegra20 VIP Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Em

Re: [PATCH v2 11/23] staging: media: tegra-video: csi: add a check to tegra_channel_get_remote_csi_subdev

2025-09-16 Thread Luca Ceresoli
ee comment above), maybe extend it: return (subdev->ops == &tegra_csi_ops || subdev->ops == &tegra_vip_ops) ? subdev : NULL; Let me know your thoughts. Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH] drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

2025-09-16 Thread Luca Ceresoli
commit: 288dac9fb6084330d968459c750c838fd06e10e6 Best regards, -- Luca Ceresoli

Re: [PATCH v2 7/9] drm/bridge: remove drm_for_each_bridge_in_chain()

2025-09-16 Thread Luca Ceresoli
On Tue, 16 Sep 2025 11:03:41 +0200 Maxime Ripard wrote: > On Mon, Sep 15, 2025 at 05:58:05PM +0200, Luca Ceresoli wrote: > > On Mon, 15 Sep 2025 14:22:24 +0200 > > Maxime Ripard wrote: > > > On Fri, Aug 08, 2025 at 04:49:14PM +0200, Luca Ceresoli wrote: > > &g

Re: [PATCH v8 0/3] drm/bridge: debugfs: show refcount and list removed bridges

2025-09-15 Thread Luca Ceresoli
feedback on drm_for_each_bridge_in_chain_scoped() would be very welcome to unlock both this and other series from being applied/sent. [0] https://lore.kernel.org/all/20250808-drm-bridge-alloc-getput-for_each_bridge-v2-3-edb6ee81e...@bootlin.com/ Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 7/9] drm/bridge: remove drm_for_each_bridge_in_chain()

2025-09-15 Thread Luca Ceresoli
On Mon, 15 Sep 2025 14:22:24 +0200 Maxime Ripard wrote: > Hi, > > On Fri, Aug 08, 2025 at 04:49:14PM +0200, Luca Ceresoli wrote: > > All users have been replaced by drm_for_each_bridge_in_chain_scoped(). > > > > Signed-off-by: Luca Ceresoli > > --- &

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-15 Thread Luca Ceresoli
e beginning > > of the .remove function. > > Another thing that just crossed my mind is why we don't call > atomic_disable when we're tearing down the bridge too. We're doing it > for the main DRM devices, it would make sense to me to disable the > encoder -> bridge -> connector (and possibly CRTC) chain if we remove a > bridge automatically. Uh, interesting idea. Do you mean something like: void drm_bridge_unplug(struct drm_bridge *bridge) { bridge->unplugged = true; synchronize_srcu(&drm_bridge_unplug_srcu); drm_bridge_remove(bridge); // as per discussion above drm_atomic_helper_shutdown(bridge->dev); } ? I'm not sure which is the right call to tear down the pipeline though. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

[PATCH v9 0/3] drm/bridge: debugfs: show refcount and list removed bridges

2025-09-15 Thread Luca Ceresoli
@bootlin.com This series was initially part of v6 of this other series: - Link to v6: https://lore.kernel.org/dri-devel/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/ --- Luca Ceresoli (3): drm/bridge: add list of removed refcounted bridges drm/debugfs: show lingering bridges

[PATCH v9 2/3] drm/debugfs: show lingering bridges

2025-09-15 Thread Luca Ceresoli
be visible in this debugfs file. Add lingering bridges to the /sys/kernel/debug/dri/bridges output. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v9: - rename leftover instances of "removed" to "lingering" Changes in v8: - updated to rename

[PATCH v9 1/3] drm/bridge: add list of removed refcounted bridges

2025-09-15 Thread Luca Ceresoli
the bridge from the lingering list and bring bridge->list back to the initialized state. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v8: - split the documentation changes to a separate patch - rename "removed" to "lingering" - improve commi

[PATCH v9 3/3] drm/bridge: adapt drm_bridge_add/remove() docs, mention the lingering list

2025-09-15 Thread Luca Ceresoli
just the type of container used to implement such (de)registration. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli --- Changes in v8: - extracted to an ad-hoc patch from the v7 patch "drm/bridge: add list of removed refcounted bridges" --- drivers/gpu/drm/drm_bri

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-13 Thread Luca Ceresoli
Hello Maxime, On Wed, 20 Aug 2025 13:13:02 +0200 Luca Ceresoli wrote: > > > + /* > > > + * sn65dsi83_atomic_disable() should release some resources, but it > > > + * cannot if we call drm_bridge_unplug() before it can > > > + * drm_bridge_enter().

[PATCH v8 2/3] drm/debugfs: show removed bridges

2025-09-12 Thread Luca Ceresoli
this debugfs file. Add removed bridges to the /sys/kernel/debug/dri/bridges output. Signed-off-by: Luca Ceresoli --- Changes in v8: - updated to rename bridge_removed_list -> bridge_lingering_list Changes in v7: - rebased on current code which is in drm_bridge.c now - removed

[PATCH v8 1/3] drm/bridge: add list of removed refcounted bridges

2025-09-12 Thread Luca Ceresoli
the bridge from the lingering list and bring bridge->list back to the initialized state. Signed-off-by: Luca Ceresoli --- Changes in v8: - split the documentation changes to a separate patch - rename "removed" to "lingering" - improve commits message about the sp

[PATCH v8 0/3] drm/bridge: debugfs: show refcount and list removed bridges

2025-09-12 Thread Luca Ceresoli
ps://lore.kernel.org/r/20250819-drm-bridge-debugfs-removed-v7-0-970702579...@bootlin.com This series was initially part of v6 of this other series: - Link to v6: https://lore.kernel.org/dri-devel/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/ --- Luca Ceresoli (3): drm/bridg

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-12 Thread Luca Ceresoli
Hi Maxime, On Wed, 10 Sep 2025 09:52:21 +0200 Maxime Ripard wrote: > On Mon, Sep 08, 2025 at 03:49:01PM +0200, Luca Ceresoli wrote: > > Hello Maxime, > > > > On Wed, 20 Aug 2025 13:13:02 +0200 > > Luca Ceresoli wrote: > > > > > > > +

Re: [PATCH] drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

2025-09-11 Thread Luca Ceresoli
by: Hulk Robot > Signed-off-by: Qi Xi Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-11 Thread Luca Ceresoli
se to add 3 different devres actions, one for each, but it would be more code and a little more resources used and I don't see the advantage. I think it makes sense that I send my current version and we can continue discussion based on the code. I'm waiting a bit before sending it, in case you have feedback about the other branch of this discussion (placement of drm_bridge_unplug()). Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-09-10 Thread Luca Ceresoli
On Wed, 10 Sep 2025 12:59:12 +0200 Maxime Ripard wrote: > On Mon, Sep 08, 2025 at 03:49:06PM +0200, Luca Ceresoli wrote: > > Hi Maxime, > > > > On Wed, 27 Aug 2025 09:46:03 +0200 > > Maxime Ripard wrote: > > > > > On Wed, Aug 20, 202

Re: [PATCH v5 10/10] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2025-09-09 Thread Luca Ceresoli
Hello Dmitry, Maxime, DRM maintainers, On Thu, 2 Jan 2025 13:01:40 +0100 Luca Ceresoli wrote: > Hi Dmitry, > > On Tue, 31 Dec 2024 17:29:52 +0200 > Dmitry Baryshkov wrote: > > > On Tue, Dec 31, 2024 at 11:40:04AM +0100, Luca Ceresoli wrote: > > > This driver

Re: [PATCH v5 10/10] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2025-09-09 Thread Luca Ceresoli
Hello, +Cc: Dmitry's current e-mail address I replied to such an old thread that is had an old address for Dmitry. On Tue, 9 Sep 2025 17:29:07 +0200 Luca Ceresoli wrote: > Hello Dmitry, Maxime, DRM maintainers, > > On Thu, 2 Jan 2025 13:01:40 +0100 > Luca Ceresoli wrote:

Re: [PATCH v1 13/19] staging: media: tegra-video: tegra20: set VI HW revision

2025-09-08 Thread Luca Ceresoli
Hello Svyatoslav, On Fri, 5 Sep 2025 19:11:06 +0300 Svyatoslav Ryhel wrote: > пт, 5 вер. 2025 р. о 19:08 Luca Ceresoli пише: > > > > On Tue, 19 Aug 2025 15:16:25 +0300 > > Svyatoslav Ryhel wrote: > > > > > Tegra20, Tegra30 and Tegra114 have VI revision

Re: [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state

2025-09-07 Thread Luca Ceresoli
or_state(). > > Signed-off-by: Maxime Ripard Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli # on imx8mp -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 09/37] drm/atomic: Document __drm_planes_state state pointer

2025-09-07 Thread Luca Ceresoli
esetting path, we can document what it's still useful for: to free > the right state when we free the global state. > > Signed-off-by: Maxime Ripard Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 03/37] drm/atomic: Document __drm_connectors_state state pointer

2025-09-05 Thread Luca Ceresoli
esetting path, we can document what it's still useful for: to free > the right state when we free the global state. > > Signed-off-by: Maxime Ripard Reviewed-by: Luca Ceresoli Thanks for documenting these non-obvious (to DRM newcomers) concepts. Luca -- Luca Ceresoli, Bootlin

Re: [PATCH v2 37/37] drm/atomic: Document __drm_private_objs_state state pointer

2025-09-05 Thread Luca Ceresoli
esetting path, we can document what it's still useful for: to free > the right state when we free the global state. > > Signed-off-by: Maxime Ripard Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v1 13/19] staging: media: tegra-video: tegra20: set VI HW revision

2025-09-05 Thread Luca Ceresoli
On Tue, 19 Aug 2025 15:16:25 +0300 Svyatoslav Ryhel wrote: > Tegra20, Tegra30 and Tegra114 have VI revision 1. Why? You should mention the reason in the commit message. But I don't see hw_revision used in the series, so unless I missed something you should drop this patch. Luca

Re: [PATCH v1 09/19] staging: media: tegra-video: vi: add flip controls only if no source controls are provided

2025-09-05 Thread Luca Ceresoli
t; V4L2_CID_VFLIP, 0, 1, 1, 0); Based on my understanding of V4L2, this should not be done. AFAIK subdevs should expose what the hardware block can do, independently from other subdevs. It is up to userspace (e.g. libcamera) to use the most appropriate control when there are redundant ones. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: (subset) [PATCH v2 0/9] drm/bridge: get/put the bridge when looping over the encoder chain

2025-09-05 Thread Luca Ceresoli
On Fri, 08 Aug 2025 16:49:07 +0200, Luca Ceresoli wrote: > This series adds drm_bridge_get/put() calls for DRM bridges used when > looping over bridges in an encoder chain. > > This is part of the work towards removal of bridges from a still existing > DRM pipeline without use-

Re: [PATCH v2 02/37] drm/atomic: Remove unused drm_atomic_get_existing_connector_state()

2025-09-05 Thread Luca Ceresoli
On Tue, 02 Sep 2025 11:35:01 +0200 Maxime Ripard wrote: > The drm_atomic_get_existing_connector_state() function is deprecated and > isn't used anymore, so let's remove it. > > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Maxime Ripard Reviewed-by: Luca Ceresoli

Re: (subset) [PATCH v2 0/9] drm/bridge: get/put the bridge returned by drm_bridge_get_next_bridge()

2025-09-03 Thread Luca Ceresoli
On Fri, 01 Aug 2025 19:05:22 +0200, Luca Ceresoli wrote: > Note: the cover in v1 was mentioning by mistake > drm_bridge_get_last_bridge() instead of drm_bridge_get_next_bridge(). > > > This series adds drm_bridge_get/put() calls for DRM brid

Re: [PATCH v2 3/9] drm/bridge: add drm_for_each_bridge_in_chain_scoped()

2025-09-03 Thread Luca Ceresoli
Hi Maxime, On Wed, 20 Aug 2025 11:40:30 +0200 Luca Ceresoli wrote: > Hi Maxime, > > On Tue, 19 Aug 2025 18:01:37 +0200 > Luca Ceresoli wrote: > > > Hi Maxime, > > > > On Tue, 19 Aug 2025 15:47:

Re: [PATCH v2 1/9] list: add list_last_entry_or_null()

2025-09-03 Thread Luca Ceresoli
ever allow me to push. > > > > How can I get that commit pushed to drm-misc-next? > > > > I think `dim push-branch -f` would work: am I supposed to use it? > > Try 'dim -f push-branch'. The parameters after push-branch go to git, > and you don't want

Re: [PATCH v2 1/9] list: add list_last_entry_or_null()

2025-09-02 Thread Luca Ceresoli
Hello DRM maintainers, On Wed, 20 Aug 2025 16:43:56 +0300 Andy Shevchenko wrote: > On Thu, Aug 14, 2025 at 06:36:09PM +0200, Luca Ceresoli wrote: > > On Wed, 6 Aug 2025 00:55:02 +0300 > > Andy Shevchenko wrote: > > > > > On Fri, Aug 01, 2025 at 07:05:2

Re: [PATCH v5 4/7] drm/bridge: dw-hdmi: Add API dw_hdmi_set_sample_iec958() for iec958 format

2025-09-01 Thread Luca Ceresoli
n v5, but I noticed this patch and I was wondering whether this mutex_lock/unlock() is really needed, as you're copying an int. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v7 2/3] drm/bridge: add list of removed refcounted bridges

2025-08-20 Thread Luca Ceresoli
lish > kind of it to that too. Maybe using register / registration would make > it more obvious? OK, I'll reword using register/registration and definitely move to a separate patch. Thanks for reviewing. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-08-20 Thread Luca Ceresoli
ources_needed) { > > + if (!ctx->irq) > > + sn65dsi83_monitor_stop(ctx); > > + > > + gpiod_set_value_cansleep(ctx->enable_gpio, 0); > > + usleep_range(1, 11000); > > + > > + regulator_dis

Re: [PATCH v2 3/9] drm/bridge: add drm_for_each_bridge_in_chain_scoped()

2025-08-20 Thread Luca Ceresoli
Hi Maxime, On Tue, 19 Aug 2025 18:01:37 +0200 Luca Ceresoli wrote: > Hi Maxime, > > On Tue, 19 Aug 2025 15:47:06 +0200 > Maxime Ripard wrote: > > > > +/** > > > + * drm_for_each_bridge_in_chain_scoped - iterate

Re: [PATCH v2 3/9] drm/bridge: add drm_for_each_bridge_in_chain_scoped()

2025-08-19 Thread Luca Ceresoli
on-NULL and the cleanup action does call drm_bridge_put() See examples such as for_each_child_of_node_scoped() and other OF iterators which work in the same way (which is no coincidence, I used them as starting point for writing this patch). Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 0/9] drm/bridge: get/put the bridge when looping over the encoder chain

2025-08-19 Thread Luca Ceresoli
On Fri, 08 Aug 2025 16:49:07 +0200 Luca Ceresoli wrote: > This series depends on: > > * commit 103578241512 ("drm/bridge-connector: Fix bridge in >drm_connector_hdmi_audio_init()"), currently in drm-misc-fixes, not yet >on drm-misc-next Just a quick update:

Re: [PATCH] samsung-dsim: move drm_bridge_add() call to probe

2025-08-19 Thread Luca Ceresoli
Hi Maxime, On Fri, 8 Aug 2025 15:20:01 +0200 Luca Ceresoli wrote: > > > Some drawbacks of current code are because at every DSI attach/detach, > > > the samsung-dsim does drm_bridge_add/remove() itself: > > > > > > * To me this looks like a ba

[PATCH v7 3/3] drm/debugfs: show removed bridges

2025-08-19 Thread Luca Ceresoli
this debugfs file. Add removed bridges to the /sys/kernel/debug/dri/bridges output. Signed-off-by: Luca Ceresoli --- Changes in v7: - rebased on current code which is in drm_bridge.c now - removed if (drm_bridge_is_refcounted(bridge)), refcounting is not optional - don't show bridge ad

[PATCH v7 0/3] drm/bridge: debugfs: show refcount and list removed bridges

2025-08-19 Thread Luca Ceresoli
6-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/t/#u Signed-off-by: Luca Ceresoli --- This series was initially part of v6 of this other series: - Link to v6: https://lore.kernel.org/dri-devel/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/ --- Luca Ceresoli (3): drm/debugfs: br

[PATCH v7 1/3] drm/debugfs: bridges_show: show refcount

2025-08-19 Thread Luca Ceresoli
Now that bridges are refcounted, exposing the refcount in debugfs can be useful. Suggested-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- Changes in v7: - rebased on current code: - code is in drm_bridge.c now - removed if (drm_bridge_is_refcounted(bridge)), refcounting is not

[PATCH v7 2/3] drm/bridge: add list of removed refcounted bridges

2025-08-19 Thread Luca Ceresoli
n the removed list, not at the initialized state as drm_bridge_add() currently expects. Signed-off-by: Luca Ceresoli --- Changes in v7: - rebase on current drm-misc-next - remove if (drm_bridge_is_refcounted(bridge)), refcounting is now mandatory - add check to detect when re-adding a bridge that is

Re: [PATCH v2 1/9] list: add list_last_entry_or_null()

2025-08-14 Thread Luca Ceresoli
Hello relevant maintainers, On Wed, 6 Aug 2025 00:55:02 +0300 Andy Shevchenko wrote: > On Fri, Aug 01, 2025 at 07:05:23PM +0200, Luca Ceresoli wrote: > > Add an equivalent of list_first_entry_or_null() to obtain the last element > > of a list. > > Acked-by: Andy She

[PATCH v2 7/9] drm/bridge: remove drm_for_each_bridge_in_chain()

2025-08-08 Thread Luca Ceresoli
All users have been replaced by drm_for_each_bridge_in_chain_scoped(). Signed-off-by: Luca Ceresoli --- .clang-format| 1 - include/drm/drm_bridge.h | 14 -- 2 files changed, 15 deletions(-) diff --git a/.clang-format b/.clang-format index

[PATCH v2 9/9] drm/omap: use drm_for_each_bridge_in_chain_from()

2025-08-08 Thread Luca Ceresoli
Use drm_for_each_bridge_in_chain_from _scoped() instead of an open-coded loop based on drm_bridge_get_next_bridge() to ensure the bridge being looped on is refcounted and simplify the driver code. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/omapdrm/omap_encoder.c | 4 +--- 1 file changed

[PATCH v2 8/9] drm/bridge: add drm_for_each_bridge_in_chain_from()

2025-08-08 Thread Luca Ceresoli
Add variant of drm_for_each_bridge_in_chain_scoped() that iterates on the encoder bridge from a given bridge until the end of the chain. Signed-off-by: Luca Ceresoli --- include/drm/drm_bridge.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/drm/drm_bridge.h b

[PATCH v2 6/9] drm/bridge: use drm_for_each_bridge_in_chain_scoped()

2025-08-08 Thread Luca Ceresoli
Use drm_for_each_bridge_in_chain_scoped() instead of drm_for_each_bridge_in_chain() to ensure the bridge being looped on is refcounted. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 5/9] drm/atomic: use drm_for_each_bridge_in_chain_scoped()

2025-08-08 Thread Luca Ceresoli
Use drm_for_each_bridge_in_chain_scoped() instead of drm_for_each_bridge_in_chain() to ensure the bridge being looped on is refcounted. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_atomic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 4/9] drm/display: bridge-connector: use drm_for_each_bridge_in_chain_scoped()

2025-08-08 Thread Luca Ceresoli
Use drm_for_each_bridge_in_chain_scoped() instead of drm_for_each_bridge_in_chain() to ensure the bridge being looped on is refcounted. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/display/drm_bridge_connector.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a

[PATCH v2 3/9] drm/bridge: add drm_for_each_bridge_in_chain_scoped()

2025-08-08 Thread Luca Ceresoli
e_bus_flags(). Also deprecate drm_for_each_bridge_in_chain(), in preparation for removing it after converting all users to the scoped version. Signed-off-by: Luca Ceresoli --- Changes in v2: - clarified commit message and mention an example where the current behaviour of drm_bridge_get_n

[PATCH v2 1/9] drm/display: bridge-connector: use scope-specific variable for the bridge pointer

2025-08-08 Thread Luca Ceresoli
ot;drm/bridge-connector: Fix bridge in drm_connector_hdmi_audio_init()") already did for the audio HDMI bridge, use n local variable inside the scopes where it is needed as a bridge_connector->bridge_hdmi_cec shortcut to make its scope clearer as well as to allow removing the 'bridge' varia

[PATCH v2 2/9] drm/display: bridge-connector: remove unused variable assignment

2025-08-08 Thread Luca Ceresoli
moved the code dereferencing it from the same 'if' scope, but did not remove the assignment. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/display/drm_bridge_connector.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/dr

[PATCH v2 0/9] drm/bridge: get/put the bridge when looping over the encoder chain

2025-08-08 Thread Luca Ceresoli
6-hotplug-drm-bridge-v6-0-9d6f2c9c3...@bootlin.com/t/#u Signed-off-by: Luca Ceresoli --- Changes in v2: - Prune series dependency list - Clarify wording in cover letter and patch 3 - Link to v1: https://lore.kernel.org/r/20250723-drm-bridge-alloc-getput-for_each_bridge-v1-0-be8f4ae00...@bootlin.

[PATCH 2/2] drm/bridge: ti-sn65dsi83: protect device resources on unplug

2025-08-08 Thread Luca Ceresoli
successful drm_bridge_enter() call), which occurs whenever the hardware is removed while the display is active. When that happens, sn65dsi83_atomic_disable() in unable to release some resources, thus this needs to be done in sn65dsi83_remove() after drm_bridge_unplug(). Signed-off-by: Luca Ceresoli

[PATCH 0/2] drm/bridge: handle gracefully atomic updates during bridge removal

2025-08-08 Thread Luca Ceresoli
o unplug of the SN65DSI8x bridge. [0] https://lore.kernel.org/all/20250106-vigorous-talented-viper-fa49d9@houat/ Signed-off-by: Luca Ceresoli --- Luca Ceresoli (2): drm/bridge: add drm_bridge_unplug() and drm_bridge_enter/exit() drm/bridge: ti-sn65dsi83: protect device resources on u

[PATCH 1/2] drm/bridge: add drm_bridge_unplug() and drm_bridge_enter/exit()

2025-08-08 Thread Luca Ceresoli
. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/all/20250106-vigorous-talented-viper-fa49d9@houat/ Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 58 include/drm/drm_bridge.h | 12 + 2 files changed, 70 insertions

Re: [PATCH] samsung-dsim: move drm_bridge_add() call to probe

2025-08-08 Thread Luca Ceresoli
Hi Maxime, On Thu, 31 Jul 2025 12:05:27 +0200 Maxime Ripard wrote: > On Mon, Jul 28, 2025 at 07:44:30PM +0200, Luca Ceresoli wrote: > > Hi Maxime, > > > > thanks for the quick feedback. > > > > On Mon, 28 Jul 2025 10:10:38 +0200 > > Maxime Ripard wrot

  1   2   3   4   5   6   7   8   9   >