mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
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>
23 lines
669 B
Plaintext
23 lines
669 B
Plaintext
# SPDX-License-Identifier: GPL-2.0 or MIT
|
|
|
|
config DRM_PANTHOR
|
|
tristate "Panthor (DRM support for ARM Mali CSF-based GPUs)"
|
|
depends on DRM
|
|
depends on ARM || ARM64 || COMPILE_TEST
|
|
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
|
|
depends on MMU
|
|
select DEVFREQ_GOV_SIMPLE_ONDEMAND
|
|
select DRM_EXEC
|
|
select DRM_GPUVM
|
|
select DRM_SCHED
|
|
select IOMMU_IO_PGTABLE_LPAE
|
|
select IOMMU_SUPPORT
|
|
select PM_DEVFREQ
|
|
help
|
|
DRM driver for ARM Mali CSF-based GPUs.
|
|
|
|
This driver is for Mali (or Immortalis) Valhall Gxxx GPUs.
|
|
|
|
Note that the Mali-G68 and Mali-G78, while Valhall architecture, will
|
|
be supported with the panfrost driver as they are not CSF GPUs.
|