mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 v7 02/20] drm/gpuvm: Helper to get range of unmap from a remap op.
Date: Thu, 12 Oct 2023 09:57:33 +0000	[thread overview]
Message-ID: <00bd08d8caecad2d684ecdd485cffe6ad79672c2.camel@imgtec.com> (raw)
In-Reply-To: <3205eb86-f875-e597-9df6-628d5799cb12@redhat.com>

Hi Danilo,

Thanks for the feedback. The change has been made and will be in the next version.

Thanks,
Donald

On Tue, 2023-10-10 at 18:31 +0200, 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/10/23 15:37, 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 v6:
> > - Remove use of __always_inline
> > 
> > Signed-off-by: Donald Robson <donald.robson@imgtec.com>
> > Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
> > ---
> >   include/drm/drm_gpuvm.h | 27 +++++++++++++++++++++++++++
> >   1 file changed, 27 insertions(+)
> > 
> > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> > index c7ed6bf441d4..932e942da921 100644
> > --- a/include/drm/drm_gpuvm.h
> > +++ b/include/drm/drm_gpuvm.h
> > @@ -702,4 +702,31 @@ void drm_gpuva_remap(struct drm_gpuva *prev,
> >   
> >   void drm_gpuva_unmap(struct drm_gpuva_op_unmap *op);
> >   
> > +/**
> > + * drm_gpuva_op_remap_get_unmap_range() - Helper to get the start and range of
> 
> Not a strong opinion on that, but maybe drm_gpuva_op_remap_to_unmap_range() would
> be a bit better.
> 
> > + * 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.
> > + *
> > + * These parameters can then be used by the caller to unmap memory pages that
> > + * are no longer required.
> 
> I think we should be a bit more precise on what this is good for. Maybe something
> like: "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 getting
> re-mapped, but is empty now."
> 
> > + */
> > +static inline void
> > +drm_gpuva_op_remap_get_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__ */

  reply	other threads:[~2023-10-12  9:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 13:37 [PATCH v7 00/20] Imagination Technologies PowerVR DRM driver Sarah Walker
2023-10-10 13:37 ` [PATCH v7 01/20] sizes.h: Add entries between SZ_32G and SZ_64T Sarah Walker
2023-10-10 13:37 ` [PATCH v7 02/20] drm/gpuvm: Helper to get range of unmap from a remap op Sarah Walker
2023-10-10 16:31   ` Danilo Krummrich
2023-10-12  9:57     ` Donald Robson [this message]
2023-10-10 13:37 ` [PATCH v7 03/20] dt-bindings: gpu: Add Imagination Technologies PowerVR/IMG GPU Sarah Walker
2023-10-10 13:37 ` [PATCH v7 04/20] drm/imagination/uapi: Add PowerVR driver UAPI Sarah Walker
2023-10-10 13:37 ` [PATCH v7 05/20] drm/imagination: Add skeleton PowerVR driver Sarah Walker
2023-10-10 13:37 ` [PATCH v7 06/20] drm/imagination: Get GPU resources Sarah Walker
2023-10-10 13:37 ` [PATCH v7 07/20] drm/imagination: Add GPU register headers Sarah Walker
2023-10-10 13:37 ` [PATCH v7 08/20] drm/imagination: Add firmware and MMU related headers Sarah Walker
2023-10-10 13:37 ` [PATCH v7 09/20] drm/imagination: Add FWIF headers Sarah Walker
2023-10-10 13:37 ` [PATCH v7 10/20] drm/imagination: Add GPU ID parsing and firmware loading Sarah Walker
2023-10-12  6:58   ` kernel test robot
2023-10-10 13:37 ` [PATCH v7 11/20] drm/imagination: Add GEM and VM related code Sarah Walker
2023-10-13 12:47   ` kernel test robot
2023-10-10 13:37 ` [PATCH v7 12/20] drm/imagination: Implement power management Sarah Walker
2023-10-10 13:37 ` [PATCH v7 13/20] drm/imagination: Implement firmware infrastructure and META FW support Sarah Walker
2023-10-10 13:37 ` [PATCH v7 14/20] drm/imagination: Implement MIPS firmware processor and MMU support Sarah Walker
2023-10-10 13:37 ` [PATCH v7 15/20] drm/imagination: Implement free list and HWRT create and destroy ioctls Sarah Walker
2023-10-10 13:37 ` [PATCH v7 16/20] drm/imagination: Implement context creation/destruction ioctls Sarah Walker
2023-10-10 13:37 ` [PATCH v7 17/20] drm/imagination: Implement job submission and scheduling Sarah Walker
2023-10-10 13:37 ` [PATCH v7 18/20] drm/imagination: Add firmware trace header Sarah Walker
2023-10-10 13:37 ` [PATCH v7 19/20] drm/imagination: Add firmware trace to debugfs Sarah Walker
2023-10-10 13:37 ` [PATCH v7 20/20] drm/imagination: Add driver documentation Sarah Walker
2023-10-19 10:12 ` [PATCH v7 00/20] Imagination Technologies PowerVR DRM driver Maxim Kochetkov

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=00bd08d8caecad2d684ecdd485cffe6ad79672c2.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®