From: Boris Brezillon <boris.brezillon@collabora.com>
To: Akash Goel <akash.goel@arm.com>
Cc: liviu.dudau@arm.com, steven.price@arm.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
nd@arm.com
Subject: Re: [PATCH v2] drm/panthor: Avoid adding of kernel BOs to extobj list
Date: Wed, 26 Nov 2025 10:52:19 +0100 [thread overview]
Message-ID: <20251126105219.3a51430c@fedora> (raw)
In-Reply-To: <20251120172118.2741724-1-akash.goel@arm.com>
On Thu, 20 Nov 2025 17:21:18 +0000
Akash Goel <akash.goel@arm.com> wrote:
> 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>
Queued to drm-misc-next.
> ---
> drivers/gpu/drm/panthor/panthor_gem.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index f369cc3e2a5f..10d255cccc09 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -145,6 +145,9 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm,
> bo = to_panthor_bo(&obj->base);
> kbo->obj = &obj->base;
> bo->flags = bo_flags;
> + bo->exclusive_vm_root_gem = panthor_vm_root_gem(vm);
> + drm_gem_object_get(bo->exclusive_vm_root_gem);
> + bo->base.base.resv = bo->exclusive_vm_root_gem->resv;
>
> if (vm == panthor_fw_vm(ptdev))
> debug_flags |= PANTHOR_DEBUGFS_GEM_USAGE_FLAG_FW_MAPPED;
> @@ -168,9 +171,6 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm,
> goto err_free_va;
>
> kbo->vm = panthor_vm_get(vm);
> - bo->exclusive_vm_root_gem = panthor_vm_root_gem(vm);
> - drm_gem_object_get(bo->exclusive_vm_root_gem);
> - bo->base.base.resv = bo->exclusive_vm_root_gem->resv;
> return kbo;
>
> err_free_va:
prev parent reply other threads:[~2025-11-26 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 17:21 [PATCH v2] drm/panthor: Avoid adding of kernel BOs to extobj list Akash Goel
2025-11-26 9:52 ` Boris Brezillon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251126105219.3a51430c@fedora \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=akash.goel@arm.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nd@arm.com \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.