Luca Ceresoli
e74b84cd83
drm/bridge: imx8*-ldb: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
These two drivers are tangled together by the ldb_add_bridge_helper(), so
they are converted at once.
They also have a similar design, each embedding an array of channels in
their main struct, and each channel embeds a drm_bridge. This prevents
dynamic, refcount-based deallocation of the bridges.
To make the new, dynamic bridge allocation possible:
* change the array of channels into an array of channel pointers
* allocate each channel using devm_drm_bridge_alloc()
* adapt ldb_add_bridge_helper() to not set the funcs pointer
(now done by devm_drm_bridge_alloc())
* adapt the code wherever using the channels
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Acked-by: Liu Ying <victor.liu@nxp.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-31-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:26 +02:00
Luca Ceresoli
a4754ae9cf
drm/bridge: ti-sn65dsi86: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Reviewed-by: Herve Codina <herve.codina@bootlin.com >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Tested-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-13-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:22 +02:00
Luca Ceresoli
7fe58bf1a9
drm/bridge: tda998x: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-12-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:22 +02:00
Luca Ceresoli
ed6987b674
drm/bridge: dw-hdmi: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-11-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:21 +02:00
Luca Ceresoli
6287ffd9ef
drm/bridge: lt9611uxc: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-7-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:21 +02:00
Luca Ceresoli
4e90a3d96a
drm/bridge: display-connector: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-6-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:20 +02:00
Luca Ceresoli
53ddeb2515
drm/bridge: analogix-anx6345: convert to devm_drm_bridge_alloc() API
...
This is the new API for allocating DRM bridges.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Reviewed-by: Andy Yan <andyshrk@163.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-3-8f91a404d86b@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-29 11:21:20 +02:00
Christophe JAILLET
b848cd418a
drm/bridge: lt9611uxc: Fix an error handling path in lt9611uxc_probe()
...
If lt9611uxc_audio_init() fails, some resources still need to be released
before returning the error code.
Use the existing error handling path.
Fixes: 0cbbd5b1a0 ("drm: bridge: add support for lontium LT9611UXC bridge")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/f167608e392c6b4d7d7f6e45e3c21878feb60cbd.1744958833.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-23 01:13:04 +03:00
Dmitry Baryshkov
58a71d2bf1
drm/bridge: analogix_dp: ignore return values of drm_panel_* calls
...
Follow the example of other drivers and ignore return values of the
drm_panel_prepare() / unprepare() / enable() / disable() calls. There is
no possible error recovery, so the driver just logs a message.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-6-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Dmitry Baryshkov
d5f34ca5df
drm/bridge: analogix_dp: inline analogix_dp_prepare_panel()
...
The analogix_dp_prepare_panel() is now only calling a corresponding
drm_panel function. Inline it to simplify the code.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-5-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Dmitry Baryshkov
62ca1c3a14
drm/bridge: analogic_dp: drop panel_lock
...
The analogix_dp_prepare_panel() function is called from bridge's
atomic_pre_enable() and atomic_post_disable() callbacks, which can not
happen simultaneously. Drop the useless mutex.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-4-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Dmitry Baryshkov
4fc72e1fc4
drm/bridge: analogic_dp: drop panel_is_modeset
...
The dp->panel_is_modeset is now a write-only field. Drop it completely.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-3-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Dmitry Baryshkov
0ce432e18c
drm/bridge: analogix_dp: drop unused argument to analogix_dp_prepare_panel()
...
After previous cleanup all calling sites pass true as is_modeset_prepare
argument to analogix_dp_prepare_panel(). Drop dead code depending on
that argument being false.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-2-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Dmitry Baryshkov
b65cbfe0e1
drm/bridge: analogix_dp: drop extra calls to analogix_dp_prepare_panel()
...
The analogix_dp_prepare_panel() returns immediately if there is no
attached panel. Drop several calls to this function which are performed
when dp->plat_data->panel is NULL.
Tested-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250401-panel-return-void-v1-1-93e1be33dc8d@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-22 16:49:11 +03:00
Damon Ding
0e8b86b6df
drm/bridge: analogix_dp: Add support for RK3588
...
Expand enum analogix_dp_devtype with RK3588_EDP, and add max_link_rate
and max_lane_count configs for it.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Link: https://lore.kernel.org/r/20250310104114.2608063-11-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:27:10 +03:00
Damon Ding
c8f0b7cb01
drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
...
Add analogix_dpaux_wait_hpd_asserted() to help confirm the HPD state
before doing AUX transfers.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/20250310104114.2608063-8-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:27:10 +03:00
Damon Ding
e5e9fa9f7a
drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
...
The main modification is moving the DP AUX initialization from function
analogix_dp_bind() to analogix_dp_probe(). In order to get the EDID of
eDP panel during probing, it is also needed to advance PM operations to
ensure that eDP controller and phy are prepared for AUX transmission.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/20250310104114.2608063-7-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:27:10 +03:00
Damon Ding
fd073dffef
drm/bridge: analogix_dp: Support to get &analogix_dp_device.plat_data and &analogix_dp_device.aux
...
Add two new functions: one to find &analogix_dp_device.plat_data via
&drm_dp_aux, and the other to get &analogix_dp_device.aux. Both of them
serve for the function of getting panel from DP AUX bus, which is why
they are included in a single commit.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Link: https://lore.kernel.org/r/20250310104114.2608063-6-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:26:06 +03:00
Damon Ding
2c0883459e
drm/bridge: analogix_dp: Add support for phy configuration.
...
Add support to configurate link rate, lane count, voltage swing and
pre-emphasis with phy_configure(). It is helpful in application scenarios
where analogix controller is mixed with the phy of other vendors.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Link: https://lore.kernel.org/r/20250310104114.2608063-4-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:26:06 +03:00
Damon Ding
c71db05114
drm/bridge: analogix_dp: Remove CONFIG_PM related check in analogix_dp_bind()/analogix_dp_unbind()
...
Remove the check related to CONFIG_PM in order to make the code more
concise, as the CONFIG_PM should be a required option for many drivers.
In addition, it is preferable to use devm_pm_runtime_enable() instead of
manually invoking pm_runtime_enable() followed by pm_runtime_disable().
Suggested-by: Douglas Anderson <dianders@chromium.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Link: https://lore.kernel.org/r/20250310104114.2608063-3-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:26:06 +03:00
Damon Ding
efab13e7d1
drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq()
...
The IRQF_NO_AUTOEN can be used for the drivers that don't want
interrupts to be enabled automatically via devm_request_threaded_irq().
Using this flag can provide be more robust compared to the way of
calling disable_irq() after devm_request_threaded_irq() without the
IRQF_NO_AUTOEN flag.
Suggested-by: Douglas Anderson <dianders@chromium.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Damon Ding <damon.ding@rock-chips.com >
Link: https://lore.kernel.org/r/20250310104114.2608063-2-damon.ding@rock-chips.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-21 01:26:06 +03:00
Andy Yan
4890d68db6
drm/bridge: dw-hdmi: Avoid including uapi headers
...
It is not recommended for drivers to include UAPI header
directly.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Heiko Stuebner <heiko@sntech.de >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250411115941.318558-1-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-17 01:54:06 +03:00
Dmitry Baryshkov
b12fa5e76e
drm/bridge: select DRM_KMS_HELPER for AUX_BRIDGE
...
The aux bridge uses devm_drm_of_get_bridge() from the panel bridge (and
correctly selects DRM_PANEL_BRIDGE). However panel bridge is not a
separate module, it is compiled into the drm_kms_helper.o. Select
DRM_KMS_HELPER too to express this dependency.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250411-aux-select-kms-v1-1-c4276f905a56@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-17 01:47:21 +03:00
Chen-Yu Tsai
f8cc87024d
drm/bridge: anx7625: Use devm_pm_runtime_enable()
...
The anx7625 driver is open coding what devm_pm_runtime_enable() does.
Switch to the common helper instead.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://patch.msgid.link/20250409093814.3977025-1-wenst@chromium.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org >
2025-04-15 15:42:17 +08:00
Dmitry Baryshkov
5d04b41889
drm/bridge: split HDMI Audio from DRM_BRIDGE_OP_HDMI
...
As pointed out by Laurent, OP bits are supposed to describe operations.
Split DRM_BRIDGE_OP_HDMI_AUDIO from DRM_BRIDGE_OP_HDMI instead of
overloading DRM_BRIDGE_OP_HDMI.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Link: https://lore.kernel.org/r/20250314-dp-hdmi-audio-v6-1-dbd228fa73d7@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-07 15:48:23 +03:00
Thomas Zimmermann
1afba39f93
Merge drm/drm-next into drm-misc-next
...
Backmerging to get v6.15-rc1 into drm-misc-next. Also fixes a
build issue when enabling CONFIG_DRM_SCHED_KUNIT_TEST.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2025-04-07 14:35:48 +02:00
Luca Ceresoli
fbe43810d5
drm/bridge: samsung-dsim: use dynamic lifetime management
...
Allow this bridge to be removable without dangling pointers and
use-after-free, together with proper use of drm_bridge_get() and _put() by
consumers.
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250326-drm-bridge-refcount-v9-5-5e0661fe1f84@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-07 11:38:06 +02:00
Luca Ceresoli
cb14da141e
drm/bridge: ti-sn65dsi83: use dynamic lifetime management
...
Allow this bridge to be removable without dangling pointers and
use-after-free, together with proper use of drm_bridge_get() and _put() by
consumers.
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250326-drm-bridge-refcount-v9-4-5e0661fe1f84@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com >
2025-04-07 11:38:05 +02:00
Linus Torvalds
16cd1c2657
Merge tag 'timers-cleanups-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
...
Pull timer cleanups from Thomas Gleixner:
"A set of final cleanups for the timer subsystem:
- Convert all del_timer[_sync]() instances over to the new
timer_delete[_sync]() API and remove the legacy wrappers.
Conversion was done with coccinelle plus some manual fixups as
coccinelle chokes on scoped_guard().
- The final cleanup of the hrtimer_init() to hrtimer_setup()
conversion.
This has been delayed to the end of the merge window, so that all
patches which have been merged through other trees are in mainline
and all new users are catched.
Doing this right before rc1 ensures that new code which is merged post
rc1 is not introducing new instances of the original functionality"
* tag 'timers-cleanups-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tracing/timers: Rename the hrtimer_init event to hrtimer_setup
hrtimers: Rename debug_init_on_stack() to debug_setup_on_stack()
hrtimers: Rename debug_init() to debug_setup()
hrtimers: Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper()
hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns()
hrtimers: Make callback function pointer private
hrtimers: Merge __hrtimer_init() into __hrtimer_setup()
hrtimers: Switch to use __htimer_setup()
hrtimers: Delete hrtimer_init()
treewide: Convert new and leftover hrtimer_init() users
treewide: Switch/rename to timer_delete[_sync]()
2025-04-06 08:35:37 -07:00
Thomas Gleixner
8fa7292fee
treewide: Switch/rename to timer_delete[_sync]()
...
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.
Conversion was done with coccinelle plus manual fixups where necessary.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2025-04-05 10:30:12 +02:00
Andy Yan
f09d9f921f
drm/bridge: it6505: Switch to common helpers to power up/down dp link
...
Use the common dp link power up/down helpers to avoid duplicating code.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250318063452.4983-5-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-02 17:41:27 +03:00
Andy Yan
39f14a0199
drm/bridge: anx78xx: Switch to common helpers to power up/down dp link
...
Use the common dp link power up/down helpers to avoid duplicating code.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250318063452.4983-4-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-02 17:41:27 +03:00
Andy Yan
4adde49ba4
drm/bridge: anx6345: Switch to common helpers to power up/down dp link
...
Use the common dp link power up/down helpers to avoid duplicating code.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250318063452.4983-3-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-02 17:41:27 +03:00
Andy Yan
23ee8c6b34
drm/bridge: cdns-mhdp8546: Switch to common helpers to power up/down dp link
...
Use the common dp link power up/down helpers to avoid duplicating code.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250318063452.4983-2-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-04-02 17:41:27 +03:00
Alexander Stein
586831a417
drm/bridge: sii902x: Set bridge type
...
This is a RGB to HDMI bridge, so set the bridge type accordingly.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250326101124.4031874-1-alexander.stein@ew.tq-group.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 21:09:59 +03:00
Arnd Bergmann
85a063b8b2
drm/i2c: tda998x: select CONFIG_DRM_KMS_HELPER
...
This fails to build without the KMS helper functions:
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o: in function `tda998x_detect_work':
tda998x_drv.c:(.text+0x4e6): undefined reference to `drm_kms_helper_hotplug_event'
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o: in function `tda998x_bind':
tda998x_drv.c:(.text.unlikely+0x33): undefined reference to `drm_simple_encoder_init'
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o:(.rodata+0x584): undefined reference to `drm_atomic_helper_connector_reset'
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o:(.rodata+0x590): undefined reference to `drm_helper_probe_single_connector_modes'
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o:(.rodata+0x5a4): undefined reference to `drm_atomic_helper_connector_duplicate_state'
x86_64-linux-ld: drivers/gpu/drm/bridge/tda998x_drv.o:(.rodata+0x5a8): undefined reference to `drm_atomic_helper_connector_destroy_state'
Select the missing symbol and fix up the broken whitespace.
Fixes: 325ba852d1 ("drm/i2c: move TDA998x driver under drivers/gpu/drm/bridge")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://lore.kernel.org/r/20250324210824.3094660-1-arnd@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 21:02:06 +03:00
Aradhya Bhatia
a53d987756
drm/bridge: cdns-dsi: Move DSI mode check to _atomic_check()
...
At present, the DSI mode configuration check happens during the
_atomic_enable() phase, which is not really the best place for this.
Moreover, if the mode is not valid, the driver gives a warning and
continues the hardware configuration.
Move the DSI mode configuration check to _atomic_check() instead, which
can properly report back any invalid mode, before the _enable phase even
begins.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-10-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
bc36ee983f
drm/bridge: cdns-dsi: Add input format negotiation
...
Add support for the input format negotiation hook, that uses the helper
drm_mipi_dsi_get_input_bus_fmt() for dsi hosts, to figure out the
required input format.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-9-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
7ad8b3441b
drm/bridge: cdns-dsi: Move to devm_drm_of_get_bridge()
...
Instead of manually finding the next bridge/panel, and maintaining the
panel-bridge (in-case the next entity is a panel), switch to using the
automatically managing devm_drm_of_get_bridge() API.
Drop the drm_panel support completely from the driver while at it.
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-7-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
47c03e6660
drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready
...
Once the DSI Link and DSI Phy are initialized, the code needs to wait
for Clk and Data Lanes to be ready, before continuing configuration.
This is in accordance with the DSI Start-up procedure, found in the
Technical Reference Manual of Texas Instrument's J721E SoC[0] which
houses this DSI TX controller.
If the previous bridge (or crtc/encoder) are configured pre-maturely,
the input signal FIFO gets corrupt. This introduces a color-shift on the
display.
Allow the driver to wait for the clk and data lanes to get ready during
DSI enable.
[0]: See section 12.6.5.7.3 "Start-up Procedure" in J721E SoC TRM
TRM Link: http://www.ti.com/lit/pdf/spruil1
Fixes: e19233955d ("drm/bridge: Add Cadence DSI driver")
Cc: stable@vger.kernel.org
Tested-by: Dominik Haller <d.haller@phytec.de >
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-6-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
c6a7ef0d48
drm/bridge: cdns-dsi: Check return value when getting default PHY config
...
Check for the return value of the phy_mipi_dphy_get_default_config()
call, and in case of an error, return back the same.
Fixes: fced5a364d ("drm/bridge: cdns: Convert to phy framework")
Cc: stable@vger.kernel.org
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-5-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
132bdcec39
drm/bridge: cdns-dsi: Fix the clock variable for mode_valid()
...
The crtc_* mode parameters do not get generated (duplicated in this
case) from the regular parameters before the mode validation phase
begins.
The rest of the code conditionally uses the crtc_* parameters only
during the bridge enable phase, but sticks to the regular parameters
for mode validation. In this singular instance, however, the driver
tries to use the crtc_clock parameter even during the mode validation,
causing the validation to fail.
Allow the D-Phy config checks to use mode->clock instead of
mode->crtc_clock during mode_valid checks, like everywhere else in the
driver.
Fixes: fced5a364d ("drm/bridge: cdns: Convert to phy framework")
Cc: stable@vger.kernel.org
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-4-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
fd2611c13f
drm/bridge: cdns-dsi: Fix phy de-init and flag it so
...
The driver code doesn't have a Phy de-initialization path as yet, and so
it does not clear the phy_initialized flag while suspending. This is a
problem because after resume the driver looks at this flag to determine
if a Phy re-initialization is required or not. It is in fact required
because the hardware is resuming from a suspend, but the driver does not
carry out any re-initialization causing the D-Phy to not work at all.
Call the counterparts of phy_init() and phy_power_on(), that are
phy_exit() and phy_power_off(), from _bridge_post_disable(), and clear
the flags so that the Phy can be initialized again when required.
Fixes: fced5a364d ("drm/bridge: cdns: Convert to phy framework")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-3-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Aradhya Bhatia
688eb4d465
drm/bridge: cdns-dsi: Fix connecting to next bridge
...
Fix the OF node pointer passed to the of_drm_find_bridge() call to find
the next bridge in the display chain.
The code to find the next panel (and create its panel-bridge) works
fine, but to find the next (non-panel) bridge does not.
To find the next bridge in the pipeline, we need to pass "np" - the OF
node pointer of the next entity in the devicetree chain. Passing
"of_node" to of_drm_find_bridge (which is what the code does currently)
will fetch the bridge for the cdns-dsi which is not what's required.
Fix that.
Fixes: e19233955d ("drm/bridge: Add Cadence DSI driver")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com >
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev >
Link: https://lore.kernel.org/r/20250329113925.68204-2-aradhya.bhatia@linux.dev
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-30 19:47:12 +03:00
Chen Ni
c1031442d3
drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls
...
'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.
Remove the redundant 'flush_workqueue()' calls.
This was generated with coccinelle:
@@
expression E;
@@
- flush_workqueue(E);
destroy_workqueue(E);
Signed-off-by: Chen Ni <nichen@iscas.ac.cn >
Reviewed-by: Robert Foss <rfoss@kernel.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/20250312090132.1624445-1-nichen@iscas.ac.cn
2025-03-27 14:04:33 -07:00
Dmitry Baryshkov
fcbb93f1e4
drm/display: dp: change drm_dp_dpcd_read_link_status() return value
...
drm_dp_dpcd_read_link_status() follows the "return error code or number
of bytes read" protocol, with the code returning less bytes than
requested in case of some errors. However most of the drivers
interpreted that as "return error code in case of any error". Switch
drm_dp_dpcd_read_link_status() to drm_dp_dpcd_read_data() and make it
follow that protocol too.
Acked-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-2-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Wolfram Sang
d69362f55f
drm/bridge: ti-sn65dsi86: Check bridge connection failure
...
Read out and check the ID registers, so we can bail out if I2C
communication does not work or if the device is unknown. Tested on a
Renesas GrayHawk board (R-Car V4M) by using a wrong I2C address and by
not enabling RuntimePM for the device.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250318155549.19625-2-wsa+renesas@sang-engineering.com
2025-03-24 08:47:58 -07:00
Wolfram Sang
1d1f7b15cb
drm/bridge: ti-sn65dsi86: make use of debugfs_init callback
...
Do not create a custom directory in debugfs-root, but use the
debugfs_init callback to create a custom directory at the given place
for the bridge. The new directory layout looks like this on a Renesas
GrayHawk-Single with a R-Car V4M SoC:
/sys/kernel/debug/dri/feb00000.display/DP-1/1-002c
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250315201651.7339-2-wsa+renesas@sang-engineering.com
2025-03-24 08:47:49 -07:00
Luca Ceresoli
616299b666
drm/bridge: fsl-ldb: make warning message more informative
...
This warning notifies a clock was set to an inaccurate value. Modify the
string to also show the clock name.
While doing that also rewrap the entire function call.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Acked-by: Liu Ying <victor.liu@nxp.com >
Signed-off-by: Liu Ying <victor.liu@nxp.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-2-f139d768b92c@bootlin.com
2025-03-24 10:24:41 +08:00
Luca Ceresoli
8c6c3d2075
drm/bridge: imx8qxp-ldb: cleanup return value
...
'ret' can only be 0 at this point, being preceded by a 'if (ret) return
ret;'. So return 0 for clarity.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Reviewed-by: Liu Ying <victor.liu@nxp.com >
Signed-off-by: Liu Ying <victor.liu@nxp.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-1-f139d768b92c@bootlin.com
2025-03-24 10:24:41 +08:00