drm/amdgpu: keep amdgpu_ctx_mgr in ctx structure
authorJames Zhu <James.Zhu@amd.com>
Mon, 15 Aug 2022 21:12:01 +0000 (17:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:59:37 +0000 (09:59 -0400)
Keep amdgpu_ctx_mgr in ctx structure to track fpriv.

v2: add missing fpriv declaration lost in rebase

Signed-off-by: James Zhu <James.Zhu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h

index e1f642a..ef27948 100644 (file)
@@ -303,6 +303,7 @@ static int amdgpu_ctx_get_stable_pstate(struct amdgpu_ctx *ctx,
 static int amdgpu_ctx_init(struct amdgpu_ctx_mgr *mgr, int32_t priority,
                           struct drm_file *filp, struct amdgpu_ctx *ctx)
 {
+       struct amdgpu_fpriv *fpriv = filp->driver_priv;
        u32 current_stable_pstate;
        int r;
 
@@ -331,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;
 }
 
index 0fa0e56..f1e27b6 100644 (file)
@@ -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 {