diff options
author | Rob Clark <robdclark@chromium.org> | 2021-09-30 10:43:20 -0700 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-10-01 13:10:20 -0700 |
commit | 14eb0cb4e9a7323c8735cf6c681ed8423ce6ae06 (patch) | |
tree | 8acd1a8f32cb4abbd00c26a1a286cf60cda46ee9 /drivers/gpu/drm/msm/adreno/a6xx_gpu.h | |
parent | f6f59072e821901d96c791864a07d57d8ec8d312 (diff) | |
download | linux-14eb0cb4e9a7323c8735cf6c681ed8423ce6ae06.tar.bz2 |
drm/msm/a6xx: Track current ctx by seqno
In theory a context can be destroyed and a new one allocated at the same
address, making the pointer comparision to detect when we don't need to
update the current pagetables invalid. Instead assign a sequence number
to each context on creation, and use this for the check.
Fixes: 84c31ee16f90 ("drm/msm/a6xx: Add support for per-instance pagetables")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a6xx_gpu.h')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h index 0bc2d062f54a..8e5527c881b1 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -19,7 +19,16 @@ struct a6xx_gpu { uint64_t sqe_iova; struct msm_ringbuffer *cur_ring; - struct msm_file_private *cur_ctx; + + /** + * cur_ctx_seqno: + * + * The ctx->seqno value of the context with current pgtables + * installed. Tracked by seqno rather than pointer value to + * avoid dangling pointers, and cases where a ctx can be freed + * and a new one created with the same address. + */ + int cur_ctx_seqno; struct a6xx_gmu gmu; |