On Thu, Sep 11, 2025 at 10:09 PM Liang, Prike <prike.li...@amd.com> wrote: > > [Public] > > Regards, > Prike > > > -----Original Message----- > > From: Alex Deucher <alexdeuc...@gmail.com> > > Sent: Friday, September 12, 2025 2:55 AM > > To: Liang, Prike <prike.li...@amd.com> > > Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander > > <alexander.deuc...@amd.com>; Koenig, Christian <christian.koe...@amd.com>; > > Khatri, Sunil <sunil.kha...@amd.com> > > Subject: Re: [PATCH 1/9] drm/amdgpu: add UAPI for user queue query status > > > > On Wed, Sep 10, 2025 at 7:37 AM Prike Liang <prike.li...@amd.com> wrote: > > > > > > From: Alex Deucher <alexander.deuc...@amd.com> > > > > > > Add an API to query queue status such as whether the queue is hung or > > > whether vram is lost. > > > > > > > We need mesa code before we can land this new interface. > Do we have a plan for upstreaming the mesa counterpart code? > Or can we update the userq structure in the drm header first if we need to > upstream the following metadata solution?
We need to write the mesa code first so we can test the whole thing end to end. Alex > > > Alex > > > > > Reviewed-by: Christian König <christian.koe...@amd.com> > > > Reviewed-by: Sunil Khatri <sunil.kha...@amd.com> > > > Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> > > > --- > > > include/uapi/drm/amdgpu_drm.h | 14 ++++++++++++++ > > > 1 file changed, 14 insertions(+) > > > > > > diff --git a/include/uapi/drm/amdgpu_drm.h > > > b/include/uapi/drm/amdgpu_drm.h index 85b3ca14f81e..7292f7bfcd13 > > > 100644 > > > --- a/include/uapi/drm/amdgpu_drm.h > > > +++ b/include/uapi/drm/amdgpu_drm.h > > > @@ -334,6 +334,7 @@ union drm_amdgpu_ctx { > > > /* user queue IOCTL operations */ > > > #define AMDGPU_USERQ_OP_CREATE 1 > > > #define AMDGPU_USERQ_OP_FREE 2 > > > +#define AMDGPU_USERQ_OP_QUERY_STATUS 3 > > > > > > /* queue priority levels */ > > > /* low < normal low < normal high < high */ @@ -346,6 +347,12 @@ > > > union drm_amdgpu_ctx { > > > /* for queues that need access to protected content */ #define > > > AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE (1 << 2) > > > > > > + > > > +/* the queue is hung */ > > > +#define AMDGPU_USERQ_QUERY_STATUS_FLAGS_HUNG (1 << 0) > > > +/* indicate vram lost since queue was created */ #define > > > +AMDGPU_USERQ_QUERY_STATUS_FLAGS_VRAMLOST (1 << 1) > > > + > > > /* > > > * This structure is a container to pass input configuration > > > * info for all supported userqueue related operations. > > > @@ -427,9 +434,16 @@ struct drm_amdgpu_userq_out { > > > __u32 _pad; > > > }; > > > > > > +/* The structure to carry output of userqueue ops */ struct > > > +drm_amdgpu_userq_out_query_state { > > > + __u32 flags; > > > + __u32 _pad; > > > +}; > > > + > > > union drm_amdgpu_userq { > > > struct drm_amdgpu_userq_in in; > > > struct drm_amdgpu_userq_out out; > > > + struct drm_amdgpu_userq_out_query_state out_qs; > > > }; > > > > > > /* GFX V11 IP specific MQD parameters */ > > > -- > > > 2.34.1 > > >