From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Steven Price <steven.price@arm.com>,
kernel@collabora.com, Liviu Dudau <liviu.dudau@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Daniel Almeida <daniel.almeida@collabora.com>,
Alice Ryhl <aliceryhl@google.com>
Subject: Re: [PATCH v8 5/6] drm/panthor: Support sparse mappings
Date: Wed, 22 Apr 2026 09:43:19 +0200 [thread overview]
Message-ID: <20260422094319.1fbd13b9@fedora> (raw)
In-Reply-To: <aefukxIMh7UtG-2x@sobremesa>
On Tue, 21 Apr 2026 22:44:18 +0100
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:
> >
> > Also, how about we do a
> >
> > gem = drm_gem_object_get(&vm->dummy->base)
>
> I'm afraid drm_gem_object_get() doesn't return a pointer to the same object. Other drivers work around this
> by defining their own refcnt macro like:
>
> static inline struct xe_bo *xe_bo_get(struct xe_bo *bo)
> {
> if (bo)
> drm_gem_object_get(&bo->ttm.base);
>
> return bo;
> }
>
> However, this is meant to operate on the driver-specific bo rather than a generic DRM one. We could also do this:
>
> if (!(op->flags & DRM_PANTHOR_VM_BIND_OP_MAP_SPARSE))
> gem = drm_gem_object_lookup(file, op->bo_handle);
> else
> drm_gem_object_get(gem = &vm->dummy->base);
If it's just this single instance, let's go for:
if (!(op->flags & DRM_PANTHOR_VM_BIND_OP_MAP_SPARSE)) {
gem = drm_gem_object_lookup(file, op->bo_handle);
} else {
gem = &vm->dummy->base;
drm_gem_object_get(gem);
}
If there are multiple places where we want to acquire a
panthor_gem_object ref, it might make sense to add those
panthor_bo_{get,put}() helpers.
next prev parent reply other threads:[~2026-04-22 7:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 21:43 [PATCH v8 0/6] Support sparse mappings in Panthor Adrián Larumbe
2026-04-16 21:43 ` [PATCH v8 1/6] drm/panthor: Expose GPU page sizes to UM Adrián Larumbe
2026-04-16 21:43 ` [PATCH v8 2/6] drm/panthor: Pass vm_bind_op to vm_prepare_map_op_ctx Adrián Larumbe
2026-04-16 21:43 ` [PATCH v8 3/6] drm/panthor: Delete spurious whitespace from uAPI header Adrián Larumbe
2026-04-16 21:43 ` [PATCH v8 4/6] drm/panthor: Remove unused operation context field Adrián Larumbe
2026-04-16 21:43 ` [PATCH v8 5/6] drm/panthor: Support sparse mappings Adrián Larumbe
2026-04-17 8:40 ` Boris Brezillon
2026-04-21 21:44 ` Adrián Larumbe
2026-04-22 7:43 ` Boris Brezillon [this message]
2026-04-16 21:43 ` [PATCH v8 6/6] drm/panthor: Bump the driver version to 1.9 Adrián Larumbe
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=20260422094319.1fbd13b9@fedora \
--to=boris.brezillon@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox