Re: [PATCH v3] drm: Add UAPI for the Asahi driver

Daniel Almeida
2025-03-24T00:21:56Z

Hi Alyssa,

>
>>>> + /**
>>>> + * @DRM_ASAHI_BIND_SINGLE_PAGE: Map a single page of the BO repeatedly
>>>> + * across the VA range.
>>>> + *
>>>> + * This is useful to fill a VA range with scratch pages or zero pages.
>>>> + * It is intended as a mechanism to accelerate sparse.
>>>> + */
>>>> + DRM_ASAHI_BIND_SINGLE_PAGE = (1L << 2),
>>
>> Does this require the BO to be a single page? If so, does it require offset==0? Or does it just take whatever page is at the specified offset?
>
> I believe the intention is that it takes whatever page is at the
> specified offset and just maps that a bunch of times. HK doesn't use
> this yet though it probably should (this was added to help reduce
> overhead when emulating sparse with scratch/zero pages, which is still
> very new functionality in hk).
>
> Accelerating this properly involves GPUVM patches - although even without
> that, moving the loop into the kernel so it's only a single ioctl
> (user-kernel roundtrip) seems worth keeping the flag for.

FYI: I will be posting a patch for the GPUVM abstraction soon.

— Daniel