Akhil P Oommen
64ac64bb62
drm/msm/adreno: Expose a PARAM to check AQE support
...
AQE (Applicaton Qrisc Engine) is required to support VK ray-pipeline. Two
conditions should be met to use this HW:
1. AQE firmware should be loaded and programmed
2. Preemption support
Expose a new MSM_PARAM to allow userspace to query its support.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714685/
Message-ID: <20260327-a8xx-gpu-batch2-v2-17-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
7fad33097e
drm/msm/a6xx: Enable Preemption on X2-85
...
Add the save-restore register lists and set the necessary quirk flags
in the catalog to enable the Preemption feature on Adreno X2-85 GPU.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714684/
Message-ID: <20260327-a8xx-gpu-batch2-v2-16-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
a693602ef5
drm/msm/a8xx: Preemption support for A840
...
The programing sequence related to preemption is unchanged from A7x. But
there is some code churn due to register shuffling in A8x. So, split out
the common code into a header file for code sharing and add/update
additional changes required to support preemption feature on A8x GPUs.
Finally, enable the preemption quirk in A840's catalog to enable this
feature.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714682/
Message-ID: <20260327-a8xx-gpu-batch2-v2-15-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
ee37487ffe
drm/msm/a8xx: Implement IFPC support for A840
...
Implement pwrup reglist support and add the necessary register
configurations to enable IFPC support on A840
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714679/
Message-ID: <20260327-a8xx-gpu-batch2-v2-14-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
dd108bb9da
drm/msm/a6xx: Add SKU detection support for X2-85
...
Add the Speedbin table to the catalog to enable SKU detection support
for X2-85 GPU found in Glymur chipset. As this chipset support the SOFT
FUSE mechanism, enable the ADRENO_QUIRK_SOFTFUSE quirk too.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714677/
Message-ID: <20260327-a8xx-gpu-batch2-v2-13-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
4ac686bfd1
drm/msm/a6xx: Add soft fuse detection support
...
Recent chipsets like Glymur supports a new mechanism for SKU detection.
A new CX_MISC register exposes the combined (or final) speedbin value
from both HW fuse register and the Soft Fuse register. Implement this new
SKU detection along with a new quirk to identify the GPUs that has soft
fuse support.
There is a side effect of this patch on A4x and older series. The
speedbin field in the MSM_PARAM_CHIPID will be 0 instead of 0xffff. This
should be okay as Mesa correctly handles it. Speedbin was not even a
thing when those GPUs' support were added.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714676/
Message-ID: <20260327-a8xx-gpu-batch2-v2-12-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
bb79a60632
drm/msm/a8xx: Add SKU table for A840
...
Add the SKU table in the catalog for A840 GPU. This data helps to pick
the correct bin from the OPP table based on the speed_bin fuse value.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714673/
Message-ID: <20260327-a8xx-gpu-batch2-v2-11-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:30 -07:00
Akhil P Oommen
742b4e88cd
drm/msm/a6xx: Update HFI definitions
...
Update the HFI definitions to support additional GMU based power
features.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714671/
Message-ID: <20260327-a8xx-gpu-batch2-v2-10-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
29c1d7e5db
drm/msm/a6xx: Use packed structs for HFI
...
HFI related structs define the ABI between the KMD and the GMU firmware.
So, use packed structures to avoid unintended compiler inserted padding.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714669/
Message-ID: <20260327-a8xx-gpu-batch2-v2-9-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
61957ab99d
drm/msm/a6xx: Add support for Debug HFI Q
...
Add the Debug HFI Queue which contains the F2H messages posted from the
GMU firmware. Having this data in coredump is useful to debug firmware
issues.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714666/
Message-ID: <20260327-a8xx-gpu-batch2-v2-7-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
bb9b1d6e94
drm/msm/a6xx: Fix gpu init from secure world
...
A7XX_GEN2 and newer GPUs requires initialization of few configurations
related to features/power from secure world. The SCM call to do this
should be triggered after GDSC and clocks are enabled. So, keep this
sequence to a6xx_gmu_resume instead of the probe.
Also, simplify the error handling in a6xx_gmu_resume() using 'goto'
labels.
Fixes: 14b27d5df3 ("drm/msm/a7xx: Initialize a750 "software fuse"")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714664/
Message-ID: <20260327-a8xx-gpu-batch2-v2-6-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
ae25e6e9cd
drm/msm/adreno: Implement gx_is_on() for A8x
...
A8x has a diverged enough for a separate implementation of gx_is_on()
check. Add that and move them to the adreno func table.
Fixes: 288a932008 ("drm/msm/adreno: Introduce A8x GPU Support")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714661/
Message-ID: <20260327-a8xx-gpu-batch2-v2-5-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
d34b691979
drm/msm/a6xx: Correct OOB usage
...
During the GMU resume sequence, using another OOB other than OOB_GPU may
confuse the internal state of GMU firmware. To align more strictly with
the downstream sequence, move the sysprof related OOB setup after the
OOB_GPU is cleared.
Fixes: 62cd0fa699 ("drm/msm/adreno: Disable IFPC when sysprof is active")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714659/
Message-ID: <20260327-a8xx-gpu-batch2-v2-4-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
0c59f258ff
drm/msm/a6xx: Switch to preemption safe AO counter
...
CP_ALWAYS_ON_COUNTER is not save-restored during preemption, so it won't
provide accurate data about the 'submit' when preemption is enabled.
Switch to CP_ALWAYS_ON_CONTEXT which is preemption safe.
Fixes: e7ae83da4a ("drm/msm/a6xx: Implement preemption for a7xx targets")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714657/
Message-ID: <20260327-a8xx-gpu-batch2-v2-3-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:29 -07:00
Akhil P Oommen
cfc8b48649
drm/msm/a8xx: Fix the ticks used in submit traces
...
GMU_ALWAYS_ON_COUNTER_* registers got moved in A8x, but currently, A6x
register offsets are used in the submit traces instead of A8x offsets.
To fix this, refactor a bit and use adreno_gpu->funcs->get_timestamp()
everywhere.
While we are at it, update a8xx_gmu_get_timestamp() to use the GMU AO
counter.
Fixes: 288a932008 ("drm/msm/adreno: Introduce A8x GPU Support")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714655/
Message-ID: <20260327-a8xx-gpu-batch2-v2-2-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Akhil P Oommen
dc78b35d5e
drm/msm/a6xx: Use barriers while updating HFI Q headers
...
To avoid harmful compiler optimizations and IO reordering in the HW, use
barriers and READ/WRITE_ONCE helpers as necessary while accessing the HFI
queue index variables.
Fixes: 4b565ca5a2 ("drm/msm: Add A6XX device support")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714653/
Message-ID: <20260327-a8xx-gpu-batch2-v2-1-2b53c38d2101@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Yasuaki Torimaru
47cbfe2608
drm/msm/gem: fix error handling in msm_ioctl_gem_info_get_metadata()
...
msm_ioctl_gem_info_get_metadata() always returns 0 regardless of
errors. When copy_to_user() fails or the user buffer is too small,
the error code stored in ret is ignored because the function
unconditionally returns 0. This causes userspace to believe the
ioctl succeeded when it did not.
Additionally, kmemdup() can return NULL on allocation failure, but
the return value is not checked. This leads to a NULL pointer
dereference in the subsequent copy_to_user() call.
Add the missing NULL check for kmemdup() and return ret instead of 0.
Note that the SET counterpart (msm_ioctl_gem_info_set_metadata)
correctly returns ret.
Fixes: 9902cb999e ("drm/msm/gem: Add metadata")
Cc: stable@vger.kernel.org
Signed-off-by: Yasuaki Torimaru <yasuakitorimaru@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/714478/
Message-ID: <20260325114635.383241-1-yasuakitorimaru@gmail.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Connor Abbott
cc83f71c9b
drm/msm/a6xx: Fix dumping A650+ debugbus blocks
...
These should be appended after the existing debugbus blocks, instead of
replacing them.
Fixes: 1e05bba5e2 ("drm/msm/a6xx: Update a6xx gpu coredump")
Signed-off-by: Connor Abbott <cwabbott0@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/714270/
Message-ID: <20260325-drm-msm-a650-debugbus-v1-1-dfbf358890a7@gmail.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Rob Clark
df0f439e39
drm/msm/shrinker: Fix can_block() logic
...
The intention here was to allow blocking if DIRECT_RECLAIM or if called
from kswapd and KSWAPD_RECLAIM is set.
Reported by Claude code review: https://lore.gitlab.freedesktop.org/drm-ai-reviews/review-patch9-20260309151119.290217-10-boris.brezillon@collabora.com/ on a panthor patch which had copied similar logic.
Reported-by: Boris Brezillon <boris.brezillon@collabora.com >
Fixes: 7860d720a8 ("drm/msm: Fix build break with recent mm tree")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Patchwork: https://patchwork.freedesktop.org/patch/714238/
Message-ID: <20260325184106.1259528-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Rob Clark
c289a6db9b
drm/msm/a6xx: Fix HLSQ register dumping
...
Fix the bitfield offset of HLSQ_READ_SEL state-type bitfield. Otherwise
we are always reading TP state when we wanted SP or HLSQ state.
Reported-by: Connor Abbott <cwabbott0@gmail.com >
Suggested-by: Connor Abbott <cwabbott0@gmail.com >
Fixes: 1707add815 ("drm/msm/a6xx: Add a6xx gpu state")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714236/
Message-ID: <20260325184043.1259312-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Rob Clark
85042c2cd9
drm/msm: Fix VM_BIND UNMAP locking
...
Wrong argument meant that the objs involved in UNMAP ops were not always
getting locked.
Since _NO_SHARE objs share a common resv with the VM (which is always
locked) this would only show up with non-_NO_SHARE BOs.
Reported-by: Victoria Brekenfeld <victoria@system76.com >
Fixes: 2e6a8a1fe2 ("drm/msm: Add VM_BIND ioctl")
Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/94
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/713898/
Message-ID: <20260324220519.1221471-2-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:28 -07:00
Rob Clark
c076123650
drm/msm: Disallow foreign mapping of _NO_SHARE
...
This restriction applies to mapping of _NO_SHARE objs in the kms vm as
well as importing/exporting BOs. Since the DPU has it's own VM, scanout
counts as "exporting" a BO from outside of it's host VM.
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/713897/
Message-ID: <20260324220519.1221471-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Rob Clark
cf50ccdb76
drm/msm: Reject fb creation from _NO_SHARE objs
...
It would be an error to map these into kms->vm. So reject this as early
as possible, when creating an fb.
Fixes: b58e12a66e ("drm/msm: Add _NO_SHARE flag")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/714264/
Message-ID: <20260325185926.1265661-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Rob Clark
d4ef6d77bb
drm/msm/a6xx: Add missing aperture_lock init
...
Looks like this was somehow missed when introducing gen8 support.
Fixes: 288a932008 ("drm/msm/adreno: Introduce A8x GPU Support")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/713545/
Message-ID: <20260323161603.1165108-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Rob Clark
8a7023b035
drm/msm/vma: Avoid lock in VM_BIND fence signaling path
...
Use msm_gem_unpin_active(), similar to what is used in the GEM_SUBMIT
path. This avoids needing to hold the obj lock, and the end result is
the same. (As with GEM_SUBMIT, we know the fence isn't signaled yet.)
Reported-by: Akhil P Oommen <akhilpo@oss.qualcomm.com >
Fixes: 2e6a8a1fe2 ("drm/msm: Add VM_BIND ioctl")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/712230/
Message-ID: <20260316184442.673558-1-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Rob Clark
9d24ec3276
drm/msm/a8xx: Update GPU name with slice_mask
...
Once we've updated the chip_id after reading the slice_mask, also update
the GPU name so it matches.
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/712225/
Message-ID: <20260316183436.671482-3-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Rob Clark
cc53487e01
drm/msm/adreno: Change chip_id format
...
The "ipv4-style" %u.%u.%u.%u used to make sense when the chip_id was
simply encoding gen.major.minor.patch. But this hasn't been true for
at least a couple years.
Switch to %08x, which is still easy enough to read for older devices,
and much easier to read with the new scheme.
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/712222/
Message-ID: <20260316183436.671482-2-robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Krzysztof Kozlowski
cb9af17e11
dt-bindings: display/msm/gpu: Drop redundant reg-names in one if:then:
...
Top-level reg-names defines already proper order for "reg-names" with
minItems: 1, so no need to repeat it again in one of "if:then:" cases.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com >
Reviewed-by: David Heidelberg <david@ixit.cz >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Patchwork: https://patchwork.freedesktop.org/patch/707987/
Message-ID: <20260301142033.88851-2-krzysztof.kozlowski@oss.qualcomm.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Anna Maniscalco
01a0d6cd70
drm/msm: always recover the gpu
...
Previously, in case there was no more work to do, recover worker
wouldn't trigger recovery and would instead rely on the gpu going to
sleep and then resuming when more work is submitted.
Recover_worker will first increment the fence of the hung ring so, if
there's only one job submitted to a ring and that causes an hang, it
will early out.
There's no guarantee that the gpu will suspend and resume before more
work is submitted and if the gpu is in a hung state it will stay in that
state and probably trigger a timeout again.
Just stop checking and always recover the gpu.
Signed-off-by: Anna Maniscalco <anna.maniscalco2000@gmail.com >
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.freedesktop.org/patch/704066/
Message-ID: <20260210-recovery_suspend_fix-v1-1-00ed9013da04@gmail.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:27 -07:00
Richard Acayan
6a0b843a16
dt-bindings: display/msm/gmu: Add SDM670 compatible
...
The Snapdragon 670 has a GMU. Add its compatible.
Signed-off-by: Richard Acayan <mailingradian@gmail.com >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/703803/
Message-ID: <20260210014603.1372-2-mailingradian@gmail.com >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:26 -07:00
Sergey Senozhatsky
4625fe5bbd
drm: gpu: msm: forbid mem reclaim from reset
...
We sometimes get into a situtation where GPU hangcheck fails to
recover GPU:
[..]
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): hangcheck detected gpu lockup rb 0!
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): completed fence: 7840161
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): submitted fence: 7840162
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): hangcheck detected gpu lockup rb 0!
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): completed fence: 7840162
msm_dpu ae01000.display-controller: [drm:hangcheck_handler] *ERROR* (IPv4: 1): submitted fence: 7840163
[..]
The problem is that msm_job worker is blocked on gpu->lock
INFO: task ring0:155 blocked for more than 122 seconds.
Not tainted 6.6.99-08727-gaac38b365d2c #1
task:ring0 state:D stack:0 pid:155 ppid:2 flags:0x00000008
Call trace:
__switch_to+0x108/0x208
schedule+0x544/0x11f0
schedule_preempt_disabled+0x30/0x50
__mutex_lock_common+0x410/0x850
__mutex_lock_slowpath+0x28/0x40
mutex_lock+0x5c/0x90
msm_job_run+0x9c/0x140
drm_sched_main+0x514/0x938
kthread+0x114/0x138
ret_from_fork+0x10/0x20
which is owned by recover worker, which is waiting for DMA fences
from a memory reclaim path, under the very same gpu->lock
INFO: task ring0:155 is blocked on a mutex likely owned by task gpu-worker:154.
task:gpu-worker state:D stack:0 pid:154 ppid:2 flags:0x00000008
Call trace:
__switch_to+0x108/0x208
schedule+0x544/0x11f0
schedule_timeout+0x1f8/0x770
dma_fence_default_wait+0x108/0x218
dma_fence_wait_timeout+0x6c/0x1c0
dma_resv_wait_timeout+0xe4/0x118
active_purge+0x34/0x98
drm_gem_lru_scan+0x1d0/0x388
msm_gem_shrinker_scan+0x1cc/0x2e8
shrink_slab+0x228/0x478
shrink_node+0x380/0x730
try_to_free_pages+0x204/0x510
__alloc_pages_direct_reclaim+0x90/0x158
__alloc_pages_slowpath+0x1d4/0x4a0
__alloc_pages+0x9f0/0xc88
vm_area_alloc_pages+0x17c/0x260
__vmalloc_node_range+0x1c0/0x420
kvmalloc_node+0xe8/0x108
msm_gpu_crashstate_capture+0x1e4/0x280
recover_worker+0x1c0/0x638
kthread_worker_fn+0x150/0x2d8
kthread+0x114/0x138
So no one can make any further progress.
Forbid recover/fault worker to enter memory reclaim (under
gpu->lock) to address this deadlock scenario.
Cc: Tomasz Figa <tfiga@chromium.org >
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org >
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/700978/
Message-ID: <20260127073341.2862078-1-senozhatsky@chromium.org >
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com >
2026-03-31 13:47:26 -07:00
Alexander Koskovich
cebf747abe
drm/msm/dsi: Add support for RGB101010 pixel format
...
Add video and command mode destination format mappings for RGB101010,
and extend the VID_CFG0 DST_FORMAT bitfield to 3 bits to accommodate
the new format value.
Make sure this is guarded behind MSM_DSI_6G_VER >= V2.1.0 as anything
older does not support this.
Required for 10 bit panels such as the BOE BF068MWM-TD0 found on the
Nothing Phone (3a).
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Patchwork: https://patchwork.freedesktop.org/patch/713721/
Link: https://lore.kernel.org/r/20260324-dsi-rgb101010-support-v5-5-ff6afc904115@pm.me
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 14:06:10 +02:00
Alexander Koskovich
a65c4d3098
drm/msm/dsi: add DSI version >= comparison helper
...
Add a helper for checking if the DSI hardware version is greater
than or equal to a given version, for use in a future change.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Patchwork: https://patchwork.freedesktop.org/patch/713719/
Link: https://lore.kernel.org/r/20260324-dsi-rgb101010-support-v5-4-ff6afc904115@pm.me
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 14:06:10 +02:00
Alexander Koskovich
913a709dea
drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0
...
The MSM8998 DSI controller is v2.0.0 as stated in commit 7b8c9e2030
("drm/msm/dsi: Add support for MSM8998 DSI controller"). The value was
always correct just the name was wrong.
Rename and reorder to maintain version sorting.
Fixes: 7b8c9e2030 ("drm/msm/dsi: Add support for MSM8998 DSI controller")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Patchwork: https://patchwork.freedesktop.org/patch/713717/
Link: https://lore.kernel.org/r/20260324-dsi-rgb101010-support-v5-3-ff6afc904115@pm.me
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 14:06:10 +02:00
Alexander Koskovich
a780b7f6c8
drm/meson: use default case for unsupported DSI pixel formats
...
Use default instead of listing unsupported formats explicitly, so the
switch statements don't need updating each time a new pixel format is
added.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Patchwork: https://patchwork.freedesktop.org/patch/713715/
Link: https://lore.kernel.org/r/20260324-dsi-rgb101010-support-v5-2-ff6afc904115@pm.me
Acked-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 14:06:10 +02:00
Alexander Koskovich
b50dc1e547
drm/mipi-dsi: add RGB101010 pixel format
...
Add MIPI_DSI_FMT_RGB101010 for 30 bit (10,10,10 RGB) pixel format,
corresponding to the packed 30 bit pixel stream defined in MIPI DSI
v1.3 Section 8.8.17.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Patchwork: https://patchwork.freedesktop.org/patch/713714/
Link: https://lore.kernel.org/r/20260324-dsi-rgb101010-support-v5-1-ff6afc904115@pm.me
[Acked by Maxime to be merged through msm-next on IRC on dri-devel]
[DB: moved RGB101010 to the end of enum mipi_dsi_pixel_format]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 14:05:33 +02:00
Jun Nie
9c171c36d8
drm/msm/dpu: support plane splitting in quad-pipe case
...
The content of every half of screen is sent out via one interface in
dual-DSI case. The content for every interface is blended by a LM
pair in quad-pipe case, thus a LM pair should not blend any content
that cross the half of screen in this case. Clip plane into pipes per
left and right half screen ROI if topology is quad pipe case.
The clipped rectangle on every half of screen is futher handled by two
pipes if its width exceeds a limit for a single pipe.
For non-virtual-plane case, there is always one stage config to serve
a LM or LM pair. So the clipping does not occur when interating stages
in this case. The plane is mapped to 2 pipes only when width or clock
rate exceeds hardware constrain within stage check.
Signed-off-by: Jun Nie <jun.nie@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/711324/
Link: https://lore.kernel.org/r/20260312-msm-next-quad-pipe-split-v19-3-4ffa2b06c996@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 10:06:25 +02:00
Jun Nie
25ee109277
drm/msm/dpu: Defer SSPP allocation until CRTC check
...
Currently, mapping plane to SSPP occurs during the plane check phase for
non-virtual plane case. The SSPP allocation and plane mapping occurs during
CRTC check phase for virtual plane case. Defer these SSPP operations until
CRTC check stage to unify the 2 cases, and ease later revisement for
quad-pipe change.
Signed-off-by: Jun Nie <jun.nie@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/711322/
Link: https://lore.kernel.org/r/20260312-msm-next-quad-pipe-split-v19-2-4ffa2b06c996@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 09:43:58 +02:00
Jun Nie
febcd37fec
drm/msm/dpu: Extract plane splitting into a dedicated function
...
dpu_plane_atomic_check_nosspp() currently handles both plane
validation and plane splitting. For better simplicity and to
facilitate future refactoring, move the splitting logic into
its own dedicated function.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Jun Nie <jun.nie@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/711319/
Link: https://lore.kernel.org/r/20260312-msm-next-quad-pipe-split-v19-1-4ffa2b06c996@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 09:43:58 +02:00
Alexander Koskovich
3bd3d4999f
drm/msm/dpu: calculate data_width like downstream
...
Derive INTF data_width from dce_bytes_per_line rather than
timing->width when DSC is enabled. Use DIV_ROUND_UP to avoid
rounding errors.
Signed-off-by: Alexander Koskovich <akoskovich@pm.me >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Tested-by: Pengyu Luo <mitltlatltl@gmail.com > # Lenovo Legion Y700 Gen4 (SM8750)
Patchwork: https://patchwork.freedesktop.org/patch/713333/
Link: https://lore.kernel.org/r/20260322-fix-data-width-calc-v2-1-d5f28136bc4e@pm.me
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 09:42:19 +02:00
Dmitry Baryshkov
7c5166fd79
drm/msm/dpu: drop VBIF index from the struct dpu_hw_vbif
...
Since we don't support and don't use VBIF_NRT, VBIF_RT is the only
possible VBIF type. To simplify the driver, drop vbif_idx from the VBIF
instance structure. As the last users of VBIF_RT and enum dpu_vbif are
gone, drop them too.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707779/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-7-2b97d0438182@oss.qualcomm.com
2026-03-25 08:06:25 +02:00
Dmitry Baryshkov
1ce6168887
drm/msm/dpu: drop VBIF index from the VBIF params
...
Since we don't support and don't use VBIF_NRT, VBIF_RT is the only
possible VBIF type. To simplify the driver, drop vbif_idx from the VBIF
parameter structures.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707783/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-6-2b97d0438182@oss.qualcomm.com
2026-03-25 08:06:25 +02:00
Dmitry Baryshkov
021fd8ca0c
drm/msm/dpu: drop vbif_idx from WB configuration
...
All MDP / DPU implementations except for MSM8996 use VBIF_RT (or the
only VBIF) for WB2. Writeback on MSM8996 is not supported (nor planned
to be supported). In order to simplify the driver, drop the field form
the struct dpu_wb_cfg.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707778/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-5-2b97d0438182@oss.qualcomm.com
[DB: also handled Eliza platform]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 08:06:20 +02:00
Dmitry Baryshkov
b26bfb5bf1
drm/msm/dpu: drop VBIF id, base and name from the catalog
...
For all the platforms VBIF id is VBIF_RT, the name and base are also
fixed. Drop those fields from the catalog.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707777/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-4-2b97d0438182@oss.qualcomm.com
2026-03-25 08:06:20 +02:00
Dmitry Baryshkov
014390e30a
drm/msm/dpu: replace VBIF-related array with bare pointers
...
As we no longer have multiple VBIF instances, it doesn't make sense to
keep VBIF data as arrays. Drop the extra wrapping and keep only a single
instance of each of the structures.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707776/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-3-2b97d0438182@oss.qualcomm.com
2026-03-25 08:06:20 +02:00
Dmitry Baryshkov
2c0c3d9d95
drm/msm/dpu: stop declaring VBIFs as an array in catalog
...
The driver handles a single VBIF instance, VBIF_RT. Stop declaring VBIFs
as an array in the DPU hardware catalog.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707774/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-2-2b97d0438182@oss.qualcomm.com
[DB: handled Eliza platform]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 08:06:14 +02:00
Dmitry Baryshkov
cfb64b0926
drm/msm/dpu: drop VBIF_NRT handling
...
The second VBIF instance, VBIF_NRT, is only used for the separate inline
rotator block. It is unsupported by the DPU driver and will require a
separate driver (or separate instance of the DPU device).
The only possible user of VBIF_NRT is writeback on MSM8996, however
writeback on that platform is currently unsupported and it's not worth
keeping extra complexity for the sake of that single legacy platform.
None of the hardware catalogs entries actually declare VBIF_NRT, so it
is left in its default state.
Stop pretending that DPU driver cares about VBIF_NRT and drop it.
Reported-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/707773/
Link: https://lore.kernel.org/r/20260227-drop-vbif-nrt-v1-1-2b97d0438182@oss.qualcomm.com
2026-03-25 08:06:14 +02:00
Pengyu Luo
82159db437
drm/msm/dsi: fix hdisplay calculation for CMD mode panel
...
Commit ac47870fd7 ("drm/msm/dsi: fix hdisplay calculation when
programming dsi registers") incorrecly broke hdisplay calculation for
CMD mode by specifying incorrect number of bytes per transfer, fix it.
Fixes: ac47870fd7 ("drm/msm/dsi: fix hdisplay calculation when programming dsi registers")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/709917/
Link: https://lore.kernel.org/r/20260307111250.105772-2-mitltlatltl@gmail.com
[DB: fixed commit message]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 08:06:14 +02:00
Pengyu Luo
2d51cfb77d
drm/msm/dsi: fix bits_per_pclk
...
mipi_dsi_pixel_format_to_bpp return dst bpp not src bpp, dst bpp may
not be the uncompressed data size. use src bpc * 3 to get src bpp,
this aligns with pclk rate calculation.
Fixes: ac47870fd7 ("drm/msm/dsi: fix hdisplay calculation when programming dsi registers")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/709916/
Link: https://lore.kernel.org/r/20260307111250.105772-1-mitltlatltl@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 08:06:14 +02:00
Cédric Bellegarde
961c900628
drm/msm/dpu: fix vblank IRQ registration before atomic_mode_set
...
dpu_encoder_toggle_vblank_for_crtc() can call control_vblank_irq()
at any time in response to a userspace vblank request, independently
of the atomic commit sequence. If this happens before the encoder's
first atomic_mode_set(), irq[INTR_IDX_RDPTR] is still zero.
Passing irq_idx=0 to dpu_core_irq_register_callback() is treated as
invalid, and DPU_IRQ_REG(0) and DPU_IRQ_BIT(0) produce misleading
values of 134217727 and 31 respectively due to unsigned wraparound
in the (irq_idx - 1) macros, resulting in the confusing error:
[dpu error]invalid IRQ=[134217727, 31]
Since irq[INTR_IDX_RDPTR] will be properly populated by
atomic_mode_set() and registered by irq_enable() as part of the
normal modeset sequence, silently skip the vblank IRQ registration
when the index has not yet been initialized. This matches the
existing pattern of the master encoder check above it.
Signed-off-by: Cédric Bellegarde <cedric.bellegarde@adishatz.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Patchwork: https://patchwork.freedesktop.org/patch/712752/
Link: https://lore.kernel.org/r/20260318171700.394945-1-cedric.bellegarde@adishatz.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2026-03-25 08:06:14 +02:00