summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2026-04-17drm/amdgpu: gate VM CPU HDP flush on reset lockChenglei Xie
During GPU reset, the application could still run CPU page table updates. Each commit called amdgpu_device_flush_hdp(), which on SR-IOV sends work through the KIQ ring. That can advance sync_seq while the GPU is being reset, leaving fence writeback out of sync and causing amdgpu_fence_emit_polling() to time out on later KIQ use. Fix: amdgpu_vm_cpu_commit(): Reset will flush HDP anyway, the HDP flush in amdgpu_vm_cpu_commit() can be skipped when a reset is ongoging. Take reset_domain->sem with down_read_trylock() before amdgpu_device_flush_hdp(). If the reset path holds the write lock, skip the HDP flush so no HDP-related HW access (including KIQ) runs during reset; state is re-established after reset. Signed-off-by: Chenglei Xie <Chenglei.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2026-04-17drm/amdgpu: Use SMUIO 15.0.0 offsets for TSC upper and lower count.Ramalingeswara Reddy, Kanala
Define and use regGOLDEN_TSC_COUNT_UPPER_smu_15_0_0 and regGOLDEN_TSC_COUNT_LOWER_smu_15_0_0 for TSC upper and lower count. Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com> Signed-off-by: Ramalingeswara Reddy, Kanala <Kanala.RamalingeswaraReddy@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2026-04-17drm/amdgpu: Remove sys file compute_partition_mem_alloc_mode at module unloadXiaogang Chen
Module reload would fail when create sys file that was not removed during module unload. Fixes: e0e9792ea2d4 ("drm/amdgpu: add an option to allow gpu partition allocate all available memory") Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com> Reviewed-by: Philip Yang <philip.yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-04-17drm/amd/pm: fix incorrect FeatureCtrlMask setting on smu v14.0.xYang Wang
OverDriveTable.FanMinimumPwm and FeatureCtrlMask.PP_OD_FEATURE_FAN_LEGACY_BIT have a hard dependency. Invalid handling of this dependency leads to disabled thermal monitoring and temperature boundary validation. v2: squash in typo fix (Yang) Fixes: 9710b84e2a6a ("drm/amd/pm: add overdrive support on smu v14.0.2/3") Cc: stable@vger.kernel.org Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-04-17drm/xe/hwmon: Enable energy attributes for CRIKarthik Poosa
Enable HWMON energy attributes for CRI, which are available through MMIO registers. Although these attributes can also be accessed via PMT, MMIO is preferred as it avoids dependency on ocode firmware load in late binding scenario. v2: Rephrase commit message. (Anshuman) Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Reviewed-by: Soham Purkait <soham.purkait@intel.com> Link: https://patch.msgid.link/20260417041456.818668-1-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-04-17drm/xe/hwmon: Read accepted power limit for CRIKarthik Poosa
Update xe_hwmon_pcode_read_power_limit() and xe_hwmon_pcode_rmw_power_limit() to read the accepted power limit for discrete platforms post CRI. For platforms before CRI only the last written pcode value was available. From CRI onwards, pcode exposes a new param2 value 2 that allows reading the accepted power limit by the hardware. v2: - Read resolved power limit in xe_hwmon_pcode_rmw_power_limit() as well. (Badal) - Rephrase commit message. (Badal) - Add prepare_power_limit_param2() to prepare param2 for mailbox power limit read. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patch.msgid.link/20260323115836.3737300-1-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2026-04-17drm/xe: Drop skip_mtcfg descriptor flagMatt Roper
The skip_mtcfg descriptor flag is unused and expected to remain that way. Drop it. Single-tile platforms are already identified by a zero/unset value for max_remote_tiles and don't need/use this flag to avoid trying to read out multi-tile configuration. PVC is currently the only multi-tile platform, and PVC uses MTCFG so this flag is not set. The current expectation is that if/when future multi-tile platforms show up, they will also use the MTCFG register in the same manner as PVC, meaning that they won't have any need to set 'skip_mtcfg' either. Even if a future platform does change how multi-tile configuration gets probed (e.g., using some different register), simply doing an early return from xe_info_probe_tile_count() would probably not be the correct logic to handle that anyway. Bspec: 53146 Reviewed-by: Xin Wang <x.wang@intel.com> Link: https://patch.msgid.link/20260416-no-skip-mtcfg-v1-1-c8ea26d81530@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-04-17drm/panel: visionox-rm69299: Make use of prepare_prev_firstGuido Günther
The DSI link must be powered up to let panel driver to talk to the panel during prepare() callback execution. Set the prepare_prev_first flag to guarantee this. Fixes: 9e15123eca79 ("drm/msm/dsi: Stop unconditionally powering up DSI hosts at modeset") Signed-off-by: Guido Günther <agx@sigxcpu.org> Signed-off-by: David Heidelberg <david@ixit.cz> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patch.msgid.link/20260417-axolotl-display-v2-1-8ce5341e46c2@ixit.cz
2026-04-17drm/xe: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: intel-xe@lists.freedesktop.org Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-29-tvrtko.ursulin@igalia.com
2026-04-17drm/v3d: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Melissa Wen <mwen@igalia.com> Cc: Maíra Canal <mcanal@igalia.com> Cc: dri-devel@lists.freedesktop.org Acked-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-28-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Philipp Stanner <phasta@kernel.org> Cc: Christian König <ckoenig.leichtzumerken@gmail.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-27-tvrtko.ursulin@igalia.com
2026-04-17drm/panthor: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Steven Price <steven.price@arm.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-26-tvrtko.ursulin@igalia.com
2026-04-17drm/panfrost: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Rob Herring <robh@kernel.org> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-25-tvrtko.ursulin@igalia.com
2026-04-17drm/nouveau: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Lyude Paul <lyude@redhat.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: nouveau@lists.freedesktop.org Reviewed-by: Lyude Paul <lyude@redhat.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-24-tvrtko.ursulin@igalia.com
2026-04-17drm/msm: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Rob Clark <robin.clark@oss.qualcomm.com> Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-23-tvrtko.ursulin@igalia.com
2026-04-17drm/lima: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Qiang Yu <yuq825@gmail.com> Cc: lima@lists.freedesktop.org Reviewed-by: Qiang Yu <yuq825@gmail.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-22-tvrtko.ursulin@igalia.com
2026-04-17drm/imagination: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Frank Binns <frank.binns@imgtec.com> Cc: Matt Coster <matt.coster@imgtec.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Matt Coster <matt.coster@imgtec.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-21-tvrtko.ursulin@igalia.com
2026-04-17drm/etnaviv: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Russell King <linux+etnaviv@armlinux.org.uk> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: etnaviv@lists.freedesktop.org Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-20-tvrtko.ursulin@igalia.com
2026-04-17drm/amdgpu: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin
Remove member no longer used by the scheduler core. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-19-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Embed run queue singleton into the schedulerTvrtko Ursulin
Now that the run queue to scheduler relationship is always 1:1 we can embed it (the run queue) directly in the scheduler struct and save on some allocation error handling code and such. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-15-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Remove FIFO and RR and simplify to a single run queueTvrtko Ursulin
Since the new FAIR policy is in general better than FIFO and almost as good as round-robin in interactive use cases, plus the latter has not been the default policy in a long time, we can afford to remove both and leave just FAIR. By doing so we can simplify the scheduler code by making the scheduler to run queue relationship always 1:1 and remove some code. Also, now that the FIFO policy is gone the tree of entities is not a FIFO tree any more so rename it to just the tree. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-14-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Switch default policy to fairTvrtko Ursulin
FAIR policy works better than FIFO for all known use cases and either matches or gets close to RR. Lets make it a default to improve the user experience especially with interactive workloads competing with heavy clients. 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> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-13-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Favour interactive clients slightlyTvrtko Ursulin
GPUs do not always implement preemption and DRM scheduler definitely does not support it at the front end scheduling level. This means execution quanta can be quite long and is controlled by userspace, consequence of which is picking the "wrong" entity to run can have a larger negative effect than it would have with a virtual runtime based CPU scheduler. Another important consideration is that rendering clients often have shallow submission queues, meaning they will be entering and exiting the scheduler's runnable queue often. Relevant scenario here is what happens when an entity re-joins the runnable queue with other entities already present. One cornerstone of the virtual runtime algorithm is to let it re-join at the head and rely on the virtual runtime accounting and timeslicing to sort it out. However, as explained above, this may not work perfectly in the GPU world. Entity could always get to overtake the existing entities, or not, depending on the submission order and rbtree equal key insertion behaviour. Allow interactive jobs to overtake entities already queued up for the limited case when interactive entity is re-joining the queue after being idle. This gives more opportunity for the compositors to have their rendering executed before the GPU hogs even if they have been configured with the same scheduling priority. To classify a client as interactive we look at its average job duration versus the average for the whole scheduler. We can track this easily by plugging into the existing job runtime tracking and applying the exponential moving average window on the past submissions. Then, all other things being equal, we let the more interactive jobs go first. 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> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-12-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Add fair scheduling policyTvrtko Ursulin
The FAIR scheduling policy is built upon the same concepts as the well known CFS CPU scheduler - entity run queue is sorted by the virtual GPU time consumed by entities in a way that the entity with least vruntime runs first. It is able to avoid total priority starvation, which is one of the problems with FIFO, and it also does not need for per priority run queues. As it scales the actual GPU runtime by an exponential factor as the priority decreases, the virtual runtime for low priority entities grows faster than for normal priority, pushing them further down the runqueue order for the same real GPU time spent. Apart from this fundamental fairness, fair policy is especially strong in oversubscription workloads where it is able to give more GPU time to short and bursty workloads when they are running in parallel with GPU heavy clients submitting deep job 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> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-11-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Remove idle entity from treeTvrtko Ursulin
There is no need to keep entities with no jobs in the tree so lets remove it once the last job is consumed. This keeps the tree smaller which is nicer and more efficient as entities are removed and re-added on every popped job. Apart from that, the upcoming fair scheduling algorithm will rely on the tree only containing runnable entities. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-10-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Account entity GPU timeTvrtko Ursulin
To implement fair scheduling we need a view into the GPU time consumed by entities. Problem we have is that jobs and entities objects have decoupled lifetimes, where at the point we have a view into accurate GPU time, we cannot link back to the entity any longer. Solve this by adding a light weight entity stats object which is reference counted by both entity and the job and hence can safely be used from either side. With that, the only other thing we need is to add a helper for adding the job's GPU time into the respective entity stats object, and call it once the accurate GPU time has been calculated. The most convenient place to do that is the free job worker for several reasons. Doing the accounting from the job completion callback would mean a few locks would need to become irq safe and we would also need to worry about out of order completions (via dma_fence_is_signaled calls which we cannot control). In-order completions are critical for GPU time accuracy which is currently adjusted per fence in the free worker and requires looking at the next job in the scheduler pending list. We would also need to add a new lock to protect the scheduler average stats update. In contrast to those complications, having the accounting done from the free worker is serialized by definition and all the above complications are avoided. Downside is there is potential for a time lag between job completions and GPU time being accounted against the entity. Since that is partly alleviated by batch processing the completed job queue, and the scheduling algorithm does not attempt to be completely fair, which would even be rather impossible to achieve in the GPU world with the current DRM scheduler design and hardware with no or poor preemption support, this downside is not considered critical. Plus, in practice the scheduler is also affected by worker scheduling delays from other angles too. Not least being able to promptly feed the GPU with new work. We therefore choose the simple option and can later consider improving upon it if the need arises. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-9-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Free all finished jobs at onceTvrtko Ursulin
To implement fair scheduling we will need as accurate as possible view into per entity GPU time utilisation. Because sched fence execution time are only adjusted for accuracy in the free worker we need to process completed jobs as soon as possible so the metric is most up to date when view from the submission side of things. 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> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-8-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Implement RR via FIFOTvrtko Ursulin
Round-robin being the non-default policy and unclear how much it is used, we can notice that it can be implemented using the FIFO data structures if we only invent a fake submit timestamp which is monotonically increasing inside drm_sched_rq instances. So instead of remembering which was the last entity the scheduler worker picked we can simply bump the picked one to the bottom of the tree, which ensures round-robin behaviour between all active queued jobs. If the picked job was the last from a given entity, we remember the assigned fake timestamp and use it to re-insert the job once it re-joins the queue. This ensures the job neither overtakes all already queued jobs, neither it goes last. Instead it keeps the position after the currently queued jobs and before the ones which haven't yet been queued at the point the entity left the queue. Advantage is that we can consolidate to a single code path and remove a bunch of code. Downside is round-robin mode now needs to lock on the job pop path but that should not have a measurable performance impact. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-7-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Add some more scheduling quality unit testsTvrtko Ursulin
This time round we explore the rate of submitted job queue processing with multiple identical parallel clients. Example test output: 3 clients: t cycle: min avg max : ... + 0ms 0 0 0 : 0 0 0 + 102ms 2 2 2 : 2 2 2 + 208ms 5 6 6 : 6 5 5 + 310ms 8 9 9 : 9 9 8 ... + 2616ms 82 83 83 : 83 83 82 + 2717ms 83 83 83 : 83 83 83 avg_max_min_delta(x100)=60 Every 100ms for the duration of the test it logs how many jobs each client had completed, prefixed by minimum, average and maximum numbers. When finished overall average delta between max and min is output as a rough indicator to scheduling fairness. 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> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-6-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Add some scheduling quality unit testsTvrtko Ursulin
To make evaluating different scheduling policies easier (no need for external benchmarks) and perfectly repeatable, lets add some synthetic workloads built upon mock scheduler unit test infrastructure. Focus is on two parallel clients (two threads) submitting different job patterns and logging their progress and some overall metrics. This is repeated for both scheduler credit limit 1 and 2. Example test output: Normal and low: pct1 cps1 qd1; pct2 cps2 qd2 + 0ms: 0 0 0; 0 0 0 + 104ms: 100 1240 112; 100 1240 125 + 209ms: 100 0 99; 100 0 125 + 313ms: 100 0 86; 100 0 125 + 419ms: 100 0 73; 100 0 125 + 524ms: 100 0 60; 100 0 125 + 628ms: 100 0 47; 100 0 125 + 731ms: 100 0 34; 100 0 125 + 836ms: 100 0 21; 100 0 125 + 939ms: 100 0 8; 100 0 125 + 1043ms: ; 100 0 120 + 1147ms: ; 100 0 107 + 1252ms: ; 100 0 94 + 1355ms: ; 100 0 81 + 1459ms: ; 100 0 68 + 1563ms: ; 100 0 55 + 1667ms: ; 100 0 42 + 1771ms: ; 100 0 29 + 1875ms: ; 100 0 16 + 1979ms: ; 100 0 3 0: prio=normal sync=0 elapsed_ms=1015ms (ideal_ms=1000ms) cycle_time(min,avg,max)=134,222,978 us latency_time(min,avg,max)=134,222,978 us 1: prio=low sync=0 elapsed_ms=2009ms (ideal_ms=1000ms) cycle_time(min,avg,max)=134,215,806 us latency_time(min,avg,max)=134,215,806 us There we have two clients represented in the two respective columns, with their progress logged roughly every 100 milliseconds. The metrics are: - pct - Percentage progress of the job submit part - cps - Cycles per second - qd - Queue depth - number of submitted unfinished jobs The cycles per second metric is inherent to the fact that workload patterns are a data driven cycling sequence of: - Submit 1..N jobs - Wait for Nth job to finish (optional) - Sleep (optional) - Repeat from start In this particular example we have a normal priority and a low priority client both spamming the scheduler with 8ms jobs with no sync and no sleeping. Hence they build very deep queues and we can see how the low priority client is completely starved until the normal finishes. Note that the PCT and CPS metrics are irrelevant for "unsync" clients since they manage to complete all of their cycles instantaneously. A different example would be: Heavy and interactive: pct1 cps1 qd1; pct2 cps2 qd2 + 0ms: 0 0 0; 0 0 0 + 106ms: 5 40 3; 5 40 0 + 209ms: 9 40 0; 9 40 0 + 314ms: 14 50 3; 14 50 0 + 417ms: 18 40 0; 18 40 0 + 522ms: 23 50 3; 23 50 0 + 625ms: 27 40 0; 27 40 1 + 729ms: 32 50 0; 32 50 0 + 833ms: 36 40 1; 36 40 0 + 937ms: 40 40 0; 40 40 0 + 1041ms: 45 50 0; 45 50 0 + 1146ms: 49 40 1; 49 40 1 + 1249ms: 54 50 0; 54 50 0 + 1353ms: 58 40 1; 58 40 0 + 1457ms: 62 40 0; 62 40 1 + 1561ms: 67 50 0; 67 50 0 + 1665ms: 71 40 1; 71 40 0 + 1772ms: 76 50 0; 76 50 0 + 1877ms: 80 40 1; 80 40 0 + 1981ms: 84 40 0; 84 40 0 + 2085ms: 89 50 0; 89 50 0 + 2189ms: 93 40 1; 93 40 0 + 2293ms: 97 40 0; 97 40 1 In this case client one is submitting 3x 2.5ms jobs, waiting for the 3rd and then sleeping for 2.5ms (in effect causing 75% GPU load, minus the overheads). Second client is submitting 1ms jobs, waiting for each to finish and sleeping for 9ms (effective 10% GPU load). Here we can see the PCT and CPS reflecting real progress. 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> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-5-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Move run queue related code into a separate fileTvrtko Ursulin
Lets move all the code dealing with struct drm_sched_rq into a separate compilation unit. Advantage being sched_main.c is left with a clearer set of responsibilities. 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> Reviewed-by: Matthew Brost <matthew.brost@intel.com> # v1 Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-4-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Consolidate entity run queue managementTvrtko Ursulin
Move the code dealing with entities entering and exiting run queues to helpers to logically separate it from jobs entering and exiting entities. 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> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-3-tvrtko.ursulin@igalia.com
2026-04-17drm/sched: Disallow initializing entities with no schedulersTvrtko Ursulin
Since we have removed the case where amdgpu was initializing entitites with either no schedulers on the list, or with a single NULL scheduler, and there appears no other drivers which rely on this, we can simplify the scheduler by explicitly rejecting that early. 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> Reviewed-by: Christian König <christian.koenig@amd.com> Acked-by: Philipp Stanner <phasta@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-2-tvrtko.ursulin@igalia.com
2026-04-17drm/xe/pf: Fix VF's scheduling priority reportingMichal Wajdeczko
When preparing number of impacted VFs parameter for the reporting helper function, we wrongly ended with adding +1 (representing PF) twice, since local variable total_vfs was already adjusted. This resulted in printing a message that was referring to an invalid VF: [] xe ... [drm] PF: Enabled 2 of 24 VFs [] xe ... [drm] PF: Tile0: GT0: PF..VF25 provisioned with 0(low) scheduling priority Fix variable initialization and adjust the loop accordingly. Fixes: fbbf73a81b84 ("drm/xe/pf: Force new VFs prorities only once") Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://patch.msgid.link/20260416131831.7302-1-michal.wajdeczko@intel.com
2026-04-17Merge tag 'drm-intel-next-fixes-2026-04-16' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/i915/kernel into drm-next - Fix VESA backlight possible check condition [backlight] (Suraj Kandpal) - Verify the correct plane DDB entry [wm] (Ville Syrjälä) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Tvrtko Ursulin <tursulin@igalia.com> Link: https://patch.msgid.link/aeCGoL4FFwT66bF4@linux
2026-04-17Merge tag 'topic/pipe-reorder-2026-04-15' of ↵Dave Airlie
https://gitlab.freedesktop.org/drm/i915/kernel into drm-next drm/i915/display: change pipe allocation order for discrete platforms This is a topic pull request for changing the pipe allocation order for discrete platforms from the usual A,B,C,D to A,C,B,D. The goal is to help pipe joiner configurations that reserve the adjacent pipe as the secondary pipe without the user space knowing. More details in the relevant commit message. The CRTC iteration is also changed to remain in pipe order. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/d69501d53c233386d70ed10290af24aafebf434f@intel.com
2026-04-16drm/xe/eustall: Fix drm_dev_put called before stream disable in closeShuicheng Lin
In xe_eu_stall_stream_close(), drm_dev_put() is called before the stream is disabled and its resources are freed. If this drops the last reference, the device structures could be freed while the subsequent cleanup code still accesses them, leading to a use-after-free. Fix this by moving drm_dev_put() after all device accesses are complete. This matches the ordering in xe_oa_release(). Fixes: 9a0b11d4cf3b ("drm/xe/eustall: Add support to init, enable and disable EU stall sampling") Cc: Harish Chegondi <harish.chegondi@intel.com> Assisted-by: Claude:claude-opus-4.6 Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Harish Chegondi <harish.chegondi@intel.com> Link: https://patch.msgid.link/20260415225428.3399934-1-shuicheng.lin@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-04-16drm/xe/xe3p_lpg: Add Wa_18044193044Varun Gupta
Add engine workaround Wa_18044193044 for graphics version 35.10 stepping A0..B0. Signed-off-by: Varun Gupta <varun.gupta@intel.com> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com> Link: https://patch.msgid.link/20260326161628.3566067-1-varun.gupta@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2026-04-16drm/nouveau: Fix double call to drm_sched_entity_fini()Philipp Stanner
nouveau_abi16_chan_fini() does invoke drm_sched_entity_fini() twice: Once directly, and a second time through nouveau_sched_destroy(). That's likely undesired behavior and might be a bug since drm_sched_entity_fini() decrements reference counts. Fix the issue by using the appropriate function, drm_sched_entity_kill(), to kill all remaining jobs within the entity. Cc: stable@kernel.vger.org Fixes: 9a0c32d698c1 ("drm/nouveau: don't fini scheduler if not initialized") Suggested-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260415144956.272506-3-phasta@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-04-16drm/sched: Make drm_sched_entity_kill() a public functionPhilipp Stanner
Some drivers do not care on teardown whether the last jobs pending in an entity are actually executed before teardown completed. For such scenarios, drm_sched_entity_flush() is not the ideal function since it's intended to wait for jobs to complete. Make drm_sched_entity_kill() public for that use-case and update the documentation. Suggested-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260415144956.272506-2-phasta@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-04-17drm/colorop: Check if getting curve_1d_type default succeedsJonathan Cavitt
Static analysis issue: In all other uses of the function drm_object_property_get_default_value, the return value of the function is checked before the output is saved to the relevant object parameter. Though likely unnecessary given the execution path involved, keep the behavior consistent across uses and only set colorop_state->curve_1d_type in __drm_colorop_state_reset if drm_object_property_get_default_value succeeds. Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/20260202214709.8037-2-jonathan.cavitt@intel.com
2026-04-17drm/gpuvm: Do not prepare NULL objectsJonathan Cavitt
Statis analysis issue: drm_gpuvm_prepare_range issues an exec_object_prepare call to all drm_gem_objects mapped between addr and addr + range. However, it is possible (albeit very unlikely) that the objects found through drm_gpuvm_for_each_va_range (as connected to va->gem) are NULL, as seen in other functions such as drm_gpuva_link and drm_gpuva_unlink_defer. Do not prepare NULL objects. Fixes: 50c1a36f594b ("drm/gpuvm: track/lock/validate external/evicted objects") Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com> Link: https://patch.msgid.link/20260130191953.61718-2-jonathan.cavitt@intel.com
2026-04-16drm/i915/reset: Disable execlist per-engine reset for display reset testsVille Syrjälä
The display reset only happens from the full reset path. We must therefore force execlist submission to always take the full reset path and not the per-engine reset path. Currently the display reset tests are in fact not testing display resets at all on platforms using execlist submission. Ring submission and GuC submission always take the full path anyway. Also disable the engine reset inside __intel_gt_set_wedged() so that we simulate the intel_gt_gpu_reset_clobbers_display() behavior as closely as possible also when taking the full wedge path. The slight race between the separate intel_display_reset_test() calls in the overall reset path is harmless. kms_busy will keep the modparam fixed during the test, and even if someone were to fiddle with the modparam manually nothing bad should happen if the calls return different values. Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-8-ville.syrjala@linux.intel.com
2026-04-16drm/i915/reset: Add "intel_display_reset_count" debugfs fileVille Syrjälä
Expose the number of display resets performed in a new "display_reset_count" debugfs file. kms_busy can use this to confirm that the kernel actually took the full display reset path. v2: Give the file an "intel_" namespace (Jani) Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Testcase: igt/kms_busy/*-with-reset Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-7-ville.syrjala@linux.intel.com
2026-04-16drm/xe/display: Add init_clock_gating.h stubsVille Syrjälä
Add static inline stubs for init_clock_gating.h functions so that we don't need ifdefs in the actual code. We already have one in intel_display_power.c, and now I need to bring over intel_display_reset.c. Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-6-ville.syrjala@linux.intel.com
2026-04-16drm/i915/reset: Move pending_fb_pin handling to i915Ville Syrjälä
Only i915 uses the pending_fb_pin counter to potentially whack the GPU harder if the display gets nuked during a GPU reset. Move the atomic counter into the i915 specific bits of code, so that we don't need to worry about on the display side. For some reason the overlay code kept the pending_fb_pin counter elevated for longer than just for the pin, but from now on it'll just cover the actual pinning part. Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-5-ville.syrjala@linux.intel.com
2026-04-16drm/i915/reset: Reorganize display reset codeVille Syrjälä
Stop returning the "is there a display?" status from intel_display_reset_prepare(). I plan to move the pending_fb_pin into the i915 code, so I need to make that determination already before intel_display_reset_prepare() is called. Add a new intel_display_reset_supported() function for that. v2: Also check display!=NULL for mock tests Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-4-ville.syrjala@linux.intel.com
2026-04-16drm/xe: Clear xe->display when no longer validVille Syrjälä
Don't leave a stale xe->display pointer hanging around after the display driver has been torn down. While xe shouldn't hit the display reset related issue that affects i915, leaving stale pointer floating around still seems like a bad idea. Cc: Jani Nikula <jani.nikula@intel.com> Cc: Jouni Högander <jouni.hogander@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260415210411.24750-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2026-04-16drm/xe: Fix type and parameter name mismatches in kernel-doc referencesShuicheng Lin
Fix kernel-doc references that point to wrong type or parameter names: - xe_guc_capture_types.h: register_data_type -> capture_register_data_type to match actual enum name - xe_oa_types.h: enum @drm_xe_oa_format_type -> enum drm_xe_oa_format_type (spurious '@' before type name) - xe_pt_walk.h: @sizes -> @shifts to match actual struct member, @start -> @addr to match actual parameter name, page.table. -> page table. (typo) Assisted-by: GitHub Copilot:claude-sonnet-4.6 Reviewed-by: Brian Nguyen <brian3.nguyen@intel.com> Link: https://patch.msgid.link/20260414225457.3687449-5-shuicheng.lin@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2026-04-16drm/xe: Fix kernel-doc comment syntax issues in header filesShuicheng Lin
Fix doc comment formatting that does not conform to kernel-doc syntax rules: - xe_guc_relay_types.h: Add missing space after '/**' in member doc comment (/**@lock -> /** @lock) - xe_oa_types.h: Fix struct documentation to use proper kernel-doc format (/** @xe_oa_buffer: -> /** struct xe_oa_buffer -) - xe_pagefault_types.h: Use dash instead of colon as separator in struct doc (struct xe_pagefault_queue: -> struct xe_pagefault_queue -) - xe_pt_walk.h: Use dash instead of colon as separator in function docs (xe_pt_num_entries: -> xe_pt_num_entries -, xe_pt_offset: -> xe_pt_offset -) Assisted-by: GitHub Copilot:claude-sonnet-4.6 Reviewed-by: Brian Nguyen <brian3.nguyen@intel.com> Link: https://patch.msgid.link/20260414225457.3687449-4-shuicheng.lin@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>