All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] drm/v3d: add multiple in/out syncobjs support
@ 2021-09-29  9:41 Melissa Wen
  2021-09-29  9:42 ` [PATCH v2 1/4] drm/v3d: decouple adding job dependencies steps from job init Melissa Wen
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Melissa Wen @ 2021-09-29  9:41 UTC (permalink / raw)
  To: dri-devel
  Cc: Emma Anholt, David Airlie, Daniel Vetter, Maxime Ripard,
	Boris Brezillon, Iago Toral

[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]

Currently, v3d only supports single in/out syncobj per submission (in
v3d_submit_cl, there are two in_sync, one for bin and another for render
job); however, Vulkan queue submit operations expect multiples wait and
signal semaphores. This series extends v3d interface and job dependency
operations to handle more than one in/out syncobj.

This version differs from the previous one by adding a prep work patch
that synthesizes job memory allocation and initialization into a single
function. Also, the design for ioctl extensions changed to subclass
drm_v3d_extension (generic type) as base element of any specific
extension (here is drm_v3d_multisync). Finally, in the multisync
extension, flags was replaced by wait_stage and it uses v3d_queue to
define sync stage (i.e. which queue to add wait semaphores)

The first patch just decouples the steps to lookup and add job
dependency from the job init code, since the operation repeats for every
syncobj that a job should wait before starting. So, the fourth patch of
this series will reuse it to handle multiples wait for semaphores.

The second patch moves job memory allocation to v3d_job_init() for any
type of v3d_job-based job. The main goal is to prevent errors when
handling job initialization failures (doing a proper cleanup). 

The third patch extends our interface by using a generic extension.
This approach was inspired by i915_user_extension[1] and
amd_cs_chunks[2] to give a little more flexibility in adding other
submission features in the future. Therefore, the list of extensions
would work as a hub of features that use an id to determine the
corresponding feature data type.

With this base, the fourth patch adds multiple wait/signal semaphores
support. For this, we add to the list of the generic extensions a new
data type (drm_v3d_multi_sync) that points to two arrays of syncobjs
(in/out) and also determines (wait_stage) the job to add wait
dependencies (v3d_queue). An auxiliary struct (v3d_submit_ext) is used
when parsing submission extensions. Finally, we reserve some space in
the semaphore struct (drm_v3d_sem) to accommodate timeline semaphores
that we aim to add support soon (same reason for already defining
v3d_submit_outsync).

[1] https://cgit.freedesktop.org/drm/drm-misc/commit/drivers/gpu/drm/i915/i915_user_extensions.c?id=9d1305ef80b95dde0337106ed8b826604e2155ad
[2] https://cgit.freedesktop.org/drm/drm-misc/tree/include/uapi/drm/amdgpu_drm.h#n556

In the mesa side, the work related to this series is in progress at
https://gitlab.freedesktop.org/mwen/mesa/-/commit/6c340bb35203a0418af87a7921d7295a4047b77f

v2:
- move job mem alloc to v3d_job_init (Iago)
- simplify and subclass the generic extension struct (Daniel)
- make job dependency conditions more understandable (Iago)


Melissa Wen (4):
  drm/v3d: decouple adding job dependencies steps from job init
  drm/v3d: alloc and init job in one shot
  drm/v3d: add generic ioctl extension
  drm/v3d: add multiple syncobjs support

 drivers/gpu/drm/v3d/v3d_drv.c |  10 +-
 drivers/gpu/drm/v3d/v3d_drv.h |  23 ++-
 drivers/gpu/drm/v3d/v3d_gem.c | 360 +++++++++++++++++++++++++---------
 include/uapi/drm/v3d_drm.h    |  78 ++++++++
 4 files changed, 368 insertions(+), 103 deletions(-)

-- 
2.30.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-30 16:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29  9:41 [PATCH v2 0/4] drm/v3d: add multiple in/out syncobjs support Melissa Wen
2021-09-29  9:42 ` [PATCH v2 1/4] drm/v3d: decouple adding job dependencies steps from job init Melissa Wen
2021-09-29  9:43 ` [PATCH v2 2/4] drm/v3d: alloc and init job in one shot Melissa Wen
2021-09-30  8:44   ` Iago Toral
2021-09-30  9:16     ` Melissa Wen
2021-09-29  9:44 ` [PATCH v2 3/4] drm/v3d: add generic ioctl extension Melissa Wen
2021-09-30  9:11   ` Iago Toral
2021-09-30  9:22     ` Melissa Wen
2021-09-30  9:59       ` Iago Toral
2021-09-29  9:45 ` [PATCH v2 4/4] drm/v3d: add multiple syncobjs support Melissa Wen
2021-09-30  9:54   ` Iago Toral
2021-09-30 10:40     ` Melissa Wen
2021-09-30 16:26       ` Melissa Wen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.