<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpu/drm/bridge/panel.c, branch v5.19-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>drm: bridge: panel: Register connector if DRM device is already registered</title>
<updated>2022-04-19T16:11:27+00:00</updated>
<author>
<name>Marek Szyprowski</name>
<email>m.szyprowski@samsung.com</email>
</author>
<published>2022-04-19T09:14:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=34263c1b1593e44a3963dcfd6ed9af70c3002686'/>
<id>34263c1b1593e44a3963dcfd6ed9af70c3002686</id>
<content type='text'>
If panel_bridge_attach() happens after DRM device registration, the
created connector will not be registered by the DRM core anymore. Fix
this by registering it explicitly in such case.

This fixes the following issue observed on Samsung Exynos4210-based Trats
board with a DSI panel (the panel driver is registered after the Exynos DRM
component device is bound):

$ ./modetest -c -Mexynos
could not get connector 56: No such file or directory
Segmentation fault

While touching this, move the connector reset() call also under the DRM
device registered check, because otherwise it is not really needed.

Fixes: 934aef885f9d ("drm: bridge: panel: Reset the connector state pointer")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220419091422.4255-1-m.szyprowski@samsung.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If panel_bridge_attach() happens after DRM device registration, the
created connector will not be registered by the DRM core anymore. Fix
this by registering it explicitly in such case.

This fixes the following issue observed on Samsung Exynos4210-based Trats
board with a DSI panel (the panel driver is registered after the Exynos DRM
component device is bound):

$ ./modetest -c -Mexynos
could not get connector 56: No such file or directory
Segmentation fault

While touching this, move the connector reset() call also under the DRM
device registered check, because otherwise it is not really needed.

Fixes: 934aef885f9d ("drm: bridge: panel: Reset the connector state pointer")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220419091422.4255-1-m.szyprowski@samsung.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: bridge: panel: Reset the connector state pointer</title>
<updated>2022-03-31T14:21:31+00:00</updated>
<author>
<name>Jagan Teki</name>
<email>jagan@amarulasolutions.com</email>
</author>
<published>2022-03-03T16:36:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=934aef885f9d99662a02690de3737b3b70116121'/>
<id>934aef885f9d99662a02690de3737b3b70116121</id>
<content type='text'>
Trigger hotplug event with drm_kms_helper_hotplug_event might fail if the
connector state pointer is NULL.

BUG observed in exynos dsi driver where drm_bridge_attach is trying to
register a connector in panel_bridge before the hotplug event is triggered.

WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_atomic_state_helper.c:494 drm_atomic_helper_connector_duplicate_state+0x94/0x9c
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.16.0-rc1-00009-g704b1dbfa4c2 #11058
Hardware name: Samsung Exynos (Flattened Device Tree)
[&lt;c0110b30&gt;] (unwind_backtrace) from [&lt;c010c618&gt;] (show_stack+0x10/0x14)
[&lt;c010c618&gt;] (show_stack) from [&lt;c0b657d4&gt;] (dump_stack_lvl+0x58/0x70)
[&lt;c0b657d4&gt;] (dump_stack_lvl) from [&lt;c01261dc&gt;] (__warn+0xd0/0x134)
[&lt;c01261dc&gt;] (__warn) from [&lt;c0b5f628&gt;] (warn_slowpath_fmt+0x5c/0xb4)
[&lt;c0b5f628&gt;] (warn_slowpath_fmt) from [&lt;c064bce4&gt;] (drm_atomic_helper_connector_duplicate_state+0x94/0x9c)
[&lt;c064bce4&gt;] (drm_atomic_helper_connector_duplicate_state) from [&lt;c0666b64&gt;] (drm_atomic_get_connector_state+0xd4/0x190)
[&lt;c0666b64&gt;] (drm_atomic_get_connector_state) from [&lt;c0667928&gt;] (__drm_atomic_helper_set_config+0x314/0x368)
[&lt;c0667928&gt;] (__drm_atomic_helper_set_config) from [&lt;c067e628&gt;] (drm_client_modeset_commit_atomic+0x170/0x278)
[&lt;c067e628&gt;] (drm_client_modeset_commit_atomic) from [&lt;c067e800&gt;] (drm_client_modeset_commit_locked+0x60/0x1c8)
[&lt;c067e800&gt;] (drm_client_modeset_commit_locked) from [&lt;c067e98c&gt;] (drm_client_modeset_commit+0x24/0x40)
[&lt;c067e98c&gt;] (drm_client_modeset_commit) from [&lt;c06509c0&gt;] (drm_fb_helper_set_par+0xb8/0xf8)
[&lt;c06509c0&gt;] (drm_fb_helper_set_par) from [&lt;c05b86d0&gt;] (fbcon_init+0x2c0/0x518)
[&lt;c05b86d0&gt;] (fbcon_init) from [&lt;c060636c&gt;] (visual_init+0xc0/0x108)
[&lt;c060636c&gt;] (visual_init) from [&lt;c06085e4&gt;] (do_bind_con_driver+0x1b8/0x3a4)
[&lt;c06085e4&gt;] (do_bind_con_driver) from [&lt;c0608b40&gt;] (do_take_over_console+0x13c/0x1e8)
[&lt;c0608b40&gt;] (do_take_over_console) from [&lt;c05b6854&gt;] (do_fbcon_takeover+0x78/0xd8)
[&lt;c05b6854&gt;] (do_fbcon_takeover) from [&lt;c05b1154&gt;] (register_framebuffer+0x208/0x2e0)
[&lt;c05b1154&gt;] (register_framebuffer) from [&lt;c064ead0&gt;] (__drm_fb_helper_initial_config_and_unlock+0x400/0x63c)
[&lt;c064ead0&gt;] (__drm_fb_helper_initial_config_and_unlock) from [&lt;c063a718&gt;] (drm_kms_helper_hotplug_event+0x24/0x30)
[&lt;c063a718&gt;] (drm_kms_helper_hotplug_event) from [&lt;c068f668&gt;] (exynos_dsi_host_attach+0x174/0x1fc)
[&lt;c068f668&gt;] (exynos_dsi_host_attach) from [&lt;c0699354&gt;] (s6e8aa0_probe+0x1b4/0x218)

So reset the atomic state for a given connector by freeing the state pointer
and allocate a new empty state object. This can be done using connector
funcs-&gt;reset helper and has to be done before the hotplug even calls.

This patch calls the connector-&gt;funcs-&gt;reset in panel_bridge_attach.

Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Acked-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-3-jagan@amarulasolutions.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trigger hotplug event with drm_kms_helper_hotplug_event might fail if the
connector state pointer is NULL.

BUG observed in exynos dsi driver where drm_bridge_attach is trying to
register a connector in panel_bridge before the hotplug event is triggered.

WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_atomic_state_helper.c:494 drm_atomic_helper_connector_duplicate_state+0x94/0x9c
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.16.0-rc1-00009-g704b1dbfa4c2 #11058
Hardware name: Samsung Exynos (Flattened Device Tree)
[&lt;c0110b30&gt;] (unwind_backtrace) from [&lt;c010c618&gt;] (show_stack+0x10/0x14)
[&lt;c010c618&gt;] (show_stack) from [&lt;c0b657d4&gt;] (dump_stack_lvl+0x58/0x70)
[&lt;c0b657d4&gt;] (dump_stack_lvl) from [&lt;c01261dc&gt;] (__warn+0xd0/0x134)
[&lt;c01261dc&gt;] (__warn) from [&lt;c0b5f628&gt;] (warn_slowpath_fmt+0x5c/0xb4)
[&lt;c0b5f628&gt;] (warn_slowpath_fmt) from [&lt;c064bce4&gt;] (drm_atomic_helper_connector_duplicate_state+0x94/0x9c)
[&lt;c064bce4&gt;] (drm_atomic_helper_connector_duplicate_state) from [&lt;c0666b64&gt;] (drm_atomic_get_connector_state+0xd4/0x190)
[&lt;c0666b64&gt;] (drm_atomic_get_connector_state) from [&lt;c0667928&gt;] (__drm_atomic_helper_set_config+0x314/0x368)
[&lt;c0667928&gt;] (__drm_atomic_helper_set_config) from [&lt;c067e628&gt;] (drm_client_modeset_commit_atomic+0x170/0x278)
[&lt;c067e628&gt;] (drm_client_modeset_commit_atomic) from [&lt;c067e800&gt;] (drm_client_modeset_commit_locked+0x60/0x1c8)
[&lt;c067e800&gt;] (drm_client_modeset_commit_locked) from [&lt;c067e98c&gt;] (drm_client_modeset_commit+0x24/0x40)
[&lt;c067e98c&gt;] (drm_client_modeset_commit) from [&lt;c06509c0&gt;] (drm_fb_helper_set_par+0xb8/0xf8)
[&lt;c06509c0&gt;] (drm_fb_helper_set_par) from [&lt;c05b86d0&gt;] (fbcon_init+0x2c0/0x518)
[&lt;c05b86d0&gt;] (fbcon_init) from [&lt;c060636c&gt;] (visual_init+0xc0/0x108)
[&lt;c060636c&gt;] (visual_init) from [&lt;c06085e4&gt;] (do_bind_con_driver+0x1b8/0x3a4)
[&lt;c06085e4&gt;] (do_bind_con_driver) from [&lt;c0608b40&gt;] (do_take_over_console+0x13c/0x1e8)
[&lt;c0608b40&gt;] (do_take_over_console) from [&lt;c05b6854&gt;] (do_fbcon_takeover+0x78/0xd8)
[&lt;c05b6854&gt;] (do_fbcon_takeover) from [&lt;c05b1154&gt;] (register_framebuffer+0x208/0x2e0)
[&lt;c05b1154&gt;] (register_framebuffer) from [&lt;c064ead0&gt;] (__drm_fb_helper_initial_config_and_unlock+0x400/0x63c)
[&lt;c064ead0&gt;] (__drm_fb_helper_initial_config_and_unlock) from [&lt;c063a718&gt;] (drm_kms_helper_hotplug_event+0x24/0x30)
[&lt;c063a718&gt;] (drm_kms_helper_hotplug_event) from [&lt;c068f668&gt;] (exynos_dsi_host_attach+0x174/0x1fc)
[&lt;c068f668&gt;] (exynos_dsi_host_attach) from [&lt;c0699354&gt;] (s6e8aa0_probe+0x1b4/0x218)

So reset the atomic state for a given connector by freeing the state pointer
and allocate a new empty state object. This can be done using connector
funcs-&gt;reset helper and has to be done before the hotplug even calls.

This patch calls the connector-&gt;funcs-&gt;reset in panel_bridge_attach.

Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Acked-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Robert Foss &lt;robert.foss@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-3-jagan@amarulasolutions.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Plumb debugfs_init through to panels</title>
<updated>2022-02-15T23:25:18+00:00</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2022-02-05T00:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2509969a9862b522d2208e8663057fb227556687'/>
<id>2509969a9862b522d2208e8663057fb227556687</id>
<content type='text'>
We'd like panels to be able to add things to debugfs underneath the
connector's directory. Let's plumb it through. A panel will be able to
put things in a "panel" directory under the connector's
directory. Note that debugfs is not ABI and so it's always possible
that the location that the panel gets for its debugfs could change in
the future.

NOTE: this currently only works if you're using a modern
architecture. Specifically the plumbing relies on _both_
drm_bridge_connector and drm_panel_bridge. If you're not using one or
both of these things then things won't be plumbed through.

As a side effect of this change, drm_bridges can also get callbacks to
put stuff underneath the connector's debugfs directory. At the moment
all bridges in the chain have their debugfs_init() called with the
connector's root directory.

Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220204161245.v2.2.Ib0bd5346135cbb0b63006b69b61d4c8af6484740@changeid
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We'd like panels to be able to add things to debugfs underneath the
connector's directory. Let's plumb it through. A panel will be able to
put things in a "panel" directory under the connector's
directory. Note that debugfs is not ABI and so it's always possible
that the location that the panel gets for its debugfs could change in
the future.

NOTE: this currently only works if you're using a modern
architecture. Specifically the plumbing relies on _both_
drm_bridge_connector and drm_panel_bridge. If you're not using one or
both of these things then things won't be plumbed through.

