aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panthor
AgeCommit message (Collapse)AuthorFilesLines
3 daysMerge tag 'drm-next-2026-06-17' of https://gitlab.freedesktop.org/drm/kernelLinus Torvalds23-841/+2540
Pull drm updates from Dave Airlie: "Highlights: - xe: add initial CRI platform support - amdgpu: initial HDMI 2.1 FRL support - rust: add some new type concepts for device lifetimes - scheduler: moves to a fair algorithm and lots of cleanups But it's mostly the usual mountain of changes across the board. core: - add docbook for DRM_IOCTL_SYNCOBJ_EVENTFD - change signature of drm_connector_attach_hdr_output_metadata_property - dedup counter and timestamp retrieval in vblank code - parse AMD VSDB v3 in CTA extension blocks - add P230, Y7, XYYY2101010, T430, XVUY210101010 formats - don't call drop master on file close if not master - use drm_printf_indent in atomic / bridge - fix 32b format descriptions - docs: fix toctree - hdmi: add common TMDS character rates - fix drm_syncobj_find_fence leak rust: - introduce Higher-Ranked lifetime types - replace drvdata with scoped registration data - add GPUVM immediate mode abstraction for rust GPU drivers - introduce DeviceContext type state for drm::Device bridge: - clarify drm_bridge_get/put - create drm_get_bridge_by_endpoint and use it - analogix_dp: add panel probing - ite-it6211 - use drm audio hdmi helpers buddy: - add lockdep annotations dp: - add PR and VRR updates - mst: fix buffer overflows - add Adaptive Sync SDP decoding support - fix OOB reads in dp-mst ttm: - bump fpfn/lpfn to 64-bit scheduler: - change default to fair scheduler - map runqueue 1:1 with scheduler dma-buf: - port selftests to kunit - convert dma-buf system/heap allocators to module - add separate DMABUF_HEAPS_SYSTEM_CC_SHARED Kconfig udmabuf: - revert hugetlb support - fix error with CONFIG_DMA_API_DEBUG dma-fence: - fix tracepoints lifetime - remove unused signal on any support ras: - add clear error counter netlink command to drm ras gpusvm: - reject VMAs with VM_IO or VM_PFNMAP when creating SVM ranges - use IOVA allocations pagemap: - use IOVA allocations panels: - update to use ref counts - add support for CSW PNB601LS1-2, LGD LP116WHA-SPB1 - add support for waveshare panels - CMN N116BCN-EA1, CMN N140HCA-EEK, IVO M140NWFQ R5, - IVO, R140NWFW R0, BOE NT140*, BOE NV133FHM-N4F, - AUO B140*, AUO B133HAN06.6 and AUO B116XTN02.3 eDP panels - Surface Pro 12 Panel xe: - add CRI PCI-IDs - debugfs add multi-lrc info - engine init cleanup - PF fair scheduling auto provisioning - system controller support for CRI/Xe3p - PXP state machine fixes - Reset/wedge/unload corner case fixes - Wedge path memory allocation fixes - PAT type cleanups - Reject unsafe PAT for CPU cached memory - OA improvements for CRI device memory - kernel doc syntax in xe headers - xe_drm.h documentation fixes - include guard cleanups - VF CCS memory pool - i915/xe step unification - Xe3p GT tuning fixes - forcewake cleanup in GT and GuC - admin-only PF mode - enable hwmon energy attributes for CRI - enable GT_MI_USER_INTERRUPT - refactor emit functions - oa workarounds - multi_queue: allow QUEUE_TIMESTAMP register - convert stolen memory to ttm range manager - use xe2 style blitter as a feature flag - make drm_driver const - add/use IRQ page to HW engine definition - fix oops when display disabled i915: - enable PIPEDMC_ERROR interrupt - more common display code refactoring - restructure DP/HDMI sink format handling - eliminate FB usage from lowlevel pinning code - panel replay bw optimization - integrate sharpness filter into the scaler - new fb_pin abstraction for xe/i915 fb transparent handling - skip inactive MST connectors on HDCP - start switching to display specific registers - use polling when irq unavailable - Adaptive-sync SDP prep amdgpu: - use drm_display_info for AMD VSDB data - Initial HDMI 2.1 FRL support - Initial DCN 4.2.1 support - GART fixes for non-4k pages - GC 11.5.6/SDMA 6.4.0/and other new IPs - GFX9/DCE6/Hawaii/SDMA4/GART/Userq fixes - Finish support for using multiple SDMA queues for TTM operations - SWSMU updates - GC 12.1 updates - SMU 15.0.8 updates - DCN 4.2 updates - DC type conversion fixes - Enable DC power module - Replay/PSR updates - SMU 13.x updates - Compute queue quantum MQD updates - ASPM fix - Align VKMS with common implementation - DC analog support fixes - UVD 3 fixes - TCC harvesting fixes for SI - GC 11 APU module reload fix - NBIO 6.3.2 support - IH 7.1 updates - DC cursor fixes - VCN/JPEG user fence fixes - DC support for connectors without DDC - Prefer ROM BAR for default VGA device - DC bandwidth fixes - Add PTL support for profiler - Introduce dc_plane_cm and migrate surface update color path - Add FRL registers for HDMI 2.1 - Restructure VM state machine - Auxless ALPM support - GEM_OP locking/warning fixes - switch to system_dfl_wq amdkfd: - GPUVM TLB flush fix - Hotplug fix - Boundary check fixes - SVM fixes - CRIU fixes - add profiler API - MES 12.1 updates msm: - core: - fix shrinker documentation - IFPC enabled for gen8 - PERFCNTR_CONFIG ioctl support - GPU: - reworked UBWC handling - a810 support - MDSS: - add support for Milos platform - reworked UBWC handling - DisplayPort: - reworked HPD handling as prep for MST - DPU: - Milos platform support - reworked UBWC handling - DSI: - Milos platform support nova: - Hopper/Blackwell enablement (GH100/GB100/GB202) - FSP support - 32-bit firmware support - HAL functions - refactor GSP boot/unload - GA100 support - VBIOS hardening/refactoring - Adopt higher order lifetime types tyr: - define register blocks - add shmem backed GEM objects - adopt higher order lifetime types - move clock cleanup into Drop radeon: - Hawaii SMU fixes - CS parser fix - use struct drm_edid instead of edid amdxdna: - export per-client BO memory via fdinfo - AIE4 device support - support medium/lower power modes - expandable device heap support - revert read-only user-pointer BO mappings ivpu: - support frequency limiting panthor: - enable GEM shrinker support - add eviction and reclaim info to fdinfo v3d: - enable runtime PM mgag200: - support XRGB1555 + C8 ast: - support XRGB1555 + C8 - use constants for lots of registers - fix register handling imagination: - fence handling refactoring nouveau: - fix sched double call - expose VBIOS on GSP-RM systems - add GA100 support virtio: - add VIRTIO_GPU_F_BLOB_ALIGNMENT flag - add deferred mapping support gud: - add RCade Display Adapter hibmc: - fix no connectors usage mediatek: - hdmi: convert error handling - simplify mtk_crtc allocation exynos: - move fbdev emulation to drm client buffers - use drm format helpers for geometry/size - adopt core DMA tracking - fix framebuffer offset handling renesas: - add RZ/T2H SOC support versilicon: - add cursor plane support tegra: - use drm client for framebuffer" * tag 'drm-next-2026-06-17' of https://gitlab.freedesktop.org/drm/kernel: (1731 commits) dma-buf: move system_cc_shared heap under separate Kconfig accel/amdxdna: Clear sva pointer after unbind agp/amd64: Fix broken error propagation in agp_amd64_probe() accel/amdxdna: Require carveout when PASID and force_iova are disabled drm/amdkfd: always resume_all after suspend_all drm/amdgpu/gfx: move fault and EOP IRQ get/put to hw_init/hw_fini drm/amd/display: Consult MCCS FreeSync cap only if requested & supported drm/amd/pm: Use strscpy in profile mode parsing drm/amdkfd: Fix infinite loop parsing CRAT with zero subtype length drm/amdkfd: fix sysfs topology prop length on buffer truncation drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages drm/amd/pm: bound OD parameter parsing to stack array size drm/amd/pm: Stop pp_od_clk_voltage emit at PAGE_SIZE drm/amdkfd: Unwind debug trap enable on copy_to_user failure drm/amdgpu: validate the mes firmware version for gfx12.1 drm/amdgpu: validate the mes firmware version for gfx12 drm/amdgpu: compare MES firmware version ucode for gfx11 drm/amdkfd: Add bounds check for AMDKFD_IOC_WAIT_EVENTS drm/amdgpu: restart the CS if some parts of the VM are still invalidated drm/amd/display: use unsigned types for local pipe and REG_GET counters ...
2026-06-03mm/slab: improve kmem_cache_alloc_bulkChristoph Hellwig1-7/+6
The kmem_cache_alloc_bulk return value is weird. It returns the number of allocated objects, but that must always be 0 or the requested number based on the implementations and the handling in the callers, but that assumption is not actually documented anywhere, which confuses automated review tools. Fix this by returning a bool if the allocation succeeded and adding a kerneldoc comment explaining the API. [rob.clark@oss.qualcomm.com: fixups in msm_iommu_pagetable_prealloc_allocate() ] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> # skbuff Link: https://patch.msgid.link/20260528093437.2519248-2-hch@lst.de Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
2026-05-28drm/panthor: Reduce padding in gems debugfs for refcountNicolas Frattaroli1-4/+4
The "gems" debugfs file is getting a little too wide for comfort. While a lot of this is unavoidable due to the theoretical upper limits of numbers here (e.g. size needs to be 16 chars because 2**48-1 in decimal is 15 digits, plus one space for separation), the refcount column has a decent 5 characters to be saved, as it can only ever contain a 10-digit decimal number. Reduce the refcount column's width to 11, which fulfils this requirement with an additional space for separation. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260521-panthor-bo-reclaim-observability-v5-2-49313994da55@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-05-28drm/panthor: Implement evicted status for GEM objectsNicolas Frattaroli2-4/+22
For fdinfo to be able to fill its evicted counter with data, panthor needs to keep track of whether a GEM object has ever been reclaimed. Just checking whether the pages are resident isn't enough, as newly allocated objects also won't be resident. Do this with a new atomic_t member on panthor_gem_object. It's increased when an object gets evicted by the shrinker, and saturates at INT_MAX. This means that once an object has been evicted at least once, its reclaim counter will never return to 0. Due to this, it's possible to distinguish evicted non-resident pages from newly allocated non-resident pages by checking whether reclaimed_count is != 0 Also add a new column and status flag to the panthor gems debugfs: the column is the number of times an object has been evicted, whereas the flag indicates whether it currently is evicted. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260521-panthor-bo-reclaim-observability-v5-1-49313994da55@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-05-28Merge v7.1-rc5 into drm-nextSimona Vetter3-29/+22
Boris Brezillion needs the gem lru fixes 379e8f1ca5e9 ("drm/gem: Make the GEM LRU lock part of drm_device") backmerged for drm-misc-next. That also means we need to sort out the rename conflict in panthor with the fixup patch from Boris from drm-tip. Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
2026-05-07drm/panthor: Avoid potential UAF due to memory reclaimAkash Goel1-5/+11
Recent changes to add shrinker support introduced a use after free vulnerability. When a BO is evicted from the shrinker callback, all its CPU and GPU mappings are invalidated. It can happen that another GPU mapping is created for the BO after the eviction. Because of the new GPU mapping, BO will be added back to one of the reclaim list but the state of corresponding vm_bo will not be changed. If vm_bo remains in evicted state and shrinker callback is invoked again then the new GPU mapping won't be invalidated. As a result the backing pages, which were acquired on the creation of new GPU mapping, can get reclaimed and reused whilst they are still mapped to the GPU. To prevent the use after free possibility, this commit removes the evicted check for vm_bo so that all GPU mappings are checked for invalidation. v2: - Update comment and add a newline in panthor_vm_evict_bo_mappings_locked(). Fixes: fb42964e2a76 ("drm/panthor: Add a GEM shrinker") Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Akash Goel <akash.goel@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260413080253.1288157-1-akash.goel@arm.com
2026-05-07drm/panthor: Fix missing declaration for panthor_transparent_hugepagegyeyoung2-0/+3
sparse reports: drivers/gpu/drm/panthor/panthor_drv.c:1805:6: warning: symbol 'panthor_transparent_hugepage' was not declared. Should it be static? Make it clean. Signed-off-by: gyeyoung <gye976@gmail.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260503144234.2150138-1-gye976@gmail.com
2026-04-30drm/panthor: Use a local iomem base for MMU AS registersKarunika Choo2-20/+25
Add an MMU_AS_CONTROL local iomem pointer to struct panthor_mmu and switch AS register accesses to that base. Interrupt accesses remain routed through the IRQ-local iomem base, while the MMU register definitions are adjusted so AS registers are expressed relative to the local MMU AS window. This completes the conversion away from using the global device mapping for MMU AS register accesses. No functional change intended. v3: - Pick up R-bs from Liviu and Steve v2: - Pick up Ack from Boris. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-9-karunika.choo@arm.com
2026-04-30drm/panthor: Use a local iomem base for firmware control registersKarunika Choo2-14/+17
Add an MCU_CONTROL-local iomem pointer to struct panthor_fw and use it for firmware control and status register accesses. Job interrupt accesses continue to go through the IRQ-local base, while doorbell writes stay on the device-wide mapping because they live outside the MCU control window. This keeps firmware register accesses scoped to the component that owns them. No functional change intended. v3: - Pick up R-bs from Liviu and Steve v2: - Pick up Ack from Boris. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-8-karunika.choo@arm.com
2026-04-30drm/panthor: Use a local iomem base for PWR registersKarunika Choo3-58/+79
Add a PWR_CONTROL-local iomem pointer to struct panthor_pwr and switch power controller register accesses to that base. Update IRQ-local iomem base to use PWR_CONTROl-local iomem and update the register definitions so the PWR block can be addressed relative to its local base. This removes the remaining dependence on the global device MMIO mapping for PWR register accesses. Update panthor_gpu_info_init() to also use the correct PWR_CONTROL iomem for the *_PRESENT registers. No functional change intended. v3: - Clean up definitions for pwr->iomem and pwr->irq.iomem. - Update PWR_INT_BASE to be relative to pwr->iomem. v2: - Update panthor_gpu_info_init() to use block-local iomem pointer. Signed-off-by: Karunika Choo <karunika.choo@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-7-karunika.choo@arm.com
2026-04-30drm/panthor: Use a local iomem base for GPU registersKarunika Choo3-47/+56
Add a GPU_CONTROL-local iomem pointer to struct panthor_gpu and use it for GPU register accesses. This limits GPU register accesses to the GPU block instead of using the device-wide MMIO mapping directly. Interrupt register accesses continue to use the IRQ-local base provided by the common IRQ helpers. Update panthor_gpu_info_init() to also use a local iomem offset for GPU features and capability. This is a refactoring only and does not change behaviour. v3: - Pick up R-bs from Liviu and Steve v2: - Update panthor_gpu_info_init() to use block-local iomem pointer. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-6-karunika.choo@arm.com
2026-04-30drm/panthor: Store IRQ register base iomem pointer in panthor_irqKarunika Choo8-20/+42
Update common IRQ handling code to work from an IRQ-local iomem base instead of referencing block-specific interrupt register offsets. Store the interrupt base address iomem pointer in struct panthor_irq and switch the shared IRQ helpers to use generic INT_* offsets from that local base. This removes the need for each caller to expose absolute IRQ register addresses while keeping the common IRQ flow unchanged. No functional change intended. v3: - Clean up definition of pwr->irq.iomem. v2: - Change IRQ request function to accept an iomem pointer instead of computing it from an offset argument. Signed-off-by: Karunika Choo <karunika.choo@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-5-karunika.choo@arm.com
2026-04-30drm/panthor: Replace cross-component register accesses with helpersKarunika Choo8-37/+61
Stop reaching into other components' registers directly and route those operations through the component that owns them. Move the timestamp/coherency helpers into panthor_gpu, add a doorbell helper, and update call sites accordingly. This keeps register knowledge local to each block and avoids spreading cross-component register accesses across the driver. This is a preparatory cleanup for using per-component iomem bases. v3: - Pick up Ack from Boris and R-bs from Liviu and Steve v2: - Fix incorrect spelling of timestamp helpers - Fix unintended trailing backslash Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-4-karunika.choo@arm.com
2026-04-30drm/panthor: Split register definitions by componentsKarunika Choo15-301/+318
Split the panthor register definitions into per-component headers for the GPU, MMU, firmware, power and generic hardware registers. This makes the register layout easier to follow and prepares the driver for component-local iomem mappings by grouping definitions with the code that owns them. The old monolithic panthor_regs.h header can then be dropped. No functional change intended. v3: - Pick up Ack from Boris and R-bs from Liviu and Steve v2: - Merge GPU_ID definitions into panthor_gpu_regs.h - deleted panthor_hw_regs.h Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-3-karunika.choo@arm.com
2026-04-30drm/panthor: Pass an iomem pointer to GPU register access helpersKarunika Choo9-143/+146
Convert the Panthor register access helpers to take an iomem pointer instead of a panthor_device pointer. This makes the helpers usable with block-local registers instead of routing all accesses to go through ptdev->iomem. It is a preparatory change for splitting the register space by components and for moving callers away from cross-component register accesses. No functional change intended. v3: - Pick up R-bs from Liviu and Steve v2: - Pick up Ack from Boris. Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Karunika Choo <karunika.choo@arm.com> Tested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260427155934.416502-2-karunika.choo@arm.com
2026-04-27Merge drm/drm-next into drm-misc-nextThomas Zimmermann2-1/+20
Getting fixes and updates from v7.1-rc1. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2026-04-24Merge tag 'drm-fixes-2026-04-24' of https://gitlab.freedesktop.org/drm/kernelLinus Torvalds2-1/+20
Pull more drm fixes from Dave Airlie: "These are the regular fixes that have built up over last couple of weeks, all pretty minor and spread all over. atomic: - raise the vblank timeout to avoid it on virtual drivers - fix colorop duplication bridge: - stm_lvds: state check fix - dw-mipi-dsi: bridge reference leak fix panel: - visionx-rm69299: init fix dma-fence: - fix sparse warning dma-buf: - UAF fix panthor: - mapping fix arcgpu: - device_node reference leak fix nouveau: - memory leak in error path fix - overflow in reloc path for old hw fix hv: - Kconfig fix v3d: - infinite loop fix" * tag 'drm-fixes-2026-04-24' of https://gitlab.freedesktop.org/drm/kernel: drm/nouveau: fix u32 overflow in pushbuf reloc bounds check MAINTAINERS: split hisilicon maintenance and add Yongbang Shi for hibmc-drm matainers drm/v3d: Reject empty multisync extension to prevent infinite loop drm/panel: visionox-rm69299: Make use of prepare_prev_first drm/drm_atomic: duplicate colorop states if plane color pipeline in use drm/nouveau: fix nvkm_device leak on aperture removal failure hv: Select CONFIG_SYSFB only for CONFIG_HYPERV_VMBUS dma-fence: Silence sparse warning in dma_fence_describe drm/bridge: dw-mipi-dsi: Fix bridge leak when host attach fails drm/arcpgu: fix device node leak drm/panthor: Fix outdated function documentation drm/panthor: Extend VM locked region for remap case to be a superset dma-buf: fix UAF in dma_buf_put() tracepoint drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector drm/atomic: Increase timeout in drm_atomic_helper_wait_for_vblanks()
2026-04-17drm/panthor: Remove drm_sched_init_args->num_rqs usageTvrtko Ursulin2-2/+0
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-13drm/panthor: Fix outdated function documentationAdrián Larumbe1-1/+1
'vm' is no longer allowed to be NULL. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Fixes: 8a1cc07578bf ("drm/panthor: Add GEM logical block") Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260408191228.537625-2-adrian.larumbe@collabora.com Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
2026-04-13drm/panthor: Extend VM locked region for remap case to be a supersetAdrián Larumbe1-0/+19
In the event of an sm_step_remap() that leads to a partial unmap of a transparent huge page, the new locked region required by an extended unmap might not be a superset of the original one. Then, if it leaves a portion of the initially requested one out, the ensuing map will trigger a warning. Fixes: 8e7460eac786 ("drm/panthor: Support partial unmaps of huge pages") Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260408191228.537625-1-adrian.larumbe@collabora.com Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
2026-04-08drm/panthor: Fix kernel-doc in panthor_sched.c so it's visibleSteven Price1-36/+36
Various substructures defined in panthor_sched.c have kernel-doc which is silently ignored because it doesn't include the full path to the member. Fix these issues so that the kernel-doc text is actually output by including the name of the parent. Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260408091242.799074-1-steven.price@arm.com
2026-04-08drm/panthor: Fix kernel-doc warning in panthor_sched.cYicong Hui1-0/+3
Fix the following W=1 kerneldoc warnings by adding the missing parameter descriptions for @ptdev and @events in panthor_sched_report_fw_events() and @ptdev in panthor_sched_report_mmu_fault() Warning: drivers/gpu/drm/panthor/panthor_sched.c:1898 function parameter 'ptdev' not described in 'panthor_sched_report_fw_events' Warning: drivers/gpu/drm/panthor/panthor_sched.c:1898 function parameter 'events' not described in 'panthor_sched_report_fw_events' Warning: drivers/gpu/drm/panthor/panthor_sched.c:2783 function parameter 'ptdev' not described in 'panthor_sched_report_mmu_fault' Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") Signed-off-by: Yicong Hui <yiconghui@gmail.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260405192309.389039-1-yiconghui@gmail.com
2026-04-03drm/panthor: Add a GEM shrinkerAkash Goel6-38/+1027
This implementation is losely based on the MSM shrinker, and it's relying on the drm_gpuvm eviction/validation infrastructure. Right now we only support swapout/eviction, but we could add an extra flag to specify when buffer content doesn't need to be preserved to avoid the swapout/swapin dance. Locking is a bit of a nightmare, but using _trylock() all the way in the reclaim path seems to make lockdep happy. And yes, we might be missing opportunities to reclaim when the system is under heavy GPU load/heavy memory pressure/heavy GPU VM activity, but that's better than no reclaim at all. v2: - Move gpu_mapped_shared next to the mmapped LRU - Add a bunch of missing is_[vm_bo,vma]_evicted() tests - Only test mmap_count to check if a BO is mmaped - Remove stale comment about shrinker not being a thing - Allow pin_count to be non-zero in panthor_gem_swapin_locked() - Fix panthor_gem_sync() to check for BO residency before doing the CPU sync - Fix the value returned by panthor_gem_shrinker_count() in case some memory has been released - Check drmm_mutex_init() ret code - Explicitly mention that PANTHOR_GEM_UNRECLAIMABLE is the initial state of all BOs v3: - Make panthor_gem_try_evict() static - Collect {A,R}-bs v4: - Update the reclaim_state in panthor_gem_mmap() - Don't reclaim GPU-mapped BOs if can_block() returns false - Skip evicited vm_bos in panthor_vm_update_bo_reclaim_lru_locked() to avoid spurious WARN_ON()s - Explain why we have to do this select_evicted_vma/repopulate_evicted_vma dance v5: - Properly report the reclaimable size in panthor_gem_debugfs_print_bos() - Check panthor_vm_lock_region() errors in panthor_vm_evict_bo_mappings_locked() - Fix lock order inversion (dma_resv_wait_timeout() inside gpuva.lock) v6: - Don't remap if the unmapped VMA is evicted. - Drop a stale comment in panthor_gem_dev_map_get_sgt_locked() - s/PANTHOR_GEM_GPU_MAPPED_PRIVATE/PANTHOR_GEM_GPU_MAPPED_SINGLE_VM/ - s/PANTHOR_GEM_GPU_MAPPED_SHARED/PANTHOR_GEM_GPU_MAPPED_MULTI_VM/ - Just count the number of vm_bo to determine the reclaim state in is_gpu_mapped() - Drop a redundant panthor_gem_backing_get_pages_locked() call in panthor_gem_swapin_locked() - Add more comments to panthor_vm_evict_bo_mappings_locked() to convince Claude it's actually safe. - Add a comment in panthor_gem_shrinker_count() to mention the race and hopefully clear Claude's concerns. - Rework the "is-still-in-list" check we have in panthor_mmu_reclaim_priv_bos() to address Claude's concerns - Don't call panthor_vm_unlock_region() if panthor_vm_lock_region() fails in remap_evicted_vma(). Was harmless, but confusing, as pointed out by Claude - Fix can_block() to allow blocking on KSWAPD_RECLAIM-only in a kswapd context - Fix a lockdep warning when the last ref on a BO is released in the shrinker path, where the resv lock can't be acquired other than with a try_lock() v7: - Skip drm_gpuvm_bo_deferred_cleanup() when repopulating VMAs to fix a deadlock Signed-off-by: Akash Goel <akash.goel@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-11-boris.brezillon@collabora.com Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Track the number of mmap on a BOBoris Brezillon2-2/+43
This will be used to order things by reclaimability. v2: - Fix refcounting v3: - Fix refcounting (again) v4: - Collect R-b v5: - Collect R-b v6: - Warn on is_imported() (not supposed to happen since mmap is redirected to the dmabuf layer) instead of adding a conditional in panthor_gem_vm_open() v7: - No changes Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-10-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Split panthor_vm_prepare_map_op_ctx() to prepare for reclaimBoris Brezillon1-27/+41
We're gonna need just the page table reservation logic when we restore evicted BO mappings, so let's prepare for that by extracting the op_ctx init and page table pre-allocation into separate helpers. v2: - Collect R-bs v3: - No changes v4: - No changes v5: - No changes v6: - No changes v7: - No changes Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-9-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Lazily allocate pages on mmap()Boris Brezillon1-41/+73
Defer pages allocation until their first access. v2: - Don't deal with FAULT_FLAG_INTERRUPTIBLE - Make sure bo->backing.pages is never an ERR_PTR() - Drop a useless vm_fault_t local var - Fix comment in panthor_gem_fault() v3: - Collect R-bs v4: - No changes v5: - No changes v6: - Fix huge_fault handling v7: - No changes Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-8-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Part ways with drm_gem_shmem_objectBoris Brezillon7-169/+670
While drm_gem_shmem_object does most of the job we need it to do, the way sub-resources (pages, sgt, vmap) are handled and their lifetimes gets in the way of BO reclaim. There has been attempts to address that [1], but in the meantime, new gem_shmem users were introduced (accel drivers), and some of them manually free some of these resources. This makes things harder to control/sanitize/validate. Thomas Zimmerman is not a huge fan of enforcing lifetimes of sub-resources and forcing gem_shmem users to go through new gem_shmem helpers when they need manual control of some sort, and I believe this is a dead end if we don't force users to follow some stricter rules through carefully designed helpers, because there will always be one user doing crazy things with gem_shmem_object internals, which ends up tripping out the common helpers when they are called. The consensus we reached was that we would be better off forking gem_shmem in panthor. So here we are, parting ways with gem_shmem. The current transition tries to minimize the changes, but there are still some aspects that are different, the main one being that we no longer have a pages_use_count, and pages stays around until the GEM object is destroyed (or when evicted once we've added a shrinker). The sgt also no longer retains pages. This is losely based on how msm does things by the way. If there's any interest in sharing code (probably with msm, since the panthor shrinker is going to be losely based on the msm implementation), we can always change gears and do that once we have everything working/merged. [1]https://patchwork.kernel.org/project/dri-devel/patch/20240105184624.508603-1-dmitry.osipenko@collabora.com/ v2: - Fix refcounting - Add a _locked suffix to a bunch of functions expecting the resv lock to be held - Take the lock before releasing resources in panthor_gem_free_object() v3: - Use ERR_CAST() to fix an ERR-ptr deref - Add missing resv_[un]lock() around a panthor_gem_backing_unpin_locked() call v4: - Fix an error path in panthor_gem_vmap_get_locked() - Don't leave bo->base.pages with an ERR_PTR() - Make panthor_gem_{pin,unpin}[_locked]() more consistent - Don't fail in panthor_gem_dev_map_get_sgt_locked() if the pages are not allocated v5: - Add missing static specifier on our vm_ops v6: - Fix huge_fault handling - s/uint32_t/u32/ - s/drm_dbg_kms/drm_dbg_driver/ - Collect R-bs v7: - No changes Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-7-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is privateBoris Brezillon1-3/+5
drm_gpuvm_bo_extobj_add() is a NOP if the object is private, but it forces us to take/release the VM resv lock, so let's do that only when we know the object can be shared. v3: - New commit v4: - Collect R-bs v5: - No changes v6: - No changes v7: - No changes Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-6-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Group panthor_kernel_bo_xxx() helpersBoris Brezillon1-106/+106
Move all panthor_kernel_bo_xxx() helpers at the end of the file, just before the debugfs init logic. This will make further panthor_gem.c refactoring more readable. v2: - Collect R-bs v3: - No changes v4: - No changes v5: - No changes v6: - No changes v7: - No changes Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-5-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Move panthor_gems_debugfs_init() to panthor_gem.cBoris Brezillon3-29/+29
There's no reason for panthor_drv to know about panthor_gem.c internals, so let's move the GEM debugfs init logic to panthor_gem.c. v2: - Collect R-bs v3: -No changes v4: - No changes v5: - No changes v6: - No changes v7: - No changes Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-4-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-04-03drm/panthor: Remove unused panthor_vm_op_ctx::map::new_vma fieldBoris Brezillon1-5/+0
This field is never used, drop it. v7: - New patch Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260401134854.2275433-3-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
2026-03-24drm/panthor: extend timestamp query with flagsMarcin Slusarz1-6/+128
Flags now control which data user space wants to query, there is more information sources, and there's ability to query duration of multiple timestamp reads. New sources: - CPU's monotonic, - CPU's monotonic raw, - GPU's cycle count These changes should make the implementation of VK_KHR_calibrated_timestamps more accurate and much simpler. Signed-off-by: Marcin Slusarz <marcin.slusarz@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260324132557.1707286-1-marcin.slusarz@arm.com
2026-03-24drm/panthor: correct firmware related messagesChristian Hewitt1-2/+2
Some English language corrections to firmware messages. No functional changes. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260323081132.3217646-1-christianshewitt@gmail.com
2026-03-12Merge drm/drm-next into drm-misc-nextMaxime Ripard1-4/+5
Biju Das needs a patch for rz-du merged in 7.0-rc3 Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-03-11Merge v7.0-rc3 into drm-nextSimona Vetter1-4/+5
Requested by Maxime Ripard for drm-misc-next because renesas people need fb797a70108f ("drm: renesas: rz-du: mipi_dsi: Set DSI divider"). Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
2026-03-11drm/panthor: Fix the "done_fence is initialized" detection logicBoris Brezillon1-1/+1
After commit 541c8f2468b9 ("dma-buf: detach fence ops on signal v3"), dma_fence::ops == NULL can't be used to check if the fence is initialized. Use dma_fence_was_initialized() instead. v2: - Use dma_fence_was_initialized() instead of open-coding it Cc: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Philipp Stanner <phasta@kernel.org> Cc: Christian König <christian.koenig@amd.com> Reported-by: Steven Price <steven.price@arm.com> Reported-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Fixes: 541c8f2468b9 ("dma-buf: detach fence ops on signal v3") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Christian König <christian.koenig@amd.com> Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260309124318.222902-1-boris.brezillon@collabora.com
2026-03-05drm/panthor: Correct the order of arguments passed to gem_syncAkash Goel1-4/+5
This commit corrects the order of arguments passed to panthor_gem_sync() function, called when the SYNC_WAIT condition has to be evaluated for a blocked GPU queue. Fixes: cd2c9c3015e6 ("drm/panthor: Add flag to map GEM object Write-Back Cacheable") Signed-off-by: Akash Goel <akash.goel@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260305110723.2871733-1-akash.goel@arm.com Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2026-03-02drm/panthor: Test for imported buffers with drm_gem_is_imported()Thomas Zimmermann1-1/+1
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The test itself does not change. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Steven Price <steven.price@arm.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Steven Price <steven.price@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/20260227133113.235940-8-tzimmermann@suse.de
2026-02-23Merge drm/drm-next into drm-misc-nextMaxime Ripard5-25/+23
Let's merge 7.0-rc1 to start the new drm-misc-next window Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-02-22Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL usesKees Cook1-3/+2
Conversion performed via this Coccinelle script: // SPDX-License-Identifier: GPL-2.0-only // Options: --include-headers-for-types --all-includes --include-headers --keep-comments virtual patch @gfp depends on patch && !(file in "tools") && !(file in "samples")@ identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex, kzalloc_obj,kzalloc_objs,kzalloc_flex, kvmalloc_obj,kvmalloc_objs,kvmalloc_flex, kvzalloc_obj,kvzalloc_objs,kvzalloc_flex}; @@ ALLOC(... - , GFP_KERNEL ) $ make coccicheck MODE=patch COCCI=gfp.cocci Build and boot tested x86_64 with Fedora 42's GCC and Clang: Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentLinus Torvalds5-16/+16
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21treewide: Replace kmalloc with kmalloc_obj for non-scalar typesKees Cook5-24/+23