drm/connector: Convert all drivers to atomic_create_state and remove reset
Subsystems (29)
Maxime Ripard
maintainerv3 cover drm/connector: Convert all drivers to atomic_create_state and remove reset
This is a follow-up to the plane and CRTC reset removal series, and part of a larger effort to remove the reset hook from all KMS objects.
The connector reset hook is overloaded: it is called both at probe time to create the initial software state and during suspend/resume to reset hardware and software state. These two roles have different requirements, and the reset hook is not fallible, making error handling difficult for the initial state allocation path.
While reset has the semantics to reset both the software and hardware state, the vast majority of implementations and all the helpers only reset the software state, making them equivalent to atomic_create_state in practice. The atomic_create_state hook makes this explicit: it only allocates and initializes a pristine state without any side effect, and returns the state pointer or an ERR_PTR on failure.
This series converts all connector drivers tree-wide from the reset hook to atomic_create_state, then removes the reset hook from struct drm_connector_funcs entirely. The conversions were done using a combination of Coccinelle semantic patches, mechanical one-line replacements and manual adjustments.
---
Changes in v3:
- Fix error path in dw-hdmi
- Fix test error path for amdgpu kunit tests
- Fix nouveau legacy path
- Link to v2: https://lore.kernel.org/r/20261022-drm-no-more-connector-reset-v2-0-0b7e4e85b1e8@kernel.org
Changes in v2:
- Change the parameter order of __drm_atomic_helper_connector_hdmi_state_init
- Fixed state argument casing for drm_atomic_helper_connector_tv_margins_state_init and drm_atomic_helper_connector_tv_state_init
- Put atomic_create_state before atomic_duplicate_state
- Fix state allocation for MST and WB connectors
- Link to v1:
https://lore.kernel.org/r/20261014-drm-no-more-connector-reset-v1-0-586c9c026823@kernel.org
---
Maxime Ripard (37):
drm/amdgpu: vkms: Switch to drm_atomic_helper_connector_create_state drm/bridge: analogix-anx6345: Switch to drm_atomic_helper_connector_create_state drm/bridge: analogix-anx78xx: Switch to drm_atomic_helper_connector_create_state drm/bridge: chrontel-ch7033: Switch to drm_atomic_helper_connector_create_state drm/bridge: nxp-ptn3460: Switch to drm_atomic_helper_connector_create_state drm/panel: Switch to drm_atomic_helper_connector_create_state drm/bridge: synopsys: dw-hdmi: Switch to drm_atomic_helper_connector_create_state drm/bridge: tc358767: Switch to drm_atomic_helper_connector_create_state drm/bridge: tda998x: Switch to drm_atomic_helper_connector_create_state drm/bridge: ti-tfp410: Switch to drm_atomic_helper_connector_create_state drm/exynos: Switch to drm_atomic_helper_connector_create_state drm/fsl-dcu: Switch to drm_atomic_helper_connector_create_state drm/loongson: Switch to drm_atomic_helper_connector_create_state drm/mipi-dbi: Switch to drm_atomic_helper_connector_create_state drm/renesas: shmobile: Switch to drm_atomic_helper_connector_create_state drm/sitronix: st7571: Switch to drm_atomic_helper_connector_create_state drm/sti: Switch to drm_atomic_helper_connector_create_state drm/sun4i: Switch to drm_atomic_helper_connector_create_state drm/tegra: Switch to drm_atomic_helper_connector_create_state drm/tests: Switch to drm_atomic_helper_connector_create_state drm/tiny: arcpgu: Switch to drm_atomic_helper_connector_create_state drm/tiny: sharp: Switch to drm_atomic_helper_connector_create_state drm/virtio: Switch to drm_atomic_helper_connector_create_state drm/vkms: Switch to drm_atomic_helper_connector_create_state drm/xen: Switch to drm_atomic_helper_connector_create_state drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state drm/meson: Convert to atomic_create_state
drm/sun4i: hdmi: Convert to atomic_create_state
drm/sun4i: tv: Convert to atomic_create_state
drm/tests: hdmi: Convert to atomic_create_state
drm/connector: Remove drm_atomic_helper_connector_reset() drm/amdgpu: dm: Convert to atomic_create_state
drm/i915: Convert to atomic_create_state
drm/nouveau: Convert to atomic_create_state
drm/tegra: Convert to atomic_create_state
drm/connector: Remove __drm_atomic_helper_connector_reset() drm/connector: Remove reset
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_connector.c | 32 ++--- .../amd/display/amdgpu_dm/amdgpu_dm_connector.h | 3 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 17 ++- .../amdgpu_dm/tests/amdgpu_dm_connector_test.c | 102 +++++++++++----- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 +- drivers/gpu/drm/bridge/chrontel-ch7033.c | 2 +- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 14 ++- drivers/gpu/drm/bridge/tc358767.c | 2 +- drivers/gpu/drm/bridge/tda998x_drv.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +- drivers/gpu/drm/drm_atomic_state_helper.c | 43 ------- drivers/gpu/drm/drm_connector.c | 8 -- drivers/gpu/drm/drm_mode_config.c | 4 +- drivers/gpu/drm/drm_panel.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 2 +- drivers/gpu/drm/i915/display/intel_connector.c | 6 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 6 +- drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 2 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 4 +- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 12 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 25 ++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 129 ++++++++++++++++----- drivers/gpu/drm/nouveau/nouveau_connector.h | 3 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/sitronix/st7571.c | 2 +- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sti/sti_hda.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 16 ++- drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun4i_tv.c | 16 ++- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- drivers/gpu/drm/tegra/dsi.c | 17 ++- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 13 +-- drivers/gpu/drm/tests/drm_atomic_commit_test.c | 2 +- drivers/gpu/drm/tests/drm_atomic_test.c | 2 +- drivers/gpu/drm/tests/drm_connector_test.c | 4 +- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 16 ++- drivers/gpu/drm/tests/drm_probe_helper_test.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/tiny/sharp-memory.c | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/vkms/vkms_connector.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_conn.c | 2 +- include/drm/drm_atomic_state_helper.h | 3 - include/drm/drm_connector.h | 12 -- include/drm/drm_mipi_dbi.h | 2 +- 58 files changed, 351 insertions(+), 236 deletions(-)
---
base-commit: 91f52e99824b0beebb48cad51bbda81437af8664
change-id: 20260709-drm-no-more-connector-reset-45ee14d7c62c
Best regards,
Signature · 1 line
Maxime Ripard <[email protected]>
Maxime Ripard
maintainerPATCH v3 1/37 drm/amdgpu: vkms: Switch to drm_atomic_helper_connector_create_state
The amdgpu: vkms connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: "Christian König" <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +1 -1
@@ -87,5 +87,5 @@ static const struct drm_connector_funcs amdgpu_vkms_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 2/37 drm/bridge: analogix-anx6345: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: analogix-anx6345 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +1 -1
@@ -484,5 +484,5 @@ static const struct drm_connector_funcs anx6345_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = anx6345_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 3/37 drm/bridge: analogix-anx78xx: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: analogix-anx78xx connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +1 -1
@@ -855,5 +855,5 @@ static const struct drm_connector_funcs anx78xx_connector_funcs = { .detect = anx78xx_detect, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 4/37 drm/bridge: chrontel-ch7033: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: chrontel-ch7033 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/chrontel-ch7033.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/chrontel-ch7033.c +1 -1
@@ -219,8 +219,8 @@ static enum drm_connector_status ch7033_connector_detect(static const struct drm_connector_funcs ch7033_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .detect = ch7033_connector_detect, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 5/37 drm/bridge: nxp-ptn3460: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: nxp-ptn3460 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/nxp-ptn3460.c +1 -1
@@ -211,5 +211,5 @@ static const struct drm_connector_funcs ptn3460_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 6/37 drm/panel: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: panel connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/drm_panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panel.c +1 -1
@@ -71,7 +71,7 @@ panel_bridge_connector_helper_funcs = {static const struct drm_connector_funcs panel_bridge_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 7/37 drm/bridge: synopsys: dw-hdmi: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: synopsys: dw-hdmi connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1 -1
@@ -2570,5 +2570,5 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { .destroy = drm_connector_cleanup, .force = dw_hdmi_connector_force, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 8/37 drm/bridge: tc358767: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: tc358767 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358767.c +1 -1
@@ -1797,5 +1797,5 @@ static const struct drm_connector_funcs tc_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 9/37 drm/bridge: tda998x: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: tda998x connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Russell King <[email protected]>
--- drivers/gpu/drm/bridge/tda998x_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tda998x_drv.c +1 -1
@@ -1210,8 +1210,8 @@ tda998x_connector_detect(struct drm_connector *connector, bool force)static const struct drm_connector_funcs tda998x_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .detect = tda998x_connector_detect, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 10/37 drm/bridge: ti-tfp410: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe bridge: ti-tfp410 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-tfp410.c +1 -1
@@ -96,5 +96,5 @@ static const struct drm_connector_funcs tfp410_con_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 11/37 drm/exynos: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe exynos connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Alim Akhtar <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dpi.c +1 -1
@@ -57,5 +57,5 @@ static const struct drm_connector_funcs exynos_dpi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = exynos_dpi_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 -1
@@ -335,5 +335,5 @@ static const struct drm_connector_funcs vidi_connector_funcs = { .detect = vidi_detect, .destroy = vidi_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
@@ -876,5 +876,5 @@ static const struct drm_connector_funcs hdmi_connector_funcs = { .detect = hdmi_detect, .destroy = hdmi_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 12/37 drm/fsl-dcu: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe fsl-dcu connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Alison Wang <[email protected]>
Cc: Stefan Agner <[email protected]>
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +1 -1
@@ -51,9 +51,9 @@ static void fsl_dcu_drm_connector_destroy(struct drm_connector *connector)static const struct drm_connector_funcs fsl_dcu_drm_connector_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .destroy = fsl_dcu_drm_connector_destroy, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = drm_atomic_helper_connector_reset, };
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 13/37 drm/loongson: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe loongson connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Huacai Chen <[email protected]>
Cc: Icenowy Zheng <[email protected]>
Cc: Jianmin Lv <[email protected]>
Cc: Mingcong Bai <[email protected]>
Cc: Qianhai Wu <[email protected]>
Cc: Xi Ruoyao <[email protected]>
--- drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 2 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/loongson/lsdc_output_7a1000.c +1 -1
@@ -96,5 +96,5 @@ static const struct drm_connector_funcs ls7a1000_dpi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state
drivers/gpu/drm/loongson/lsdc_output_7a2000.c +2 -2
@@ -204,5 +204,5 @@ static const struct drm_connector_funcs ls7a2000_hdmi_connector_funcs[2] = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -213,5 +213,5 @@ static const struct drm_connector_funcs ls7a2000_hdmi_connector_funcs[2] = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 14/37 drm/mipi-dbi: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe mipi-dbi connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- include/drm/drm_mipi_dbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/drm_mipi_dbi.h +1 -1
@@ -258,6 +258,6 @@ void drm_mipi_dbi_crtc_helper_atomic_disable(struct drm_crtc *crtc,#define DRM_MIPI_DBI_CONNECTOR_FUNCS \ - .reset = drm_atomic_helper_connector_reset, \ .fill_modes = drm_helper_probe_single_connector_modes, \ + .atomic_create_state = drm_atomic_helper_connector_create_state, \ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, \ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 15/37 drm/renesas: shmobile: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe renesas: shmobile connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Geert Uytterhoeven <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +1 -1
@@ -528,7 +528,7 @@ static void shmob_drm_connector_destroy(struct drm_connector *connector)static const struct drm_connector_funcs connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = shmob_drm_connector_destroy, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 16/37 drm/sitronix: st7571: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe sitronix: st7571 connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Marcus Folkesson <[email protected]>
--- drivers/gpu/drm/sitronix/st7571.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sitronix/st7571.c +1 -1
@@ -476,7 +476,7 @@ static const struct drm_encoder_helper_funcs st7571_encoder_helper_funcs = {static const struct drm_connector_funcs st7571_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 17/37 drm/sti: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe sti connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Alain Volmat <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
--- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sti/sti_hda.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/sti/sti_dvo.c +1 -1
@@ -421,5 +421,5 @@ static const struct drm_connector_funcs sti_dvo_connector_funcs = { .detect = sti_dvo_connector_detect, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/sti/sti_hda.c +1 -1
@@ -664,5 +664,5 @@ static const struct drm_connector_funcs sti_hda_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/sti/sti_hdmi.c +1 -1
@@ -1147,5 +1147,5 @@ static const struct drm_connector_funcs sti_hdmi_connector_funcs = { .detect = sti_hdmi_connector_detect, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_set_property = sti_hdmi_connector_set_property, .atomic_get_property = sti_hdmi_connector_get_property,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 18/37 drm/sun4i: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe sun4i connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Chen-Yu Tsai <[email protected]>
Cc: Samuel Holland <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/sun4i_lvds.c +1 -1
@@ -66,5 +66,5 @@ static const struct drm_connector_funcs sun4i_lvds_con_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = sun4i_lvds_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/sun4i/sun4i_rgb.c +1 -1
@@ -157,5 +157,5 @@ static const struct drm_connector_funcs sun4i_rgb_con_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = sun4i_rgb_connector_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +1 -1
@@ -838,5 +838,5 @@ static const struct drm_connector_funcs sun6i_dsi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 19/37 drm/tegra: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe tegra connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Jonathan Hunter <[email protected]>
Cc: Mikko Perttunen <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/tegra/hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/hdmi.c +1 -1
@@ -1131,8 +1131,8 @@ static void tegra_hdmi_early_unregister(struct drm_connector *connector)static const struct drm_connector_funcs tegra_hdmi_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .detect = tegra_hdmi_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = tegra_output_connector_destroy, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 20/37 drm/tests: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe tests connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
--- drivers/gpu/drm/tests/drm_atomic_commit_test.c | 2 +- drivers/gpu/drm/tests/drm_atomic_test.c | 2 +- drivers/gpu/drm/tests/drm_connector_test.c | 4 ++-- drivers/gpu/drm/tests/drm_probe_helper_test.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/tests/drm_atomic_commit_test.c +1 -1
@@ -52,7 +52,7 @@ static const struct drm_encoder_helper_funcs drm_atomic_test_encoder_funcs = {static const struct drm_connector_funcs dummy_connector_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .reset = drm_atomic_helper_connector_reset, };
drivers/gpu/drm/tests/drm_atomic_test.c +1 -1
@@ -24,7 +24,7 @@ static const struct drm_connector_helper_funcs drm_atomic_init_connector_helper_static const struct drm_connector_funcs drm_atomic_init_connector_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .reset = drm_atomic_helper_connector_reset, };
drivers/gpu/drm/tests/drm_connector_test.c +2 -2
@@ -49,7 +49,7 @@ static const struct drm_connector_hdmi_funcs dummy_hdmi_funcs = {static const struct drm_connector_funcs dummy_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .reset = drm_atomic_helper_connector_reset, };
@@ -203,7 +203,7 @@ static struct kunit_suite drmm_connector_init_test_suite = {static const struct drm_connector_funcs dummy_dynamic_init_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .reset = drm_atomic_helper_connector_reset, .destroy = drm_connector_cleanup, };
drivers/gpu/drm/tests/drm_probe_helper_test.c +1 -1
@@ -26,7 +26,7 @@ static const struct drm_connector_helper_funcs drm_probe_helper_connector_helperstatic const struct drm_connector_funcs drm_probe_helper_connector_funcs = { + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .reset = drm_atomic_helper_connector_reset, };
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 21/37 drm/tiny: arcpgu: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe tiny: arcpgu connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Alexey Brodkin <[email protected]>
--- drivers/gpu/drm/tiny/arcpgu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tiny/arcpgu.c +1 -1
@@ -99,7 +99,7 @@ arcpgu_drm_connector_helper_funcs = {static const struct drm_connector_funcs arcpgu_drm_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 22/37 drm/tiny: sharp: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe tiny: sharp connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Alex Lanzano <[email protected]>
--- drivers/gpu/drm/tiny/sharp-memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tiny/sharp-memory.c +1 -1
@@ -370,7 +370,7 @@ static const struct drm_connector_helper_funcs sharp_memory_connector_hfuncs = {static const struct drm_connector_funcs sharp_memory_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 23/37 drm/virtio: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe virtio connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Chia-I Wu <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Dmitry Osipenko <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Gurchetan Singh <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -1
@@ -271,5 +271,5 @@ static const struct drm_connector_funcs virtio_gpu_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = virtio_gpu_conn_destroy, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 24/37 drm/vkms: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe vkms connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Haneen Mohammed <[email protected]>
Cc: Louis Chauvet <[email protected]>
Cc: Melissa Wen <[email protected]>
--- drivers/gpu/drm/vkms/vkms_connector.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vkms/vkms_connector.c +1 -1
@@ -38,5 +38,5 @@ static const struct drm_connector_funcs vkms_connector_funcs = { .detect = vkms_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/vkms/vkms_writeback.c +1 -1
@@ -27,5 +27,5 @@ static const u32 vkms_wb_formats[] = {static const struct drm_connector_funcs vkms_wb_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 25/37 drm/xen: Switch to drm_atomic_helper_connector_create_state
In reply to Maxime RipardThe xen connector implementation uses the deprecated drm_atomic_helper_connector_reset() as its reset hook.
Switch to drm_atomic_helper_connector_create_state() instead.
---
Cc: Oleksandr Andrushchenko <[email protected]>
--- drivers/gpu/drm/xen/xen_drm_front_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xen/xen_drm_front_conn.c +1 -1
@@ -95,5 +95,5 @@ static const struct drm_connector_funcs connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, + .atomic_create_state = drm_atomic_helper_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 26/37 drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state
In reply to Maxime RipardThe dw-hdmi driver calls drm_atomic_helper_connector_reset() during connector creation to allocate an initial connector state needed by drm_connector_attach_max_bpc_property(). However, the driver only needs to allocate a pristine state, which is exactly what atomic_create_state provides.
Convert to drm_atomic_helper_connector_create_state() with proper error handling.
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +11 -1
@@ -2606,5 +2606,15 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi)* connector to have a state. */ -drm_atomic_helper_connector_reset (connector); +if (!connector->state) { +struct drm_connector_state *conn_state; + + conn_state =drm_atomic_helper_connector_create_state (connector); +if (IS_ERR (conn_state)) { +drm_connector_cleanup (connector); +return PTR_ERR (conn_state); + } + + connector->state = conn_state; + }drm_connector_attach_max_bpc_property (connector,8 ,16 );
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 27/37 drm/meson: Convert to atomic_create_state
In reply to Maxime RipardThe meson HDMI encoder calls drm_atomic_helper_connector_reset() during connector creation to allocate an initial connector state needed by drm_connector_attach_max_bpc_property(). However, the driver only needs to allocate a pristine state, which is exactly what atomic_create_state provides.
Convert to drm_atomic_helper_connector_create_state() with proper error handling.
---
Cc: Jerome Brunet <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_encoder_hdmi.c +11 -1
@@ -449,5 +449,15 @@ int meson_encoder_hdmi_probe(struct meson_drm *priv)* connector to have a state. */ -drm_atomic_helper_connector_reset (meson_encoder_hdmi->connector); +if (!meson_encoder_hdmi->connector->state) { +struct drm_connector_state *conn_state; + + conn_state =drm_atomic_helper_connector_create_state (meson_encoder_hdmi->connector); +if (IS_ERR (conn_state)) { + ret =PTR_ERR (conn_state); + goto err_put_node; + } + + meson_encoder_hdmi->connector->state = conn_state; + } if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_GXL) ||
Signature · 7 lines
2.55.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v3 27/37] drm/meson: Convert to atomic_create_state
Quoted 11 lines · Maxime Ripard
The meson HDMI encoder calls
drm_atomic_helper_connector_reset()during connector creation to allocate an initial connector state needed bydrm_connector_attach_max_bpc_property(). However, the driver only needs to allocate a pristine state, which is exactly whatatomic_create_stateprovides.Convert to
drm_atomic_helper_connector_create_state()with proper error handling.Signed-off-by Maxime Ripard <[email protected]>
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Maxime Ripard
maintainerPATCH v3 28/37 drm/sun4i: hdmi: Convert to atomic_create_state
In reply to Maxime RipardThe sun4i HDMI connector reset implementation creates a pristine state and initializes the HDMI state. It does not perform any hardware reset.
Since this is equivalent to what atomic_create_state expects, convert the reset function to an atomic_create_state hook that returns the initialized state.
---
Cc: Chen-Yu Tsai <[email protected]>
Cc: Samuel Holland <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +12 -4
@@ -291,9 +291,17 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) } -static void sun4i_hdmi_connector_reset (struct drm_connector *connector) +static struct drm_connector_state * +sun4i_hdmi_connector_create_state (struct drm_connector *connector) { -drm_atomic_helper_connector_reset (connector); -__drm_atomic_helper_connector_hdmi_state_init (connector->state, +struct drm_connector_state *connector_state; + + connector_state =drm_atomic_helper_connector_create_state (connector); +if (IS_ERR (connector_state)) +return connector_state; + +__drm_atomic_helper_connector_hdmi_state_init (connector_state, connector); + +return connector_state; }
@@ -302,5 +310,5 @@ static const struct drm_connector_funcs sun4i_hdmi_connector_funcs = { .detect = sun4i_hdmi_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = sun4i_hdmi_connector_reset, + .atomic_create_state = sun4i_hdmi_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 29/37 drm/sun4i: tv: Convert to atomic_create_state
In reply to Maxime RipardThe sun4i TV connector reset implementation creates a pristine state and initializes the analog TV properties. It does not perform any hardware reset.
Since this is equivalent to what atomic_create_state expects, convert the reset function to an atomic_create_state hook that returns the initialized state.
---
Cc: Chen-Yu Tsai <[email protected]>
Cc: Samuel Holland <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/sun4i/sun4i_tv.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/sun4i/sun4i_tv.c +12 -4
@@ -406,8 +406,16 @@ static const struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_fu }; -static void sun4i_tv_connector_reset (struct drm_connector *connector) +static struct drm_connector_state * +sun4i_tv_connector_create_state (struct drm_connector *connector) { -drm_atomic_helper_connector_reset (connector); -drm_atomic_helper_connector_tv_state_init (connector->state, connector); +struct drm_connector_state *connector_state; + + connector_state =drm_atomic_helper_connector_create_state (connector); +if (IS_ERR (connector_state)) +return connector_state; + +drm_atomic_helper_connector_tv_state_init (connector_state, connector); + +return connector_state; }
@@ -415,5 +423,5 @@ static const struct drm_connector_funcs sun4i_tv_comp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = sun4i_tv_connector_reset, + .atomic_create_state = sun4i_tv_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 30/37 drm/tests: hdmi: Convert to atomic_create_state
In reply to Maxime RipardThe test HDMI connector reset implementation creates a pristine state and initializes the HDMI state. It does not perform any hardware reset.
Since this is equivalent to what atomic_create_state expects, convert the reset function to an atomic_create_state hook that returns the initialized state.
--- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +12 -4
@@ -200,16 +200,24 @@ static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = { }; -static void dummy_hdmi_connector_reset (struct drm_connector *connector) +static struct drm_connector_state * +dummy_hdmi_connector_create_state (struct drm_connector *connector) { -drm_atomic_helper_connector_reset (connector); -__drm_atomic_helper_connector_hdmi_state_init (connector->state, +struct drm_connector_state *connector_state; + + connector_state =drm_atomic_helper_connector_create_state (connector); +if (IS_ERR (connector_state)) +return connector_state; + +__drm_atomic_helper_connector_hdmi_state_init (connector_state, connector); + +return connector_state; }static const struct drm_connector_funcs dummy_connector_funcs = { + .atomic_create_state = dummy_hdmi_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = dummy_hdmi_connector_reset, };
Signature · 1 line
2.55.0
Thomas Zimmermann
maintainerRe: [PATCH v3 30/37] drm/tests: hdmi: Convert to atomic_create_state
Hi
Am 30.10.26 um 16:14 schrieb Maxime Ripard:
[...]
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = { · line 209
Quoted 3 lines
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +3
-0+ connector_state =drm_atomic_helper_connector_create_state (connector); +if (IS_ERR (connector_state)) +return connector_state;
Somewhat unrelated to this series, this return statement made me think that we should consider requiring an ERR_CAST() in such situations. It documents what is happening and we're also not really returning a connector state.
Best regards
Thomas
Quoted 16 lines
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c +5
-1+ +__drm_atomic_helper_connector_hdmi_state_init (connector_state, connector); + +return connector_state; }static const struct drm_connector_funcs dummy_connector_funcs = { + .atomic_create_state = dummy_hdmi_connector_create_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = dummy_hdmi_connector_reset, };
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
Maxime Ripard
maintainerPATCH v3 31/37 drm/connector: Remove drm_atomic_helper_connector_reset()
In reply to Maxime RipardAll drivers implementing the connector reset hook with drm_atomic_helper_connector_reset() have been converted to atomic_create_state.
Remove drm_atomic_helper_connector_reset().
--- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +-- drivers/gpu/drm/drm_atomic_state_helper.c | 20 -------------------- include/drm/drm_atomic_state_helper.h | 1 - include/drm/drm_connector.h | 2 +- 4 files changed, 2 insertions(+), 24 deletions(-)
drivers/gpu/drm/display/drm_hdmi_state_helper.c +1 -2
@@ -315,6 +315,5 @@* Initializes all HDMI resources from a @drm_connector_state without * actually allocating it. This is useful for HDMI drivers, in -* combination with __drm_atomic_helper_connector_state_init(), -* drm_atomic_helper_connector_reset(), or +* combination with __drm_atomic_helper_connector_state_init(), or * drm_atomic_helper_connector_create_state(). */
drivers/gpu/drm/drm_atomic_state_helper.c +0 -20
@@ -436,24 +436,4 @@ __drm_atomic_helper_connector_reset(struct drm_connector *connector,EXPORT_SYMBOL (__drm_atomic_helper_connector_reset); -/** -* drm_atomic_helper_connector_reset - default &drm_connector_funcs.reset hook for connectors -* @connector: drm connector -* -* Resets the atomic state for @connector by freeing the state pointer (which -* might be NULL, e.g. at driver load time) and allocating a new empty state -* object. -*/ -void drm_atomic_helper_connector_reset (struct drm_connector *connector) -{ -struct drm_connector_state *conn_state =kzalloc_obj (*conn_state); - -if (connector->state) -__drm_atomic_helper_connector_destroy_state (connector->state); - -kfree (connector->state); -__drm_atomic_helper_connector_reset (connector, conn_state); -} -EXPORT_SYMBOL (drm_atomic_helper_connector_reset); -/** * drm_atomic_helper_connector_create_state - default &drm_connector_funcs.atomic_create_state hook for connectors
include/drm/drm_atomic_state_helper.h +0 -1
@@ -69,5 +69,4 @@ void __drm_atomic_helper_connector_state_init(struct drm_connector_state *conn_svoid __drm_atomic_helper_connector_reset (struct drm_connector *connector,struct drm_connector_state *conn_state); -void drm_atomic_helper_connector_reset (struct drm_connector *connector);struct drm_connector_state *drm_atomic_helper_connector_create_state (struct drm_connector *connector);
include/drm/drm_connector.h +1 -1
@@ -1666,5 +1666,5 @@ struct drm_connector_funcs {* It's not a helper hook only for historical reasons. * -* Atomic drivers can use drm_atomic_helper_connector_reset() to reset +* Atomic drivers can use __drm_atomic_helper_connector_reset() to reset * atomic state using this hook. */
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 32/37 drm/amdgpu: dm: Convert to atomic_create_state
In reply to Maxime RipardThe amdgpu_dm connector reset implementation creates a custom state subclass, but only initializes a pristine state without resetting any hardware. This is equivalent to what atomic_create_state expects. Convert to it.
---
Cc: "Christian König" <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Harry Wentland <[email protected]>
Cc: Leo Li <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
Cc: [email protected]
--- .../amd/display/amdgpu_dm/amdgpu_dm_connector.c | 32 ++++--- .../amd/display/amdgpu_dm/amdgpu_dm_connector.h | 3 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 ++- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 17 +++- .../amdgpu_dm/tests/amdgpu_dm_connector_test.c | 102 ++++++++++++++------- 5 files changed, 113 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +18 -14
@@ -1942,20 +1942,14 @@ STATIC_IFN_KUNIT void amdgpu_dm_connector_destroy(struct drm_connector *connectoEXPORT_IF_KUNIT (amdgpu_dm_connector_destroy); -void amdgpu_dm_connector_funcs_reset (struct drm_connector *connector) +struct drm_connector_state * +amdgpu_dm_connector_atomic_create_state (struct drm_connector *connector) { -struct dm_connector_state *old_state = -to_dm_connector_state (connector->state);struct dm_connector_state *state; state =kzalloc_obj (*state);if (!state) -return ; +return ERR_PTR (-ENOMEM ); -if (connector->state) -__drm_atomic_helper_connector_destroy_state (connector->state); - -kfree (old_state); - -__drm_atomic_helper_connector_reset (connector, &state->base); +__drm_atomic_helper_connector_state_init (&state->base, connector); state->scaling =RMX_OFF ;
@@ -1973,6 +1967,8 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) state->abm_level = amdgpu_dm_abm_level; } + +return &state->base; } -EXPORT_IF_KUNIT (amdgpu_dm_connector_funcs_reset); +EXPORT_IF_KUNIT (amdgpu_dm_connector_atomic_create_state); struct drm_connector_state *
@@ -2073,8 +2069,8 @@ EXPORT_IF_KUNIT(amdgpu_dm_connector_funcs_force);static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { - .reset = amdgpu_dm_connector_funcs_reset, .detect = amdgpu_dm_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = amdgpu_dm_connector_destroy, + .atomic_create_state = amdgpu_dm_connector_atomic_create_state, .atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -3200,6 +3196,14 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,* Allocate some default initial connector state with our reset helper. */ -if (aconnector->base.funcs->reset) - aconnector->base.funcs->reset (&aconnector->base); +if (!aconnector->base.state && + aconnector->base.funcs->atomic_create_state) { +struct drm_connector_state *conn_state; + + conn_state = aconnector->base.funcs->atomic_create_state (&aconnector->base); +if (IS_ERR (conn_state)) +return ; + + aconnector->base.state = conn_state; + } aconnector->connector_id = link_index;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +2 -1
@@ -51,5 +51,6 @@ struct drm_edid;struct drm_property ; -void amdgpu_dm_connector_funcs_reset (struct drm_connector *connector); +struct drm_connector_state * +amdgpu_dm_connector_atomic_create_state (struct drm_connector *connector); struct drm_connector_state *
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +9 -2
@@ -259,5 +259,5 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = dm_dp_mst_connector_destroy, - .reset = amdgpu_dm_connector_funcs_reset, + .atomic_create_state = amdgpu_dm_connector_atomic_create_state, .atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -672,4 +672,5 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,struct amdgpu_device *adev =drm_to_adev (dev);struct amdgpu_dm_connector *aconnector; +struct drm_connector_state *conn_state;struct drm_connector *connector;int i;
@@ -739,5 +740,11 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,* framebuffer lists */ -amdgpu_dm_connector_funcs_reset (connector); + conn_state =amdgpu_dm_connector_atomic_create_state (connector); +if (!IS_ERR (conn_state)) { +if (connector->state) + connector->funcs->atomic_destroy_state (connector, connector->state); + + connector->state = conn_state; + }drm_dp_mst_get_port_malloc (port);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c +14 -3
@@ -226,5 +226,5 @@ static const struct drm_connector_funcs amdgpu_dm_wb_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = amdgpu_dm_connector_funcs_reset, + .atomic_create_state = amdgpu_dm_connector_atomic_create_state, .atomic_duplicate_state = amdgpu_dm_connector_atomic_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -241,4 +241,5 @@ int amdgpu_dm_wb_connector_init(struct amdgpu_display_manager *dm, uint32_t link_index) { +struct drm_connector *connector;struct dc *dc = dm->dc;struct dc_link *link =dc_get_link_at_index (dc, link_index);
@@ -262,6 +263,16 @@ int amdgpu_dm_wb_connector_init(struct amdgpu_display_manager *dm,* Allocate some default initial connector state with our reset helper. */ -if (wbcon->base.base.funcs->reset) - wbcon->base.base.funcs->reset (&wbcon->base.base); + connector = &wbcon->base.base; +if (connector->funcs->atomic_create_state) { +struct drm_connector_state *conn_state; + + conn_state =amdgpu_dm_connector_atomic_create_state (connector); +if (!IS_ERR (conn_state)) { +if (connector->state) + connector->funcs->atomic_destroy_state (connector, connector->state); + + connector->state = conn_state; + } + }return 0 ;
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +70 -32
222 lines not on this page · raw message
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 33/37 drm/i915: Convert to atomic_create_state
In reply to Maxime RipardThe i915 connector initialization uses __drm_atomic_helper_connector_reset() to set up the initial state during connector allocation. However, it only needs to initialize the state, not reset it.
Switch to __drm_atomic_helper_connector_state_init() and assign connector->state explicitly, matching what atomic_create_state expects.
---
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- drivers/gpu/drm/i915/display/intel_connector.c | 6 ++++-- drivers/gpu/drm/i915/display/intel_sdvo.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_connector.c +4 -2
@@ -91,6 +91,8 @@ static int intel_connector_init(struct intel_connector *connector)return -ENOMEM ; -__drm_atomic_helper_connector_reset (&connector->base, - &conn_state->base); +__drm_atomic_helper_connector_state_init (&conn_state->base, + &connector->base); + + connector->base.state = &conn_state->base;intel_panel_init_alloc (connector);
drivers/gpu/drm/i915/display/intel_sdvo.c +4 -2
@@ -2791,6 +2791,8 @@ static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void) } -__drm_atomic_helper_connector_reset (&sdvo_connector->base.base, - &conn_state->base.base); +__drm_atomic_helper_connector_state_init (&conn_state->base.base, + &sdvo_connector->base.base); + + sdvo_connector->base.base.state = &conn_state->base.base;intel_panel_init_alloc (&sdvo_connector->base);
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 34/37 drm/nouveau: Convert to atomic_create_state
In reply to Maxime RipardThe nouveau connector reset implementation creates a custom state subclass, but only initializes a pristine state and sets driver-specific defaults without resetting any hardware. This is equivalent to what atomic_create_state expects. Convert to it.
This is significantly harder than the other drivers though, since pre-nv50 display doesn't support atomic modesetting. Instead, its connectors keep their property state embedded in struct nouveau_connector, and drm_connector.state is left NULL.
Thus, only the atomic path needs to be converted, with the embedded state initialized at connector creation time for pre-nv50. Those connectors are also given connector funcs without atomic_create_state:
the DRM core would otherwise install the embedded state into drm_connector.state and eventually pass it to atomic_destroy_state, which frees it.
---
Cc: Danilo Krummrich <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/nouveau/dispnv50/disp.c | 25 ++++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 129 +++++++++++++++++++++------- drivers/gpu/drm/nouveau/nouveau_connector.h | 3 +- 3 files changed, 119 insertions(+), 38 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +18 -7
@@ -1249,7 +1249,7 @@ nv50_mstc_destroy(struct drm_connector *connector)static const struct drm_connector_funcs nv50_mstc = { - .reset = nouveau_conn_reset, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = nv50_mstc_destroy, + .atomic_create_state = nouveau_conn_atomic_create_state, .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state, .atomic_destroy_state = nouveau_conn_atomic_destroy_state,
@@ -1263,4 +1263,5 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, {struct drm_device *dev = mstm->outp->base.base.dev; +struct drm_connector_state *conn_state;struct drm_crtc *crtc;struct nv50_mstc *mstc;
@@ -1274,13 +1275,16 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, ret =drm_connector_dynamic_init (dev, &mstc->connector, &nv50_mstc, DRM_MODE_CONNECTOR_DisplayPort,NULL ); -if (ret) { -kfree (*pmstc); - *pmstc =NULL ; -return ret; - } +if (ret) + goto err_free;drm_connector_helper_add (&mstc->connector, &nv50_mstc_help); - mstc->connector.funcs->reset (&mstc->connector); + conn_state = mstc->connector.funcs->atomic_create_state (&mstc->connector); +if (IS_ERR (conn_state)) { + ret =PTR_ERR (conn_state); + goto err_cleanup; + } + mstc->connector.state = conn_state; +nouveau_conn_attach_properties (&mstc->connector);
@@ -1298,4 +1302,11 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port,drm_dp_mst_get_port_malloc (port);return 0 ; + +err_cleanup: +drm_connector_cleanup (&mstc->connector); +err_free: +kfree (*pmstc); + *pmstc =NULL ; +return ret; }
drivers/gpu/drm/nouveau/nouveau_connector.c +99 -30
168 lines not on this page · raw message
drivers/gpu/drm/nouveau/nouveau_connector.h +2 -1
@@ -217,5 +217,6 @@ extern int nouveau_hdmimhz;void nouveau_conn_attach_properties (struct drm_connector *); -void nouveau_conn_reset (struct drm_connector *); +struct drm_connector_state * +nouveau_conn_atomic_create_state (struct drm_connector *);struct drm_connector_state *nouveau_conn_atomic_duplicate_state (struct drm_connector *);
Signature · 1 line
2.55.0
Thomas Zimmermann
maintainerRe: [PATCH v3 34/37] drm/nouveau: Convert to atomic_create_state
Hi
Am 30.10.26 um 16:14 schrieb Maxime Ripard:
[...]
drivers/gpu/drm/nouveau/nouveau_connector.c nouveau_conn_reset(struct drm_connector *connector) · line 274
Quoted 7 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +7
-0+struct drm_connector_state * +nouveau_conn_atomic_create_state (struct drm_connector *connector) +{ +struct nouveau_conn_atom *asyc; + + asyc =kzalloc_obj (*asyc); +if (WARN_ON (!asyc))
Since you're here anyway, please use drm_WARN_ON_ONCE(). Plain WARN_ON() doesn't seem a good fir here.
Best regards
Thomas
Quoted 152 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +89
-12+return ERR_PTR (-ENOMEM ); + +__drm_atomic_helper_connector_state_init (&asyc->state, connector); +nouveau_conn_atom_init (connector, asyc); + +return &asyc->state; +} +void nouveau_conn_attach_properties (struct drm_connector *connector)@@ -1231,5 +1231,47 @@ static const struct drm_connector_funcs nouveau_connector_funcs = { .dpms = drm_helper_connector_dpms, - .reset = nouveau_conn_reset, + .detect = nouveau_connector_detect, + .force = nouveau_connector_force, + .fill_modes = drm_helper_probe_single_connector_modes, + .set_property = nouveau_connector_set_property, + .destroy = nouveau_connector_destroy, + .atomic_create_state = nouveau_conn_atomic_create_state, + .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state, + .atomic_destroy_state = nouveau_conn_atomic_destroy_state, + .atomic_set_property = nouveau_conn_atomic_set_property, + .atomic_get_property = nouveau_conn_atomic_get_property, + .late_register = nouveau_connector_late_register, + .early_unregister = nouveau_connector_early_unregister, +}; + +static const struct drm_connector_funcs +nouveau_connector_funcs_lvds = { + .dpms = drm_helper_connector_dpms, + .detect = nouveau_connector_detect_lvds, + .force = nouveau_connector_force, + .fill_modes = drm_helper_probe_single_connector_modes, + .set_property = nouveau_connector_set_property, + .destroy = nouveau_connector_destroy, + .atomic_create_state = nouveau_conn_atomic_create_state, + .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state, + .atomic_destroy_state = nouveau_conn_atomic_destroy_state, + .atomic_set_property = nouveau_conn_atomic_set_property, + .atomic_get_property = nouveau_conn_atomic_get_property, + .late_register = nouveau_connector_late_register, + .early_unregister = nouveau_connector_early_unregister, +}; + +/* +* Pre-nv50 doesn't support atomic modesetting: the connector property state +* lives in the embedded struct nouveau_connector.properties_state and +* drm_connector.state is left alone, as expected from a legacy driver. +* +* Those connectors must not expose atomic_create_state: the DRM core would +* then install the embedded state into drm_connector.state and eventually +* pass it to atomic_destroy_state, which frees it. +*/ +static const struct drm_connector_funcs +nouveau_connector_funcs_legacy = { + .dpms = drm_helper_connector_dpms, .detect = nouveau_connector_detect, .force = nouveau_connector_force,@@ -1246,7 +1288,6 @@ nouveau_connector_funcs = {static const struct drm_connector_funcs -nouveau_connector_funcs_lvds = { +nouveau_connector_funcs_lvds_legacy = { .dpms = drm_helper_connector_dpms, - .reset = nouveau_conn_reset, .detect = nouveau_connector_detect_lvds, .force = nouveau_connector_force,@@ -1362,5 +1403,7 @@ nouveau_connector_create(struct drm_device *dev, int index)struct nouveau_display *disp =nouveau_display (dev);struct nouveau_connector *nv_connector =NULL ; +struct drm_connector_state *conn_state;struct drm_connector *connector; +const struct drm_connector_funcs *funcs;struct drm_connector_list_iter conn_iter;int type, ret =0 ;@@ -1459,8 +1502,17 @@ nouveau_connector_create(struct drm_device *dev, int index) type =drm_conntype_from_dcb (nv_connector->type); -if (type ==DRM_MODE_CONNECTOR_LVDS ) -drm_connector_init (dev, connector, &nouveau_connector_funcs_lvds, type); -else -drm_connector_init (dev, connector, &nouveau_connector_funcs, type); +if (type ==DRM_MODE_CONNECTOR_LVDS ) { +if (drm_drv_uses_atomic_modeset (dev)) + funcs = &nouveau_connector_funcs_lvds; +else + funcs = &nouveau_connector_funcs_lvds_legacy; + }else { +if (drm_drv_uses_atomic_modeset (dev)) + funcs = &nouveau_connector_funcs; +else + funcs = &nouveau_connector_funcs_legacy; + } + +drm_connector_init (dev, connector, funcs, type);switch (type) {@@ -1514,13 +1566,26 @@ nouveau_connector_create(struct drm_device *dev, int index) nouveau_connector_irq,NVIF_CONN_EVENT_V0_IRQ , &nv_connector->irq); -if (ret) { -nvif_event_dtor (&nv_connector->hpd); -nvif_conn_dtor (&nv_connector->conn); +if (ret) goto drm_conn_err; - } } } - connector->funcs->reset (connector); +if (drm_drv_uses_atomic_modeset (dev)) { + conn_state = connector->funcs->atomic_create_state (connector); +if (IS_ERR (conn_state)) { + ret =PTR_ERR (conn_state); + goto drm_conn_err; + } + connector->state = conn_state; + }else { +/* Pre-nv50 keeps its property state embedded in struct +* nouveau_connector: drm_connector.state must remain NULL, +* the DRM core expects legacy drivers to use +* drm_connector.encoder. +*/ +nouveau_conn_atom_init (connector, + &nv_connector->properties_state); + } +nouveau_conn_attach_properties (connector);@@ -1567,4 +1632,8 @@ nouveau_connector_create(struct drm_device *dev, int index) drm_conn_err: +nvif_event_dtor (&nv_connector->irq); +nvif_event_dtor (&nv_connector->hpd); +cancel_work_sync (&nv_connector->irq_work); +nvif_conn_dtor (&nv_connector->conn);drm_connector_cleanup (connector);kfree (nv_connector);drivers/gpu/drm/nouveau/nouveau_connector.h +2
-1@@ -217,5 +217,6 @@ extern int nouveau_hdmimhz;void nouveau_conn_attach_properties (struct drm_connector *); -void nouveau_conn_reset (struct drm_connector *); +struct drm_connector_state * +nouveau_conn_atomic_create_state (struct drm_connector *);struct drm_connector_state *nouveau_conn_atomic_duplicate_state (struct drm_connector *);
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
Thomas Zimmermann
maintainerRe: [PATCH v3 34/37] drm/nouveau: Convert to atomic_create_state
In reply to Maxime RipardHi
Am 30.10.26 um 16:14 schrieb Maxime Ripard:
[...]
drivers/gpu/drm/nouveau/nouveau_connector.c nouveau_conn_reset(struct drm_connector *connector) · line 274
Quoted 7 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +7
-0+struct drm_connector_state * +nouveau_conn_atomic_create_state (struct drm_connector *connector) +{ +struct nouveau_conn_atom *asyc; + + asyc =kzalloc_obj (*asyc); +if (WARN_ON (!asyc))
Since you're here anyway, please use drm_WARN_ON_ONCE(). Plain WARN_ON() doesn't seem a good fit here.
Best regards
Thomas
Quoted 152 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +89
-12+return ERR_PTR (-ENOMEM ); + +__drm_atomic_helper_connector_state_init (&asyc->state, connector); +nouveau_conn_atom_init (connector, asyc); + +return &asyc->state; +} +void nouveau_conn_attach_properties (struct drm_connector *connector)@@ -1231,5 +1231,47 @@ static const struct drm_connector_funcs nouveau_connector_funcs = { .dpms = drm_helper_connector_dpms, - .reset = nouveau_conn_reset, + .detect = nouveau_connector_detect, + .force = nouveau_connector_force, + .fill_modes = drm_helper_probe_single_connector_modes, + .set_property = nouveau_connector_set_property, + .destroy = nouveau_connector_destroy, + .atomic_create_state = nouveau_conn_atomic_create_state, + .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state, + .atomic_destroy_state = nouveau_conn_atomic_destroy_state, + .atomic_set_property = nouveau_conn_atomic_set_property, + .atomic_get_property = nouveau_conn_atomic_get_property, + .late_register = nouveau_connector_late_register, + .early_unregister = nouveau_connector_early_unregister, +}; + +static const struct drm_connector_funcs +nouveau_connector_funcs_lvds = { + .dpms = drm_helper_connector_dpms, + .detect = nouveau_connector_detect_lvds, + .force = nouveau_connector_force, + .fill_modes = drm_helper_probe_single_connector_modes, + .set_property = nouveau_connector_set_property, + .destroy = nouveau_connector_destroy, + .atomic_create_state = nouveau_conn_atomic_create_state, + .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state, + .atomic_destroy_state = nouveau_conn_atomic_destroy_state, + .atomic_set_property = nouveau_conn_atomic_set_property, + .atomic_get_property = nouveau_conn_atomic_get_property, + .late_register = nouveau_connector_late_register, + .early_unregister = nouveau_connector_early_unregister, +}; + +/* +* Pre-nv50 doesn't support atomic modesetting: the connector property state +* lives in the embedded struct nouveau_connector.properties_state and +* drm_connector.state is left alone, as expected from a legacy driver. +* +* Those connectors must not expose atomic_create_state: the DRM core would +* then install the embedded state into drm_connector.state and eventually +* pass it to atomic_destroy_state, which frees it. +*/ +static const struct drm_connector_funcs +nouveau_connector_funcs_legacy = { + .dpms = drm_helper_connector_dpms, .detect = nouveau_connector_detect, .force = nouveau_connector_force,@@ -1246,7 +1288,6 @@ nouveau_connector_funcs = {static const struct drm_connector_funcs -nouveau_connector_funcs_lvds = { +nouveau_connector_funcs_lvds_legacy = { .dpms = drm_helper_connector_dpms, - .reset = nouveau_conn_reset, .detect = nouveau_connector_detect_lvds, .force = nouveau_connector_force,@@ -1362,5 +1403,7 @@ nouveau_connector_create(struct drm_device *dev, int index)struct nouveau_display *disp =nouveau_display (dev);struct nouveau_connector *nv_connector =NULL ; +struct drm_connector_state *conn_state;struct drm_connector *connector; +const struct drm_connector_funcs *funcs;struct drm_connector_list_iter conn_iter;int type, ret =0 ;@@ -1459,8 +1502,17 @@ nouveau_connector_create(struct drm_device *dev, int index) type =drm_conntype_from_dcb (nv_connector->type); -if (type ==DRM_MODE_CONNECTOR_LVDS ) -drm_connector_init (dev, connector, &nouveau_connector_funcs_lvds, type); -else -drm_connector_init (dev, connector, &nouveau_connector_funcs, type); +if (type ==DRM_MODE_CONNECTOR_LVDS ) { +if (drm_drv_uses_atomic_modeset (dev)) + funcs = &nouveau_connector_funcs_lvds; +else + funcs = &nouveau_connector_funcs_lvds_legacy; + }else { +if (drm_drv_uses_atomic_modeset (dev)) + funcs = &nouveau_connector_funcs; +else + funcs = &nouveau_connector_funcs_legacy; + } + +drm_connector_init (dev, connector, funcs, type);switch (type) {@@ -1514,13 +1566,26 @@ nouveau_connector_create(struct drm_device *dev, int index) nouveau_connector_irq,NVIF_CONN_EVENT_V0_IRQ , &nv_connector->irq); -if (ret) { -nvif_event_dtor (&nv_connector->hpd); -nvif_conn_dtor (&nv_connector->conn); +if (ret) goto drm_conn_err; - } } } - connector->funcs->reset (connector); +if (drm_drv_uses_atomic_modeset (dev)) { + conn_state = connector->funcs->atomic_create_state (connector); +if (IS_ERR (conn_state)) { + ret =PTR_ERR (conn_state); + goto drm_conn_err; + } + connector->state = conn_state; + }else { +/* Pre-nv50 keeps its property state embedded in struct +* nouveau_connector: drm_connector.state must remain NULL, +* the DRM core expects legacy drivers to use +* drm_connector.encoder. +*/ +nouveau_conn_atom_init (connector, + &nv_connector->properties_state); + } +nouveau_conn_attach_properties (connector);@@ -1567,4 +1632,8 @@ nouveau_connector_create(struct drm_device *dev, int index) drm_conn_err: +nvif_event_dtor (&nv_connector->irq); +nvif_event_dtor (&nv_connector->hpd); +cancel_work_sync (&nv_connector->irq_work); +nvif_conn_dtor (&nv_connector->conn);drm_connector_cleanup (connector);kfree (nv_connector);drivers/gpu/drm/nouveau/nouveau_connector.h +2
-1@@ -217,5 +217,6 @@ extern int nouveau_hdmimhz;void nouveau_conn_attach_properties (struct drm_connector *); -void nouveau_conn_reset (struct drm_connector *); +struct drm_connector_state * +nouveau_conn_atomic_create_state (struct drm_connector *);struct drm_connector_state *nouveau_conn_atomic_duplicate_state (struct drm_connector *);
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
Maxime Ripard
maintainerPATCH v3 35/37 drm/tegra: Convert to atomic_create_state
In reply to Maxime RipardThe tegra DSI and SOR connector reset implementations create custom state subclasses, but only initialize a pristine state without resetting any hardware. This is equivalent to what atomic_create_state expects. Convert to it.
---
Cc: Jonathan Hunter <[email protected]>
Cc: Mikko Perttunen <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
--- drivers/gpu/drm/tegra/dsi.c | 17 ++++++++--------- drivers/gpu/drm/tegra/sor.c | 13 +++++-------- 2 files changed, 13 insertions(+), 17 deletions(-)
drivers/gpu/drm/tegra/dsi.c +8 -9
@@ -786,17 +786,16 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi) } -static void tegra_dsi_connector_reset (struct drm_connector *connector) +static struct drm_connector_state * +tegra_dsi_connector_create_state (struct drm_connector *connector) { -struct tegra_dsi_state *state =kzalloc_obj (*state); +struct tegra_dsi_state *state; + state =kzalloc_obj (*state);if (!state) -return ; +return ERR_PTR (-ENOMEM ); -if (connector->state) { -__drm_atomic_helper_connector_destroy_state (connector->state); -kfree (connector->state); - } +__drm_atomic_helper_connector_state_init (&state->base, connector); -__drm_atomic_helper_connector_reset (connector, &state->base); +return &state->base; }
@@ -818,8 +817,8 @@ tegra_dsi_connector_duplicate_state(struct drm_connector *connector)static const struct drm_connector_funcs tegra_dsi_connector_funcs = { - .reset = tegra_dsi_connector_reset, .detect = tegra_output_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = tegra_output_connector_destroy, + .atomic_create_state = tegra_dsi_connector_create_state, .atomic_duplicate_state = tegra_dsi_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
drivers/gpu/drm/tegra/sor.c +5 -8
@@ -1721,5 +1721,5 @@ static void tegra_sor_early_unregister(struct drm_connector *connector) } -static void tegra_sor_connector_reset (struct drm_connector *connector) +static struct drm_connector_state *tegra_sor_connector_create_state (struct drm_connector *connector) {struct tegra_sor_state *state;
@@ -1727,12 +1727,9 @@ static void tegra_sor_connector_reset(struct drm_connector *connector) state =kzalloc_obj (*state);if (!state) -return ; +return ERR_PTR (-ENOMEM ); -if (connector->state) { -__drm_atomic_helper_connector_destroy_state (connector->state); -kfree (connector->state); - } +__drm_atomic_helper_connector_state_init (&state->base, connector); -__drm_atomic_helper_connector_reset (connector, &state->base); +return &state->base; }
@@ -1765,8 +1762,8 @@ tegra_sor_connector_duplicate_state(struct drm_connector *connector)static const struct drm_connector_funcs tegra_sor_connector_funcs = { - .reset = tegra_sor_connector_reset, .detect = tegra_sor_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = tegra_output_connector_destroy, + .atomic_create_state = tegra_sor_connector_create_state, .atomic_duplicate_state = tegra_sor_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 36/37 drm/connector: Remove __drm_atomic_helper_connector_reset()
In reply to Maxime RipardAll drivers implementing the connector reset hook using __drm_atomic_helper_connector_reset() have been converted to atomic_create_state.
Remove __drm_atomic_helper_connector_reset().
--- drivers/gpu/drm/drm_atomic_state_helper.c | 23 ----------------------- include/drm/drm_atomic_state_helper.h | 2 -- include/drm/drm_connector.h | 3 --- 3 files changed, 28 deletions(-)
drivers/gpu/drm/drm_atomic_state_helper.c +0 -23
@@ -413,27 +413,4 @@ __drm_atomic_helper_connector_state_init(struct drm_connector_state *conn_state,EXPORT_SYMBOL (__drm_atomic_helper_connector_state_init); -/** -* __drm_atomic_helper_connector_reset - reset state on connector -* @connector: drm connector -* @conn_state: connector state to assign -* -* Initializes the newly allocated @conn_state and assigns it to -* the &drm_connector->state pointer of @connector, usually required when -* initializing the drivers or when called from the &drm_connector_funcs.reset -* hook. -* -* This is useful for drivers that subclass the connector state. -*/ -void -__drm_atomic_helper_connector_reset (struct drm_connector *connector, -struct drm_connector_state *conn_state) -{ -if (conn_state) -__drm_atomic_helper_connector_state_init (conn_state, connector); - - connector->state = conn_state; -} -EXPORT_SYMBOL (__drm_atomic_helper_connector_reset); -/** * drm_atomic_helper_connector_create_state - default &drm_connector_funcs.atomic_create_state hook for connectors
include/drm/drm_atomic_state_helper.h +0 -2
@@ -67,6 +67,4 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,void __drm_atomic_helper_connector_state_init (struct drm_connector_state *conn_state,struct drm_connector *connector); -void __drm_atomic_helper_connector_reset (struct drm_connector *connector, -struct drm_connector_state *conn_state);struct drm_connector_state *drm_atomic_helper_connector_create_state (struct drm_connector *connector);
include/drm/drm_connector.h +0 -3
@@ -1665,7 +1665,4 @@ struct drm_connector_funcs {* called by the core directly, only through drm_mode_config_reset(). * It's not a helper hook only for historical reasons. -* -* Atomic drivers can use __drm_atomic_helper_connector_reset() to reset -* atomic state using this hook. */ void (*reset)(struct drm_connector *connector);
Signature · 1 line
2.55.0
Maxime Ripard
maintainerPATCH v3 37/37 drm/connector: Remove reset
In reply to Maxime RipardAll the drivers that used to implement the reset hook have been converted to use atomic_create_state instead.
Remove the reset hook from drm_connector_funcs, and the code calling it in drm_mode_config_reset(), drmm_connector_hdmi_init() and panel_bridge_attach().
--- drivers/gpu/drm/drm_connector.c | 8 -------- drivers/gpu/drm/drm_mode_config.c | 4 +--- drivers/gpu/drm/drm_panel.c | 2 -- include/drm/drm_connector.h | 9 --------- 4 files changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -8
@@ -663,8 +663,4 @@ int drmm_connector_hdmi_init(struct drm_device *dev, connector->state = state; - }else if (connector->funcs->reset) { - connector->funcs->reset (connector); -if (!connector->state) -return -ENOMEM ; }
@@ -771,8 +767,4 @@ int drmm_connector_hdmi_ini2(struct drm_device *dev, connector->state = state; - }else if (connector->funcs->reset) { - connector->funcs->reset (connector); -if (!connector->state) -return -ENOMEM ; }
drivers/gpu/drm/drm_mode_config.c +1 -3
@@ -316,7 +316,5 @@ void drm_mode_config_reset(struct drm_device *dev)drm_connector_list_iter_begin (dev, &conn_iter);drm_for_each_connector_iter (connector, &conn_iter) { -if (connector->funcs->reset) - connector->funcs->reset (connector); -else if (connector->funcs->atomic_create_state) +if (connector->funcs->atomic_create_state)drm_mode_config_connector_reset_with_create_state (connector); }
drivers/gpu/drm/drm_panel.c +0 -2
@@ -115,6 +115,4 @@ static int panel_bridge_attach(struct drm_bridge *bridge, connector->state = conn_state; - }else if (connector->funcs->reset) { - connector->funcs->reset (connector); }
include/drm/drm_connector.h +0 -9
@@ -1659,13 +1659,4 @@ struct drm_connector_funcs {int (*dpms)(struct drm_connector *connector,int mode); -/** -* @reset: -* -* Reset connector hardware and software state to off. This function isn't -* called by the core directly, only through drm_mode_config_reset(). -* It's not a helper hook only for historical reasons. -*/ -void (*reset)(struct drm_connector *connector); -/** * @detect:
Signature · 1 line
2.55.0
Hi Maxime
Am 30.10.26 um 16:13 schrieb Maxime Ripard:
Quoted 17 lines
This is a follow-up to the plane and CRTC reset removal series, and part of a larger effort to remove the reset hook from all KMS objects.
The connector reset hook is overloaded: it is called both at probe time to create the initial software state and during suspend/resume to reset hardware and software state. These two roles have different requirements, and the reset hook is not fallible, making error handling difficult for the initial state allocation path.
While reset has the semantics to reset both the software and hardware state, the vast majority of implementations and all the helpers only reset the software state, making them equivalent to
atomic_create_statein practice. Theatomic_create_statehook makes this explicit: it only allocates and initializes a pristine state without any side effect, and returns the state pointer or anERR_PTRon failure.
Quoted 7 lines
This series converts all connector drivers tree-wide from the reset hook to
atomic_create_state, then removes the reset hook from structdrm_connector_funcsentirely. The conversions were done using a combination of Coccinelle semantic patches, mechanical one-line replacements and manual adjustments.Signed-off-by Maxime Ripard <[email protected]>
for the entire series.
Best regards
Thomas
Quoted 120 lines
---
Changes in v3:
- Fix error path in dw-hdmi
- Fix test error path for amdgpu kunit tests
- Fix nouveau legacy path
- Link to v2: https://lore.kernel.org/r/20261022-drm-no-more-connector-reset-v2-0-0b7e4e85b1e8@kernel.orgChanges in v2:
- Change the parameter order of__drm_atomic_helper_connector_hdmi_state_init
- Fixed state argument casing fordrm_atomic_helper_connector_tv_margins_state_initanddrm_atomic_helper_connector_tv_state_init
- Putatomic_create_statebeforeatomic_duplicate_state
- Fix state allocation for MST and WB connectors
- Link to v1:https://lore.kernel.org/r/20261014-drm-no-more-connector-reset-v1-0-586c9c026823@kernel.org---
Maxime Ripard (37):
drm/amdgpu: vkms: Switch todrm_atomic_helper_connector_create_statedrm/bridge: analogix-anx6345: Switch todrm_atomic_helper_connector_create_statedrm/bridge: analogix-anx78xx: Switch todrm_atomic_helper_connector_create_statedrm/bridge: chrontel-ch7033: Switch todrm_atomic_helper_connector_create_statedrm/bridge: nxp-ptn3460: Switch todrm_atomic_helper_connector_create_statedrm/panel: Switch todrm_atomic_helper_connector_create_statedrm/bridge: synopsys: dw-hdmi: Switch todrm_atomic_helper_connector_create_statedrm/bridge: tc358767: Switch todrm_atomic_helper_connector_create_statedrm/bridge: tda998x: Switch todrm_atomic_helper_connector_create_statedrm/bridge: ti-tfp410: Switch todrm_atomic_helper_connector_create_statedrm/exynos: Switch todrm_atomic_helper_connector_create_statedrm/fsl-dcu: Switch todrm_atomic_helper_connector_create_statedrm/loongson: Switch todrm_atomic_helper_connector_create_statedrm/mipi-dbi: Switch todrm_atomic_helper_connector_create_statedrm/renesas: shmobile: Switch todrm_atomic_helper_connector_create_statedrm/sitronix: st7571: Switch todrm_atomic_helper_connector_create_statedrm/sti: Switch todrm_atomic_helper_connector_create_statedrm/sun4i: Switch todrm_atomic_helper_connector_create_statedrm/tegra: Switch todrm_atomic_helper_connector_create_statedrm/tests: Switch todrm_atomic_helper_connector_create_statedrm/tiny: arcpgu: Switch todrm_atomic_helper_connector_create_statedrm/tiny: sharp: Switch todrm_atomic_helper_connector_create_statedrm/virtio: Switch todrm_atomic_helper_connector_create_statedrm/vkms: Switch todrm_atomic_helper_connector_create_statedrm/xen: Switch todrm_atomic_helper_connector_create_statedrm/bridge: synopsys: dw-hdmi: Convert toatomic_create_statedrm/meson: Convert toatomic_create_state
drm/sun4i: hdmi: Convert toatomic_create_state
drm/sun4i: tv: Convert toatomic_create_state
drm/tests: hdmi: Convert toatomic_create_state
drm/connector: Removedrm_atomic_helper_connector_reset()drm/amdgpu: dm: Convert toatomic_create_state
drm/i915: Convert toatomic_create_state
drm/nouveau: Convert toatomic_create_state
drm/tegra: Convert toatomic_create_state
drm/connector: Remove__drm_atomic_helper_connector_reset()drm/connector: Remove resetdrivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_connector.c | 32 ++--- .../amd/display/amdgpu_dm/amdgpu_dm_connector.h | 3 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 17 ++- .../amdgpu_dm/tests/amdgpu_dm_connector_test.c | 102 +++++++++++----- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 +- drivers/gpu/drm/bridge/chrontel-ch7033.c | 2 +- drivers/gpu/drm/bridge/nxp-ptn3460.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 14 ++- drivers/gpu/drm/bridge/tc358767.c | 2 +- drivers/gpu/drm/bridge/tda998x_drv.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +- drivers/gpu/drm/drm_atomic_state_helper.c | 43 ------- drivers/gpu/drm/drm_connector.c | 8 -- drivers/gpu/drm/drm_mode_config.c | 4 +- drivers/gpu/drm/drm_panel.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 2 +- drivers/gpu/drm/i915/display/intel_connector.c | 6 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 6 +- drivers/gpu/drm/loongson/lsdc_output_7a1000.c | 2 +- drivers/gpu/drm/loongson/lsdc_output_7a2000.c | 4 +- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 12 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 25 ++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 129 ++++++++++++++++----- drivers/gpu/drm/nouveau/nouveau_connector.h | 3 +- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/sitronix/st7571.c | 2 +- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sti/sti_hda.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 16 ++- drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun4i_tv.c | 16 ++- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- drivers/gpu/drm/tegra/dsi.c | 17 ++- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 13 +-- drivers/gpu/drm/tests/drm_atomic_commit_test.c | 2 +- drivers/gpu/drm/tests/drm_atomic_test.c | 2 +- drivers/gpu/drm/tests/drm_connector_test.c | 4 +- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 16 ++- drivers/gpu/drm/tests/drm_probe_helper_test.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/tiny/sharp-memory.c | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/vkms/vkms_connector.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_conn.c | 2 +- include/drm/drm_atomic_state_helper.h | 3 - include/drm/drm_connector.h | 12 -- include/drm/drm_mipi_dbi.h | 2 +- 58 files changed, 351 insertions(+), 236 deletions(-)---
base-commit:91f52e99824b0beebb48cad51bbda81437af8664
change-id: 20260709-drm-no-more-connector-reset-45ee14d7c62cBest regards,
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
Quoted 17 lines · Maxime Ripard
This is a follow-up to the plane and CRTC reset removal series, and part of a larger effort to remove the reset hook from all KMS objects.
The connector reset hook is overloaded: it is called both at probe time to create the initial software state and during suspend/resume to reset hardware and software state. These two roles have different requirements, and the reset hook is not fallible, making error handling difficult for the initial state allocation path.
While reset has the semantics to reset both the software and hardware state, the vast majority of implementations and all the helpers only reset the software state, making them equivalent to
atomic_create_statein practice. Theatomic_create_statehook makes this explicit: it only allocates and initializes a pristine state without any side effect, and returns the state pointer or anERR_PTRon failure.
Quoted 7 lines
This series converts all connector drivers tree-wide from the reset hook to
atomic_create_state, then removes the reset hook from structdrm_connector_funcsentirely. The conversions were done using a combination of Coccinelle semantic patches, mechanical one-line replacements and manual adjustments.Signed-off-by Maxime Ripard <[email protected]>
Applied to drm-misc-next
Maxime