linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Sarah Walker <sarah.walker@imgtec.com>, dri-devel@lists.freedesktop.org
Cc: linux-doc@vger.kernel.org, hns@goldelico.com,
	krzysztof.kozlowski+dt@linaro.org, matthew.brost@intel.com,
	corbet@lwn.net, luben.tuikov@amd.com, dakr@redhat.com,
	donald.robson@imgtec.com, devicetree@vger.kernel.org,
	conor+dt@kernel.org, mripard@kernel.org, matt.coster@imgtec.com,
	robh+dt@kernel.org, faith.ekstrand@collabora.com,
	linux-kernel@vger.kernel.org, afd@ti.com,
	boris.brezillon@collabora.com, tzimmermann@suse.de,
	christian.koenig@amd.com
Subject: Re: [PATCH v6 02/20] drm/gpuva_mgr: Helper to get range of unmap from a remap op.
Date: Thu, 07 Sep 2023 15:14:14 +0300	[thread overview]
Message-ID: <87a5tygoyx.fsf@intel.com> (raw)
In-Reply-To: <20230906095542.3280699-3-sarah.walker@imgtec.com>

On Wed, 06 Sep 2023, Sarah Walker <sarah.walker@imgtec.com> wrote:
> From: Donald Robson <donald.robson@imgtec.com>
>
> Signed-off-by: Donald Robson <donald.robson@imgtec.com>
> ---
>  include/drm/drm_gpuva_mgr.h | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/include/drm/drm_gpuva_mgr.h b/include/drm/drm_gpuva_mgr.h
> index ed8d50200cc3..be7b3a6d7e67 100644
> --- a/include/drm/drm_gpuva_mgr.h
> +++ b/include/drm/drm_gpuva_mgr.h
> @@ -703,4 +703,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
> + * 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.
> + */
> +static __always_inline void

IMO __always_inline *always* requires a justification in the commit
message.

BR,
Jani.


> +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_GPUVA_MGR_H__ */

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2023-09-07 16:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  9:55 [PATCH v6 00/20] Imagination Technologies PowerVR DRM driver Sarah Walker
2023-09-06  9:55 ` [PATCH v6 01/20] sizes.h: Add entries between 32G and 64T Sarah Walker
2023-09-06  9:55 ` [PATCH v6 02/20] drm/gpuva_mgr: Helper to get range of unmap from a remap op Sarah Walker
2023-09-06 11:35   ` Maxime Ripard
2023-09-06 11:46     ` Sarah Walker
2023-09-07 12:14   ` Jani Nikula [this message]
2023-09-07 13:00     ` Donald Robson
2023-09-07 13:15       ` Jani Nikula
2023-09-06  9:55 ` [PATCH v6 03/20] dt-bindings: gpu: Add Imagination Technologies PowerVR/IMG GPU Sarah Walker
2023-09-06 11:36   ` Maxime Ripard
2023-09-06 11:36   ` Maxime Ripard
2023-09-06 19:03   ` Linus Walleij
2023-09-07 10:20   ` Conor Dooley
2023-09-06  9:55 ` [PATCH v6 04/20] drm/imagination/uapi: Add PowerVR driver UAPI Sarah Walker
     [not found]   ` <CAD_bs+qdnVPYbmtzqcpCC8xdLVNvDb8uNccsd=P6YX+sgMG6Xg@mail.gmail.com>
2023-09-22 18:46     ` Andrew Davis
2023-09-25  0:41   ` Dave Airlie
2023-09-06  9:55 ` [PATCH v6 05/20] drm/imagination: Add skeleton PowerVR driver Sarah Walker
2023-09-06  9:55 ` [PATCH v6 06/20] drm/imagination: Get GPU resources Sarah Walker
2023-09-06  9:55 ` [PATCH v6 08/20] drm/imagination: Add firmware and MMU related headers Sarah Walker
2023-09-06 11:55   ` Maxime Ripard
2023-09-06  9:55 ` [PATCH v6 10/20] drm/imagination: Add GPU ID parsing and firmware loading Sarah Walker
2023-09-06  9:55 ` [PATCH v6 12/20] drm/imagination: Implement power management Sarah Walker
2023-09-06  9:55 ` [PATCH v6 14/20] drm/imagination: Implement MIPS firmware processor and MMU support Sarah Walker
2023-09-06  9:55 ` [PATCH v6 15/20] drm/imagination: Implement free list and HWRT create and destroy ioctls Sarah Walker
2023-09-06  9:55 ` [PATCH v6 16/20] drm/imagination: Implement context creation/destruction ioctls Sarah Walker
2023-09-06  9:55 ` [PATCH v6 18/20] drm/imagination: Add firmware trace header Sarah Walker
2023-09-06  9:55 ` [PATCH v6 19/20] drm/imagination: Add firmware trace to debugfs Sarah Walker
2023-09-06  9:55 ` [PATCH v6 20/20] drm/imagination: Add driver documentation Sarah Walker

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=87a5tygoyx.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=afd@ti.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=devicetree@vger.kernel.org \
    --cc=donald.robson@imgtec.com \
    --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=matt.coster@imgtec.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sarah.walker@imgtec.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;
as well as URLs for NNTP newsgroup(s).