diff options
author | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-05-28 11:29:36 +0200 |
---|---|---|
committer | Luca Ceresoli <luca.ceresoli@bootlin.com> | 2025-06-19 14:56:19 +0200 |
commit | a59a271769149f0b8258507276f3d2a24370cbdb (patch) | |
tree | 0a06cf538bb66d9532db2732c1085d0b96cda7fc /arch/x86/entry/syscall_32.c | |
parent | 1a45ef022f0364186d4fb2f4e5255dcae1ff638a (diff) |
drm/bridge: tc358767: convert to devm_drm_bridge_alloc() APIHEADfor-linux-nextdrm-misc-next
This is the new API for allocating DRM bridges.
Converting this driver is a bit complex because the drm_bridge funcs
pointer differs based on the bridge mode. So the current code does:
* tc_probe()
* devm_kzalloc() private struct embedding drm_bridge
* call tc_probe_bridge_endpoint() which
* parses DT description into struct fields
* computes the mode
* calls different bridge init functions based on the mode
* each sets a different bridge.funcs pointer
The new API expects the funcs pointer to be known at alloc time, which does
not fit in the current code structure.
Solve this by splitting tc_probe_bridge_endpoint() in two functions:
* tc_probe_get_mode(), computing the mode without needing the private
driver structure
* tc_probe_bridge_endpoint(), only initializing the endpoints
So now the mode is known before allocation and so
is the funcs pointer, while all other operations are still happening after
allocation, directly into the private struct data, as they used to.
The new code flow is:
* tc_probe()
* tc_probe_get_mode()
* parses DT description
* computes and returns the mode
* based onf the mode, pick the funcs pointer
* devm_drm_bridfge_alloc(..., funcs)
* call tc_probe_bridge_endpoint() which
* calls different bridge init functions based on the mode
* these don't set the funcs pointer, it was done by _alloc
This solution is chosen to minimize the changes in the driver logical code
flow. The drawback is we now iterate twice over the endpoints during probe.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250528-drm-bridge-convert-to-alloc-api-v4-1-f04e698c9a77@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Diffstat (limited to 'arch/x86/entry/syscall_32.c')
0 files changed, 0 insertions, 0 deletions