ctx->vm should not be inialized yet (or if it has, an error is returned
immediately following this check), so this isn't a valid way to check
for per-process-pgtable support.

Instead just check if create_private_vm() is supported.

Reported-by: Sashiko <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 84101e534ebe..3370cd44382f 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -513,7 +513,7 @@ int adreno_set_param(struct msm_gpu *gpu, struct 
msm_context *ctx,
                guard(rwsem_read)(&ctx->ctxlock);
 
                /* We can only support VM_BIND with per-process pgtables: */
-               if (ctx->vm == gpu->vm)
+               if (!gpu->funcs->create_private_vm)
                        return UERR(EINVAL, drm, "requires per-process 
pgtables");
 
                /*
-- 
2.55.0

Reply via email to