[PATCH 07/11] drm/amdgpu: add UAPI to query GFX shadow sizes

Christian König ckoenig.leichtzumerken at gmail.com
Wed Mar 22 08:50:34 UTC 2023



Am 21.03.23 um 20:53 schrieb Alex Deucher:
> On Mon, Mar 20, 2023 at 8:31 PM Marek Olšák <maraeo at gmail.com> wrote:
>> On Mon, Mar 20, 2023 at 1:38 PM Alex Deucher <alexander.deucher at amd.com> wrote:
>>> Add UAPI to query the GFX shadow buffer requirements
>>> for preemption on GFX11.  UMDs need to specify the shadow
>>> areas for preemption.
>>>
>>> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
>>> ---
>>>   include/uapi/drm/amdgpu_drm.h | 10 ++++++++++
>>>   1 file changed, 10 insertions(+)
>>>
>>> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
>>> index 3d9474af6566..19a806145371 100644
>>> --- a/include/uapi/drm/amdgpu_drm.h
>>> +++ b/include/uapi/drm/amdgpu_drm.h
>>> @@ -886,6 +886,7 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
>>>          #define AMDGPU_INFO_VIDEO_CAPS_DECODE           0
>>>          /* Subquery id: Encode */
>>>          #define AMDGPU_INFO_VIDEO_CAPS_ENCODE           1
>>> +#define AMDGPU_INFO_CP_GFX_SHADOW_SIZE         0x22
>>
>> Can you put this into the device structure instead? Let's minimize the number of kernel queries as much as possible.
> I guess, but one nice thing about this is that we can use the query as
> a way to determine if the kernel supports this functionality or not.
> If not, the query returns -ENOTSUP.

Well if we put it at the end of the device info structure the sizes 
should be zero on older kernels/fw.

That will also work nicely.

Christian.

>
> Alex
>
>
>> Thanks,
>> Marek
>>



More information about the amd-gfx mailing list