As a side effect of this change, drm_bridges can also get callbacks to
put stuff underneath the connector's debugfs directory. At the moment
all bridges in the chain have their debugfs_init() called with the
connector's root directory.

Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220204161245.v2.2.Ib0bd5346135cbb0b63006b69b61d4c8af6484740@changeid
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/bridge: Move devm_drm_of_get_bridge to bridge/panel.c</title>
<updated>2021-09-22T08:44:00+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2021-09-17T18:09:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d4ae66f10c8b9959dce1766d9a87070e567236eb'/>
<id>d4ae66f10c8b9959dce1766d9a87070e567236eb</id>
<content type='text'>
By depending on devm_drm_panel_bridge_add(), devm_drm_of_get_bridge()
introduces a circular dependency between the modules drm (where
devm_drm_of_get_bridge() ends up) and drm_kms_helper (where
devm_drm_panel_bridge_add() is).

Fix this by moving devm_drm_of_get_bridge() to bridge/panel.c and thus
drm_kms_helper.

Fixes: 87ea95808d53 ("drm/bridge: Add a function to abstract away panels")
Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210917180925.2602266-1-maxime@cerno.tech
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By depending on devm_drm_panel_bridge_add(), devm_drm_of_get_bridge()
introduces a circular dependency between the modules drm (where
devm_drm_of_get_bridge() ends up) and drm_kms_helper (where
devm_drm_panel_bridge_add() is).

Fix this by moving devm_drm_of_get_bridge() to bridge/panel.c and thus
drm_kms_helper.

Fixes: 87ea95808d53 ("drm/bridge: Add a function to abstract away panels")
Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210917180925.2602266-1-maxime@cerno.tech
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: bridge/panel: Cleanup connector on bridge detach</title>
<updated>2021-03-29T15:46:01+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-27T11:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d906839d321c2efbf3fed4bc31ffd9ff55b75c0'/>
<id>4d906839d321c2efbf3fed4bc31ffd9ff55b75c0</id>
<content type='text'>
If we don't call drm_connector_cleanup() manually in
panel_bridge_detach(), the connector will be cleaned up with the other
DRM objects in the call to drm_mode_config_cleanup(). However, since our
drm_connector is devm-allocated, by the time drm_mode_config_cleanup()
will be called, our connector will be long gone. Therefore, the
connector must be cleaned up when the bridge is detached to avoid
use-after-free conditions.

v2: Cleanup connector only if it was created

v3: Add FIXME

v4: (Use connector-&gt;dev) directly in if() block

Fixes: 13dfc0540a57 ("drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge.")
Cc: &lt;stable@vger.kernel.org&gt; # 4.12+
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Cc: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Cc: Laurent Pinchart &lt;Laurent.pinchart@ideasonboard.com&gt;
Cc: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Cc: Jernej Skrabec &lt;jernej.skrabec@siol.net&gt;
Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210327115742.18986-2-paul@crapouillou.net
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we don't call drm_connector_cleanup() manually in
panel_bridge_detach(), the connector will be cleaned up with the other
DRM objects in the call to drm_mode_config_cleanup(). However, since our
drm_connector is devm-allocated, by the time drm_mode_config_cleanup()
will be called, our connector will be long gone. Therefore, the
connector must be cleaned up when the bridge is detached to avoid
use-after-free conditions.

v2: Cleanup connector only if it was created

v3: Add FIXME

v4: (Use connector-&gt;dev) directly in if() block

