Merge tag 'amd-drm-next-6.1-2022-09-08' of https://gitlab.freedesktop.org/agd5f/linux...
[linux-2.6-block.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ctx.c
index 8ee4e8491f3917ab9a7d56bca2283a456afdc3a1..3ea48385fab3ae97bb2a7549ae405d7c72a8c979 100644 (file)
@@ -402,7 +402,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
                }
        }
 
-       if (drm_dev_enter(&adev->ddev, &idx)) {
+       if (drm_dev_enter(adev_to_drm(adev), &idx)) {
                amdgpu_ctx_set_stable_pstate(ctx, ctx->stable_pstate);
                drm_dev_exit(idx);
        }
@@ -848,7 +848,7 @@ void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr,
 
        mgr->adev = adev;
        mutex_init(&mgr->lock);
-       idr_init(&mgr->ctx_handles);
+       idr_init_base(&mgr->ctx_handles, 1);
 
        for (i = 0; i < AMDGPU_HW_IP_NUM; ++i)
                atomic64_set(&mgr->time_spend[i], 0);