[GIT PULL] drm-misc-next-fixes

2025-06-29 Thread Inki Dae
Hi Dave and Daniel, Just prevented pointer leakage in printk() of samsung-dsim.c module. Please kindly let me know if there is any problem. Thanks, Inki Dae The following changes since commit fd03f82a026cc03cb8051a8c6487c99f96c9029f: drm/bridge: analogix_dp: Fix clk-disable removal (202

[PATCH] drm/ci: Remove sdm845/cheza jobs

2025-06-29 Thread Rob Clark
These runners are no more. So remove the jobs. Signed-off-by: Rob Clark --- drivers/gpu/drm/ci/build.sh | 17 - drivers/gpu/drm/ci/test.yml | 14 - .../gpu/drm/ci/xfails/msm-sdm845-fails.txt| 29 -- .../gpu/drm/ci/xfails/msm-sdm845-flakes.txt | 139 -

[PATCH v8 09/42] drm/msm: Collapse vma close and delete

2025-06-29 Thread Rob Clark
From: Rob Clark This fits better drm_gpuvm/drm_gpuva. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 16 +++- drivers/gpu/drm/msm/msm_gem_vma.c | 2 ++ 2 files changed, 5

[PATCH v8 15/42] drm/msm: Use drm_gpuvm types more

2025-06-29 Thread Rob Clark
From: Rob Clark Most of the driver code doesn't need to reach in to msm specific fields, so just use the drm_gpuvm/drm_gpuva types directly. This should hopefully improve commonality with other drivers and make the code easier to understand. Signed-off-by: Rob Clark Signed-off-by: Rob Clark T

[PATCH v8 06/42] drm/msm: Rename msm_gem_address_space -> msm_gem_vm

2025-06-29 Thread Rob Clark
From: Rob Clark Re-aligning naming to better match drm_gpuvm terminology will make things less confusing at the end of the drm_gpuvm conversion. This is just rename churn, no functional change. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonin

[PATCH v8 16/42] drm/msm: Split out helper to get iommu prot flags

2025-06-29 Thread Rob Clark
From: Rob Clark We'll re-use this in the vm_bind path. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 12 ++-- drivers/gpu/drm/msm/msm_gem.h | 1 + 2 files changed, 11 insertions(

[PATCH v8 18/42] drm/msm: Add PRR support

2025-06-29 Thread Rob Clark
From: Rob Clark Add PRR (Partial Resident Region) is a bypass address which make GPU writes go to /dev/null and reads return zero. This is used to implement vulkan sparse residency. To support PRR/NULL mappings, we allocate a page to reserve a physical address which we know will not be used as

[PATCH v8 13/42] drm/msm: drm_gpuvm conversion

2025-06-29 Thread Rob Clark
From: Rob Clark Now that we've realigned deletion and allocation, switch over to using drm_gpuvm/drm_gpuva. This allows us to support multiple VMAs per BO per VM, to allow mapping different parts of a single BO at different virtual addresses, which is a key requirement for sparse/VM_BIND. This

[PATCH v8 12/42] drm/msm: Refcount framebuffer pins

2025-06-29 Thread Rob Clark
We were already keeping a refcount of # of prepares (pins), to clear the iova array. Use that to avoid unpinning the iova until the last cleanup (unpin). This way, when msm_gem_unpin_iova() actually tears down the mapping, we won't have problems if the fb is being scanned out on another display (

[PATCH v8 10/42] drm/msm: Don't close VMAs on purge

2025-06-29 Thread Rob Clark
From: Rob Clark Previously we'd also tear down the VMA, making the address space available again. But with drm_gpuvm conversion, this would require holding the locks of all VMs the GEM object is mapped in. Which is problematic for the shrinker. Instead just let the VMA hang around until the GE

[PATCH v8 11/42] drm/msm: Stop passing vm to msm_framebuffer

2025-06-29 Thread Rob Clark
The fb only deals with kms->vm, so make that explicit. This will start letting us refcount the # of times the fb is pinned, so we can only unpin the vma after last user of the fb is done. Having a single reference count really only works if there is only a single vm. Signed-off-by: Rob Clark Te

[PATCH v8 07/42] drm/msm: Remove vram carveout support

2025-06-29 Thread Rob Clark
From: Rob Clark It is standing in the way of drm_gpuvm / VM_BIND support. Not to mention frequently broken and rarely tested. And I think only needed for a 10yr old not quite upstream SoC (msm8974). Maybe we can add support back in later, but I'm doubtful. Signed-off-by: Rob Clark Signed-off

[PATCH v8 08/42] drm/msm: Collapse vma allocation and initialization

2025-06-29 Thread Rob Clark
From: Rob Clark Now that we've dropped vram carveout support, we can collapse vma allocation and initialization. This better matches how things work with drm_gpuvm. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers

[PATCH v8 05/42] drm/msm: Improve msm_context comments

2025-06-29 Thread Rob Clark
From: Rob Clark Just some tidying up. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu.h | 44 +++ 1 file changed, 29 insertions(+)

[PATCH v8 03/42] drm/gem: Add ww_acquire_ctx support to drm_gem_lru_scan()

2025-06-29 Thread Rob Clark
From: Rob Clark If the callback is going to have to attempt to grab more locks, it is useful to have an ww_acquire_ctx to avoid locking order problems. Why not use the drm_exec helper instead? Mainly because (a) where ww_acquire_init() is called is awkward, and (b) we don't really need to retry

[PATCH v8 04/42] drm/msm: Rename msm_file_private -> msm_context

2025-06-29 Thread Rob Clark
From: Rob Clark This is a more descriptive name. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 6

[PATCH v8 00/42] drm/msm: sparse / "VM_BIND" support

2025-06-29 Thread Rob Clark
Conversion to DRM GPU VA Manager[1], and adding support for Vulkan Sparse Memory[2] in the form of: 1. A new VM_BIND submitqueue type for executing VM MSM_SUBMIT_BO_OP_MAP/ MAP_NULL/UNMAP commands 2. A new VM_BIND ioctl to allow submitting batches of one or more MAP/MAP_NULL/UNMAP com

[PATCH v8 01/42] drm/gpuvm: Fix doc comments

2025-06-29 Thread Rob Clark
Correctly summerize drm_gpuvm_sm_map/unmap, and fix the parameter order and names. Just something I noticed in passing. v2: Don't rename the arg names in prototypes to match function declarations [Danilo] Signed-off-by: Rob Clark Acked-by: Danilo Krummrich Tested-by: Antonino Maniscalco R

[PATCH v8 02/42] drm/gpuvm: Add locking helpers

2025-06-29 Thread Rob Clark
For UNMAP/REMAP steps we could be needing to lock objects that are not explicitly listed in the VM_BIND ioctl in order to tear-down unmapped VAs. These helpers handle locking/preparing the needed objects. Note that these functions do not strictly require the VM changes to be applied before the ne

[PATCH v8 36/42] drm/msm: Add VM logging for VM_BIND updates

2025-06-29 Thread Rob Clark
From: Rob Clark When userspace opts in to VM_BIND, the submit no longer holds references keeping the VMA alive. This makes it difficult to distinguish between UMD/KMD/app bugs. So add a debug option for logging the most recent VM updates and capturing these in GPU devcoredumps. The submitqueue

[PATCH v8 17/42] drm/msm: Add mmu support for non-zero offset

2025-06-29 Thread Rob Clark
From: Rob Clark Only needs to be supported for iopgtables mmu, the other cases are either only used for kernel managed mappings (where offset is always zero) or devices which do not support sparse bindings. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Revie

[PATCH v8 31/42] drm/msm: Add VM_BIND submitqueue

2025-06-29 Thread Rob Clark
From: Rob Clark This submitqueue type isn't tied to a hw ringbuffer, but instead executes on the CPU for performing async VM_BIND ops. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h

[PATCH v8 33/42] drm/msm: Support pgtable preallocation

2025-06-29 Thread Rob Clark
From: Rob Clark Introduce a mechanism to count the worst case # of pages required in a VM_BIND op. Note that previously we would have had to somehow account for allocations in unmap, when splitting a block. This behavior was removed in commit 33729a5fc0ca ("iommu/io-pgtable-arm: Remove split on

[PATCH v8 22/42] drm/msm: Add opt-in for VM_BIND

2025-06-29 Thread Rob Clark
From: Rob Clark Add a SET_PARAM for userspace to request to manage to the VM itself, instead of getting a kernel managed VM. In order to transition to a userspace managed VM, this param must be set before any mappings are created. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: A

[PATCH v8 41/42] drm/msm: Defer VMA unmap for fb unpins

2025-06-29 Thread Rob Clark
With the conversion to drm_gpuvm, we lost the lazy VMA cleanup, which means that fb cleanup/unpin when pageflipping to new scanout buffers immediately unmaps the scanout buffer. This is costly (with tlbinv, it can be 4-6ms for a 1080p scanout buffer, and more for higher resolutions)! To avoid thi

[PATCH v8 35/42] drm/msm: Add VM_BIND ioctl

2025-06-29 Thread Rob Clark
From: Rob Clark Add a VM_BIND ioctl for binding/unbinding buffers into a VM. This is only supported if userspace has opted in to MSM_PARAM_EN_VM_BIND. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/m

[PATCH v8 40/42] drm/msm: Bump UAPI version

2025-06-29 Thread Rob Clark
From: Rob Clark Bump version to signal to userspace that VM_BIND is supported. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

[PATCH v8 27/42] drm/msm: Crashdump support for sparse

2025-06-29 Thread Rob Clark
From: Rob Clark In this case, we need to iterate the VMAs looking for ones with MSM_VMA_DUMP flag. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu.c | 96 ++- 1

[PATCH v8 25/42] drm/msm: Crashdump prep for sparse mappings

2025-06-29 Thread Rob Clark
From: Rob Clark In this case, userspace could request dumping partial GEM obj mappings. Also drop use of should_dump() helper, which really only makes sense in the old submit->bos[] table world. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Anto

[PATCH v8 26/42] drm/msm: rd dumping prep for sparse mappings

2025-06-29 Thread Rob Clark
From: Rob Clark Similar to the previous commit, add support for dumping partial mappings. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h | 10 - drivers/gpu/drm/msm/msm_rd.c | 38 ++

[PATCH v8 30/42] drm/msm: Use DMA_RESV_USAGE_BOOKKEEP/KERNEL

2025-06-29 Thread Rob Clark
From: Rob Clark Any place we wait for a BO to become idle, we should use BOOKKEEP usage, to ensure that it waits for _any_ activity. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c |

[PATCH v8 34/42] drm/msm: Split out map/unmap ops

2025-06-29 Thread Rob Clark
From: Rob Clark With async VM_BIND, the actual pgtable updates are deferred. Synchronously, a list of map/unmap ops will be generated, but the actual pgtable changes are deferred. To support that, split out op handlers and change the existing non-VM_BIND paths to use them. Note in particular, t

[PATCH v8 32/42] drm/msm: Support IO_PGTABLE_QUIRK_NO_WARN_ON

2025-06-29 Thread Rob Clark
From: Rob Clark With user managed VMs and multiple queues, it is in theory possible to trigger map/unmap errors. These will (in a later patch) mark the VM as unusable. But we want to tell the io-pgtable helpers not to spam the log. In addition, in the unmap path, we don't want to bail early fr

[PATCH v8 38/42] drm/msm: Add mmu prealloc tracepoint

2025-06-29 Thread Rob Clark
From: Rob Clark So we can monitor how many pages are getting preallocated vs how many get used. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu_trace.h | 14 ++ drivers/gpu/drm/msm/

[PATCH v8 37/42] drm/msm: Add VMA unmap reason

2025-06-29 Thread Rob Clark
From: Rob Clark Make the VM log a bit more useful by providing a reason for the unmap (ie. closing VM vs evict/purge, etc) Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 20 +++

[PATCH v8 23/42] drm/msm: Mark VM as unusable on GPU hangs

2025-06-29 Thread Rob Clark
From: Rob Clark If userspace has opted-in to VM_BIND, then GPU hangs and VM_BIND errors will mark the VM as unusable. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h| 17 +

[PATCH v8 29/42] drm/msm: Extract out syncobj helpers

2025-06-29 Thread Rob Clark
From: Rob Clark We'll be re-using these for the VM_BIND ioctl. Also, rename a few things in the uapi header to reflect that syncobj use is not specific to the submit ioctl. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco ---

[PATCH v8 42/42] drm/msm: Add VM_BIND throttling

2025-06-29 Thread Rob Clark
A large number of (unsorted or separate) small (<2MB) mappings can cause a lot of, probably unnecessary, prealloc pages. Ie. a single 4k page size mapping will pre-allocate 3 pages (for levels 2-4) for the pagetable. Which can chew up a large amount of unneeded memory. So add a mechanism to put

[PATCH v8 28/42] drm/msm: rd dumping support for sparse

2025-06-29 Thread Rob Clark
From: Rob Clark As with devcoredump, we need to iterate the VMAs to figure out what to dump. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_rd.c | 48 +--- 1 file c

[PATCH v8 14/42] drm/msm: Convert vm locking

2025-06-29 Thread Rob Clark
From: Rob Clark Convert to using the gpuvm's r_obj for serializing access to the VM. This way we can use the drm_exec helper for dealing with deadlock detection and backoff. This will let us deal with upcoming locking order conflicts with the VM_BIND implmentation (ie. in some scenarious we need

[PATCH v8 24/42] drm/msm: Add _NO_SHARE flag

2025-06-29 Thread Rob Clark
From: Rob Clark Buffers that are not shared between contexts can share a single resv object. This way drm_gpuvm will not track them as external objects, and submit-time validating overhead will be O(1) for all N non-shared BOs, instead of O(n). Signed-off-by: Rob Clark Signed-off-by: Rob Clark

[PATCH v8 20/42] drm/msm: Drop queued submits on lastclose()

2025-06-29 Thread Rob Clark
From: Rob Clark If we haven't written the submit into the ringbuffer yet, then drop it. The submit still retires through the normal path, to preserve fence signalling order, but we can skip the IB's to userspace cmdstream. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino M

[PATCH v8 19/42] drm/msm: Rename msm_gem_vma_purge() -> _unmap()

2025-06-29 Thread Rob Clark
From: Rob Clark This is a more descriptive name. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 6 +++--- drivers/gpu/drm/msm/msm_gem.h | 2 +- drivers/gpu/drm/msm/msm_gem_vma.c |

[PATCH v8 39/42] drm/msm: use trylock for debugfs

2025-06-29 Thread Rob Clark
From: Rob Clark This resolves a potential deadlock vs msm_gem_vm_close(). Otherwise for _NO_SHARE buffers msm_gem_describe() could be trying to acquire the shared vm resv, while already holding priv->obj_lock. But _vm_close() might drop the last reference to a GEM obj while already holding the

[PATCH v8 21/42] drm/msm: Lazily create context VM

2025-06-29 Thread Rob Clark
From: Rob Clark In the next commit, a way for userspace to opt-in to userspace managed VM is added. For this to work, we need to defer creation of the VM until it is needed. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco ---

Re: [PATCH v6 1/8] drm/vkms: Create helpers macro to avoid code duplication in format callbacks

2025-06-29 Thread kernel test robot
Hi Louis, kernel test robot noticed the following build warnings: [auto build test WARNING on bb8aa27eff6f3376242da37c2d02b9dcc66934b1] url: https://github.com/intel-lab-lkp/linux/commits/Louis-Chauvet/drm-vkms-Create-helpers-macro-to-avoid-code-duplication-in-format-callbacks/20250628-06514

[PATCH v9 17/42] drm/msm: Add mmu support for non-zero offset

2025-06-29 Thread Rob Clark
From: Rob Clark Only needs to be supported for iopgtables mmu, the other cases are either only used for kernel managed mappings (where offset is always zero) or devices which do not support sparse bindings. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Revie

[PATCH v9 06/42] drm/msm: Rename msm_gem_address_space -> msm_gem_vm

2025-06-29 Thread Rob Clark
From: Rob Clark Re-aligning naming to better match drm_gpuvm terminology will make things less confusing at the end of the drm_gpuvm conversion. This is just rename churn, no functional change. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonin

[PATCH v9 07/42] drm/msm: Remove vram carveout support

2025-06-29 Thread Rob Clark
From: Rob Clark It is standing in the way of drm_gpuvm / VM_BIND support. Not to mention frequently broken and rarely tested. And I think only needed for a 10yr old not quite upstream SoC (msm8974). Maybe we can add support back in later, but I'm doubtful. Signed-off-by: Rob Clark Signed-off

[PATCH v9 09/42] drm/msm: Collapse vma close and delete

2025-06-29 Thread Rob Clark
From: Rob Clark This fits better drm_gpuvm/drm_gpuva. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 16 +++- drivers/gpu/drm/msm/msm_gem_vma.c | 2 ++ 2 files changed, 5

[PATCH v9 04/42] drm/msm: Rename msm_file_private -> msm_context

2025-06-29 Thread Rob Clark
From: Rob Clark This is a more descriptive name. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 6

[PATCH v9 02/42] drm/gpuvm: Add locking helpers

2025-06-29 Thread Rob Clark
For UNMAP/REMAP steps we could be needing to lock objects that are not explicitly listed in the VM_BIND ioctl in order to tear-down unmapped VAs. These helpers handle locking/preparing the needed objects. Note that these functions do not strictly require the VM changes to be applied before the ne

[PATCH v9 03/42] drm/gem: Add ww_acquire_ctx support to drm_gem_lru_scan()

2025-06-29 Thread Rob Clark
From: Rob Clark If the callback is going to have to attempt to grab more locks, it is useful to have an ww_acquire_ctx to avoid locking order problems. Why not use the drm_exec helper instead? Mainly because (a) where ww_acquire_init() is called is awkward, and (b) we don't really need to retry

[PATCH v9 00/42] drm/msm: sparse / "VM_BIND" support

2025-06-29 Thread Rob Clark
Conversion to DRM GPU VA Manager[1], and adding support for Vulkan Sparse Memory[2] in the form of: 1. A new VM_BIND submitqueue type for executing VM MSM_SUBMIT_BO_OP_MAP/ MAP_NULL/UNMAP commands 2. A new VM_BIND ioctl to allow submitting batches of one or more MAP/MAP_NULL/UNMAP com

[PATCH v9 15/42] drm/msm: Use drm_gpuvm types more

2025-06-29 Thread Rob Clark
From: Rob Clark Most of the driver code doesn't need to reach in to msm specific fields, so just use the drm_gpuvm/drm_gpuva types directly. This should hopefully improve commonality with other drivers and make the code easier to understand. Signed-off-by: Rob Clark Signed-off-by: Rob Clark T

[PATCH v9 22/42] drm/msm: Add opt-in for VM_BIND

2025-06-29 Thread Rob Clark
From: Rob Clark Add a SET_PARAM for userspace to request to manage to the VM itself, instead of getting a kernel managed VM. In order to transition to a userspace managed VM, this param must be set before any mappings are created. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: A

[PATCH v9 08/42] drm/msm: Collapse vma allocation and initialization

2025-06-29 Thread Rob Clark
From: Rob Clark Now that we've dropped vram carveout support, we can collapse vma allocation and initialization. This better matches how things work with drm_gpuvm. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers

[PATCH v9 13/42] drm/msm: drm_gpuvm conversion

2025-06-29 Thread Rob Clark
From: Rob Clark Now that we've realigned deletion and allocation, switch over to using drm_gpuvm/drm_gpuva. This allows us to support multiple VMAs per BO per VM, to allow mapping different parts of a single BO at different virtual addresses, which is a key requirement for sparse/VM_BIND. This

[PATCH v9 01/42] drm/gpuvm: Fix doc comments

2025-06-29 Thread Rob Clark
Correctly summerize drm_gpuvm_sm_map/unmap, and fix the parameter order and names. Just something I noticed in passing. v2: Don't rename the arg names in prototypes to match function declarations [Danilo] Signed-off-by: Rob Clark Acked-by: Danilo Krummrich Tested-by: Antonino Maniscalco R

[PATCH v9 25/42] drm/msm: Crashdump prep for sparse mappings

2025-06-29 Thread Rob Clark
From: Rob Clark In this case, userspace could request dumping partial GEM obj mappings. Also drop use of should_dump() helper, which really only makes sense in the old submit->bos[] table world. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Anto

[PATCH v9 23/42] drm/msm: Mark VM as unusable on GPU hangs

2025-06-29 Thread Rob Clark
From: Rob Clark If userspace has opted-in to VM_BIND, then GPU hangs and VM_BIND errors will mark the VM as unusable. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h| 17 +

[PATCH v9 29/42] drm/msm: Extract out syncobj helpers

2025-06-29 Thread Rob Clark
From: Rob Clark We'll be re-using these for the VM_BIND ioctl. Also, rename a few things in the uapi header to reflect that syncobj use is not specific to the submit ioctl. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco ---

[PATCH v9 12/42] drm/msm: Refcount framebuffer pins

2025-06-29 Thread Rob Clark
We were already keeping a refcount of # of prepares (pins), to clear the iova array. Use that to avoid unpinning the iova until the last cleanup (unpin). This way, when msm_gem_unpin_iova() actually tears down the mapping, we won't have problems if the fb is being scanned out on another display (

[PATCH v9 14/42] drm/msm: Convert vm locking

2025-06-29 Thread Rob Clark
From: Rob Clark Convert to using the gpuvm's r_obj for serializing access to the VM. This way we can use the drm_exec helper for dealing with deadlock detection and backoff. This will let us deal with upcoming locking order conflicts with the VM_BIND implmentation (ie. in some scenarious we need

[PATCH v9 33/42] drm/msm: Support pgtable preallocation

2025-06-29 Thread Rob Clark
From: Rob Clark Introduce a mechanism to count the worst case # of pages required in a VM_BIND op. Note that previously we would have had to somehow account for allocations in unmap, when splitting a block. This behavior was removed in commit 33729a5fc0ca ("iommu/io-pgtable-arm: Remove split on

[PATCH v9 38/42] drm/msm: Add mmu prealloc tracepoint

2025-06-29 Thread Rob Clark
From: Rob Clark So we can monitor how many pages are getting preallocated vs how many get used. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu_trace.h | 14 ++ drivers/gpu/drm/msm/

[PATCH v9 26/42] drm/msm: rd dumping prep for sparse mappings

2025-06-29 Thread Rob Clark
From: Rob Clark Similar to the previous commit, add support for dumping partial mappings. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h | 10 - drivers/gpu/drm/msm/msm_rd.c | 38 ++

[PATCH v9 30/42] drm/msm: Use DMA_RESV_USAGE_BOOKKEEP/KERNEL

2025-06-29 Thread Rob Clark
From: Rob Clark Any place we wait for a BO to become idle, we should use BOOKKEEP usage, to ensure that it waits for _any_ activity. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c |

[PATCH v9 19/42] drm/msm: Rename msm_gem_vma_purge() -> _unmap()

2025-06-29 Thread Rob Clark
From: Rob Clark This is a more descriptive name. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 6 +++--- drivers/gpu/drm/msm/msm_gem.h | 2 +- drivers/gpu/drm/msm/msm_gem_vma.c |

[PATCH v9 24/42] drm/msm: Add _NO_SHARE flag

2025-06-29 Thread Rob Clark
From: Rob Clark Buffers that are not shared between contexts can share a single resv object. This way drm_gpuvm will not track them as external objects, and submit-time validating overhead will be O(1) for all N non-shared BOs, instead of O(n). Signed-off-by: Rob Clark Signed-off-by: Rob Clark

[PATCH v9 20/42] drm/msm: Drop queued submits on lastclose()

2025-06-29 Thread Rob Clark
From: Rob Clark If we haven't written the submit into the ringbuffer yet, then drop it. The submit still retires through the normal path, to preserve fence signalling order, but we can skip the IB's to userspace cmdstream. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino M

[PATCH v9 27/42] drm/msm: Crashdump support for sparse

2025-06-29 Thread Rob Clark
From: Rob Clark In this case, we need to iterate the VMAs looking for ones with MSM_VMA_DUMP flag. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu.c | 96 ++- 1

[PATCH v9 18/42] drm/msm: Add PRR support

2025-06-29 Thread Rob Clark
From: Rob Clark Add PRR (Partial Resident Region) is a bypass address which make GPU writes go to /dev/null and reads return zero. This is used to implement vulkan sparse residency. To support PRR/NULL mappings, we allocate a page to reserve a physical address which we know will not be used as

[PATCH v9 21/42] drm/msm: Lazily create context VM

2025-06-29 Thread Rob Clark
From: Rob Clark In the next commit, a way for userspace to opt-in to userspace managed VM is added. For this to work, we need to defer creation of the VM until it is needed. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco ---

[PATCH v9 10/42] drm/msm: Don't close VMAs on purge

2025-06-29 Thread Rob Clark
From: Rob Clark Previously we'd also tear down the VMA, making the address space available again. But with drm_gpuvm conversion, this would require holding the locks of all VMs the GEM object is mapped in. Which is problematic for the shrinker. Instead just let the VMA hang around until the GE

[PATCH v9 11/42] drm/msm: Stop passing vm to msm_framebuffer

2025-06-29 Thread Rob Clark
The fb only deals with kms->vm, so make that explicit. This will start letting us refcount the # of times the fb is pinned, so we can only unpin the vma after last user of the fb is done. Having a single reference count really only works if there is only a single vm. Signed-off-by: Rob Clark Te

[PATCH v9 35/42] drm/msm: Add VM_BIND ioctl

2025-06-29 Thread Rob Clark
From: Rob Clark Add a VM_BIND ioctl for binding/unbinding buffers into a VM. This is only supported if userspace has opted in to MSM_PARAM_EN_VM_BIND. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/m

[PATCH v9 37/42] drm/msm: Add VMA unmap reason

2025-06-29 Thread Rob Clark
From: Rob Clark Make the VM log a bit more useful by providing a reason for the unmap (ie. closing VM vs evict/purge, etc) Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 20 +++

[PATCH v9 31/42] drm/msm: Add VM_BIND submitqueue

2025-06-29 Thread Rob Clark
From: Rob Clark This submitqueue type isn't tied to a hw ringbuffer, but instead executes on the CPU for performing async VM_BIND ops. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.h

[PATCH v9 32/42] drm/msm: Support IO_PGTABLE_QUIRK_NO_WARN_ON

2025-06-29 Thread Rob Clark
From: Rob Clark With user managed VMs and multiple queues, it is in theory possible to trigger map/unmap errors. These will (in a later patch) mark the VM as unusable. But we want to tell the io-pgtable helpers not to spam the log. In addition, in the unmap path, we don't want to bail early fr

[PATCH v9 40/42] drm/msm: Bump UAPI version

2025-06-29 Thread Rob Clark
From: Rob Clark Bump version to signal to userspace that VM_BIND is supported. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

[PATCH v9 42/42] drm/msm: Add VM_BIND throttling

2025-06-29 Thread Rob Clark
A large number of (unsorted or separate) small (<2MB) mappings can cause a lot of, probably unnecessary, prealloc pages. Ie. a single 4k page size mapping will pre-allocate 3 pages (for levels 2-4) for the pagetable. Which can chew up a large amount of unneeded memory. So add a mechanism to put

[PATCH v9 36/42] drm/msm: Add VM logging for VM_BIND updates

2025-06-29 Thread Rob Clark
From: Rob Clark When userspace opts in to VM_BIND, the submit no longer holds references keeping the VMA alive. This makes it difficult to distinguish between UMD/KMD/app bugs. So add a debug option for logging the most recent VM updates and capturing these in GPU devcoredumps. The submitqueue

[PATCH v9 41/42] drm/msm: Defer VMA unmap for fb unpins

2025-06-29 Thread Rob Clark
With the conversion to drm_gpuvm, we lost the lazy VMA cleanup, which means that fb cleanup/unpin when pageflipping to new scanout buffers immediately unmaps the scanout buffer. This is costly (with tlbinv, it can be 4-6ms for a 1080p scanout buffer, and more for higher resolutions)! To avoid thi

[PATCH v9 28/42] drm/msm: rd dumping support for sparse

2025-06-29 Thread Rob Clark
From: Rob Clark As with devcoredump, we need to iterate the VMAs to figure out what to dump. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_rd.c | 48 +--- 1 file c

[PATCH v9 39/42] drm/msm: use trylock for debugfs

2025-06-29 Thread Rob Clark
From: Rob Clark This resolves a potential deadlock vs msm_gem_vm_close(). Otherwise for _NO_SHARE buffers msm_gem_describe() could be trying to acquire the shared vm resv, while already holding priv->obj_lock. But _vm_close() might drop the last reference to a GEM obj while already holding the

[PATCH v9 05/42] drm/msm: Improve msm_context comments

2025-06-29 Thread Rob Clark
From: Rob Clark Just some tidying up. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gpu.h | 44 +++ 1 file changed, 29 insertions(+)

[PATCH v9 16/42] drm/msm: Split out helper to get iommu prot flags

2025-06-29 Thread Rob Clark
From: Rob Clark We'll re-use this in the vm_bind path. Signed-off-by: Rob Clark Signed-off-by: Rob Clark Tested-by: Antonino Maniscalco Reviewed-by: Antonino Maniscalco --- drivers/gpu/drm/msm/msm_gem.c | 12 ++-- drivers/gpu/drm/msm/msm_gem.h | 1 + 2 files changed, 11 insertions(

[PATCH v9 34/42] drm/msm: Split out map/unmap ops

2025-06-29 Thread Rob Clark
From: Rob Clark With async VM_BIND, the actual pgtable updates are deferred. Synchronously, a list of map/unmap ops will be generated, but the actual pgtable changes are deferred. To support that, split out op handlers and change the existing non-VM_BIND paths to use them. Note in particular, t

Re: [PATCH v6 7/8] drm/vkms: Create helper macro for YUV formats

2025-06-29 Thread kernel test robot
Hi Louis, kernel test robot noticed the following build warnings: [auto build test WARNING on bb8aa27eff6f3376242da37c2d02b9dcc66934b1] url: https://github.com/intel-lab-lkp/linux/commits/Louis-Chauvet/drm-vkms-Create-helpers-macro-to-avoid-code-duplication-in-format-callbacks/20250628-06514

Re: [PATCH 0/3] NVIDIA Tegra210 NVJPG support

2025-06-29 Thread Mikko Perttunen
On 6/17/25 6:26 PM, Diogo Ivo wrote: On 6/17/25 5:40 AM, Mikko Perttunen wrote: On 6/16/25 7:21 PM, Diogo Ivo wrote: On 6/11/25 4:06 PM, Thierry Reding wrote: On Wed, Jun 11, 2025 at 01:05:40PM +0100, Diogo Ivo wrote: On 6/10/25 10:52 AM, Mikko Perttunen wrote: On 6/10/25 6:05 PM, Th

Re: [PATCH v6 9/9] PCI: Add a new 'boot_display' attribute

2025-06-29 Thread Thomas Zimmermann
Hi Am 27.06.25 um 17:37 schrieb Mario Limonciello: On 6/27/2025 2:07 AM, Thomas Zimmermann wrote: Hi Am 27.06.25 um 06:31 schrieb Mario Limonciello: From: Mario Limonciello On systems with multiple GPUs there can be uncertainty which GPU is the primary one used to drive the display at bootu

Re: [PATCH v2 1/5] dt-bindings: display: simple-framebuffer: Add interconnects property

2025-06-29 Thread Thomas Zimmermann
Hi Am 28.06.25 um 13:49 schrieb Krzysztof Kozlowski: On 27/06/2025 11:48, Luca Weiss wrote: Hi Krzysztof, On Fri Jun 27, 2025 at 10:08 AM CEST, Krzysztof Kozlowski wrote: On Mon, Jun 23, 2025 at 08:44:45AM +0200, Luca Weiss wrote: Document the interconnects property which is a list of interc

Re: [PATCH v2 1/5] dt-bindings: display: simple-framebuffer: Add interconnects property

2025-06-29 Thread Thomas Zimmermann
Hi Am 28.06.25 um 13:50 schrieb Krzysztof Kozlowski: On 27/06/2025 13:34, Thomas Zimmermann wrote: Hi Am 27.06.25 um 10:08 schrieb Krzysztof Kozlowski: On Mon, Jun 23, 2025 at 08:44:45AM +0200, Luca Weiss wrote: Document the interconnects property which is a list of interconnect paths that i

Re: [PATCH v2 1/3] drm/tegra: Add NVJPG driver

2025-06-29 Thread Mikko Perttunen
On 6/11/25 9:18 PM, Diogo Ivo wrote: ... +static int nvjpg_load_falcon_firmware(struct nvjpg *nvjpg) +{ + struct host1x_client *client = &nvjpg->client.base; + struct tegra_drm *tegra = nvjpg->client.drm; + dma_addr_t iova; + size_t size; + void *virt; + int er

Re: [PATCH] drm/bridge: it6505: replace scnprintf with sysfs_emit_at in debugfs show

2025-06-29 Thread Greg KH
On Sun, Jun 29, 2025 at 08:35:09PM -0300, Marcelo Moreira wrote: > Update the receive_timing_debugfs_show() function to utilize > sysfs_emit_at() for formatting output to the debugfs buffer. > This change adheres to the recommendation outlined > in Documentation/filesystems/sysfs.rst. > > This mod

RE: [PATCH 00/13] Modify drm helpers to use luminance

2025-06-29 Thread Kandpal, Suraj
> -Original Message- > From: Kandpal, Suraj > Sent: Wednesday, June 25, 2025 4:50 PM > To: Jani Nikula ; intel...@lists.freedesktop.org; > intel-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org; > nouv...@lists.freedesktop.org; Lyude Paul > Cc: Murthy, Arun R > Subject: RE: [

[PATCH 15/17] memcontrol: allow objcg api when memcg is config off.

2025-06-29 Thread Dave Airlie
From: Dave Airlie amdgpu wants to use the objcg api and not have to enable ifdef around it, so just add a dummy function for the config off path. Signed-off-by: Dave Airlie --- include/linux/memcontrol.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/memcontrol.h b/incl

drm/ttm/memcg/lru: enable memcg tracking for ttm and amdgpu driver

2025-06-29 Thread Dave Airlie
Hi all, tl;dr: start using list_lru/numa/memcg in GPU driver core and amdgpu driver for now. This is a complete series of patches, some of which have been sent before and reviewed, but I want to get the complete picture for others, and try to figure out how best to land this. There are 3 piec

[PATCH 07/17] ttm/pool: track allocated_pages per numa node.

2025-06-29 Thread Dave Airlie
From: Dave Airlie This gets the memory sizes from the nodes and stores the limit as 50% of those. I think eventually we should drop the limits once we have memcg aware shrinking, but this should be more NUMA friendly, and I think seems like what people would prefer to happen on NUMA aware systems

  1   2   >