summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/rockchip
AgeCommit message (Collapse)Author
2026-10-16drm/rockchip: rk3066_hdmi: Advertise HDMI 1.4 capabilitiesCristian Ciocaltea
Bridges using DRM_BRIDGE_OP_HDMI are now expected to also provide a supported HDMI version. This is not yet enforced, but will become mandatory once the migration to the new caps-based HDMI connector initialization API is completed. The RK3066 HDMI TX supports HDMI 1.4a, as described in commit f84d3d37b7fb ("drm: rockchip: introduce rk3066 hdmi"). However, the driver does not currently enforce a maximum TMDS character rate, it only filters non-CEA modes and excludes VIC 1 (640x480) via the .mode_valid callback. Advertise HDMI 1.4 support for now so that modes exceeding the 340 MHz TMDS limit are rejected by the core. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Tested-by: Robin Räber <robin.raebi@gmail.com> Link: https://patch.msgid.link/20261001-bridge-advert-hdmi-caps-v1-7-f8806570e243@collabora.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2026-10-16drm/rockchip: rk3066_hdmi: Convert to devm_drm_bridge_alloc() APICristian Ciocaltea
Bridge drivers are expected to use devm_drm_bridge_alloc() instead of devm_kzalloc() for allocating and partially initializing a private driver struct embedding a struct drm_bridge. Perform the API conversion and drop the now redundant manual initialization of the drm_bridge funcs pointer, following the pattern established by commit 9c399719cfb9 ("drm: convert many bridge drivers from devm_kzalloc() to devm_drm_bridge_alloc() API"). Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patch.msgid.link/20261001-bridge-alloc-conv-v1-1-f0a1fe040a86@collabora.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2026-10-12drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reportsCristian Ciocaltea
Notify only the affected connector instead of polling all of them, and ensure .detect_ctx() runs on reconnect to recover SCDC state. Tested-by: Maud Spierings <maud_spierings@hotmail.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-15-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Control the HPD IRQ line via the bridge HPD opsCristian Ciocaltea
The HPD interrupt must not be delivered before the DRM connector is fully set up, and it should be quiesced while the display pipeline is suspended. On top of that, the threaded handler re-arms HPD unconditionally after the hotplug debounce, which must not override an explicit disable requested by the DRM core. Request the HPD IRQ in bind() with IRQF_NO_AUTOEN so it stays disabled until the core arms it, and drive enable_irq()/disable_irq() from the phy ops invoked by the bridge through its hpd_{enable,disable}() callbacks. This ensures the line is only armed after the connector is ready. disable_irq() additionally waits for the threaded handler to finish, so its GRF re-arm can no longer race with and override a core-requested disable. Masking the line is not enough on its own, though: the threaded handler merely queues hpd_work with a 150 ms debounce, so an event taken shortly before the disable would still probe the connector and read the EDID long after the core considers HPD quiesced. Since disable_irq() has drained the threaded handler, which is the only site arming the work, it can no longer be requeued and dropping it is race-free. Use the non-syncing cancel_delayed_work() for that: waiting on a running callback would pull mode_config.mutex, taken by the work through drm_connector_helper_hpd_irq_event(), under the hpd_state_mutex held by drm_bridge_hpd_disable(). That inverts the order of the connector probe path, which holds mode_config.mutex while reaching hpd_state_mutex via drm_kms_helper_poll_enable(). A callback already in progress is drained by the system-sleep and unbind paths instead. Note that IRQF_NO_AUTOEN is incompatible with IRQF_SHARED; the latter is dropped as this IRQ has no other users. Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-14-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Factor out HPD interrupt (un)mask helpersCristian Ciocaltea
Extract the GRF-level HPD interrupt mask/unmask register writes into dedicated dw_hdmi_qp_rk35{88,76}_{mask,unmask}_hpd() helpers, and use them from the .enable_hpd()/.disable_hpd() phy ops as well as the hardirq, threaded re-arm and io_init() paths. This is a preparatory refactor that separates the SoC-level HPD mask from the phy op entry points, so a subsequent change can gate the platform HPD IRQ line without affecting the debounce paths. Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-13-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Implement .{enable,disable}_hpd() PHY opsCristian Ciocaltea
Implement .enable_hpd() and .disable_hpd() phy ops for RK3576 and RK3588 SoCs, used by the corresponding bridge callbacks for HPD activation control. Consolidate the interrupt clear-and-unmask sequence into enable_hpd() and the mask-only operation into disable_hpd(), replacing the open-coded register writes in the interrupt handlers and io_init(). The .setup_hpd() phy op, which was previously called from dw_hdmi_qp_init_hw(), is no longer needed and its users are removed. Tested-by: Maud Spierings <maud_spierings@hotmail.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-12-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_initCristian Ciocaltea
Start with HPD masked, matching RK3588, so the bridge framework controls when interrupts are armed via hpd_enable(). Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Maud Spierings <maud_spierings@hotmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-11-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Avoid spurious HPD IRQ thread wakeupsCristian Ciocaltea
The RK3576 and RK3588 HPD hardirq handlers read shared status registers and currently wake the threaded handler whenever any bit in those registers is set. This can wake the HDMI IRQ thread for unrelated status bits, and on RK3588 can also wake the thread for the other HDMI port. Mask the status value with the SoC-specific HPD interrupt bit before deciding whether to wake the threaded handler. On RK3588, select the HDMI0 or HDMI1 HPD bit according to the instance port id. No stable backport is needed. The issue may only cause spurious IRQ thread wakeups and does not cause functional breakage. Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260702151346.5A4EC1F000E9@smtp.kernel.org/ Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://lore.kernel.org/all/20260702151346.5A4EC1F000E9@smtp.kernel.org/ Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-10-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind()Cristian Ciocaltea
Replace indirect struct device accesses via hdmi->dev and pdev->dev with the local dev parameter already available in dw_hdmi_qp_rockchip_bind(), for consistency and readability. Tested-by: Maud Spierings <maud_spierings@hotmail.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-9-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messagesCristian Ciocaltea
Add the missing trailing newlines to a couple of dev_err_probe() calls in dw_hdmi_qp_rockchip_bind(). Fixes: b6736a4ea3fa ("drm/rockchip: dw_hdmi_qp: Improve error handling with dev_err_probe()") Fixes: e1f7b7cbd74c ("drm/rockchip: dw_hdmi_qp: Switch to drmm_encoder_init()") Tested-by: Maud Spierings <maud_spierings@hotmail.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> # NanoPC-T6 LTS, Rock 5B Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-8-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Cancel pending HPD work on suspendCristian Ciocaltea
The HPD threaded handler debounces hotplug events by delaying hdmi->hpd_work for 150 ms. Nothing discards that work when the system goes to sleep: drm_kms_helper_poll_disable() only disables the HPD IRQ line via the bridge .hpd_disable() op, and disable_irq() merely waits for the threaded handler, which has already returned after arming the timer. If the debounce expires during suspend, its non-freezable work may probe the connector and read the EDID over DDC. Since genpd powers off the HDMI controller's power domain in ->suspend_noirq(), this access may hit unpowered hardware and hang the system. Cancel the work in the suspend callback. The DRM device is registered as a consumer of the HDMI device, so it always suspends first and the HPD IRQ is already disabled by that point, meaning nothing can re-arm the work behind our back. No counterpart is needed on resume, as the work gets scheduled again on the next hotplug interrupt. Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260723015909.7F79A1F000E9@smtp.kernel.org/ Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-7-195157ba0b40@collabora.com
2026-10-12drm/rockchip: dw_hdmi_qp: Fix invalid drvdata access in PM opsCristian Ciocaltea
The system-sleep PM callbacks fetch the driver state via dev_get_drvdata() and dereference it unconditionally. However, the platform device is bound by ->probe(), which merely registers a component, hence the callbacks may well run when no valid state is available: - Before the aggregate driver calls ->bind(), e.g. when the system suspends while probing is still deferred waiting for the VOP, dev_get_drvdata() returns NULL. - After ->unbind(), or when ->bind() fails past platform_set_drvdata(), drvdata is left pointing to memory obtained via drmm_kzalloc(), which is released together with the DRM device, while this platform device remains bound and PM-capable. Publish the driver data only after ->bind() completes successfully, and clear it in ->unbind(). This ensures that a non-NULL drvdata always represents live state, allowing each PM callback to rely on a single NULL check. Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260702151550.8E14D1F000E9@smtp.kernel.org/ Closes: https://lore.kernel.org/all/20260723014811.1F9F01F000E9@smtp.kernel.org/ Tested-by: Robin Räber <robin.raebi@gmail.com> Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20261005-dw-hdmi-qp-scramb-v12-6-195157ba0b40@collabora.com
2026-10-01drm/fbdev: Move fbdev helpers into client libraryThomas Zimmermann
DRM's fbdev helpers are for the fbdev-emulation clients. Move them into the client-library module. Fix include statements throughout DRM drivers. While at it, rename the files from drm_fb_helper to drm_fbdev_helper. The old name was too reminiscent of DRM's framebuffer code. The GEM support code for fbdev remains part of DRM's memory managers. v4: - fix the depedendencies from v3 v3: - remove obsolete dependencies from Kconfig v2: - update armada und docs Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patch.msgid.link/20260928080323.23909-3-tzimmermann@suse.de
2026-09-28drm/bridge: analogix_dp: don't create a panel_bridgeLuca Ceresoli
Now a panel_bridge is automatically created for every drm_panel and the panel-bridge API is just a deprecated wrapper to access it. Update and simplify the code by just getting a reference to the already-existing bridge using of_drm_get_bridge_by_endpoint(). As of_drm_get_bridge_by_endpoint() returns a refcounted bridge, take care of putting the bridge reference. This is not easily done in the remove path due to the different probe paths of the user drivers, so add a devm action to ensure the reference is put only when it was taken. Assisted-by: opencode:deepseek-v4-flash-0731 Tested-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Damon Ding <damon.ding@rock-chips.com> Link: https://patch.msgid.link/20260916-drm-bridge-every-panel-v3-19-83afb4f1a707@bootlin.com [Luca: remove now unused variable] Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2026-09-28drm: of: move drm_of_find_panel_or_bridge() from drm_of.c to drm_panel.cLuca Ceresoli
We want to move drm_panel.o from the main drm module to a new drm_panel module, but there is one function in the drm module that calls into drm_panel.c code: drm_of_find_panel_or_bridge() (drm_of.c, drm module) -> calls of_drm_find_panel (drm_panel.c, future drm_panel module) Avoid this issue by moving drm_of_find_panel_or_bridge() to drm_panel.c. Update Kconfig symbols of drivers calling drm_of_find_panel_or_bridge() to select DRM_PANEL when this is not done already. No functional changes, just moving code around. Suggested-by: Maxime Ripard <mripard@kernel.org> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260916-drm-bridge-every-panel-v3-1-83afb4f1a707@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2026-09-22Backmerge tag 'v7.3-rc4' into drm-nextDave Airlie
Linux 7.3-rc4 Requested by Philipp Stanner for 2ab510e63197360945f915dd5631a77c63ac6b27 would be needed as a groundlayer for further patches that extend the locking in drm_sched Signed-off-by: Dave Airlie <airlied@redhat.com>
2026-09-15drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY typesChaoyi Chen
Currently, there are generally two types of DPHY for Rockchip. One is the DPHY used by RK3288/RK3399, whose timing is described by Table A-3 High-Speed Transition Times in the databook. The other is the DPHY used by PX30 and its successors. If its timing is still described using RK3288/RK3399, it may not perform correctly on some DSI panel. Add dphy_get_timing for different D-PHY types to adapt to timing differences. The configuration details are as follows: - RK3288/RK3399: Select the corresponding entry from the timing table based on the data rate. - PX30 and later platforms: Use a fixed timing configuration. Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260914013331.108-3-kernel@airkyi.com
2026-09-15drm/rockchip: dsi: Add maximum per lane bit rate calculationChaoyi Chen
Different chips have varying support for the maximum bit rate per lane. Add calculation for the maximum per lane bit rate for various chip platforms. Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260914013331.108-2-kernel@airkyi.com
2026-09-15drm/rockchip: Convert to atomic_create_stateMaxime Ripard
The plane only initializes a pristine state in its reset hook using drm_atomic_helper_plane_reset(), which is equivalent to what atomic_create_state expects. Convert to it. The conversion was done using the following Coccinelle semantic patch: @@ identifier funcs; symbol drm_atomic_helper_plane_reset; symbol drm_atomic_helper_plane_create_state; @@ struct drm_plane_funcs funcs = { ..., - .reset = drm_atomic_helper_plane_reset, + .atomic_create_state = drm_atomic_helper_plane_create_state, ..., }; @match_struct_reset@ identifier funcs, reset_func; @@ struct drm_plane_funcs funcs = { ..., .reset = reset_func, ..., }; @reset_uses_helpers depends on match_struct_reset@ identifier match_struct_reset.reset_func; @@ void reset_func(...) { <+... ( __drm_atomic_helper_plane_reset(...); | __drm_gem_reset_shadow_plane(...); ) ...+> } @match_struct_destroy@ identifier funcs, destroy_func; @@ struct drm_plane_funcs funcs = { ..., .atomic_destroy_state = destroy_func, ..., }; @script:python renamed_func@ old_name << match_struct_reset.reset_func; new_name; @@ if old_name.endswith("_reset"): coccinelle.new_name = old_name.replace("_reset", "_create_state") else: coccinelle.new_name = old_name @update_struct depends on match_struct_reset && reset_uses_helpers@ identifier match_struct_reset.funcs, match_struct_reset.reset_func; identifier renamed_func.new_name; @@ struct drm_plane_funcs funcs = { ..., - .reset = reset_func, + .atomic_create_state = new_name, ..., }; @drop_destroy depends on update_struct && match_struct_destroy@ identifier match_struct_reset.reset_func; identifier match_struct_destroy.destroy_func; identifier container_func; identifier P; symbol drm_atomic_helper_plane_destroy_state; symbol __drm_atomic_helper_plane_destroy_state; @@ void reset_func(struct drm_plane *P) { ... ( - if (P->state) { - <+... ( - drm_atomic_helper_plane_destroy_state(P, P->state); | - __drm_atomic_helper_plane_destroy_state(P->state); | - P->funcs->atomic_destroy_state(P, P->state); | - destroy_func(P, P->state); ) - ...+> - } | - drm_WARN_ON_ONCE(P->dev, P->state); | - WARN_ON(P->state); ) ... ( - kfree(P->state); | - kfree(container_func(P->state)); | // kfree is optional ) ( - P->state = NULL; | // plane->state clearing is optional ) ... } @drop_destroy_mtk depends on update_struct@ identifier P; symbol __drm_atomic_helper_plane_destroy_state; symbol to_mtk_plane_state; @@ void mtk_plane_reset(struct drm_plane *P) { ... - if (P->state) { - __drm_atomic_helper_plane_destroy_state(P->state); - ... - } else { ... - } ... } @transform_nv50_wndw depends on update_struct@ identifier S; @@ void nv50_wndw_reset(...) { ... - if (WARN_ON(!(S = kzalloc_obj(*S)))) + S = kzalloc_obj(*S); + if (WARN_ON(!S)) return; ... } @transform_kzalloc depends on update_struct@ identifier match_struct_reset.reset_func; identifier P, S; statement ST; statement list STL; @@ void reset_func(struct drm_plane *P) { <... S = kzalloc_obj(*S); ( - if (S) - { - STL - } + if (!S) return; + + STL | - if (S) ST + if (!S) return; + + ST ) ...> } @transform_body depends on update_struct@ identifier match_struct_reset.reset_func; identifier renamed_func.new_name; identifier S, P; expression PS; @@ - void reset_func(struct drm_plane *P) + struct drm_plane_state *new_name(struct drm_plane *P) { ... S = kzalloc_obj(*S); ... ( if (!S) { ... - return; + return ERR_PTR(-ENOMEM); } | if (WARN_ON(!S)) { ... - return; + return ERR_PTR(-ENOMEM); } | if (S == NULL) { ... - return; + return ERR_PTR(-ENOMEM); } ) ... ( - __drm_atomic_helper_plane_reset(P, PS); + __drm_atomic_helper_plane_state_init(PS, P); | - __drm_gem_reset_shadow_plane(P, PS); + __drm_gem_shadow_plane_state_init(P, PS); ) ... } @update_early_return depends on update_struct@ identifier match_struct_reset.reset_func; identifier renamed_func.new_name; identifier P; expression PS; @@ struct drm_plane_state *new_name(struct drm_plane *P) { <+... - return; + return ERR_PTR(-EINVAL); ...+> } @update_return_plane depends on update_struct@ identifier match_struct_reset.reset_func; identifier renamed_func.new_name; identifier P; expression PS; @@ struct drm_plane_state *new_name(struct drm_plane *P) { ... __drm_atomic_helper_plane_state_init(PS, P); ... + + return PS; } @update_return_shadow depends on update_struct@ identifier renamed_func.new_name; identifier P; expression PS; @@ struct drm_plane_state *new_name(struct drm_plane *P) { ... __drm_gem_shadow_plane_state_init(P, PS); ... + + return &PS->base; } Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260908-drm-no-more-plane-reset-v4-15-a31b3fcfc989@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-09-03drm/rockchip: rk3066_hdmi: Add missing Kconfig selectsIgor Paunovic
rk3066_hdmi.c calls drm_bridge_connector_init(), but ROCKCHIP_RK3066_HDMI selects neither DRM_BRIDGE_CONNECTOR nor DRM_DISPLAY_HELPER, whose module carries the bridge-connector code. A configuration with ROCKCHIP_RK3066_HDMI as the only enabled Rockchip output option fails to link: aarch64-linux-gnu-ld: drivers/gpu/drm/rockchip/rk3066_hdmi.o: in function `rk3066_hdmi_bind': rk3066_hdmi.c:(.text+0x7a4): undefined reference to `drm_bridge_connector_init' aarch64-linux-gnu-ld: drivers/gpu/drm/rockchip/rk3066_hdmi.o: in function `rk3066_hdmi_bridge_atomic_enable': rk3066_hdmi.c:(.text+0xe74): undefined reference to `drm_atomic_helper_connector_hdmi_update_infoframes' Select both, like ROCKCHIP_CDN_DP, ROCKCHIP_LVDS and ROCKCHIP_RGB do. DRM_BRIDGE_CONNECTOR in turn selects DRM_DISPLAY_HDMI_STATE_HELPER, which resolves the second symbol. Fixes: 57d6811e8a6d ("drm/rockchip: rk3066_hdmi: switch to drm bridge") Signed-off-by: Igor Paunovic <royalnet026@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260813144019.12089-3-royalnet026@gmail.com
2026-09-03drm/rockchip: dw_dp: Select DRM_BRIDGE_CONNECTORIgor Paunovic
dw_dp-rockchip.c calls drm_bridge_connector_init(), but ROCKCHIP_DW_DP does not select DRM_BRIDGE_CONNECTOR. A configuration with ROCKCHIP_DW_DP as the only enabled Rockchip output option fails to link: aarch64-linux-gnu-ld: drivers/gpu/drm/rockchip/dw_dp-rockchip.o: in function `dw_dp_rockchip_bind': dw_dp-rockchip.c:(.text+0x1d4): undefined reference to `drm_bridge_connector_init' Five other Rockchip encoder options that call drm_bridge_connector_init() (ROCKCHIP_ANALOGIX_DP, ROCKCHIP_CDN_DP, ROCKCHIP_DW_HDMI_QP, ROCKCHIP_LVDS, ROCKCHIP_RGB) already select it, which masks the gap in any configuration that enables one of them. ROCKCHIP_INNO_HDMI is covered through its DRM_INNO_HDMI core option. The same change was posted by Marius Dinu in March and dropped when the failure stopped reproducing in his build. The failure is configuration-dependent - any other enabled option that selects DRM_BRIDGE_CONNECTOR hides it - and it still reproduces on current drm-misc-next with the configuration described above. Select DRM_BRIDGE_CONNECTOR like the other users do. Fixes: d68ba7bac955 ("drm/rockchip: Add RK3588 DPTX output support") Link: https://lore.kernel.org/r/aneNCDU12OzG99UX@venus # ack to handle this apart from the dw-dp series Link: https://lore.kernel.org/r/20260319155051.1944-1-m95d+git@psihoexpert.ro # earlier submission by Marius Dinu Signed-off-by: Igor Paunovic <royalnet026@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260813144019.12089-2-royalnet026@gmail.com
2026-09-03drm/rockchip: analogix_dp: fix unchecked bound endpoint name lengthYudi Yang
rockchip_dp_drm_encoder_enable() uses sprintf() to format a device tree path into a 32-byte stack buffer. Device tree paths are not limited to this size, so a sufficiently long path can overflow the buffer. Use snprintf() with the destination size to truncate the generated name and keep the writes within bounds. Fixes: 729f8eefdcad ("drm/rockchip: analogix_dp: Add support for RK3588") Cc: stable@vger.kernel.org Signed-off-by: Yudi Yang <2000jedi@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260901195511.2761251-1-2000jedi@gmail.com
2026-08-31drm/rockchip: vop2: Convert to atomic_create_stateMaxime Ripard
The rockchip vop2 crtc implementation provides a custom reset hook. However, this hook only allocates the state, initializes it with __drm_atomic_helper_crtc_reset(), and frees the previous state. It does not perform any hardware reset. Since this is exactly what the atomic_create_state hook is meant to do, minus the old state cleanup which the caller handles, convert the implementation to use atomic_create_state with __drm_atomic_helper_crtc_state_init() instead. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260821-drm-no-more-crtc-reset-v1-62-fb793475c05a@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-08-31drm/rockchip: vop: Convert to atomic_create_stateMaxime Ripard
The rockchip vop crtc implementation provides a custom reset hook. However, this hook only allocates the state, initializes it with __drm_atomic_helper_crtc_reset(), and frees the previous state. It does not perform any hardware reset. Since this is exactly what the atomic_create_state hook is meant to do, minus the old state cleanup which the caller handles, convert the implementation to use atomic_create_state with __drm_atomic_helper_crtc_state_init() instead. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260821-drm-no-more-crtc-reset-v1-61-fb793475c05a@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-08-21Merge tag 'drm-next-2026-08-20' of https://gitlab.freedesktop.org/drm/kernelLinus Torvalds
Pull drm updates from Dave Airlie: "Highlights: - dmemcg eviction support is good for low VRAM things like Steam Machine - AMD adds gfx6-8 modifier support for older GPUs that enables a bunch of wayland stuff - i915/xe has some new hw support but also a lot of display refactoring Everything: perf: - export perf_allow_ APIs for xe udmabuf: - remove default size limit of 64MB rust: - i/o rework (signed tag from driver-core tree) - add registration guard and registration data - fix unbounded lifetimes in ioctl handler args - fix a drm_dev_register race - gem_shmem: add DmaResvGuard helper - gpuvm: require send/sync for driver data - implement send/sync for GpuVaAlloc and GpuVmBo - add SmContext lifetime - rename dma_handle to dma_address - change pci_sriov_get_totalvfs return to unsigned int core: - create drm_of_get_panel_orientation - send per-connector hotplug events - add thunderbolt UBHR tunneling support connector: - add color format property dmem: - introduce a peak file - accept one region per limit - add dmemcg support for eviction gpusvm: - reorg code to give drivers more flexibility atomic: - add create_state callback and helper - add documentation on atomic commit lifetime buddy: - add per-order free - add used block scoreboard - fix UAF - test buffer clearance on resume - add phys_addr->block helper gem: - drop DRIVER_GEM_GPUVA flag ttm: - be more aggressive allocating below protection limit sched: - add test suite for concurrent job submissions hdmi: - hook the color format property in helpers mipi-dsi: - add MIPI_DSI_MODE_DSC_ALL_SLICES_IN_PKT bridge: - add atomic create callbacks - drop atomic reset - display-connector: don't autoenable HPD IRQ - trigger initial HPD for DP - ti-sn65dsi83: remove NO_HFP and NO_HBP mode flags - analogix_dp: switch to DP link training helpers dp: - add support for DSC max delta BPP edid: - parse panel type from DisplayID 2.x Display Parameters sysfb: - improve panel, stride, framebuffer size validation panel: - implement ref counting for struct drm_panel - himax-hx83121a: add backlight regulator support - novatek-nt36672a: Inline panel init sequences - visionox-vtdr6130: enable DSC - novatek-nt37801: Use mipi_dsi_*_multi() functions - samsung-s6d16d0: Fix prepare error handling - support Novatek NT36536 plus DT bindings - sofef00: fix backlight updates - osd101t2587: use mipi_dsi_*_multi interface - panel-edp: adjust timing for AUO displays - panel-lvds: support Opto Logic SCX1001511GGC49 - panel-simple: support Kyocera tcg070wvlq - panel-edp: quirks - AUO B116XAT04.3, CMN N116BCP-EA2, CSW MNB601LS1-8 - BOE NV116WH2-M30, BOE NT116WHM-N21, BOE NV116FH1-M31 - BOE NV116FH1-M30, NV140FHM-N5B, TM156VDXP25 - BOE NE160QDM-NY1, MB116AS01 - new: - Samsung ATNA40HQ08-0, Anbernic TD4310 - Chipone ICNA35XX, Ilitek ILI9488 - Ilitek ILI7807S, Renesas R63419 - MNE001BS6-2, MNF601BS4-1, Sharp LQ120P1JX51 virtio: - add support for save/restore virtio_gpu_objects - abort vq wait on device removal amdgpu: - add color format DRM property - initial compute pipe reset support - add GFX 6-8 modifier support - initial DCN 6.0.0 support - dmemcg eviction support - improved boundary checking for bios parsing - RAS updates and rework - VCN secure submission fixes - 8K panel fix - Display KUNIT tests - parse panel type from DisplayID - Align IP discovery to pci device lifetime - SOC15 register macro cleanups - UVD memory placement fixes - GFX9 mode2 reset fixes - drop unnecessary BUG/BUG_ON - GFX8 soft reset rework - enable soft reset on GFX8 - PSP/SMU 15.0.9 update - VI ASPM fix - userq fixes - amdgpu_vm_get_task_info_pasid lifetime fix - DC CACP support - change system_unbound_wq with system_dfl_wq - Loosen VFCT bios parsing to deal with pci=realloc - SI/SMU7 AC/DC switch fix - VM fence handling fix - GEM close optimisation - Apple Studio Display fixes - DC FRL fixes amdkfd: - initial compute pipe reset support - allow applications to opt out of sigbus on fatal errors - improve CRIU boundary checks - MQD handling rework - move TBA/TMA from system to device memory - avoid topology-lock in kfd_mmap - SVM eviction fixes radeon: - fix unset CONFIG_ACPI build i915: - Novalake (NVL display version 35) timing generator enabling - NVL DC3CO enabling - enable UBHR link rates on thunderbolt tunnels - Reduce Xe3+ PM demand peak bandwidth - enable pipe DMC error interrupts for display 30+ - add kunit tests for DP link config selection - refactor and document DP link recovery - i915/xe driver display probe/remove/suspend/resume/shutdown cleanup and unification - i915/xe display runtime PM unified - Break i915 and xe panic dependency on struct intel_framebuffer - Streamline Pre/Post-CSC LUT loops - drop TGL DC3DO support - CDCLK santization - fix HDMI scrambling enable - fix phys bo pread/pwrite with offset - add missing nospec on parallel submit slot - fix some NULL derefs xe: - drop force_execlist module param - gate observation streams with perf_allow_cpu - skip FORCE_WC and vm_bound check for external dma-bufs - dmemcg eviction support - remove unused NVL-S GuC - TLB invalidation improvements - NVL-S updated PCI-IDs and w/a - madvise: optimise invalidation path - fix infinite gt-reset loop in timeout recovery - update TTM device benefical_order - wait on external BO kernel fences in exec ioctl - add/use more KLV helpers - sriov: disable display in admin only PF mode - add RAS GPU health indicator - optimise TTM populate for DONTNEED BO - drop force_probe for NVL-s - add debugfs for pcode info amdxdna: - disable device buffer export nova: - build nova-core/nova-drm from drivers/gpu - export nova-core rust symbols (workaround) - GSP boot process consolidation - Boot GSP with vGPU enabled - TLV firmware image format support - Hopper/Blackwell fixes and cleanups - I/O projection adoption tyr: - firmware loading and MCU boot - add generic slot manager + MMU - GPU VM support ARM64 LPAE page tables - add kernel buffer object for internal allocations - add parser for Mali CSF - add MCU booting nouveau: - race fixes - check instmem iomapping at first use - add dmemcg support - expose NVDEC channels - add scanline position/head state support for GSP qxl: - convert simple encoder to regular ethosu: - add perf counter support etnaviv: - force flush on power register ops msm: - support DSC configuration with slice_per_pkt > 1 mxsfb: - fix disable sequence panthor: - support sparse mappings rockchip: - switch away from simple helpers - support YUV background color - fix layer config timeout - add edp support for rk3576 - add batch command submission function rocket: - error handling and NULL ptr deref fixes sun4i: - switch away from simple helpers imagination: - mark BXM-4-64 MC1 as support host1x: - support tegra264 tegra: - add DSI for tegra 20/30 v3d: - reduce PM runtime autosuspend delay - scheduler fixes and refactoring - deprecate v3d 3.3 and 4.1 - validate CPU job query boundaries hibmc: - improve plane format handling - switch to gem shmem mediatek: - cec: correct compat for mt7623-8167? exynos: - remove simple dependency - add error handling to encoder paths - take i2c adapter module reference" * tag 'drm-next-2026-08-20' of https://gitlab.freedesktop.org/drm/kernel: (2074 commits) drm/xe/mcr: Take vcs1/vecs1 into account for first media slice drm/xe: Fix a bug in pc_adjust_freq_bounds() drm/xe: Fix xe_device_probe() failure drm/xe/drm_ras: Move has_drm_ras check to drm_ras layer drm/xe/ras: Fix boot-time ras error processing drm/amd/display: make DC_RUN_WITH_PREEMPTION_ENABLED misuse a build error drm/amd/pm: silence uninitialized variable warnings drm/amdgpu: skip BOs being torn down during GTT recovery drm/amdgpu: Reject UVD message with invalid number of h265 refs drm/amdgpu: keep PRT mappings off the vm_bo state lists drm/amdgpu: fix nbif 6.3.1 l1 low power not functional drm/amd/display: fix BT.2020 YCbCr output CSC matrices for DCE drm/amd/display: fix BT.2020 YCbCr limited output CSC matrix drm/amdgpu: Implement insert_end for VCE 3 drm/amdgpu: Fix UVD min buffer sizes drm/amdgpu: Fix UVD decode image min size calculation drm/amdgpu: Fix UVD dpb min size calculation for H264 drm/amdgpu: Reject UVD message with dimensions above 4096 drm/amdgpu: check ASPM on the dGPU host link drm/radeon: fix autosuspend cleanup during teardown ...
2026-08-06mm: introduce vma_get_page_prot() and use itLorenzo Stoakes
There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Make life easier by introducing vma_get_page_prot() parameterised by the VMA. This also makes converting vm_get_page_prot() to vma_flags_t easier. Also update the userland VMA tests to reflect the change. No functional change intended. Link: https://lore.kernel.org/20260711-b4-vma-flags-mm-v2-8-0fa2357d5431@kernel.org Signed-off-by: Lorenzo Stoakes <ljs@kernel.org> Acked-by: Zi Yan <ziy@nvidia.com> Acked-by: Jani Nikula <jani.nikula@intel.com> # for i915 Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> [DRM] Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: Christian Brauner <brauner@kernel.org> Cc: Dave Airlie <airlied@gmail.com> Cc: David Hildenbrand <david@kernel.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Jan Kara <jack@suse.cz> Cc: Jann Horn <jannh@google.com> Cc: Lance Yang <lance.yang@linux.dev> Cc: Mike Rapoport <rppt@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Nico Pache <npache@redhat.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Pedro Falcato <pfalcato@suse.de> Cc: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-07-20drm/panel: of_drm_find_panel() return a counted referenceAlbert Esteve
Callers of of_drm_find_panel() and drm_of_find_panel_or_bridge() receive a pointer with no reference held, creating a window where the panel device can be unregistered and freed between the lookup and first use (e.g., drm_panel_prepare()). Fix the lookup function by acquiring a reference with drm_panel_get() before returning, under panel_lock. Callers are now responsible for calling drm_panel_put() when they no longer need the pointer. For bridge drivers that immediately wrap the panel in a panel_bridge (which acquires its own reference), release the lookup reference right after the bridge creation call. For analogix-anx6345, which stores the panel for direct use, release the reference in the i2c remove path. For platform drivers using analogix_dp_core with a component lifecycle (exynos_dp, rockchip analogix_dp), release the lookup reference in the platform remove() function. The panel_bridge created during bind() holds a separate reference that devm cleanup releases after remove() returns. Also fix devm_drm_of_get_bridge() and drmm_of_get_bridge() in bridge/panel.c itself, update a second batch of drivers calling of_drm_find_panel() or drm_of_find_panel_or_bridge() to release the lookup reference after wrapping the panel in a bridge, and handle the cases where a panel is found but cannot be used, dropping the reference immediately in those paths. Assisted-by: Claude:claude-opus-4-6 Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Albert Esteve <aesteve@redhat.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260717-drm_refcount_wiring-v3-3-023900c32e01@redhat.com
2026-07-08Merge drm/drm-next into drm-misc-nextThomas Zimmermann
Backmerging to get updates from v7.2-rc2 into drm-misc-next. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2026-07-07Merge tag 'drm-misc-next-2026-07-02' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for 7.3: UAPI Changes: Cross-subsystem Changes: Core Changes: - bridge: Add atomic_create_state callback and helpers, drop atomic_reset - dp: Add support for DSC max delta BPP - edid: Parse panel type from DisplayID 2.x Display Parameters - sysfb: Improve panel, stride and framebuffer size validation Driver Changes: - hibmc: Improvements to the plane formats handling, switch to gem-shmem - nouveau: race fixes, misc improvements - bridges: - Convert all bridges to atomic_create_state - panels: - panel-edp: New quirks for BOE NE160QDM-NY1, MB116AS01 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20260702-powerful-successful-raptor-eded34@houat
2026-07-06drm/rockchip: Remove dependency on DRM simple helpersDiogo Silva
Simple KMS helper are deprecated since they only add an intermediate layer between drivers and the atomic modesetting. This patch removes the drm_simple_encoder_init() helper usage in the rockchip drivers by open coding it and using the encoder atomic helpers directly. This is a step to eventually get rid of this simple KMS helper, once all drivers that use it have been converted. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Diogo Silva <diogompaissilva@gmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260704-rockchip-drm-simple-v5-1-a333f527a4f9@gmail.com
2026-07-06Merge tag 'drm-misc-next-2026-06-19' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for 7.3: UAPI Changes: - connector: Add color format property Cross-subsystem Changes: - dmem: introduce a peak file Core Changes: - atomic: Add create_state callback and helpers to all objects, add documentation on atomic commit lifetime - buddy: Fix use-after-free, add per-order free and used block scoreboards - gem: Remove DRIVER_GEM_GPUVA feature flag - hdmi: Hook the color format property in the helpers - mipi-dsi: Add MIPI_DSI_MODE_DSC_ALL_SLICES_IN_PKT flag - sched: Add test suite for concurrent job submissions - virtio: Add support for saving and restoring virtio_gpu_objects, abort virtqueue wait on device removal to avoid hung task Driver Changes: - amdgpu: Implement "color format" DRM property - amdxdna: Disable device buffer exporting - ethosu: Add performance counter support - msm: Support DSC configurations with slice_per_pkt > 1 - mxsfb: Fix disable sequence - panthor: Support sparse mappings - rockchip: Support YUV background color, Fix layer config timeout, add edp support for rk3576, cleanups and formats improvements - solomon: Add a batch command submission function - tegra: Add DSI support for Tegra 20 and 30, fix dsi driver when the firmware hasn't enabled the controller, - v3d: Reduce PM runtime autosuspend delay, Scheduler and submission fixes and refactoring, Deprecate V3D 3.3 and 4.1 support - bridge: - display-connector: don't autoenable HPD IRQ, trigger initial HPD event for DP - dw-dp: Null pointer dereference and use-after-free fixes - ti-sn65dsi83: Remove NO_HFP and NO_HBP mode flags - panel: - himax-hx83121a: add backlight regulator support - novatek-nt36672a: Inline panel init sequences - panel-edp: Add quirks for AUO B116XAT04.3, CMN N116BCP-EA2, CSW MNB601LS1-8, BOE NV116WH2-M30, BOE NT116WHM-N21, BOE NV116FH1-M31, BOE NV116FH1-M30, NV140FHM-N5B, TM156VDXP25 - New panels: Samsung ATNA40HQ08-0, Anbernic TD4310, Chipone ICNA35XX, Ilitek ILI9488 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20260619-burgundy-termite-of-whirlwind-f7a4dd@houat
2026-07-03Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c ↵Uwe Kleine-König (The Capable Hub)
files) Replace the #include of <linux/mod_devicetable.h> by the more specific <linux/device-id/*.h> where applicable. For most cases the include can be dropped completely, only a few drivers need one or two headers added. Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
2026-06-22drm/rockchip: lvds: Switch to atomic_create_stateMaxime Ripard
The drm_bridge_funcs.atomic_reset callback and its drm_atomic_helper_bridge_reset() helper are deprecated. Switch to the atomic_create_state callback and its drm_atomic_helper_bridge_create_state() counterpart. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # imx8mp + sn65dsi84 + bridge hotplug Link: https://patch.msgid.link/20260619-drm-no-more-bridge-reset-v3-66-ff399263111b@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-06-22drm/rockchip: rk3066_hdmi: Switch to atomic_create_stateMaxime Ripard
The drm_bridge_funcs.atomic_reset callback and its drm_atomic_helper_bridge_reset() helper are deprecated. Switch to the atomic_create_state callback and its drm_atomic_helper_bridge_create_state() counterpart. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # imx8mp + sn65dsi84 + bridge hotplug Link: https://patch.msgid.link/20260619-drm-no-more-bridge-reset-v3-65-ff399263111b@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-06-22drm/rockchip: cdn-dp: Switch to atomic_create_stateMaxime Ripard
The drm_bridge_funcs.atomic_reset callback and its drm_atomic_helper_bridge_reset() helper are deprecated. Switch to the atomic_create_state callback and its drm_atomic_helper_bridge_create_state() counterpart. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # imx8mp + sn65dsi84 + bridge hotplug Link: https://patch.msgid.link/20260619-drm-no-more-bridge-reset-v3-64-ff399263111b@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-06-09drm/rockchip: dw_hdmi_qp: Set supported_formats platdataNicolas Frattaroli
With the introduction of the supported_formats member in the dw-hdmi-qp platform data struct, drivers that have access to this information should now set it. Set it in the rockchip dw_hdmi_qp glue driver. This allows this information to be passed down to the dw-hdmi-qp core, which sets it in the bridge it creates, and consequently will allow the common HDMI bridge code to act on it. Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-17-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/rockchip: dw_hdmi_qp: Implement "color format" DRM propertyNicolas Frattaroli
Switch between requested color formats by setting the right bus formats, configuring the VO GRF registers, and setting the right output mode. To do this, the encoder's atomic_check queries the bus format of the first bridge, which was determined by the bridge chain recursive format selection. Pick the input format if it's !FIXED, otherwise, pick the output format. The previously unused GRF register color format defines are redone as well. Both RK3588 and RK3576 use the same defines; it didn't look like this as there was a typo in the previously (unused) definition. Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-16-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/rockchip: vop2: Set correct output format for RK3576 YUV422Nicolas Frattaroli
For RK3576 to be able to output YUV422 signals, it first needs to be able to pick the right output mode in the display controller to do so. The RK3576 hardware specifies different output formats depending on the used display protocol. Adjust the written register value based on the SoC and connector, so other users of vcstate->output_mode don't have to care about this. Reviewed-by: Andy Yan <andyshrk@163.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-14-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/rockchip: vop2: Recognise 10-bit YUV422 as YUV formatNicolas Frattaroli
The Rockchip VOP2 video output driver has a "is_yuv_output" function, which returns true when a given bus format is a YUV format, and false otherwise. This switch statement is lacking the bus format used for YUV422 10-bit. Add the two component orderings of the YUV422 10-bit bus formats to the switch statement. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-13-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/rockchip: vop2: Add RK3576 to the RG swap special caseNicolas Frattaroli
Much like RK3588, RK3576 requires an RG swap to be performed for YUV444 8-bit and YUV444 10-bit bus formats. Add its version to the already existing check for RK3588, so that YUV444 output is correct on this platform. Fixes: 944757a4cba6 ("drm/rockchip: vop2: Add support for rk3576") Reviewed-by: Andy Yan <andyshrk@163.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-12-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/rockchip: Add YUV422 output mode constants for VOP2Nicolas Frattaroli
The Rockchip display controller has a general YUV422 output mode, and some SoC-specific connector-specific output modes for RK3576. Add them, based on the values in downstream and the TRM (dsp_out_mode in RK3576 TRM Part 2, register POST*_CTRL_POST_DSP_CTRL). Reviewed-by: Andy Yan <andyshrk@163.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260609-color-format-v17-11-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-02drm/rockchip: dw_hdmi: Use resume_early pm ops for system suspendJonas Karlman
rockchip_drm_sys_resume()/drm_mode_config_helper_resume() is called before the resume pm ops of dw-hdmi. This result in an atomic_enable() before dw_hdmi_rockchip_resume()/dw_hdmi_resume() is called. Resume (without changes): - rockchip_drm_sys_resume() - drm_mode_config_helper_resume() - atomic_enable() - dw_hdmi_rockchip_resume() - dw_hdmi_resume() - dw_hdmi_init_hw() Change to use resume_early pm ops for system suspend to ensure pm ops for dw-hdmi is run before rockchip-drm pm ops. Also fix a possible NULL pointer dereference timing issue while at it. Resume (with changes): - dw_hdmi_rockchip_resume_early() - dw_hdmi_resume() - dw_hdmi_init_hw() - rockchip_drm_sys_resume() - drm_mode_config_helper_resume() - atomic_enable() Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-12-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Propagate bus format to display driverJonas Karlman
The HDMI block is currently hardcoded to expect RGB output from the display controller. However, the VOP in some SoCs are capable of YCbCr output to the HDMI block. Read the negotiated bus format from the bridge state and propagate it to the CRCT state in form of output mode and bus format. Treat the format MEDIA_BUS_FMT_FIXED as RGB888 and reject any unsupported formats. This has no inpact until dw-hdmi bridge is fully converted to a HDMI bridge and also adds support for the "color format" connector property. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-11-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Configure HDMI PHY in atomic_mode_set()Jonas Karlman
The HDMI helpers negotiated TMDS character rate and output bpc are available from the connector state. Change the encoder helper from mode_set() to atomic_mode_set() so these values can be used to configure the HDMI PHY using phy_configure(). This has no impact until the dw-hdmi bridge is fully converted into a HDMI bridge and HDMI helpers are used to assign hdmi.tmds_char_rate. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-10-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Set output_port for RK3568/RK3566Jonas Karlman
All in-tree RK3568/RK3566 device trees using HDMI also include the required hdmi-connector node at port@1 since their introduction. Define the output_port for RK3568 so that dw-hdmi bridge driver can pick up the display-connector bridge once the dw-hdmi connector is replaced with a bridge connector in a future change. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-9-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Clean up whitespaceJonas Karlman
Move the blank line before the RK3328 definitions for readability and make the phy_config table spacing consistent with other tables. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-8-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Remove empty encoder helper funcsJonas Karlman
Remove the empty disable() and static return true mode_fixup() encoder helper funcs as they do not provide any useful functionality. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-7-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Hold a reference to the dw-hdmi bridgeJonas Karlman
Take a reference on the dw-hdmi bridge during bind and drop it again from unbind to ensure the bridge is kept alive for the lifetime of the encoder component. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-6-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Inline resource lookup into bind()Jonas Karlman
Inline rockchip_hdmi_parse_dt() into dw_hdmi_rockchip_bind() so the probe path is easier to follow in one place. Also ensure failures in bind() use dev_err_probe() so probe deferrals and errors are reported consistently. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-5-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Use drmres helpers for encoder resourcesJonas Karlman
Change to use drmres helpers drmm_kzalloc() to allocate driver data and drmm_encoder_init() to initialize the encoder. With use of drmres the manual encoder cleanup in failure path and unbind is also removed. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328 Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260518193748.2482823-4-jonas@kwiboo.se