Fixes: 13dfc0540a57 ("drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge.")
Cc: &lt;stable@vger.kernel.org&gt; # 4.12+
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Cc: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Cc: Laurent Pinchart &lt;Laurent.pinchart@ideasonboard.com&gt;
Cc: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Cc: Jernej Skrabec &lt;jernej.skrabec@siol.net&gt;
Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210327115742.18986-2-paul@crapouillou.net
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Remove unnecessary drm_panel_attach and drm_panel_detach</title>
<updated>2020-08-08T07:06:33+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2020-08-02T16:43:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87154ff86bf69ecf76600e56ecab0b79fc3f71ea'/>
<id>87154ff86bf69ecf76600e56ecab0b79fc3f71ea</id>
<content type='text'>
These functions are now empty and no longer
useful so remove the functions and their uses.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Bernard Zhao &lt;bernard@vivo.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;,
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Icenowy Zheng &lt;icenowy@aosc.io&gt;,
Cc: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Robert Chiras &lt;robert.chiras@nxp.com&gt;
Cc: dri-devel@lists.freedesktop.org,
Cc: linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; # Fixed build and a few warnings
Link: https://patchwork.freedesktop.org/patch/msgid/9e13761020750b1ce2f1fabee23ef6e2a2942882.camel@perches.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions are now empty and no longer
useful so remove the functions and their uses.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Bernard Zhao &lt;bernard@vivo.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;,
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Icenowy Zheng &lt;icenowy@aosc.io&gt;,
Cc: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Robert Chiras &lt;robert.chiras@nxp.com&gt;
Cc: dri-devel@lists.freedesktop.org,
Cc: linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; # Fixed build and a few warnings
Link: https://patchwork.freedesktop.org/patch/msgid/9e13761020750b1ce2f1fabee23ef6e2a2942882.camel@perches.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/bridge: panel: Return always an error pointer in drm_panel_bridge_add()</title>
<updated>2020-04-25T14:48:55+00:00</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2020-04-16T21:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=30be3031087139061de4421bf52015931eaab569'/>
<id>30be3031087139061de4421bf52015931eaab569</id>
<content type='text'>
Since commit 89958b7cd955 ("drm/bridge: panel: Infer connector type from
panel by default"), drm_panel_bridge_add() and their variants can return
NULL and an error pointer. This is fine but none of the actual users of
the API are checking for the NULL value. Instead of change all the
users, seems reasonable to return an error pointer instead. So change
the returned value for those functions when the connector type is unknown.

Suggested-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200416210654.2468805-1-enric.balletbo@collabora.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit 89958b7cd955 ("drm/bridge: panel: Infer connector type from
panel by default"), drm_panel_bridge_add() and their variants can return
NULL and an error pointer. This is fine but none of the actual users of
the API are checking for the NULL value. Instead of change all the
users, seems reasonable to return an error pointer instead. So change
the returned value for those functions when the connector type is unknown.

Suggested-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200416210654.2468805-1-enric.balletbo@collabora.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/bridge: fix kernel-doc warning in panel.c</title>
<updated>2020-04-05T20:23:10+00:00</updated>
<author>
<name>Sam Ravnborg</name>
<email>sam@ravnborg.org</email>
</author>
<published>2020-03-28T13:20:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=91fcf8e603848961e7d83ebf48f52ff8f608eae5'/>
<id>91fcf8e603848961e7d83ebf48f52ff8f608eae5</id>
<content type='text'>
Add missing documentation to fix following warning:
panel.c:303: warning: Function parameter or member 'bridge' not described in 'drm_panel_bridge_connector'

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Cc: Mihail Atanassov &lt;Mihail.Atanassov@arm.com&gt;
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Cc: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Cc: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Cc: Jernej Skrabec &lt;jernej.skrabec@siol.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-7-sam@ravnborg.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing documentation to fix following warning:
panel.c:303: warning: Function parameter or member 'bridge' not described in 'drm_panel_bridge_connector'

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Cc: Mihail Atanassov &lt;Mihail.Atanassov@arm.com&gt;
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Cc: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Cc: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Cc: Jernej Skrabec &lt;jernej.skrabec@siol.net&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200328132025.19910-7-sam@ravnborg.org
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/bridge: panel: Implement bridge connector operations</title>
<updated>2020-02-26T11:31:39+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2020-02-26T11:24:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2be68b59e5d035f7d404477f8df2262ca5de981f'/>
<id>2be68b59e5d035f7d404477f8df2262ca5de981f</id>
<content type='text'>
Implement the newly added bridge connector operations, allowing the
usage of drm_bridge_panel with drm_bridge_connector.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Reviewed-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Tested-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-18-laurent.pinchart@ideasonboard.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement the newly added bridge connector operations, allowing the
usage of drm_bridge_panel with drm_bridge_connector.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Reviewed-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Tested-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-18-laurent.pinchart@ideasonboard.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/bridge: Extend bridge API to disable connector creation</title>
<updated>2020-02-26T11:31:23+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2020-02-26T11:24:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a25b988ff83f3ca0d8f5acf855fb1717c1c61a69'/>
<id>a25b988ff83f3ca0d8f5acf855fb1717c1c61a69</id>
<content type='text'>
Most bridge drivers create a DRM connector to model the connector at the
output of the bridge. This model is historical and has worked pretty
well so far, but causes several issues:

- It prevents supporting more complex display pipelines where DRM
connector operations are split over multiple components. For instance a
pipeline with a bridge connected to the DDC signals to read EDID data,
and another one connected to the HPD signal to detect connection and
disconnection, will not be possible to support through this model.

- It requires every bridge driver to implement similar connector
handling code, resulting in code duplication.

- It assumes that a bridge will either be wired to a connector or to
another bridge, but doesn't support bridges that can be used in both
positions very well (although there is some ad-hoc support for this in
the analogix_dp bridge driver).

In order to solve these issues, ownership of the connector should be
moved to the display controller driver (where it can be implemented
using helpers provided by the core).

Extend the bridge API to allow disabling connector creation in bridge
drivers as a first step towards the new model. The new flags argument to
the bridge .attach() operation allows instructing the bridge driver to
skip creating a connector. Unconditionally set the new flags argument to
0 for now to keep the existing behaviour, and modify all existing bridge
drivers to return an error when connector creation is not requested as
they don't support this feature yet.

The change is based on the following semantic patch, with manual review
and edits.

@ rule1 @
identifier funcs;
identifier fn;
@@
 struct drm_bridge_funcs funcs = {
 	...,
 	.attach = fn
 };

@ depends on rule1 @
identifier rule1.fn;
identifier bridge;
statement S, S1;
@@
 int fn(
 	struct drm_bridge *bridge
+	, enum drm_bridge_attach_flags flags
 )
 {
 	... when != S
+	if (flags &amp; DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+		DRM_ERROR("Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}
+
 	S1
 	...
 }

@ depends on rule1 @
identifier rule1.fn;
identifier bridge, flags;
expression E1, E2, E3;
@@
 int fn(
 	struct drm_bridge *bridge,
 	enum drm_bridge_attach_flags flags
 ) {
 &lt;...
 drm_bridge_attach(E1, E2, E3
+	, flags
 )
 ...&gt;
 }

@@
expression E1, E2, E3;
@@
 drm_bridge_attach(E1, E2, E3
+	, 0
 )

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Tested-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-10-laurent.pinchart@ideasonboard.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most bridge drivers create a DRM connector to model the connector at the
output of the bridge. This model is historical and has worked pretty
well so far, but causes several issues:

- It prevents supporting more complex display pipelines where DRM
connector operations are split over multiple components. For instance a
pipeline with a bridge connected to the DDC signals to read EDID data,
and another one connected to the HPD signal to detect connection and
disconnection, will not be possible to support through this model.

- It requires every bridge driver to implement similar connector
handling code, resulting in code duplication.

- It assumes that a bridge will either be wired to a connector or to
another bridge, but doesn't support bridges that can be used in both
positions very well (although there is some ad-hoc support for this in
the analogix_dp bridge driver).

In order to solve these issues, ownership of the connector should be
moved to the display controller driver (where it can be implemented
using helpers provided by the core).

Extend the bridge API to allow disabling connector creation in bridge
drivers as a first step towards the new model. The new flags argument to
the bridge .attach() operation allows instructing the bridge driver to
skip creating a connector. Unconditionally set the new flags argument to
0 for now to keep the existing behaviour, and modify all existing bridge
drivers to return an error when connector creation is not requested as
they don't support this feature yet.

The change is based on the following semantic patch, with manual review
and edits.

@ rule1 @
identifier funcs;
identifier fn;
@@
 struct drm_bridge_funcs funcs = {
 	...,
 	.attach = fn
 };

@ depends on rule1 @
identifier rule1.fn;
identifier bridge;
statement S, S1;
@@
 int fn(
 	struct drm_bridge *bridge
+	, enum drm_bridge_attach_flags flags
 )
 {
 	... when != S
+	if (flags &amp; DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+		DRM_ERROR("Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}
+
 	S1
 	...
 }

@ depends on rule1 @
identifier rule1.fn;
identifier bridge, flags;
expression E1, E2, E3;
@@
 int fn(
 	struct drm_bridge *bridge,
 	enum drm_bridge_attach_flags flags
 ) {
 &lt;...
 drm_bridge_attach(E1, E2, E3
+	, flags
 )
 ...&gt;
 }

@@
expression E1, E2, E3;
@@
 drm_bridge_attach(E1, E2, E3
+	, 0
 )

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Tested-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-10-laurent.pinchart@ideasonboard.com
</pre>
</div>
</content>
</entry>
</feed>
