<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/bridge/panel.c, branch v6.3</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.3</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-01-05T07:50:05+00:00</updated>
<entry>
<title>drm/bridge: panel: Prevent ERR_PTR Dereference</title>
<updated>2023-01-05T07:50:05+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2023-01-02T12:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8dd4e8c49efc5a7a3879e117e4aa58082734506e'/>
<id>urn:sha1:8dd4e8c49efc5a7a3879e117e4aa58082734506e</id>
<content type='text'>
Commit 5ea6b1702781 ("drm/panel: Add prepare_prev_first flag to
drm_panel") introduced an access to the bridge pointer in the
devm_drm_panel_bridge_add_typed() function.

However, due to the unusual ERR_PTR check when getting that pointer, the
pointer access is done even though the pointer might be an error
pointer.

Rework the function for a more traditional design that will return
immediately if it gets an ERR_PTR so that we never access the pointer in
that case.

Fixes: 5ea6b1702781 ("drm/panel: Add prepare_prev_first flag to drm_panel")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Reviewed-by: Andrzej Hajda &lt;andrzej.hajda@intel.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230102120123.19062-1-maxime@cerno.tech
Link: https://patchwork.freedesktop.org/patch/msgid/20230102120123.19062-1-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/bridge: panel: Set pre_enable_prev_first from drmm_panel_bridge_add</title>
<updated>2023-01-02T10:38:43+00:00</updated>
<author>
<name>Dave Stevenson</name>
<email>dave.stevenson@raspberrypi.com</email>
</author>
<published>2022-12-22T18:52:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0974687a19c316388e877d9a4f482feb9d070585'/>
<id>urn:sha1:0974687a19c316388e877d9a4f482feb9d070585</id>
<content type='text'>
Commit 5ea6b1702781 ("drm/panel: Add prepare_prev_first flag to drm_panel")
added code to copy prepare_prev_first from drm_panel to pre_enable_prev_first
in drm_bridge when called through devm_panel_bridge_add, but
missed drmm_panel_bridge_add.

Add the same code to drmm_panel_bridge_add.

Fixes: 5ea6b1702781 ("drm/panel: Add prepare_prev_first flag to drm_panel")
Signed-off-by: Dave Stevenson &lt;dave.stevenson@raspberrypi.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20221222185213.3773336-1-dave.stevenson@raspberrypi.com
</content>
</entry>
<entry>
<title>drm/panel: Add prepare_prev_first flag to drm_panel</title>
<updated>2022-12-08T08:56:57+00:00</updated>
<author>
<name>Dave Stevenson</name>
<email>dave.stevenson@raspberrypi.com</email>
</author>
<published>2022-12-05T17:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ea6b17027810ffbdb5bea7d0a2b1d312dd1021c'/>
<id>urn:sha1:5ea6b17027810ffbdb5bea7d0a2b1d312dd1021c</id>
<content type='text'>
Mapping to the drm_bridge flag pre_enable_prev_first,
add a new flag prepare_prev_first to drm_panel to allow
the panel driver to request that the upstream bridge should
be pre_enabled before the panel prepare.

Signed-off-by: Dave Stevenson &lt;dave.stevenson@raspberrypi.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20221205173328.1395350-6-dave.stevenson@raspberrypi.com
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
</content>
</entry>
<entry>
<title>drm/bridge: panel: Introduce drmm_of_get_bridge</title>
<updated>2022-07-13T08:46:06+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-07-11T17:38:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae9f1f2ca093906f06311ade42772eeb021af39f'/>
<id>urn:sha1:ae9f1f2ca093906f06311ade42772eeb021af39f</id>
<content type='text'>
Unlike what can be found for other DRM entities, we don't have a
DRM-managed function equivalent to devm_drm_of_get_bridge().

Let's create it.

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220711173939.1132294-12-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm/bridge: panel: Introduce drmm_panel_bridge_add</title>
<updated>2022-07-13T08:46:06+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-07-11T17:38:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=abea75e9207e7744f524a5373e9c149226e17a5d'/>
<id>urn:sha1:abea75e9207e7744f524a5373e9c149226e17a5d</id>
<content type='text'>
Unlike what can be found for other entities, there's no DRM-managed
function to create a panel_bridge instance from a panel.

Let's introduce one.

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20220711173939.1132294-11-maxime@cerno.tech
</content>
</entry>
<entry>
<title>drm: Config orientation property if panel provides it</title>
<updated>2022-06-21T15:52:59+00:00</updated>
<author>
<name>Hsin-Yi Wang</name>
<email>hsinyi@chromium.org</email>
</author>
<published>2022-06-09T07:27:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15b9ca1641f0c3cd74885280331e9172c62a125e'/>
<id>urn:sha1:15b9ca1641f0c3cd74885280331e9172c62a125e</id>
<content type='text'>
Panel orientation property should be set before drm_dev_register().
Some drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

In drm_bridge_connector_init(), if a bridge is a panel bridge, use it to
set the connector's panel orientation property.

Suggested-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Reviewed-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
[dianders: fixed space vs. tab indentation]
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220609072722.3488207-9-hsinyi@chromium.org
</content>
</entry>
<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.radix-linux.su/kernel/linux.git/commit/?id=34263c1b1593e44a3963dcfd6ed9af70c3002686'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=934aef885f9d99662a02690de3737b3b70116121'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=2509969a9862b522d2208e8663057fb227556687'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=d4ae66f10c8b9959dce1766d9a87070e567236eb'/>
<id>urn:sha1: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>
</entry>
</feed>
