summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-08-18drm/sched: Lock drm_sched_entity_is_idle()Philipp Stanner
drm_sched_entity_is_idle() contains a badly documented memory barrier and an invalid lockless access to entity->stopped. Moreover, it also accesses entity->list which is at all other places protected by entity->lock. This function is in no way performance critical, so it is safer, more readable and more maintainable to take the spinlock. Add locking to drm_sched_entity_is_idle(). Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260813094539.2407911-2-phasta@kernel.org
2026-08-18drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEMDaniel Baluta
QCOM_UBWC_CONFIG is about to depend on QCOM_SMEM. Guard the DRM_MSM select with 'if ARCH_QCOM && QCOM_SMEM', and add 'depends on QCOM_SMEM || QCOM_SMEM=n' so a built-in driver is never selected against a missing or modular SMEM. Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM") Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Tested-by: Nathan Chancellor <nathan@kernel.org> # build Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-08-17drm/xe: tests: fix error message in xe_migrate_sanity_test()Dan Carpenter
This is supposed to print the error code but there is a copy and paste bug so it prints "bo" instead of "err". Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Dan Carpenter <error27@gmail.com> Link: https://patch.msgid.link/an1tu0z3T-qX1ogn@stanley.mountain Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 28a4198c52a1468fc1b620a9837557ea1dc1766d) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-17drm/bridge: chipone-icn6211: use devm_mipi_dsi_attachOsama Abdelkader
Follow up on the previous devm_drm_bridge_add() conversion by converting the remaining manual cleanup in chipone-icn6211 to the managed helper. Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patch.msgid.link/20260521212529.151493-1-osama.abdelkader@gmail.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2026-08-14drm/nouveau/gsp: Increase delay for magic sleep in r535_gsp_fini()Lyude Paul
As it turns out, Turing isn't the only architecture that needs this. On this Dell Precision 7780 with an AD103 GPU, along with pretty much every other laptop I tested, runtime PM is still somewhat unreliable. At first glance it seems as if it's fixed, but lowering the autosuspend delay to 500ms and then doing a stress test of suspend/resume cycles on the GPU ends up causing everything to start timing out. After quite a lot of digging, I eventually landed back on this magic timeout in r535_gsp_fini(). As it turns out, increasing the timeout ends up fixing the runtime PM issues as far as I can tell, even during intense stress testing. Unfortunately after spending quite a bit of time trying to dig through OpenRM to figure out what this magic sleep is actually doing, I've also come up short with any reasonable explanation. In lieu of that, I'm going to include the observations I did make while trying to figure this out in hopes someone eventually does figure this out: * The magic sleep has to occur after fbsr is initialized. Performing it at any time before that doesn't appear to work. * In situations where runtime PM starts getting flaky, some rather interesting visual effects end up happening on occasion before the GPU fully falls over. In particular, squares that look like the result of an incomplete blitting operation to a tiled buffer end up showing up on applications like vkcube. Interestingly enough, they remain in precisely the same place between runtime PM cycles until the GPU falls over - even when restarting vkcube multiple times, and even when vkcube is actively updating the screen. Even more interestingly, they're not limited to a specific framebuffer - you can see the squares changing as the cube rotates around. We cannot however, say that this is likely to be a incomplete fbsr operation. The magic sleep happens before fbsr is actually saved (which happens on the GSP unload), so it's something else. * During a short bit of testing with a desktop that I have, the magic sleep seemed to make no difference to whether or not suspend/resume works. It seems to generally work almost always. So we can assume this is likely exclusive to runtime PM, not S3. As well, here's a list of the things I tried before settling on the magic sleep: * Hooking up NV2080_CTRL_CMD_INTERNAL_GCX_ENTRY_PREREQUISITE and then blocking runtime PM until OpenRM signals that GC6/GCOFF is ready appears to make no difference. * Hooking up some (maybe not all, unsure about that part) bits of comptag saving including: * Fetching static memsys information from GSP * Adding the size of the comptag storage to the fbsr data * Adding a GA103+ workaround for disabling raw compression mode during fbsr (it doesn't seem like it applies for any systems I tried it on anyhow) * Setting bPreserveVideoMemoryAllocations=1 in GspSystemInfo So, until we can figure this out properly - just sleep for longer. Signed-off-by: Lyude Paul <lyude@redhat.com> Fixes: 53dac0623853 ("drm/nouveau/gsp: add support for 570.144") Cc: <stable@vger.kernel.org> # v6.16+ Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260814194542.781955-5-lyude@redhat.com
2026-08-14drm/nouveau/gsp/r570: Enable S/R Display workaround in GSPLyude Paul
There's two flags that we've never been setting when asking GSP to suspend the GPU, which OpenRM does set: GPU_STATE_FLAGS_PRESERVING GPU_STATE_FLAGS_PM_TRANSITION These flags aren't -supposed- to do much in GSP, they're mostly used by OpenRM itself for state tracking. The only thing they do from GSP's side is control whether or not a single display related workaround is applied during suspend. But as it turns out, that single workaround is actually quite crucial for getting runtime PM working with nouveau - and without it set we end up seeing a lot more failures with runtime PM resume. So, let's start setting it. Signed-off-by: Lyude Paul <lyude@redhat.com> Fixes: 53dac0623853 ("drm/nouveau/gsp: add support for 570.144") Cc: <stable@vger.kernel.org> # v6.16+ Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260814194542.781955-4-lyude@redhat.com
2026-08-14drm/nouveau/gsp/r570: Set GcOff = 0 in fbsrLyude Paul
Previously, it looked as if we were able to fix suspend/resume on some desktops by setting Gcoff based on whether or not we were entering runtime PM. This was a mistake though - the only time suspend/resume would end up actually working was if Gcoff = 0. It seems like it's likely the main reason for this is the FBSR GcOff argument actually controls GSP's behavior with regards to which buffers it decides to save across suspend/resume. When GcOff = 1, RM reserved regions are saved unless they are marked as LOST_ON_SUSPEND, and RM channel-context and kernel-client buffers are also saved -including- when they are LOST_ON_SUSPEND. This means with GcOff = 1, we end up having GSP save and restore buffers that actually need to be reinitialized on resume - causing the failures we're setting. Thanks to John Hubbard from Nvidia for providing some background on what these options do in the GSP firmware do! Signed-off-by: Lyude Paul <lyude@redhat.com> Fixes: 53dac0623853 ("drm/nouveau/gsp: add support for 570.144") Cc: <stable@vger.kernel.org> # v6.16+ Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260814194542.781955-3-lyude@redhat.com
2026-08-14Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware"Lyude Paul
This reverts commit 8302d0afeaec0bc57d951dd085e0cffe997d4d18. It turns out this looked like the right fix on some systems, but it's not - as this causes runtime PM to actually fail on many a laptop. Fixes: 8302d0afeaec ("nouveau/gsp: fix suspend/resume regression on r570 firmware") Cc: <stable@vger.kernel.org> # v6.19+ Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260814194542.781955-2-lyude@redhat.com
2026-08-14drm/nouveau/kms/nv50-: Enable atomic modesetting by defaultLyude Paul
Nouveau is one of the very few modern hardware drivers in the kernel that doesn't have atomic modesetting enabled by default, in part because when it was originally written by Ben there wasn't much in the way of good atomic modesetting clients to actually test things out with. Nowadays however, atomic modesetting is very much the norm - and support in userspace for non-atomic drivers is starting to bitrot a bit - leading to its own set of issues. At the same time, many of those issues are fixed by just turning on atomic in nouveau. Plus, I've been running nouveau with atomic modesetting on by default for most of the machines I work on, and I've already fixed quite a number of issues to the point where things seem quite stable (excluding a single screen flashing bug on my desktop, which I am not particularly convinced has anything to do with atomic modesetting). Now that we've protected against breaking things for chipsets where atomic isn't supported (<nv50) - let's enable it by default on generations of hardware that support it. We'll leave the module parameter around for the time being, as turning it off may be helpful in the possibility that we hit regressions. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-6-lyude@redhat.com
2026-08-14drm/nouveau/kms: Only allow enabling atomic modesetting on nv50+Lyude Paul
Atomic modesetting support was never added for pre-nv50 chipsets, so make sure we don't allow it to be forced on. Additionally, print a small warning when it's not supported. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-5-lyude@redhat.com
2026-08-14drm/nouveau: Fix drm_driver struct/nouveau.atomic parameter handlingLyude Paul
The way we handled the nouveau.atomic module parameter before was fairly broken, and had a number of issues: - It was only ever actually parsed in the case of PCI devices. - When nouveau.atomic was enabled, it would add the cap for atomic modesetting to the global driver_pci structure. This meant that if one GPU on a system supported atomic and another didn't, it would still get enabled for both. Looking into this exposed further silliness in the way that we actually handle the drm_driver struct. We have one global structure for platform devices, and another for PCI devices - both of which are literally identical. So before we start preparing to enable atomic modesetting by default, let's fix this. Instead of sharing driver_pci and driver_platform, we instead create driver_legacy_kms and driver_atomic_kms, each of which is identical except for the DRIVER_ATOMIC capabilities flag, and then assign either depending on the nouveau_atomic module parameter. Doing this is also preferable, as the next step for enabling atomic modesetting by default will be ensuring that we don't enable it for legacy devices that still don't support it. This requires only checking the atomic modesetting module parameter after the NVKM device is ready, as this allows us to check the GPU family that nouveau is running on. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-4-lyude@redhat.com
2026-08-14drm/nouveau: Print the nouveau.atomic parameter in nouveau_display_options()Lyude Paul
Seems like we never remembered to start printing the value for this, so let's start to aid in troubleshooting in case we run into any issues with atomic. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-3-lyude@redhat.com
2026-08-14drm/nouveau: Fix cleanup bug in nouveau_drm_device_new()Lyude Paul
Sashiko caught this while reviewing the patches for enabling atomic by default - if we fail to allocate the DRM device pointer, we'll attempt to free the error pointer that it returns rather than the actual struct. Let's fix this while we're at it. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-2-lyude@redhat.com
2026-08-14drm/xe/pci: Report 'cannot re-enable' error using SIGIDMichal Wajdeczko
Report 'cannot re-enable PCI device' error using xe_log() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-34-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/gt: Report 'Queue full' pagefault error using SIGIDMichal Wajdeczko
Report 'Queue full' error using xe_log_err() helper. While around, replace WARN_ON with WARN_ON_ONCE as there is no need for extra noise each time we hit this unlikely condition. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-33-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/gt: Report 'Fault response' pagefault error using SIGIDMichal Wajdeczko
Report 'Unsuccessful response' error using xe_log_err_info() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-32-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/gt: Report 'reset failed' errors using SIGIDMichal Wajdeczko
Report 'reset' related err/info messages using xe_log() helpers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-31-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/guc: Report 'GuC mmio' errors using SIGIDMichal Wajdeczko
Report various 'GuC mmio' errors using xe_log() helpers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-30-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/pcode: Report 'initialization timedout' error using SIGIDMichal Wajdeczko
Report 'initialization timedout' error using xe_log_err() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-29-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/pcode: Report 'timeout, retrying' error using SIGIDMichal Wajdeczko
Report 'timeout, retrying with preemption disabled' error using xe_log_err() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Badal Nilawar <badal.nilawar@intel.com> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Link: https://patch.msgid.link/20260814171801.13347-28-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/pcode: Report 'Mailbox failed' error using SIGIDMichal Wajdeczko
Report 'Mailbox failed' error using xe_log_err() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-27-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe: Report 'device wedged' errors using SIGIDMichal Wajdeczko
Report 'device wedged' error using xe_log_err_fatal() helper. Use -EIO as the error cause, as nothing else is provided here. The hints about the recovery method and bug filing are now separated as it only needs to be printed once. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-26-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/survivability: Report 'Runtime Mode enabled' status using SIGIDMichal Wajdeczko
Report 'Runtime Mode' status or failure using xe_log_err() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-25-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/survivability: Report 'Boot Mode enabled' status using SIGIDMichal Wajdeczko
Report 'Boot Mode' status or failure using various xe_log() helpers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-24-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/survivability: Report 'boot status' on sysfs failureMichal Wajdeczko
If we fail to create any of the survivability sysfs files, the user can't view boot status registers any more. Report them into dmesg instead using our existing SIGID helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-23-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/survivability: Report sysfs failure in one placeMichal Wajdeczko
If we fail to create any of the survivability sysfs files, actual error is reported by the caller. Move that reporting to sysfs helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-22-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/survivability: Report 'boot status' using SIGIDMichal Wajdeczko
Report 'boot status' and other scratch registers details using the xe_log_info() macros. While around, add helper to decode boot status code and change pdev parameter to xe. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> #v1 Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-21-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe: Report all probe errors using SIGIDMichal Wajdeczko
For completeness, we should catch and report all probe errors, not just the ones that have explicit error message. Split xe_pci_probe() function after a display check to avoid reporting -EPROBE_DEFER and use xe_log_err_fatal() helper to report all returned errors. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-20-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe: Report 'probe blocked' status using SIGIDMichal Wajdeczko
Report 'driver loading blocked' status using xe_log_info() helper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-19-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/tests: Add kunit tests for xe_anyMichal Wajdeczko
Add simple sanity tests for all xe_any macros to make sure they are working as expected. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-18-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/tests: Add Kunit tests for xe_logMichal Wajdeczko
All dmesg log lines generated by the xe_log() functions or helper macros are expected to have a stable format. Add tests to verify that generated output is not accidentally changed. Add demo pseudo tests to show how to use all variants of the xe_log() helpers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-17-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/kunit: Setup driver data in the test deviceMichal Wajdeczko
While we have helpers pdev_to_xe_device() and kdev_to_xe_device() to obtain the xe_device pointer from the struct device pointer or from the struct pci_dev pointer, we must also setup the drm_device pointer as driver data in the device to make them work. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-16-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/ras: Check RAS and LOG component definitionsMichal Wajdeczko
While not strictly required, we want to make sure that components definitions used by the RAS firmware are in the same fixed relation with HW components definitions used by the LOG infrastructure to allow code simplification. Add static asserts to enforce that. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-15-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Extend components list with hardware itemsMichal Wajdeczko
Update our super macro with new top level hardware components. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> #v2 Cc: Riana Tauro <riana.tauro@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-14-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add hardware error signaturesMichal Wajdeczko
Extend our error signatures definitions xe_sigid to cover also firmware/hardware-originated errors and make them distinguishable from initially defined software-initiated errors. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Yoni Levitt <yoni.levitt@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-13-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Index all SIGID printk messagesMichal Wajdeczko
When CONFIG_PRINTK_INDEX is enabled, it is expected that all device level printk messages are indexed for audit. While usually this is done automatically behind the scenes when code is using regular dev_printk macros, since we are generating different dmesg messages inside xe_log_emit() based on the severity, component and location, we only get those entries in /sys/kernel/debug/printk/index/xe: <3> drivers/gpu/drm/xe/xe_log.c:142 log_dmesg_vprintk "%s %s: [drm] *ERROR* %pV" <6> drivers/gpu/drm/xe/xe_log.c:140 log_dmesg_vprintk "%s %s: [drm] %pV" Explicitly generate printk index using dev_printk_index_emit() with some generic prefix that includes the SIGID tag. Suggested-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-12-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for errno-onlyMichal Wajdeczko
For the software based SIGID errors, we will usually want to pass only the errno value as the data to be logged in the dmesg line or the CPER record. Add simple wrappers for that. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> #v3 Link: https://patch.msgid.link/20260814171801.13347-11-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for component & severityMichal Wajdeczko
There are only few CPER severity levels defined, add some helpers to avoid forcing developers to write full CPER severity enum name in every macro call. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-10-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for componentsMichal Wajdeczko
Our component list already defines relation between the component name, identified by the TAG, and its numerical identifier and the assigned SIGID. We can also already prepare location identifier based on the pointer type used to emit the log entry. Add helper that will prepare SIGID, COMPONENT and LOCATION parameters for xe_log_emit() using provided components TAG and the pointer. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-9-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for location & severityMichal Wajdeczko
There are only few CPER severity levels defined, add more helpers to avoid forcing developers to write full CPER severity name in every function call. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-8-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for locationMichal Wajdeczko
We can determine the location of the SIGID error source based on the type of the xe pointer being currently available. Add helper macros that will accept any of xe_device, xe_tile or xe_gt pointers instead of plain pci_dev to generate valid XE_LOG_LOCATION identifier and then call low-level xe_log_emit(pdev) function. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-7-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add SIGID log helpers for severityMichal Wajdeczko
There are only few CPER severity levels defined, add simple helper for each of them, to avoid forcing developers to write full severity name in every function call. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-6-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add component/location decorations to dmesgMichal Wajdeczko
While we can't directly use our xe_tile|gt_err|info helpers to get nice Tile/GT decorations, we can still add them manually based on the structured location parameter. Similarly, we can add component name prefix based on the component identifier. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-5-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Introduce structured component/location identifiersMichal Wajdeczko
Introduce structured identifiers for each component type that could emit a SIGID log entry and for their locations. We plan to store those IDs in the CPER records for better filtering. Define also structured identifiers for the supported locations. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> #v3 Link: https://patch.msgid.link/20260814171801.13347-4-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe/log: Add structured SIGID error logging infrastructureMallesh Koujalagi
Today the driver reports faults with ad-hoc drm_err()/xe_gt_err() strings that have no stable shape. That is readable for a human, but it gives fleet tooling nothing durable to match on: the wording changes between releases, lines can be rate-limited or dropped under an error storm, and there is no consistent way to ask "which recognised fault just happened?". Introduce a signature identifier (SIGID): a small, stable integer that names one recognised Xe fault site and serves as the primary handle for triage. A SIGID maps, through published end-user documentation, to a description and a recommended action; the driver only has to emit the right SIGID next to the usual human-readable text. Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Assisted-by: Copilot:Opus-4.8 Co-developed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Riana Tauro <riana.tauro@intel.com> Cc: Stuart Summers <stuart.summers@intel.com> cc: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patch.msgid.link/20260814171801.13347-3-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm/xe: Introduce xe_any helpersMichal Wajdeczko
In upcoming patches we want to define macros that will work with either xe_device or xe_tile or xe_gt pointers. To make them work and to allow compiler optimizations, introduce set of helpers that will return either expected pointer type or NULL or make necessary conversions to/from the struct xe/device/pci_dev. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/20260814171801.13347-2-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-08-14drm: use drm_warn() in validate_blend_mode_for_alpha_formats()Leandro Ribeiro
Commit 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") introduced a WARN() to let driver developers know that a previously valid behavior should now be changed. But WARN() should not be used for that, as it's a kernel warning report mechanism for conditions that are not expected to happen. It also produces a stack trace. Instead, a simple warning-level log message should have been used, as drivers were expected to trigger the condition. This is causing problems for fuzzers, as they may stop when encountering a "BUG:" or "WARNING:" in the logs. Replace WARN() with drm_warn() in this function, avoiding these issues. Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Link: https://patch.msgid.link/20260731154232.37020-2-leandro.ribeiro@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
2026-08-14drm/virtio: use the DMA API for resource backing on XenBenjamin Leggett
On a Xen PV domain page addresses bear no relation to the real machine addresses the host would have to use to reach it. virtio_ring.c handles this correctly, vring_use_map_api() returns true for any xen_domain() regardless of VIRTIO_F_ACCESS_PLATFORM. virtio-gpu makes the same decision independently, but its copy looks only at the feature bit: bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev); QEMU does not set iommu_platform on virtio-vga by default, so VIRTIO_F_ACCESS_PLATFORM is not negotiated, use_dma_api is false, and virtio_gpu_object_shmem_init() describes the framebuffer's backing pages to the host with sg_phys(). Those are guest-physical addresses. In a PV domain they resolve, on the host side, to pages belonging to some other domain, so the host scans out unrelated memory. Move the decision into virtio_gpu_use_dma_api() and give it the xen_domain() check, like vring_use_map_api() has. This additionally enables the dma_sync_sgtable_for_device() calls in virtgpu_vq.c, which are required for correctness whenever swiotlb is in play. Reproduced with a Xen 4.21 PV dom0 nested inside QEMU 8.2 with virtio-vga, on both a distro 6.8 kernel and 6.18 LTS. A PVH dom0 works fine and doesn't need this fix because it is identity-mapped, only PV dom0s are affected. Fixes: a3b815f09bb8 ("drm/virtio: add iommu support.") Signed-off-by: Ben Leggett <benjamin@edera.io> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patch.msgid.link/20260806-virtgpu-xen-dma-v1-1-e499b345bbad@edera.io
2026-08-14drm/virtio: reclaim pending vbufs before tearing down vqsAnuj Bolewar
virtio_gpu_free_vbufs() destroys the vbufs kmem_cache after the virtqueues have already been released. Commands that were queued but never completed by the device leave their vbuffers stranded in the virtqueue, so the cache still holds live objects when virtio_gpu_deinit() tears everything down. This triggers a WARNING in virtio_gpu_free_vbufs: BUG virtio-gpu-vbufs (Not tainted): Objects remaining in cache on __kmem_cache_shutdown() Drain any buffers still sitting in the control and cursor virtqueues in virtio_gpu_deinit() after the device has been reset and before the virtqueues are deleted, following the same pattern used by virtio_console's remove_vqs(). Each reclaimed buffer is released with free_vbuf(), dropping the reference on any GEM objects it holds. Pending RESOURCE_UNREF commands are handled as well: their resp_cb_data still references a GEM object, so it is cleaned up with virtio_gpu_cleanup_object() to avoid leaking it on teardown. Reported-by: syzbot+06f9b2a53ba4a5a47644@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=06f9b2a53ba4a5a47644 Signed-off-by: Anuj Bolewar <bolewara@gmail.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patch.msgid.link/20260802-virtio-gpu-reclaim-vbufs-v2-1-5767fb860691@gmail.com
2026-08-14drm/virtio: check return value of vgdev_output_init()shechenglong
The return value of vgdev_output_init(), called by virtio_gpu_modeset_init(), is not checked. As a result, modeset initialization continues even if an output fails to initialize. check the return value and return the error to the caller. Signed-off-by: shechenglong <shechenglong@xfusion.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patch.msgid.link/20260811015624.830-1-shechenglong@xfusion.com