From: Donald Robson <Donald.Robson@imgtec.com>
To: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"dakr@redhat.com" <dakr@redhat.com>,
Sarah Walker <Sarah.Walker@imgtec.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
"luben.tuikov@amd.com" <luben.tuikov@amd.com>,
"christian.koenig@amd.com" <christian.koenig@amd.com>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"hns@goldelico.com" <hns@goldelico.com>,
"matthew.brost@intel.com" <matthew.brost@intel.com>,
"afd@ti.com" <afd@ti.com>, "daniel@ffwll.ch" <daniel@ffwll.ch>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"boris.brezillon@collabora.com" <boris.brezillon@collabora.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
Frank Binns <Frank.Binns@imgtec.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"airlied@gmail.com" <airlied@gmail.com>,
"faith.ekstrand@collabora.com" <faith.ekstrand@collabora.com>
Subject: Re: [EXTERNAL] Re: [PATCH v8 02/20] drm/gpuvm: Helper to get range of unmap from a remap op.
Date: Mon, 20 Nov 2023 11:07:36 +0000 [thread overview]
Message-ID: <60fb969e2faae2137c48e8840ca31626f9a403d8.camel@imgtec.com> (raw)
In-Reply-To: <e517d560-3a1f-4e79-9bec-acdc77784bcd@redhat.com>
On Tue, 2023-11-14 at 17:42 +0100, Danilo Krummrich wrote:
> *** CAUTION: This email originates from a source not known to Imagination Technologies. Think before you click a link or open an attachment ***
>
> On 10/31/23 16:12, Sarah Walker wrote:
> > From: Donald Robson <donald.robson@imgtec.com>
> >
> > Determining the start and range of the unmap stage of a remap op is a
> > common piece of code currently implemented by multiple drivers. Add a
> > helper for this.
> >
> > Changes since v7:
> > - Renamed helper to drm_gpuva_op_remap_to_unmap_range()
> > - Improved documentation
> >
> > Changes since v6:
> > - Remove use of __always_inline
> >
> > Signed-off-by: Donald Robson <donald.robson@imgtec.com>
> > Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
>
> Reviewed-by: Danilo Krummrich <dakr@redhat.com>
>
> Want me to apply the patch?
Yes please! Thanks again Danilo.
>
> > ---
> > include/drm/drm_gpuvm.h | 28 ++++++++++++++++++++++++++++
> > 1 file changed, 28 insertions(+)
> >
> > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> > index c7ed6bf441d4..c64585dc4e8e 100644
> > --- a/include/drm/drm_gpuvm.h
> > +++ b/include/drm/drm_gpuvm.h
> > @@ -702,4 +702,32 @@ void drm_gpuva_remap(struct drm_gpuva *prev,
> >
> > void drm_gpuva_unmap(struct drm_gpuva_op_unmap *op);
> >
> > +/**
> > + * drm_gpuva_op_remap_to_unmap_range() - Helper to get the start and range of
> > + * the unmap stage of a remap op.
> > + * @op: Remap op.
> > + * @start_addr: Output pointer for the start of the required unmap.
> > + * @range: Output pointer for the length of the required unmap.
> > + *
> > + * The given start address and range will be set such that they represent the
> > + * range of the address space that was previously covered by the mapping being
> > + * re-mapped, but is now empty.
> > + */
> > +static inline void
> > +drm_gpuva_op_remap_to_unmap_range(const struct drm_gpuva_op_remap *op,
> > + u64 *start_addr, u64 *range)
> > +{
> > + const u64 va_start = op->prev ?
> > + op->prev->va.addr + op->prev->va.range :
> > + op->unmap->va->va.addr;
> > + const u64 va_end = op->next ?
> > + op->next->va.addr :
> > + op->unmap->va->va.addr + op->unmap->va->va.range;
> > +
> > + if (start_addr)
> > + *start_addr = va_start;
> > + if (range)
> > + *range = va_end - va_start;
> > +}
> > +
> > #endif /* __DRM_GPUVM_H__ */
next prev parent reply other threads:[~2023-11-20 11:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 15:12 [PATCH v8 00/20] Imagination Technologies PowerVR DRM driver Sarah Walker
2023-10-31 15:12 ` [PATCH v8 01/20] sizes.h: Add entries between SZ_32G and SZ_64T Sarah Walker
2023-10-31 15:12 ` [PATCH v8 02/20] drm/gpuvm: Helper to get range of unmap from a remap op Sarah Walker
2023-11-14 16:42 ` Danilo Krummrich
2023-11-20 11:07 ` Donald Robson [this message]
2023-10-31 15:12 ` [PATCH v8 03/20] dt-bindings: gpu: Add Imagination Technologies PowerVR/IMG GPU Sarah Walker
2023-10-31 15:12 ` [PATCH v8 04/20] drm/imagination/uapi: Add PowerVR driver UAPI Sarah Walker
2023-11-06 14:51 ` Faith Ekstrand
2023-10-31 15:12 ` [PATCH v8 05/20] drm/imagination: Add skeleton PowerVR driver Sarah Walker
2023-10-31 15:12 ` [PATCH v8 06/20] drm/imagination: Get GPU resources Sarah Walker
2023-10-31 15:12 ` [PATCH v8 07/20] drm/imagination: Add GPU register headers Sarah Walker
2023-10-31 15:12 ` [PATCH v8 08/20] drm/imagination: Add firmware and MMU related headers Sarah Walker
2023-10-31 15:12 ` [PATCH v8 09/20] drm/imagination: Add FWIF headers Sarah Walker
2023-10-31 15:12 ` [PATCH v8 10/20] drm/imagination: Add GPU ID parsing and firmware loading Sarah Walker
2023-10-31 15:12 ` [PATCH v8 11/20] drm/imagination: Add GEM and VM related code Sarah Walker
2023-10-31 15:12 ` [PATCH v8 12/20] drm/imagination: Implement power management Sarah Walker
2023-10-31 15:12 ` [PATCH v8 13/20] drm/imagination: Implement firmware infrastructure and META FW support Sarah Walker
2023-10-31 15:12 ` [PATCH v8 14/20] drm/imagination: Implement MIPS firmware processor and MMU support Sarah Walker
2023-10-31 15:12 ` [PATCH v8 15/20] drm/imagination: Implement free list and HWRT create and destroy ioctls Sarah Walker
2023-10-31 15:12 ` [PATCH v8 16/20] drm/imagination: Implement context creation/destruction ioctls Sarah Walker
2023-10-31 15:12 ` [PATCH v8 17/20] drm/imagination: Implement job submission and scheduling Sarah Walker
2023-10-31 15:12 ` [PATCH v8 18/20] drm/imagination: Add firmware trace header Sarah Walker
2023-10-31 15:12 ` [PATCH v8 19/20] drm/imagination: Add firmware trace to debugfs Sarah Walker
2023-10-31 15:12 ` [PATCH v8 20/20] drm/imagination: Add driver documentation Sarah Walker
2023-10-31 16:31 ` [PATCH v8 00/20] Imagination Technologies PowerVR DRM driver Maxime Ripard
2023-11-01 10:15 ` Frank Binns
2023-11-06 9:43 ` mripard
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=60fb969e2faae2137c48e8840ca31626f9a403d8.camel@imgtec.com \
--to=donald.robson@imgtec.com \
--cc=Frank.Binns@imgtec.com \
--cc=Sarah.Walker@imgtec.com \
--cc=afd@ti.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=christian.koenig@amd.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=hns@goldelico.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luben.tuikov@amd.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--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
all inboxes | Powered by JetHome®