summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-06-10gpu: nova-core: gsp: Move gsp register definition into gsp moduleAntonin Malzieu Ridolfi
Split the gsp register definitions grouped in nova root register file to the gsp module which actually use them. Suggested-by: Alexandre Courbot <acourbot@nvidia.com> Suggested-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Antonin Malzieu Ridolfi <dev@nanonej.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260607140949.152575-1-dev@nanonej.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-06-10drm/xe: include all registered queues in TLB invalidationTangudu Tilak Tirumalesh
Context-based TLB invalidation currently selects only scheduling-active exec queues via q->ops->active(). During rebind flows, queues may be suspended (or transitioning through resume) while still owning valid translations, causing them to be skipped from invalidation and leading to missed TLB invalidations on LR rebinds. The underlying issue is a TOCTOU: q->guc->state bits are flipped lock-free from enable_scheduling(), disable_scheduling{,_deregister}(), the suspend/resume sched-msg handlers, handle_sched_done(), and guc_exec_queue_stop(); nothing in send_tlb_inval_ctx_ppgtt() serializes against them, so any state-based predicate can race. Include all the registered queues so that TLB invalidations are not missed. This is race-free because list membership on vm->exec_queues.list is stable under vm->exec_queues.lock held by the caller. The performance impact is expected to be minimal and harmless. If it does turn out to be a concern, we can come back with a race-safe solution to ignore certain queues. Fixes: 6cdaa5346d6f ("drm/xe: Add context-based invalidation to GuC TLB invalidation backend") Assisted-by: Claude:claude-opus-4.6 Suggested-by: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Signed-off-by: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260608162745.338725-2-tilak.tirumalesh.tangudu@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> (cherry picked from commit aa625e1e9f0710e424fe4f0e3f032807df81b5b0) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-10drm/xe/hw_error: Use HW_ERR prefix in logRaag Jadav
Hardware errors should be logged with HW_ERR prefix. Make them consistent with existing logs. Fixes: 01aab7e1c9d4 ("drm/xe/xe_hw_error: Add support for PVC SoC errors") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Riana Tauro <riana.tauro@intel.com> Link: https://patch.msgid.link/20260602044919.702209-5-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit ad60a618c49fef07d1860bfb1091140d29f5eddb) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-10drm/xe/drm_ras: Add per node cleanup actionRaag Jadav
cleanup_node_param() is not registered for previous node in case of counter allocation failure, which results in stale memory of previous node that isn't cleaned up on unwind. Add per node cleanup action which guarantees cleanup on unwind and also simplifies the cleanup logic. Fixes: b40db12b542f ("drm/xe/xe_drm_ras: Add support for XE DRM RAS") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Riana Tauro <riana.tauro@intel.com> Link: https://patch.msgid.link/20260602044919.702209-4-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit 67fc5543d8274b2fcbef87734fad0469358f4478) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-10drm/xe/drm_ras: Make counter allocation drm managedRaag Jadav
cleanup_node_param() is not registered for previous node in case of counter allocation failure, which results in stale memory of previous node that isn't cleaned up on unwind. Fix this using drm managed allocation, which is guaranteed to be cleaned up on unwind. Fixes: b40db12b542f ("drm/xe/xe_drm_ras: Add support for XE DRM RAS") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Riana Tauro <riana.tauro@intel.com> Link: https://patch.msgid.link/20260602044919.702209-3-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit 58d77c77ea0c5cb2b755ebe23e973c8272acd896) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-10drm/xe/display: fix oops in suspend/shutdown without displayJani Nikula
The xe driver keeps track of whether to probe display, and whether display hardware is there, using xe->info.probe_display. It gets set to false if there's no display after intel_display_device_probe(). However, the display may also be disabled via fuses, detected at a later time in intel_display_device_info_runtime_init(). In this case, the xe driver does for_each_intel_crtc() on uninitialized mode config in xe_display_flush_cleanup_work(), leading to a NULL pointer dereference, and generally calls display code with display info cleared. Check for intel_display_device_present() after intel_display_device_info_runtime_init(), and reset xe->info.probe_display as necessary. Also do unset_display_features() for completeness, although display runtime init has already done that. This will need to be unified across all cases later. Move intel_display_device_info_runtime_init() call slightly earlier, similar to i915, to avoid a bunch of unnecessary setup for no display cases. Note #1: The xe driver has no business doing low level display plumbing like for_each_intel_crtc() to begin with. It all needs to happen in display code. Note #2: The actual bug is present already in commit 44e694958b95 ("drm/xe/display: Implement display support"), but the oops was likely introduced later at commit ddf6492e0e50 ("drm/xe/display: Make display suspend/resume work on discrete"). Fixes: 44e694958b95 ("drm/xe/display: Implement display support") Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7904 Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/6150 Cc: stable@vger.kernel.org # v6.8+ Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260515160920.1082842-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit 7c3eb9f47533220888a67266448185fd0775d4da) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2026-06-10drm/amd/display: use plane color_mgmt_changed to track colorop changesMelissa Wen
Ensure the driver tracks changes in any colorop property of a plane color pipeline by using the same mechanism of CRTC color management and update plane color blocks when any colorop property changes. It fixes an issue observed on gamescope settings for night mode which is done via shaper/3D-LUT updates. Fixes: 9ba25915efba ("drm/amd/display: Add support for sRGB EOTF in DEGAM block") Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Link: https://patch.msgid.link/20260609110420.1298352-5-mwen@igalia.com
2026-06-10drm/atomic: track individual colorop updatesMelissa Wen
As we do for CRTC color mgmt properties, use color_mgmt_changed flag to track any value changes in the color pipeline of a given plane, so that drivers can update color blocks as soon as plane color pipeline or individual colorop values change. Since we're here, only announce and track changes to plane COLOR_PIPELINE prop if its value is actually changing. Fixes: 8c5ea1745f4c ("drm/colorop: Add BYPASS property") Fixes: 7fa3ee8c0a79 ("drm/colorop: Define LUT_1D interpolation") Fixes: 41651f9d42eb ("drm/colorop: Add 1D Curve subtype") Fixes: 3410108037d5 ("drm/colorop: Add multiplier type") Fixes: db971856bbe0 ("drm/colorop: Add 3D LUT support to color pipeline") Fixes: e5719e7f1900 ("drm/colorop: Add 3x4 CTM type") Fixes: 99a4e4f08abe ("drm/colorop: Add 1D Curve Custom LUT type") Fixes: 2afc3184f3b3 ("drm/plane: Add COLOR PIPELINE property") Reviewed-by: Harry Wentland <harry.wentland@amd.com> #v1 Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Fixes: 9ba25915efba ("drm/amd/display: Add support for sRGB EOTF in DEGAM block") Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Link: https://patch.msgid.link/20260609110420.1298352-4-mwen@igalia.com
2026-06-10drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutableMelissa Wen
As interpolation props are actually mutable props, any changes should be handled by drm_colorop_state. Move their enum and make it correctly behaves as mutable. Fixes: 7fa3ee8c0a79 ("drm/colorop: Define LUT_1D interpolation") Fixes: db971856bbe0 ("drm/colorop: Add 3D LUT support to color pipeline") Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Reviewed-by: Alex Hung <alex.hung@amd.com> Fixes: 9ba25915efba ("drm/amd/display: Add support for sRGB EOTF in DEGAM block") Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Link: https://patch.msgid.link/20260609110420.1298352-3-mwen@igalia.com
2026-06-10drm/i915/color: deduplicate loops in xelpd_program_plane_post_csc_lut()Jani Nikula
Now that the pre_csc_lut and non-pre_csc_lut paths look similar, deduplicate the loops and just determine the value based on pre_csc_lut vs. not. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/4b3f55002a1c5b7067ccd6688d802fc284410e03.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: deduplicate loops in xelpd_program_plane_pre_csc_lut()Jani Nikula
Now that the pre_csc_lut and non-pre_csc_lut paths look similar, deduplicate the loops and just determine the value based on pre_csc_lut vs. not. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/b943121a358dab0b04c9766baba8295f12ae53fc.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: join loops in xelpd_program_plane_post_csc_lut()Jani Nikula
Use single for loops instead of two. Especially switching from a for-loop to a do-while-loop with the same loop index is confusing, and it's hard to figure out the end index. Define the end in terms of lut_size; there's three more entries after the first 32. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/011336e9d57bba57e15d1aa64ae53a20c461ed62.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: join loops in xelpd_program_plane_pre_csc_lut()Jani Nikula
Use single for loops instead of two. Especially switching from a for-loop to a do-while-loop with the same loop index is confusing, and it's hard to figure out the end index. Define the end in terms of lut_size; there's three more entries after the first 128. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/6d4f8bb713a998c199606c079bed924458f04f54.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: reduce indent in xelpd_program_plane_post_csc_lut()Jani Nikula
Return early for !icl_is_hdr_plane() to reduce indent. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/cb60ebb0c5fe67331425ba51280cea4ba111c577.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: reduce indent in xelpd_program_plane_pre_csc_lut()Jani Nikula
Return early for !icl_is_hdr_plane() to reduce indent. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/ba09d28e1dfb74ecd7c06c3554df485dbcca9a8a.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: clean up variables in xelpd_program_plane_post_csc_lut()Jani Nikula
Use plain int for counting. Initialize lut_size at declaration. Remove extra u32 v and just use lut_val. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/5b4ee3400084d8ccec77b81c8cbbd294394fcbc9.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/color: clean up variables in xelpd_program_plane_pre_csc_lut()Jani Nikula
Use plain int for counting. Initialize lut_size at declaration. Remove unnecessary lut_val initialization. Remove extra u32 v and just use lut_val. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/92d8a508ab18dfd33b6e5573e6edf433f1bbd321.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-06-10drm/i915/gem: Fix phys BO pread/pwrite with offsetJoonas Lahtinen
sg_page() returns struct page pointer not (void *) so the scaling of pread/pwrite is wrong for phys BO and wrong parts of BO would be accessed if non-zero offset is used. Last impacted platform with overlay or cursor planes using phys mapping was Gen3/945G/Lakeport. Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> Fixes: c6790dc22312 ("drm/i915: Wean off drm_pci_alloc/drm_pci_free") Cc: <stable@vger.kernel.org> # v4.5+ Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Link: https://patch.msgid.link/20260610060314.26111-1-joonas.lahtinen@linux.intel.com (cherry picked from commit 3e49a2f85070b2fb672c1e0fdba281a4ea3aebe6) Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
2026-06-10drm/i915/gem: Fix phys BO pread/pwrite with offsetJoonas Lahtinen
sg_page() returns struct page pointer not (void *) so the scaling of pread/pwrite is wrong for phys BO and wrong parts of BO would be accessed if non-zero offset is used. Last impacted platform with overlay or cursor planes using phys mapping was Gen3/945G/Lakeport. Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org> Fixes: c6790dc22312 ("drm/i915: Wean off drm_pci_alloc/drm_pci_free") Cc: <stable@vger.kernel.org> # v4.5+ Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Link: https://patch.msgid.link/20260610060314.26111-1-joonas.lahtinen@linux.intel.com
2026-06-10rust: make `build_assert` module the home of related macrosGary Guo
Given the macro scoping rules, all macros are rendered twice, in the module and in the top-level of kernel crate. Add `#[doc(hidden)]` to the macro definition and `#[doc(inline)]` to the re-export inside `build_assert` module so the top-level items are hidden. [ Sadly, because the definition is hidden, `rustdoc` decides to not list them as re-exports in the `prelude` page anymore, even if we refer to the not-actually-hidden item. - Miguel ] Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Acked-by: Boqun Feng <boqun@kernel.org> Signed-off-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260609142637.373347-1-gary@kernel.org [ Kept a single declaration in the prelude, and reworded since they already had `no_inline`. Removed other imports from `predefine` since we now use the prelude. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-06-10drm/sched: Remove redundant entity->rq initialization and checksTvrtko Ursulin
Commit 28c5bf28763d ("drm/sched: Disallow initializing entities with no schedulers") failed to notice clearing of entity->rq in drm_sched_entity_init() is now redundant and can be removed. Given that entity->rq can now never be NULL, we also remove two impossible checks, from drm_sched_entity_kill() and drm_sched_entity_flush() respectively. Similarly, we can also remove the !entity->rq check in drm_sched_job_init(). And for the better, given that the error message, if it ever triggered, would have dereferenced the yet un-initialized job-> sched (only initialized later in drm_sched_job_arm()). This appears to have been theoretically broken ever since commit 56e449603f0a ("drm/sched: Convert the GPU scheduler to variable number of run-queues") . Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Christian König <christian.koenig@amd.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Philipp Stanner <phasta@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260602153339.43453-1-tvrtko.ursulin@igalia.com
2026-06-10gpu: nova-core: clean up FSP FRTS commentsJohn Hubbard
Two comments in the FSP Chain of Trust message setup had drifted from the code. One referred to a variable name that no longer exists, and another described the unused sysmem FRTS fields as future work rather than explaining why they are zero. Update both to describe the code as it stands. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260603235034.131354-3-jhubbard@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-06-09drm/connector: Update docs of "colorspace" for color format propNicolas Frattaroli
The colorspace property's documentation states that BT2020_RGB and BT2020_YCC are equivalent, and the output format depends on the driver. Now that there is a "color format" property that userspace can use to explicitly set a format, update the colorspace docs to mention this. The behaviour here is not changed for userspace that doesn't know about the color format property yet, as the color format property defaults to "AUTO", where the choice of output format is left up to drivers. 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-24-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/bridge: Document bridge chain format selectionNicolas Frattaroli
The bridge chain format selection behaviour was, until now, undocumented. With the addition of the "color format" DRM property, it's not sufficiently complex enough that documentation is warranted, especially for driver authors trying to do the right thing. Add a high-level overview of how the process is supposed to work, and mention what the display driver is supposed to do if it wants to make use of this functionality. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-23-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/tests: bridge: Add test for HDMI output bus formats helperNicolas Frattaroli
The common atomic_get_output_bus_fmts helper for HDMI bridge connectors, called drm_atomic_helper_bridge_get_hdmi_output_bus_fmts, should return an array of output bus formats depending on the supported formats of the connector, and the current output BPC. Add a test to exercise some of this helper. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-22-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/tests: bridge: Add KUnit tests for bridge chain format selectionNicolas Frattaroli
With the "color format" property, the bridge chain format selection has gained increased complexity. Instead of simply finding any sequence of bus formats that works, the bridge chain format selection needs to pick a sequence that results in the requested color format. Add KUnit tests for this new logic. These take the form of some pleasant preprocessor macros to make it less cumbersome to define test bridges with a set of possible input and output formats. The input and output formats are defined for bridges in the form of tuples, where the first member defines the input format, and the second member defines the output format that can be produced from this input format. This means the tests can construct scenarios in which not all inputs can be converted to all outputs. Some tests are added to test interesting scenarios to exercise the bus format selection in the presence of a specific color format request. Furthermore, tests are added to verify that bridge chains that end in an HDMI connector will always prefer RGB when the color format is DRM_CONNECTOR_COLOR_FORMAT_AUTO, as is the behaviour in the HDMI state helpers. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-21-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/tests: hdmi: Add tests for HDMI helper's mode_validNicolas Frattaroli
Add some KUnit tests to verify that the HDMI state helper's mode_valid implementation does not improperly reject chroma subsampled modes on the basis of their clock rate not being satisfiable in RGB. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-20-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/tests: hdmi: Add tests for the color_format propertyNicolas Frattaroli
Add some KUnit tests to check the color_format property is working as expected with the HDMI state helper. Existing tests are extended to also test the DRM_CONNECTOR_COLOR_FORMAT_AUTO case, in order to avoid duplicating test cases. For the explicitly selected color format cases, parameterized tests are added. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-19-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/connector: Register color format property on HDMI connectorsNicolas Frattaroli
The drmm_connector_hdmi_init function can figure out what DRM color formats are supported by a particular connector based on the supported HDMI format bitmask that's passed in. Use it to register the drm color format property. Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-18-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
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/bridge: dw-hdmi-qp: Use common HDMI output bus fmts helperNicolas Frattaroli
Make use of the common drm_bridge_funcs.atomic_get_output_bus_fmts helper for HDMI bridge connectors. This allows dw-hdmi-qp HDMI bridges to participate in recursive bus format selection in a meaningful way. 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-15-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-09drm/amdgpu: Implement "color format" DRM propertyNicolas Frattaroli
The "color format" DRM property allows userspace to explicitly pick a color format to use. If an unsupported color format is requested, userspace will be given an error instead of silently having its request disobeyed. The default case, which is AUTO, picks YCbCr 4:2:0 if it's a 4:2:0-only mode, and RGB in all other cases. Co-developed-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Co-developed-by: Andri Yngvason <andri@yngvason.is> Signed-off-by: Andri Yngvason <andri@yngvason.is> Co-developed-by: Marius Vlad <marius.vlad@collabora.com> Signed-off-by: Marius Vlad <marius.vlad@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-10-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/display: hdmi-state-helper: Try subsampling in mode_validNicolas Frattaroli
drm_hdmi_connector_mode_valid assumes modes are only valid if they work with RGB. The reality is more complex however: YCbCr 4:2:0 chroma-subsampled modes only require half the pixel clock that the same mode would require in RGB. This leads to drm_hdmi_connector_mode_valid rejecting perfectly valid 420-only or 420-also modes. Fix this by checking whether the mode is 420-capable first. If so, then proceed by checking it with DRM_OUTPUT_COLOR_FORMAT_YCBCR420 so long as the connector has legalized 420, otherwise error out. If the mode is not 420-capable, check with RGB as was previously always the case. Fixes: 47368ab437fd ("drm/display: hdmi: add generic mode_valid helper") Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-9-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/display: hdmi-state-helper: Act on color format DRM propertyNicolas Frattaroli
With the introduction of the "color format" DRM property, which allows userspace to request a specific color format, the HDMI state helper should implement this. Implement it by translating the requested drm_connector_color_format to a drm_output_color_format enum value as per the logic HDMI should use for this: Auto is translated to RGB, and a fallback to YUV420 is only performed if the original color format was auto. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-8-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/atomic-helper: Add HDMI bridge output bus formats helperNicolas Frattaroli
The drm_bridge_funcs atomic_get_output_bus_fmts operation should be the same for likely every HDMI connector bridge, unless such an HDMI connector bridge has some special hardware restrictions that I cannot envision yet. To avoid code duplication and standardize on a set of media bus formats that the HDMI output color formats translate to, add a common helper function that implements this operation to the drm bridge helpers. The function returns a list of output bus formats based on the HDMI bridge's current output bits-per-component, and its bitmask of supported color formats. To guard against future expansion of DRM_OUTPUT_COLOR_FORMAT outgrowing the hweight8 call, add a BUILD_BUG_ON statement where it's used that checks for DRM_OUTPUT_COLOR_FORMAT_COUNT. The justification for not using hweight32 in all cases is that not all ISAs have a popcount instruction, and will benefit from a smaller/faster software implementation that doesn't have to operate across all bits. The justification for not defining an hweight_color depending on the value of DRM_OUTPUT_COLOR_FORMAT_COUNT is that this count enum value is only known at compile time, not at preprocessor time. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-7-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/bridge: Act on the DRM color format propertyNicolas Frattaroli
The new DRM color format property allows userspace to request a specific color format on a connector. In turn, this fills the connector state's color_format member to switch color formats. Make drm_bridges consider the color_format set in the connector state during the atomic bridge check. Call into the connector function to get the connector state's connector color format. For bridge connectors including an HDMI bridge, this will make use of whatever the HDMI implementation set as output formats, and AUTO will never be part of the rejection logic. Reject any output bus formats that do not correspond to the requested color format. DRM_CONNECTOR_COLOR_FORMAT_AUTO is always accepted as a matching color format for a bus format, meaning that non-HDMI bridge chains will end up picking the first bus format choice that works, as has already been the case previously. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-6-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/display: bridge_connector: Use HDMI color format for HDMI connsNicolas Frattaroli
For bridge connectors which contain an HDMI bridge at some stage, the HDMI state helpers' format selection logic should be involved. Add an implementation for the drm_bridge_funcs color_format function, which translates from the HDMI state's output format to a connector format for bridge connectors involving an HDMI bridge, but return the connector state's color_format member unchanged otherwise. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-5-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/connector: Let connectors have a say in their color formatNicolas Frattaroli
Add a function to get the connector color format from a connector state, and a new function pointer in drm_connector_funcs to allow connectors to override what connector color format it returns. This is useful for the bridge chain recursive bus format selection code, which does not wish to implement connector implementation specific checks like whether it involves HDMI. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.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-4-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm: Add new general DRM property "color format"Nicolas Frattaroli
Add a new general DRM property named "color format" which can be used by userspace to request the display driver to output a particular color format. Possible string values for the new enum property are: - "AUTO" (setup by default, driver internally picks the color format) - "RGB" - "YUV 4:4:4" - "YUV 4:2:2" - "YUV 4:2:0" Drivers should advertise from this list the formats they support in an optimistic best-case scenario. EDID data from the sink can then be used in the kernel's atomic check phase to restrict this set of formats, as well as by userspace to make a correct choice in the first place. Co-developed-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Co-developed-by: Andri Yngvason <andri@yngvason.is> Signed-off-by: Andri Yngvason <andri@yngvason.is> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-3-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/display: hdmi-state-helper: Use default case for unsupported formatsNicolas Frattaroli
Switch statements that do not handle all possible values of an enumeration will generate a warning during compilation. In preparation for adding a COUNT value to the end of the enum, this needs to be dealt with. Add a default case to sink_supports_format_bpc's DRM_OUTPUT_COLOR_FORMAT switch statement, and move the log-and-return unknown pixel format handling into it. No functional change. Reviewed-by: Maxime Ripard <mripard@kernel.org> 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-2-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A checkWerner Sembach
Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check that was performed in the drm_mode_is_420_only() case, but not in the drm_mode_is_420_also() && force_yuv420_output case. Without further knowledge if YCbCr 4:2:0 is supported outside of HDMI, there is no reason to use RGB when the display reports drm_mode_is_420_only() even on a non HDMI connection. This patch also moves both checks in the same if-case. This eliminates an extra else-if-case. Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Andri Yngvason <andri@yngvason.is> Tested-by: Andri Yngvason <andri@yngvason.is> 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-1-35739b5782cc@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-06-09drm/vc4: fix krealloc() memory leakAlexander A. Klimov
Don't just overwrite the original pointer passed to krealloc() with its return value without checking latter: MEM = krealloc(MEM, SZ, GFP); If krealloc() returns NULL, that erases the pointer to the still allocated memory, hence leaks this memory. Instead, use a temporary variable, check it's not NULL and only then assign it to the original pointer: TMP = krealloc(MEM, SZ, GFP); if (!TMP) return; MEM = TMP; While on it, use krealloc_array(). Fixes: 6d45c81d229d ("drm/vc4: Add support for branching in shader validation.") Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Maíra Canal <mcanal@igalia.com> Link: https://patch.msgid.link/20260606123817.37222-1-grandmaster@al2klimov.de
2026-06-09drm/xe: drop unused xe_exec_queue_ops::active callbackTangudu Tilak Tirumalesh
send_tlb_inval_ctx_ppgtt() was the only caller of q->ops->active(q). The per-VM exec_queue list is now walked unfiltered. With no remaining callers, drop the .active op from struct xe_exec_queue_ops along with the GuC and execlist backend implementations (guc_exec_queue_active() and execlist_exec_queue_active()). Signed-off-by: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/20260608162745.338725-3-tilak.tirumalesh.tangudu@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2026-06-09drm/xe: include all registered queues in TLB invalidationTangudu Tilak Tirumalesh
Context-based TLB invalidation currently selects only scheduling-active exec queues via q->ops->active(). During rebind flows, queues may be suspended (or transitioning through resume) while still owning valid translations, causing them to be skipped from invalidation and leading to missed TLB invalidations on LR rebinds. The underlying issue is a TOCTOU: q->guc->state bits are flipped lock-free from enable_scheduling(), disable_scheduling{,_deregister}(), the suspend/resume sched-msg handlers, handle_sched_done(), and guc_exec_queue_stop(); nothing in send_tlb_inval_ctx_ppgtt() serializes against them, so any state-based predicate can race. Include all the registered queues so that TLB invalidations are not missed. This is race-free because list membership on vm->exec_queues.list is stable under vm->exec_queues.lock held by the caller. The performance impact is expected to be minimal and harmless. If it does turn out to be a concern, we can come back with a race-safe solution to ignore certain queues. Fixes: 6cdaa5346d6f ("drm/xe: Add context-based invalidation to GuC TLB invalidation backend") Assisted-by: Claude:claude-opus-4.6 Suggested-by: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Signed-off-by: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260608162745.338725-2-tilak.tirumalesh.tangudu@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2026-06-09drm/v3d: Deprecate V3D 3.3 and 4.1 supportMaíra Canal
V3D 3.3 (Broadcom BCM7268) and V3D 4.1 (Broadcom BCM7278) has had no in-tree userspace since Mesa dropped support in 2024, on the grounds that those generations were no longer being tested. The situation in the kernel is similar: the maintainers don't have this hardware, the hardware is not available for purchase, and there is no known user of these GPUs. With no userspace left to drive it and no known users, maintaining the ver <= 41 code paths is a cost without a benefit, considering that these paths are not being exercised on real hardware. As a first step toward removal, emit a deprecation warning at probe for V3D versions earlier than or equal to 4.1. The hardware remains functional for now; this only warns. If any real user appears and explain its use-case, support can be retained. Schedule the removal of V3D 3.3 and 4.1 support to the next kernel release. Link: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851 Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20260606185616.694188-2-mcanal@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>