Re: [PATCH v5 07/21] gpu: host1x: Introduce UAPI header

Thierry Reding
2021-03-23T11:43:40Z

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

On Tue, Mar 23, 2021 at 01:12:36PM +0200, Mikko Perttunen wrote:
> On 3/23/21 12:52 PM, Thierry Reding wrote:
> > On Mon, Jan 11, 2021 at 03:00:05PM +0200, Mikko Perttunen wrote:
[...]
> > > +struct host1x_fence_extract_fence {
> > > + __u32 id;
> > > + __u32 threshold;
> > > +};
> > > +
> > > +struct host1x_fence_extract {
> > > + /**
> > > + * @fence_fd: [in]
> > > + *
> > > + * sync_file file descriptor
> > > + */
> > > + __s32 fence_fd;
> > > +
> > > + /**
> > > + * @num_fences: [in,out]
> > > + *
> > > + * In: size of the `fences_ptr` array counted in elements.
> > > + * Out: required size of the `fences_ptr` array counted in elements.
> > > + */
> > > + __u32 num_fences;
> > > +
> > > + /**
> > > + * @fences_ptr: [in]
> > > + *
> > > + * Pointer to array of `struct host1x_fence_extract_fence`.
> > > + */
> > > + __u64 fences_ptr;
> > > +
> > > + __u32 reserved[2];
> > > +};
> >
> > For the others it's pretty clear to me what the purpose is, but I'm at a
> > complete loss with this one. What's the use-case for this?
>
> This is needed to process incoming prefences for userspace-programmed
> engines -- mainly, the GPU with usermode submit enabled.

I'm not sure what GPU usermode submit is. The name would imply that it's
somehow a mechanism to submit work to the GPU without getting the kernel
involved at all. That's something we'd have to clarify with the Nouveau
team to see if it's something they'd consider implementing, or implement
it ourselves.

Currently there's no interoperation at the syncpoint level between
Nouveau and Tegra DRM, so Nouveau on Tegra doesn't use any syncpoints at
all and hence there's currently no use at all for this kind of API.

> To align with other upstream code, I've been thinking of removing this whole
> UAPI; moving the syncpoint allocation part to the DRM UAPI, and dropping the
> sync_file stuff altogether (if we have support for job submission outputting
> syncobjs, those could still be converted into sync_files). This doesn't
> support usecases like GPU usermode submit, so for downstream we'll have to
> add it back in, though. Would like to hear your opinion on it as well.

That certainly sounds like a much easier sell because we have use-cases
for all of that. Along with your patches for NVDEC, the existing
userspace for VIC and your work-in-progress NVDEC userspace, this should
cover all the requirements.

Long story short, I think we have some ground to cover before we can
start thinking about how to do GPU usermode submits in an upstream
stack. As such we have no clear idea of what this is going to look like
in the end, or if it's going to be supported at all, so I think it'd be
best to move forward with your alternate proposal and move the syncpoint
functionality into Tegra DRM so that it can be used for VIC, NVDEC and
potentially other engines. If we ever get to the point of having to
support GPU usermode submit, we can take another look at how best to
support it.

Thierry

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