[PATCH 06/29] drm/amdgpu: keep amdgpu_ctx_mgr in ctx structure

Alex Deucher alexdeucher at gmail.com
Fri May 19 13:36:50 UTC 2023


On Fri, May 19, 2023 at 8:16 AM Mike Lothian <mike at fireburn.co.uk> wrote:
>
> On Wed, 10 May 2023 at 22:24, Alex Deucher <alexander.deucher at amd.com> wrote:
> >
> > From: James Zhu <James.Zhu at amd.com>
> >
> > Keep amdgpu_ctx_mgr in ctx structure to track fpriv.
> >
> > Signed-off-by: James Zhu <James.Zhu at amd.com>
> > Acked-by: Lijo Lazar <lijo.lazar at amd.com>
> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 1 +
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 1 +
> >  2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > index e3d047663d61..06d68a08251a 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > @@ -332,6 +332,7 @@ static int amdgpu_ctx_init(struct amdgpu_ctx_mgr *mgr, int32_t priority,
> >         else
> >                 ctx->stable_pstate = current_stable_pstate;
> >
> > +       ctx->ctx_mgr = &(fpriv->ctx_mgr);
> >         return 0;
> >  }
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> > index 5fd79f94e2d0..85376baaa92f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> > @@ -57,6 +57,7 @@ struct amdgpu_ctx {
> >         unsigned long                   ras_counter_ce;
> >         unsigned long                   ras_counter_ue;
> >         uint32_t                        stable_pstate;
> > +       struct amdgpu_ctx_mgr           *ctx_mgr;
> >  };
> >
> >  struct amdgpu_ctx_mgr {
> > --
> > 2.40.1
> >
>
> Hi
>
> This isn't compiling for me with clang 16
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c:348:19: error: use of
> undeclared identifier 'fpriv'
>        ctx->ctx_mgr = &(fpriv->ctx_mgr);
>                         ^
> 1 error generated.

When this patch was originally written the function had fpriv defined,
but it got missed after a rebase.  Fixed up now.

Alex


>
> Cheers
>
> Mike


More information about the amd-gfx mailing list