Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panthor: Avoid adding of kernel BOs to extobj list

The kernel BOs unnecessarily got added to the external objects list
of drm_gpuvm, when mapping to GPU, which would have resulted in few
extra CPU cycles being spent at the time of job submission as
drm_exec_until_all_locked() loop iterates over all external objects.

Kernel BOs are private to a VM and so they share the dma_resv object of
the dummy GEM object created for a VM. Use of DRM_EXEC_IGNORE_DUPLICATES
flag ensured the recursive locking of the dummy GEM object was ignored.
Also no extra space got allocated to add fences to the dma_resv object
of dummy GEM object. So no other impact apart from few extra CPU cycles.

This commit sets the pointer to dma_resv object of GEM object of
kernel BOs before they are mapped to GPU, to prevent them from
being added to external objects list.

v2: Add R-bs and fixes tags

Fixes: 8a1cc07578bf ("drm/panthor: Add GEM logical block")
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>
Link: https://patch.msgid.link/20251120172118.2741724-1-akash.goel@arm.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

authored by

Akash Goel and committed by
Boris Brezillon
ce04ec03 63c971af

+3 -3
+3 -3
drivers/gpu/drm/panthor/panthor_gem.c
··· 145 145 bo = to_panthor_bo(&obj->base); 146 146 kbo->obj = &obj->base; 147 147 bo->flags = bo_flags; 148 + bo->exclusive_vm_root_gem = panthor_vm_root_gem(vm); 149 + drm_gem_object_get(bo->exclusive_vm_root_gem); 150 + bo->base.base.resv = bo->exclusive_vm_root_gem->resv; 148 151 149 152 if (vm == panthor_fw_vm(ptdev)) 150 153 debug_flags |= PANTHOR_DEBUGFS_GEM_USAGE_FLAG_FW_MAPPED; ··· 171 168 goto err_free_va; 172 169 173 170 kbo->vm = panthor_vm_get(vm); 174 - bo->exclusive_vm_root_gem = panthor_vm_root_gem(vm); 175 - drm_gem_object_get(bo->exclusive_vm_root_gem); 176 - bo->base.base.resv = bo->exclusive_vm_root_gem->resv; 177 171 return kbo; 178 172 179 173 err_free_va: