<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 21, 2023 at 3:54 PM Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Mar 20, 2023 at 8:31 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
><br>
> On Mon, Mar 20, 2023 at 1:38 PM Alex Deucher <<a href="mailto:alexander.deucher@amd.com" target="_blank">alexander.deucher@amd.com</a>> wrote:<br>
>><br>
>> Add UAPI to query the GFX shadow buffer requirements<br>
>> for preemption on GFX11. UMDs need to specify the shadow<br>
>> areas for preemption.<br>
>><br>
>> Signed-off-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com" target="_blank">alexander.deucher@amd.com</a>><br>
>> ---<br>
>> include/uapi/drm/amdgpu_drm.h | 10 ++++++++++<br>
>> 1 file changed, 10 insertions(+)<br>
>><br>
>> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h<br>
>> index 3d9474af6566..19a806145371 100644<br>
>> --- a/include/uapi/drm/amdgpu_drm.h<br>
>> +++ b/include/uapi/drm/amdgpu_drm.h<br>
>> @@ -886,6 +886,7 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {<br>
>> #define AMDGPU_INFO_VIDEO_CAPS_DECODE 0<br>
>> /* Subquery id: Encode */<br>
>> #define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1<br>
>> +#define AMDGPU_INFO_CP_GFX_SHADOW_SIZE 0x22<br>
><br>
><br>
> Can you put this into the device structure instead? Let's minimize the number of kernel queries as much as possible.<br>
<br>
I guess, but one nice thing about this is that we can use the query as<br>
a way to determine if the kernel supports this functionality or not.<br>
If not, the query returns -ENOTSUP.<br></blockquote><div><br></div>That should be another flag in the device info structure or the sizes should be 0. There is never a reason to add a new single-value INFO query.<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Marek<br></div></div>