All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: matthew.brost@intel.com, Tatsuyuki Ishi <ishitatsuyuki@gmail.com>,
	arunpravin.paneerselvam@amd.com, thomas_os@shipmail.org,
	francois.dugast@intel.com, amd-gfx@lists.freedesktop.org,
	luben.tuikov@amd.com, dakr@redhat.com,
	dri-devel@lists.freedesktop.org, felix.kuehling@amd.com
Subject: Re: [PATCH 06/13] drm/amdgpu: use the new drm_exec object for CS v2
Date: Tue, 20 Jun 2023 11:20:32 +0200	[thread overview]
Message-ID: <20230620112032.3c8091d7@collabora.com> (raw)
In-Reply-To: <01ad928e-a900-fc5e-901c-8fe2639d711a@gmail.com>

On Tue, 20 Jun 2023 11:14:51 +0200
Christian König <ckoenig.leichtzumerken@gmail.com> wrote:

> Am 20.06.23 um 11:09 schrieb Boris Brezillon:
> > On Tue, 20 Jun 2023 10:44:26 +0200
> > Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
> >  
> >> Am 20.06.23 um 10:28 schrieb Boris Brezillon:  
> >>> On Tue, 20 Jun 2023 10:12:13 +0200
> >>> Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
> >>>     
> >>>>> I think Boris's suggestion of having this through a common
> >>>>> DRM_EXEC_FLAG_ALLOW_DUPLICATES flag fits well.  
> >>>> No, again. The only driver which should accept duplicates is radeon, for
> >>>> all other drivers especially new ones duplicates should probably be
> >>>> rejected.
> >>>>
> >>>> We only allow this for radeon because it is already UAPI, could be that
> >>>> we need to do this for amdgpu as well but I really hope we don't need this.  
> >>> Just want to describe the use case we have: we support submission in
> >>> batch (several jobs passed to the submit ioctl) with a
> >>> submit-all-or-nothing model: if any of the job description is passed
> >>> wrong args or causes an allocation error, we fail the whole group. In
> >>> the submission path, we want to prepare GEMs for all jobs. That means
> >>> adding enough fence slots for the number job finished fences. Given not
> >>> all jobs will access the same set of BOs, I thought I could use
> >>> duplicates support to make my life easier, because otherwise I have to
> >>> collect all BOs upfront, store them in a temporary array, and keep
> >>> track of the number of fence slots needed for each of them. I guess
> >>> the other option would be to over-estimate the number of slots and make
> >>> it equal to num_jobs for all BOs.  
> >> Sounds pretty much what amdgpu is doing as well, but question is why
> >> don't you give just one list of BOs? Do you really want to add the
> >> fences that fine grained?  
> > Actually, we don't give a list of BOs at all, we pass a VM, and lock
> > all BOs attached to the VM (similar to what Xe does). And, as all other
> > drivers being submitted recently, we use explicit sync, so most of
> > those VM BOs, except for the imported/exported ones, will be given a
> > BOOKKEEP fence.
> >
> > The reason we need support for duplicates is because we also have
> > implicit BOs (like the HWRT object that's shared by the
> > geometry/fragment queues to pass data around), and those can be passed
> > to multiple jobs in a given batch and require special synchronization
> > (geometry job writes to them, fragment job reads from them, so we have
> > a reader/writer sync to express). I can of course de-duplicate upfront,
> > by parsing jobs and creating an array of BOs that need to be acquired
> > over the whole submission, but that's still one extra-step I'd prefer
> > to avoid, given the dma_resv framework allows us to figure it out at
> > lock time. I can also just deal with the EALREADY case in the driver
> > directly, it's not like it's super complicated anyway, just thought
> > other drivers would fall in the same situation, that's all.  
> 
> Well as long as you just need to ignore EALREADY, that should be trivial 
> and doable.

Oh, yeah, that's all I need really. We probably don't want to add the
GEM object a second time in the array though, hence the goto
reserve_fences in my proposal when EALREADY is returned.

> 
> What radeon needs is to keep EALREADY BOs in a separate container 
> because we need to double check their properties to not break the UAPI.
> 
> I strongly think that this shouldn't be needed by any other driver.
> 
> Going to add a flag to ignore EALREADY which can be set during exec init.

