On Tue, 20 Jun 2023 10:12:13 +0200 Christian König <ckoenig.leichtzumerken@xxxxxxxxx> 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.