mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Danilo Krummrich <dakr@redhat.com>,
	airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com,
	sarah.walker@imgtec.com, donald.robson@imgtec.com,
	boris.brezillon@collabora.com, christian.koenig@amd.com,
	faith@gfxstrand.net
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH drm-misc-next v6 4/6] drm/gpuvm: track/lock/validate external/evicted objects
Date: Tue, 10 Oct 2023 08:40:17 +0200	[thread overview]
Message-ID: <c6ce663d-dd69-46a2-7b55-359169b6c03c@linux.intel.com> (raw)
In-Reply-To: <20231008233212.13815-5-dakr@redhat.com>


On 10/9/23 01:32, Danilo Krummrich wrote:
> Currently the DRM GPUVM offers common infrastructure to track GPU VA
> allocations and mappings, generically connect GPU VA mappings to their
> backing buffers and perform more complex mapping operations on the GPU VA
> space.
>
> However, there are more design patterns commonly used by drivers, which
> can potentially be generalized in order to make the DRM GPUVM represent
> a basis for GPU-VM implementations. In this context, this patch aims
> at generalizing the following elements.
>
> 1) Provide a common dma-resv for GEM objects not being used outside of
>     this GPU-VM.
>
> 2) Provide tracking of external GEM objects (GEM objects which are
>     shared with other GPU-VMs).
>
> 3) Provide functions to efficiently lock all GEM objects dma-resv the
>     GPU-VM contains mappings of.
>
> 4) Provide tracking of evicted GEM objects the GPU-VM contains mappings
>     of, such that validation of evicted GEM objects is accelerated.
>
> 5) Provide some convinience functions for common patterns.
>
> Big thanks to Boris Brezillon for his help to figure out locking for
> drivers updating the GPU VA space within the fence signalling path.
>
> Suggested-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
>
> +/**
> + * drm_gpuvm_resv_add_fence - add fence to private and all extobj
> + * dma-resv
> + * @gpuvm: the &drm_gpuvm to add a fence to
> + * @exec: the &drm_exec locking context
> + * @fence: fence to add
> + * @private_usage: private dma-resv usage
> + * @extobj_usage: extobj dma-resv usage
> + */
> +void
> +drm_gpuvm_resv_add_fence(struct drm_gpuvm *gpuvm,
> +			 struct drm_exec *exec,
> +			 struct dma_fence *fence,
> +			 enum dma_resv_usage private_usage,
> +			 enum dma_resv_usage extobj_usage)
> +{
> +	struct drm_gem_object *obj;
> +	unsigned long index;
> +
> +	drm_exec_for_each_locked_object(exec, index, obj) {
> +		dma_resv_assert_held(obj->resv);
> +		dma_resv_add_fence(obj->resv, fence,
> +				   drm_gpuvm_is_extobj(gpuvm, obj) ?
> +				   private_usage : extobj_usage);

It looks like private_usage and extobj_usage are mixed up above?


> +	}
> +}
> +EXPORT_SYMBOL_GPL(drm_gpuvm_resv_add_fence);
> +

Thanks,

Thomas



  parent reply	other threads:[~2023-10-10  6:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 23:32 [PATCH drm-misc-next v6 0/6] [RFC] DRM GPUVM features Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 1/6] drm/gpuvm: add common dma-resv per struct drm_gpuvm Danilo Krummrich
2023-10-13 11:38   ` Thomas Hellström
2023-10-13 11:51     ` Danilo Krummrich
2023-10-13 13:00       ` Thomas Hellström
2023-10-17 13:18         ` Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 2/6] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Danilo Krummrich
2023-10-13 11:43   ` Thomas Hellström
2023-10-08 23:32 ` [PATCH drm-misc-next v6 3/6] drm/gpuvm: add an abstraction for a VM / BO combination Danilo Krummrich
2023-10-13 12:30   ` Thomas Hellström
2023-10-17  9:58     ` Danilo Krummrich
2023-10-17 10:54       ` Thomas Hellström
2023-10-13 12:33   ` Thomas Hellström
2023-10-08 23:32 ` [PATCH drm-misc-next v6 4/6] drm/gpuvm: track/lock/validate external/evicted objects Danilo Krummrich
2023-10-09 13:36   ` Thomas Hellström
2023-10-09 14:45     ` Danilo Krummrich
2023-10-09 20:54       ` Danilo Krummrich
2023-10-10  6:26       ` Thomas Hellström
2023-10-13 12:04         ` Danilo Krummrich
2023-10-13 13:02           ` Thomas Hellström
2023-10-10  6:40   ` Thomas Hellström [this message]
2023-10-13 12:05     ` Danilo Krummrich
2023-10-13 13:37   ` Thomas Hellström
2023-10-16 10:55     ` Thomas Hellström
2023-10-08 23:32 ` [PATCH drm-misc-next v6 5/6] drm/nouveau: make use of the GPUVM's shared dma-resv Danilo Krummrich
2023-10-08 23:32 ` [PATCH drm-misc-next v6 6/6] drm/nouveau: use GPUVM common infrastructure Danilo Krummrich

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=c6ce663d-dd69-46a2-7b55-359169b6c03c@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dakr@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=donald.robson@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=faith@gfxstrand.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=sarah.walker@imgtec.com \
    /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

Powered by JetHome