summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-06-03gpu: nova-core: Hopper/Blackwell: add GSP lockdown release pollingJohn Hubbard
On Hopper and Blackwell, FSP boots GSP with hardware lockdown enabled. After FSP Chain of Trust completes, the driver must poll for lockdown release before proceeding with GSP initialization. Add the register bit and helper functions needed for this polling. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-7-d9f3a06939e0@nvidia.com [acourbot: fix `lockdown_released` logic and add explanatory comments.] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: Hopper/Blackwell: add FSP Chain of Trust bootJohn Hubbard
Build and send the Chain of Trust message to FSP, bundling the DMA-coherent boot parameters that FSP reads at boot time. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-6-d9f3a06939e0@nvidia.com [acourbot: rename `frts_offset` to `frts_vidmem_offset`.] [acourbot: add note about frts_sysmem_* CoT members.] Co-developed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: Hopper/Blackwell: select FSP Chain of Trust versionJohn Hubbard
The FSP Chain of Trust handshake is versioned: Hopper speaks version 1 and Blackwell speaks version 2. Provide the version through the FSP HAL so the boot message carries the value FSP expects, and so chipsets that do not use FSP need not express a version at all. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-5-d9f3a06939e0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: Hopper/Blackwell: add FSP send/receive messagingJohn Hubbard
FSP exchanges are request/response: the driver sends an MCTP/NVDM message and must match the reply against the request before acting on it. Add the synchronous send-and-wait path that validates the response transport and message headers and confirms the reply corresponds to the request that was sent. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-4-d9f3a06939e0@nvidia.com [acourbot: make `MessageToFsp` private.] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: add MCTP/NVDM protocol types for firmware communicationJohn Hubbard
Add the MCTP (Management Component Transport Protocol) and NVDM (NVIDIA Data Model) wire-format types used for communication between the kernel driver and GPU firmware processors. This includes typed MCTP transport headers, NVDM message headers, and NVDM message type identifiers. Both the FSP boot path and the upcoming GSP RPC message queue share this protocol layer. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-3-d9f3a06939e0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: Hopper/Blackwell: add FSP message infrastructureJohn Hubbard
FSP communication uses a pair of non-circular queues in the FSP falcon's EMEM, one for messages from the driver to FSP and one for replies, with the driver polling for response data. Add the queue registers and the low-level helpers used by the higher-level FSP message layer. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-2-d9f3a06939e0@nvidia.com [acourbot: align register fields names with OpenRM.] [acourbot: represent registers as arrays of 8 instances, as per OpenRM.] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03gpu: nova-core: Hopper/Blackwell: add FSP falcon EMEM operationsJohn Hubbard
Add external memory (EMEM) read/write operations to the GPU's FSP falcon engine. These operations use Falcon PIO (Programmed I/O) to communicate with the FSP through indirect memory access. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603-b4-blackwell-v13-1-d9f3a06939e0@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-03drm/v3d: Skip CSD when it has zeroed workgroupsMaíra Canal
A compute shader dispatch encodes its workgroup counts in the CFG0..CFG2 registers. Kicking off a dispatch with a zero count in any of the three dimensions is invalid. First, the hardware will process 0 as 65536, while the user-space driver exposes a maximum of 65535. Over that, a submission with a zeroed workgroup dimension should be a no-op. These zeroed counts can reach the dispatch path through an indirect CSD job, whose workgroup counts are only known once the indirect buffer is read and may legitimately be zero, but such scenario should only result in a no-op. Overwrite the indirect CSD job workgroup counts with the indirect BO ones, even if they are zeroed, and don't submit the job to the hardware when any of the workgroup counts is zero, so the job completes immediately instead of running the shader. Cc: stable@vger.kernel.org Fixes: d223f98f0209 ("drm/v3d: Add support for compute shader dispatch.") Suggested-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20260602-v3d-fix-indirect-csd-v4-2-654309e32bc0@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
2026-06-03drm/v3d: Fix vaddr leak when indirect CSD has zeroed workgroupsMaíra Canal
v3d_rewrite_csd_job_wg_counts_from_indirect() maps both the indirect buffer and the workgroup buffer and is expected to release them before returning. When any of the workgroup counts read from the buffer is zero, the function bailed out early and skipped the cleanup, leaking the vaddr mappings of both BOs. Jump to the cleanup path instead of returning directly, so the mappings are always dropped. Cc: stable@vger.kernel.org Fixes: 18b8413b25b7 ("drm/v3d: Create a CPU job extension for a indirect CSD job") Suggested-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20260602-v3d-fix-indirect-csd-v4-1-654309e32bc0@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
2026-06-03drm/i915/edp: Check supported link rates DPCD readNikita Zhandarovich
intel_edp_set_sink_rates() reads DP_SUPPORTED_LINK_RATES into a local stack array and then parses the array unconditionally. If the read fails, the array contents are not valid and may result in bogus sink link rates being used. Use drm_dp_dpcd_read_data() and clear the sink rate array on failure, so the existing parser falls back to the default sink rate handling. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 68f357cb7347 ("drm/i915/dp: generate and cache sink rate array for all DP, not just eDP 1.4") Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/20260529145759.1640646-1-n.zhandarovich@fintech.ru Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-03drm/print: describe 6th & 9th bit of drm.debugMichał Grzelak
Setting 6th or 9th bit of drm.debug change debug logging. Meanwhile `modinfo drm` does not inform about it at all. Add info to MODULE_PARAM_DESC(debug, ...) about setting 6th and 9th bit basing on DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, ...). Match description of corresponding bits with enum drm_debug_category. Include 9th bit in the example with enabling all possible logging provided at comment at include/drm/drm_print.h. Signed-off-by: Michał Grzelak <michal.grzelak@intel.com> Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260522135520.1862848-2-michal.grzelak@intel.com
2026-06-03drm/i915: Fix color blob reference handling in intel_plane_stateChaitanya Kumar Borah
Take proper references for hw color blobs (degamma_lut, gamma_lut, ctm, lut_3d) in intel_plane_duplicate_state() and drop them in intel_plane_destroy_state(). v2: - handle blobs in hw state clear Cc: <stable@vger.kernel.org> #v6.19+ Fixes: 3b7476e786c2 ("drm/i915/color: Add framework to program PRE/POST CSC LUT") Fixes: a78f1b6baf4d ("drm/i915/color: Add framework to program CSC") Fixes: 65db7a1f9cf7 ("drm/i915/color: Add 3D LUT to color pipeline") Reviewed-by: Pranay Samala <pranay.samala@intel.com> #v1 Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Link: https://patch.msgid.link/20260601082953.128539-4-chaitanya.kumar.borah@intel.com (cherry picked from commit c6eea1925154b6697fe22b217faab9bb30635e6b) Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
2026-06-03drm/sched: Add test suite for concurrent job submissionsMarco Pagani
Add a new test suite to simulate concurrent job submissions to the DRM scheduler, as this functionality is not covered by current test suites. The new test suite includes two initial test cases: (i) a test case for parallel job submission and (ii) a test case for interleaved job submission and completion. In the first test case, worker threads concurrently submit jobs to the scheduler, and then the timeline is manually advanced to complete them in bulk. In the second test case, worker threads concurrently submit sequences of jobs of different durations to the mock scheduler using a sliding window to better model real-world workloads. The timeline is advanced automatically by the finishing jobs, interleaving submission with completion. Signed-off-by: Marco Pagani <marco.pagani@linux.dev> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260520093350.1036001-1-marco.pagani@linux.dev
2026-06-03thermal/of: Add cooling device ID supportDaniel Lezcano
Introduce an identifier (cdev_id) for cooling devices registered from device tree. This prepares support for a new DT binding where cooling devices are identified by a tuple (device node, ID), instead of relying on child nodes. Existing users are updated to pass a default ID of 0, preserving the current behavior. Future changes will extend the cooling map parsing to match cooling devices based on both the device node and the ID. No functional change intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> Link: https://patch.msgid.link/20260526140802.1059293-19-daniel.lezcano@oss.qualcomm.com
2026-06-03Merge tag 'amd-drm-next-7.2-2026-05-29' of ↵Dave Airlie
https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-7.2-2026-05-29: amdgpu: - GEM_OP warning fix - GEM_OP locking fix - Userq fixes - DCN 2.1 refclk fix - SI fixes - HMM fixes - Add DC KUNIT tests - UML fixes - Switch to system_dfl_wq - Old DC power state cleanup - RAS fixes amdkfd: - svm_range_set_attr locking fix - CRIU restore fix - KFD debugger fix radeon: - Use struct drm_edid instead of struct edid Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260529214346.2328355-1-alexander.deucher@amd.com
2026-06-03Merge tag 'drm-intel-gt-next-2026-05-29' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/i915/kernel into drm-next Cross-subsystem Changes: - Backmerge of drm-next to pull in a commit to revert Driver Changes: - Avoid skipping already signaled fence after reset (Sebastian) - Fix potential UAF in TTM object purge (Janusz) - Fix refcount underflow in intel_engine_park_heartbeat (Sebastian) - Drop check for changed VM in EXECBUF (Joonas) - Revert the "else vma = NULL" patch for being superseded (Joonas) - Selfest improvements (Janusz, Krzysztof) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patch.msgid.link/ahlc1R5bzJvmBLlZ@jlahtine-mobl
2026-06-03Merge tag 'drm-misc-next-2026-05-28' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for v7.2-rc1: UAPI Changes: - amdxdna: Revert read-only user-pointer BO mappings. - panthor: Add eviction and reclaim info to fdinfo. Cross-subsystem Changes: - Convert DMA-buf system and cma heap allocators to module. Core Changes: - Cleanup driver misuses of drm/exec. Driver Changes: - Add LG LP129WT232166, AM-1280800W8TZQW-T00H, NEC NL6448BC33-70C, Riverdi RVT70HSLNWCA0 and RVT101HVLNWC00 panels. - Add support for RZ/T2H SoC to renesas. - Add cursor plane support to verisilicon. - Support DVI outputs in ite-it66121 bridge. - Assorted bugfixes, docbook updates and improvements to ivpu, tegra, host1x, nouveau. - Add DSC quirk for ASUS DC301 USB-C dock. - Use drm client buffer for tegra framebuffer. - Add support for GA100 to nouveau. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/ef65f43c-becf-473c-a5cc-203fdfecd491@linux.intel.com
2026-06-03drm/virtio: abort virtqueue wait on device removal to avoid hung taskRyosuke Yasuoka
virtio_gpu_queue_ctrl_sgs() and virtio_gpu_queue_cursor() use wait_event() without any abort condition when waiting for virtqueue space. If the host device stops processing commands, these waits block indefinitely inside a drm_dev_enter/exit() critical section. Since drm_dev_unplug(), which is called in device removal and system shutdown call path, blocks on synchronize_srcu() until all critical sections complete, device removal and system shutdown also hang. Add a vqs_released flag to virtio_gpu_device and include it in the wait_event() condition. Set the flag and wake up both queues in a new virtio_gpu_release_vqs() helper, called before drm_dev_unplug() in both virtio_gpu_remove() and virtio_gpu_shutdown(). When the flag is set, the wait returns immediately and the command is aborted, following the same cleanup path as drm_dev_enter() failure. Signed-off-by: Ryosuke Yasuoka <ryasuoka@redhat.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patch.msgid.link/20260601-virtio-gpu_wait_event-v3-1-89530517a98a@redhat.com
2026-06-03Merge tag 'drm-intel-next-2026-05-28' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/i915/kernel into drm-next Xe related: - Fix Xe oops in suspend/shutdown when display was disabled (Jani) Display in general: - More general refactor towards display separation (Jani) - Preparation for fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (Ankit) - PSR related fixes and improvements (Jouni) - Use polling when irqs are unavailable (Michal) - Split bandwidth params into platform- and display-IP-specific structs (Gustavo) - Revert "drm/i915/backlight: Remove try_vesa_interface" (Suraj) - Casf & scaler refactoring (Michal) - Add support for pipe background color (Maarten) - General clean-ups (Maarten) - Sanitize DP link capability change handling (Imre) - Multiple BW QGV fixes (Ville) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/ahhFE5Co5PdZQKG8@intel.com
2026-06-03Merge tag 'drm-xe-next-2026-05-28' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/xe/kernel into drm-next Driver Changes: - drm/xe: Move xe_uc_fw_abi.h to abi/ (Michal Wajdeczko) - drm/xe: Restore IDLEDLY regiter on engine reset (Balasubramani Vivekanandan) - drm/xe/pm: Do early initialization in init_early() (Michal Wajdeczko) - drm/xe/pm: Don't access device in init_early() (Michal Wajdeczko) - drm/xe: Separate early xe_device initialization (Michal Wajdeczko) - drm/xe: Move xe->info.devid|revid initialization (Michal Wajdeczko) - drm/xe: Move xe->info.force_execlist initialization (Michal Wajdeczko) - drm/xe: Drop unused param from xe_device_create() (Michal Wajdeczko) - drm/xe: Use raw device ID to find sub-platform descriptor (Michal Wajdeczko) - drm/xe: Assign queue name in time for drm_sched_init (Tvrtko Ursulin) - drm/xe/rtp: Implement a structured parser for rule matching (Gustavo Sousa) - drm/xe/rtp: Fully parse the ruleset (Gustavo Sousa) - drm/xe/rtp: Extract rule_match_item() (Gustavo Sousa) - drm/xe/rtp: Do not break parsing when missing context (Gustavo Sousa) - drm/xe/rtp: Don't short-circuit to false in or-yes case (Gustavo Sousa) - drm/xe/rtp: Drop rule matching cases from rtp_to_sr_cases and rtp_cases (Gustavo Sousa) - drm/xe/rtp: Write kunit test cases specific for rule matching (Gustavo Sousa) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/ahg7tgWh8djEngjM@fedora
2026-06-02drm/xe/rtp: Ensure device_oob_was only evaluates correct rulesViolet Monti
This commit builds on the implementation of the GT WA testing, increasing the scope of testing to include the device OOB workaround list. As well as checking for XE_RTP_ENGINE_CLASS(), this test also checks for rules involving XE_RTP_GRAPHICS() and XE_RTP_MEDIA(), as well as their derivatives. This test will raise expectation fails for any workarounds in the device_oob_was list that has an invalid rule type, preventing evaluation or inclusion of rules that could be applied in the wrong context. v6: - No change v5: - No change v4: - No change v3: - Removed "VISIBLE_IF_KUNIT" keyword from xe_wa.h - Heavily reworked rule checking within _dev_oob_test() function for easier understanding and interpreting of errors v2: - Changed xe_rtp_table_dev_oob_test() to follow format of xe_rtp_table_gt_test - Changed device_oob_was generated params to follow format of gt_was Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Violet Monti <violet.monti@intel.com> Link: https://patch.msgid.link/20260601200947.2032784-10-violet.monti@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-06-02drm/xe/rtp: Ensure oob_was does not evaluate engine type rulesViolet Monti
This commit builds on the implementation of the GT WA testing, increasing the scope of testing to include the OOB workaround list. The added test checks for workarounds with XE_RTP_ENGINE_CLASS() rules and raises an expectationfailure if any are found. Unlike the GT workarounds, there are no flags within this workaround list, so all invalid rules will fail. v6: - No change v5: - No change v4: - No change v3: - Removed VISIBLE_IF_KUNIT keyword from xe_wa.h - Reworked KUNIT_EXPECT_TRUE for easier decoding of errors v2: - Changed xe_rtp_table_oob_test() to follow format of xe_rtp_table_gt_test - Changed oob_was generated params to follow format of gt_was generated params Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Violet Monti <violet.monti@intel.com> Link: https://patch.msgid.link/20260601200947.2032784-9-violet.monti@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-06-02drm/xe/rtp: Ensure gt_was doesn't evaluate rules with engine typesViolet Monti
It is currently possible for a RTP rule, and subsequently a workaround, to expect contexts that may not be present when the workaround is applied. For example, the workarounds in the engine_was[] in drm/xe/xe_wa.c expect an engine entity to be active. Conversely, the gt_was[] is not depending on an engine entity to implement its workarounds. This kunit test addition checks the gt_was[] workaround list for any workarounds with XEP_RTP_ENGINE_CLASS() rules. If a workaround does have one of these rules, the workaround is then checked for the "FOREACH_ENGINE" flag, which ensures the workaround is implemented properly. The result of this test is an expectation failure if a workaround has an improper XE_RTP_ENGINE_CLASS() rule setup, and aims to prevent future issues of gt_was workarounds being applied without proper contexts. The gt_tunings[] RTP table has the same functional layout and requirements as gt_was[], so it shares the same kunit test function, minimizing excessive code. v6: - No change v5: - Remove unnecessary headers from xe_rtp_table_test.c v4: - No change v3: - Removed "VISIBLE_IF_KUNIT" keyword from xe_wa.h - Added gt_tunings[] for testing - Reworked KUNIT_EXPECT_TRUE() for easier parsing of errors v2: - Moved contents of xe_rtp_tables_test.h to .c and removed file - Renamed macro RTP_KUNIT_ARRAY_PARAM to RTP_TABLE_PARAM - Removed unnecessary functions and iterative components from generated _gen_params functions and implemented usage of table name and WA number as entry name - Condensed xe_rtp_table_gt_test() to use KUNIT_EXPECT_TRUE with no message statement - Removed xe_rtp_table_test_init() and xe_rtp_table_test_exit() as fake device initialization is not necessary Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Violet Monti <violet.monti@intel.com> Link: https://patch.msgid.link/20260601200947.2032784-8-violet.monti@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-06-02drm/xe/rtp: Add struct types for RTP tablesGustavo Sousa
We currently have a mixture of styles for our RTP tables with respect of how we define the number of entries: * xe_rtp_process_to_sr() expects to receive the number of entries as arguments; * xe_rtp_process() expects the array to have a sentinel at the end of the array; * in xe_rtp_test.c, even though xe_rtp_process_to_sr() does not require a sentinel value, we need to rely on that technique to be able to count xe_rtp_entry_sr entries because simply using ARRAY_SIZE() is not possible. The style used by xe_rtp_process_to_sr() makes it hard to share the tables with other compilation units (e.g. kunit tests), since the number of entries is calculated with ARRAY_SIZE(), which is done at compile time. Since we use the size of the tables to create some bitmasks, using a sentinel style doesn't seem great either. A way to reconcile things into a single style is to have a struct type that would hold the entries array and the number of entries. Since we have xe_rtp_entry and xe_rtp_entry_sr, we would have one type for each. The advantage of the proposed approach is that now we have a nice way to share the tables directly to kunit tests with information about their size. v6: - Removed sentinels that are not needed v5: - Removed added code from conflict resolution issues v4: - Removed conflicts with main branch v3: - No changes v2: - Add compatibility with new xe_rtp_table_sr format for "bad-mcr-reg-forced-to-regular" and "bad-regular-reg-forced-to-mcr" Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Violet Monti <violet.monti@intel.com> Link: https://patch.msgid.link/20260601200947.2032784-7-violet.monti@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-06-02rust/drm/gem: Use DeviceContext with GEM objectsLyude Paul
Now that we have the ability to represent the context in which a DRM device is in at compile-time, we can start carrying around this context with GEM object types in order to allow a driver to safely create GEM objects before a DRM device has registered with userspace. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20260507220044.3204919-4-lyude@redhat.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-06-02drm/bridge: analogix_dp: Convert status check functions to boolDamon Ding
Convert analogix_dp_is_slave_video_stream_clock_on() and analogix_dp_is_video_stream_on() from int to bool return type. This makes the code more readable and aligns with kernel best practices for boolean status checks, while simplifying the callers by removing unnecessary "== 0" comparisons. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260521102716.1373519-1-damon.ding@rock-chips.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
2026-06-02drm/rockchip: dw_hdmi: Use local dev variable consistently in bind()Jonas Karlman
Replace indirect struct device accesses via hdmi->dev and pdev->dev with the local dev parameter already available in dw_hdmi_rockchip_bind(), for consistency and readability. 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-3-jonas@kwiboo.se
2026-06-02drm/rockchip: dw_hdmi: Use of_device_get_match_data() to get match dataJonas Karlman
Change to use of_device_get_match_data() to get match data prior to allocating private data. All current entries in the of_device_id match table provide match data, so no functional change is intended. 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-2-jonas@kwiboo.se
2026-06-02drm/rockchip: analogix_dp: Add support for RK3576Damon Ding
RK3576 integrates Analogix eDP 1.3 TX and Samsung combo PHY hardware blocks that fully match the proven RK3588 design. Add dedicated chip data table and device tree matching entry to bring up basic eDP functionality for the RK3576 platform. Support is limited to RGB output up to 4K@60Hz for now; audio, PSR and other advanced eDP 1.3 features remain unvalidated. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601065100.1103873-12-damon.ding@rock-chips.com
2026-06-02drm/bridge: analogix_dp: Add support for RK3576Damon Ding
Add RK3576_EDP device type entry and extend Rockchip check to match existing hardware capabilities shared with RK3588. Set identical maximum link rate and lane count parameters for RK3576 eDP controller to reuse existing RK3588 config. Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601065100.1103873-11-damon.ding@rock-chips.com
2026-06-02drm/bridge: analogix_dp: Rename and simplify is_rockchip()Damon Ding
Rename inline helper is_rockchip() to analogix_dp_is_rockchip() to follow driver namespace convention consistently across code. Replace chained equality comparisons with switch-case layout to improve readability and simplify adding new SoC entries later. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Suggested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601065100.1103873-10-damon.ding@rock-chips.com
2026-06-02drm/rockchip: analogix_dp: Fix OF node reference leak via auto cleanupDamon Ding
Sashiko reported a reference leak in rockchip_dp_drm_encoder_enable(), the of_get_child_by_name() function does not call of_node_put() in a symmetrical way [1]. Fix the device node reference leak by using __free(device_node) to automatically manage of_node_put() for all device nodes. Fixes: 729f8eefdcad ("drm/rockchip: analogix_dp: Add support for RK3588") Link: https://sashiko.dev/#/patchset/20260527024336.191433-1-damon.ding@rock-chips.com?part=5 #1 Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601065100.1103873-7-damon.ding@rock-chips.com
2026-06-02drm/rockchip: analogix_dp: Enable hclk for RK3588Damon Ding
Acquire and enable the HCLK_VO1 bus clock explicitly for RK3588 eDP controller to guarantee register and datapath access. The clock was previously enabled implicitly via rockchip,vo-grf phandle reference, which relies on side effect and is fragile. Fetch optional "hclk" clock in driver to align with updated device tree binding and keep consistent with hardware clock dependency. Fixes: 729f8eefdcad ("drm/rockchip: analogix_dp: Add support for RK3588") Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601065100.1103873-6-damon.ding@rock-chips.com
2026-06-02drm/rockchip: vop2: Use vop2->old_layer_sel directly in ↵Cristian Ciocaltea
wait_for_layer_cfg_done() After the old_layer_sel local was removed, the only caller of rk3568_vop2_wait_for_layer_cfg_done() already passes vop2->old_layer_sel as the expected value. Drop the redundant parameter and read the member directly inside the function. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260504-vop2-layer-cfg-tmout-v1-5-730226a7331e@collabora.com
2026-06-02drm/rockchip: vop2: Drop redundant zero-init in setup_layer_mixer()Cristian Ciocaltea
The layer_sel and atv_layer_sel local variables in rk3568_vop2_setup_layer_mixer() are unconditionally assigned from vop2->old_layer_sel and the RK3568_OVL_LAYER_SEL register read, respectively, before any use. Remove the superfluous zero-initializers. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260504-vop2-layer-cfg-tmout-v1-4-730226a7331e@collabora.com
2026-06-02drm/rockchip: vop2: Delay old_{layer|port}_sel updates in setup_layer_mixer()Cristian Ciocaltea
The old_layer_sel and old_port_sel local variables were introduced to hold the previous VP configuration for comparisons and wait targets, working around the premature update of vop2->old_layer_sel and vop2->old_port_sel earlier in the function. Remove these superfluous locals and instead defer the assignments of vop2->old_layer_sel and vop2->old_port_sel to just before the corresponding shadow register writes, where the transition from old to new logically belongs. No functional change intended. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260504-vop2-layer-cfg-tmout-v1-3-730226a7331e@collabora.com
2026-06-02drm/rockchip: vop2: Wait for layer cfg done before switching ↵Cristian Ciocaltea
LAYERSEL_REGDONE_SEL LAYERSEL_REGDONE_SEL mask of RK3568_OVL_CTRL register controls which Video Port (VP) vsync latches the shared RK3568_OVL_{LAYER|PORT}_SEL shadow registers into the active configuration. rk3568_vop2_setup_layer_mixer() overwrites LAYERSEL_REGDONE_SEL to the current VP ID before waiting for the previous VP layer configuration to take effect. As a consequence, the previous VP vsync can no longer trigger the latch, so the wait polls a value that might never appear. Move the layer cfg done wait before the RK3568_OVL_CTRL write so the previous VP vsync can still commit the pending configuration. Fixes: 3e89a8c68354 ("drm/rockchip: vop2: Fix the update of LAYER/PORT select registers when there are multi display output on rk3588/rk3568") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260504-vop2-layer-cfg-tmout-v1-2-730226a7331e@collabora.com
2026-06-02drm/rockchip: vop2: Fix wrong wait target in layer cfg done checkCristian Ciocaltea
rk3568_vop2_setup_layer_mixer() waits for the previous Video Port (VP) layer configuration to take effect before writing a new one to the shared RK3568_OVL_LAYER_SEL shadow register. However, it passes vop2->old_layer_sel to rk3568_vop2_wait_for_layer_cfg_done() as the expected value, which at that point already contains the new VP layer. This causes the wait to poll for a value that has not been written to the shadow register yet, resulting in spurious timeouts when two non-blocking atomic commits race: rockchip-drm display-subsystem: [drm] *ERROR* wait layer cfg done timeout [...] Pass the local old_layer_sel instead, which still holds the value captured from vop2->old_layer_sel before it was overwritten, i.e. the previous VP target that the hardware is expected to latch. Fixes: 3e89a8c68354 ("drm/rockchip: vop2: Fix the update of LAYER/PORT select registers when there are multi display output on rk3588/rk3568") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260504-vop2-layer-cfg-tmout-v1-1-730226a7331e@collabora.com
2026-06-02rust/drm: Introduce DeviceContextLyude Paul
One of the tricky things about DRM bindings in Rust is the fact that initialization of a DRM device is a multi-step process. It's quite normal for a device driver to start making use of its DRM device for tasks like creating GEM objects before userspace registration happens. This is an issue in rust though, since prior to userspace registration the device is only partly initialized. This means there's a plethora of DRM device operations we can't yet expose without opening up the door to UB if the DRM device in question isn't yet registered. Additionally, this isn't something we can reliably check at runtime. And even if we could, performing an operation which requires the device be registered when the device isn't actually registered is a programmer bug, meaning there's no real way to gracefully handle such a mistake at runtime. And even if that wasn't the case, it would be horrendously annoying and noisy to have to check if a device is registered constantly throughout a driver. In order to solve this, we first take inspiration from `kernel::device::DeviceContext` and introduce `kernel::drm::DeviceContext`. This provides us with a ZST type that we can generalize over to represent contexts where a device is known to have been registered with userspace at some point in time (`Registered`), along with contexts where we can't make such a guarantee (`Uninit`). It's important to note we intentionally do not provide a `DeviceContext` which represents an unregistered device. This is because there's no reasonable way to guarantee that a device with long-living references to itself will not be registered eventually with userspace. Instead, we provide a new-type for this: `UnregisteredDevice` which can provide a guarantee that the `Device` has never been registered with userspace. To ensure this, we modify `Registration` so that creating a new `Registration` requires passing ownership of an `UnregisteredDevice`. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20260507220044.3204919-2-lyude@redhat.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-06-02drm/rockchip: dw_dp: Release core resourcesCristian Ciocaltea
Core resources such as the DisplayPort AUX channel get initialized and registered during dw_dp_bind(), but are never unregistered, which may lead to memory leaks and/or use-after-free: [ 224.661371] BUG: KASAN: slab-use-after-free in device_is_dependent+0xe0/0x2b0 [ 224.662015] Read of size 8 at addr ffff00011aee8550 by task modprobe/658 [ 224.662612] [ 224.662752] CPU: 7 UID: 0 PID: 658 Comm: modprobe Not tainted 7.0.0-rc2-next-20260305 #14 PREEMPT [ 224.662759] Hardware name: Radxa ROCK 5B (DT) [ 224.662762] Call trace: [ 224.662764] show_stack+0x20/0x38 (C) [ 224.662772] dump_stack_lvl+0x6c/0x98 [ 224.662777] print_report+0x160/0x4b8 [ 224.662783] kasan_report+0xb4/0xe0 [ 224.662790] __asan_report_load8_noabort+0x20/0x30 [ 224.662796] device_is_dependent+0xe0/0x2b0 [ 224.662802] device_is_dependent+0x108/0x2b0 [ 224.662808] device_link_add+0x1f8/0x10b0 [ 224.662813] devm_of_phy_get_by_index+0x120/0x200 [ 224.662819] dw_dp_bind+0x34c/0xb10 [dw_dp] [ 224.662830] dw_dp_rockchip_bind+0x194/0x250 [rockchipdrm] [ 224.662864] component_bind_all+0x3a8/0x720 [ 224.662869] rockchip_drm_bind+0x120/0x390 [rockchipdrm] [ 224.662899] try_to_bring_up_aggregate_device+0x76c/0x838 [ 224.662904] component_master_add_with_match+0x1f4/0x230 [ 224.662909] rockchip_drm_platform_probe+0x420/0x538 [rockchipdrm] [ 224.662939] platform_probe+0xe8/0x168 [ 224.662945] really_probe+0x340/0x828 [ 224.662950] __driver_probe_device+0x2e0/0x350 [ 224.662954] driver_probe_device+0x80/0x140 [ 224.662959] __driver_attach+0x398/0x460 [ 224.662964] bus_for_each_dev+0xe0/0x198 [ 224.662968] driver_attach+0x50/0x68 [ 224.662972] bus_add_driver+0x2a0/0x4c0 [ 224.662977] driver_register+0x294/0x360 [ 224.662982] __platform_driver_register+0x7c/0x98 [ 224.662987] rockchip_drm_init+0xc4/0xff8 [rockchipdrm] Since a previous commit exported dw_dp_unbind() function in DW DP core library to take care of the necessary cleanup, use this in the component's unbind() callback, as well as in its bind() error path. Fixes: d68ba7bac955 ("drm/rockchip: Add RK3588 DPTX output support") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601-drm-rk-fixes-v4-3-c3f3f123e1da@collabora.com
2026-06-02drm/rockchip: dw_dp: Add missing newline in dev_err_probe() messageCristian Ciocaltea
Add the missing trailing newline to dev_err_probe() call in dw_dp_rockchip_bind(). Fixes: d68ba7bac955 ("drm/rockchip: Add RK3588 DPTX output support") Fixes: 26cb3e26efa7 ("drm/rockchip: dw_dp: Simplify error handling") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20260601-drm-rk-fixes-v4-2-c3f3f123e1da@collabora.com