Thanks!

  reply	other threads:[~2023-06-20  9:20 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 11:51 Common DRM execution context v4 Christian König
2023-05-04 11:51 ` [PATCH 01/13] drm: execution context for GEM buffers v4 Christian König
2023-05-04 14:02   ` Thomas Hellström (Intel)
2023-05-25 20:42   ` Danilo Krummrich
2023-06-14 12:23   ` Boris Brezillon
2023-06-14 12:30     ` Christian König
2023-06-14 13:02       ` Boris Brezillon
2023-06-17 11:54         ` Boris Brezillon
2023-06-19  8:59           ` Thomas Hellström (Intel)
2023-06-19  9:20             ` Christian König
2023-06-19  9:33               ` Thomas Hellström (Intel)
2023-06-19  9:48                 ` Christian König
2023-06-19 11:06                   ` Thomas Hellström (Intel)
2023-06-21 13:35                     ` Christian König
2023-06-19 10:23               ` Boris Brezillon
2023-06-19 10:12             ` Boris Brezillon
2023-06-19 10:44               ` Christian König
2023-06-19 11:05                 ` Boris Brezillon
2023-06-19 12:01                   ` Boris Brezillon
2023-06-19 12:29                 ` Boris Brezillon
2023-06-20  6:47                   ` Boris Brezillon
2023-06-20  7:28                     ` Christian König
2023-05-04 11:51 ` [PATCH 02/13] drm: add drm_exec selftests v2 Christian König
2023-05-04 12:07   ` Maíra Canal
2023-05-04 12:52     ` Christian König
2023-05-04 11:51 ` [PATCH 03/13] drm/amdkfd: switch over to using drm_exec v2 Christian König
2023-05-04 11:51 ` [PATCH 04/13] drm/amdgpu: use drm_exec for GEM and CSA handling Christian König
2023-05-04 11:51 ` [PATCH 05/13] drm/amdgpu: use drm_exec for MES testing Christian König
2023-05-04 11:51 ` [PATCH 06/13] drm/amdgpu: use the new drm_exec object for CS v2 Christian König
2023-06-12 13:16   ` Tatsuyuki Ishi
2023-06-20  4:07   ` Tatsuyuki Ishi
2023-06-20  4:14     ` Tatsuyuki Ishi
2023-06-20  8:13       ` Christian König
2023-06-20  8:12     ` Christian König
2023-06-20  8:16       ` Tatsuyuki Ishi
2023-06-20  9:04         ` Tatsuyuki Ishi
2023-06-20  8:28       ` Boris Brezillon
2023-06-20  8:44         ` Christian König
2023-06-20  9:09           ` Boris Brezillon
2023-06-20  9:14             ` Christian König
2023-06-20  9:20               ` Boris Brezillon [this message]
2023-05-04 11:51 ` [PATCH 07/13] drm/radeon: switch over to drm_exec Christian König
2023-05-04 11:51 ` [PATCH 08/13] drm/qxl: switch to using drm_exec Christian König
2023-06-20  9:13   ` Thomas Zimmermann
2023-06-20  9:15     ` Christian König
2023-05-04 11:51 ` [PATCH 09/13] drm/lima: " Christian König
2023-05-04 11:51 ` [PATCH 10/13] drm/virtgpu: " Christian König
2023-05-04 11:51 ` [PATCH 11/13] drm/panfrost: " Christian König
2023-05-04 11:51 ` [PATCH 12/13] drm/v3d: " Christian König
2023-05-04 11:51 ` [PATCH 13/13] drm: remove drm_gem_(un)lock_reservations Christian König
  -- strict thread matches above, loose matches on Subject: below --
2023-06-12  9:06 [PATCH 06/13] drm/amdgpu: use the new drm_exec object for CS v2 Tatsuyuki Ishi

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=20230620112032.3c8091d7@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dakr@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felix.kuehling@amd.com \
    --cc=francois.dugast@intel.com \
    --cc=ishitatsuyuki@gmail.com \
    --cc=luben.tuikov@amd.com \
    --cc=matthew.brost@intel.com \
    --cc=thomas_os@shipmail.org \
    /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 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.