Public
Regards,
Prike
> -----Original Message-----
> From: Koenig, Christian <[email protected]>
> Sent: Thursday, June 11, 2026 5:25 PM
> To: Liang, Prike <[email protected]>; [email protected]
> Cc: Deucher, Alexander <[email protected]>; Pelloux-Prayer, Pierre-
> Eric <[email protected]>
> Subject: Re: [PATCH v2 1/3] drm/amdgpu: set the userq xcp_id
>
>
>
> On 6/11/26 10:33, Prike Liang wrote:
> > Initialize the userq xcp_id.
> >
> > Signed-off-by: Prike Liang <[email protected]>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > index 3d6b1cfeca24..c1175cb6d242 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> > @@ -585,6 +585,17 @@ static int amdgpu_userq_priority_permit(struct drm_file
> *filp,
> > return -EACCES;
> > }
> >
> > +
> > +static u32 amdgpu_userq_get_xcp_id(struct amdgpu_fpriv *fpriv)
>
> I don't think we need a separate function for this, just inline it below.
Yeah, will do in the following version. Since similar XCP ID retrieval is also
needed in other places, we may need to extract this as a helper function in
amdgpu_xcp.c
>
> > +{
> > + /*
> > + * The enforce-isolation userq path uses idx 0 for non-partitioned
> > + * devices, matching the gfx ring isolation handling.
> > + */
> > + return fpriv->xcp_id == AMDGPU_XCP_NO_PARTITION ? 0 :
> > + fpriv->xcp_id;
>
> That can be shortened into fpriv->xcp_id != AMDGPU_XCP_NO_PARTITION ?: 0;
>
> > +}
> > +
> > static int
> > amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq
> > *args) { @@ -629,6 +640,7 @@ amdgpu_userq_create(struct drm_file
> > *filp, union drm_amdgpu_userq *args)
> > queue->queue_type = args->in.ip_type;
> > queue->vm = &fpriv->vm;
> > queue->priority = priority;
> > + queue->xcp_id = amdgpu_userq_get_xcp_id(fpriv);
> > queue->userq_mgr = uq_mgr;
> > INIT_DELAYED_WORK(&queue->hang_detect_work,
> > amdgpu_userq_hang_detect_work);