summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_drv.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2021-09-30 10:43:20 -0700
committerRob Clark <robdclark@chromium.org>2021-10-01 13:10:20 -0700
commit14eb0cb4e9a7323c8735cf6c681ed8423ce6ae06 (patch)
tree8acd1a8f32cb4abbd00c26a1a286cf60cda46ee9 /drivers/gpu/drm/msm/msm_drv.c
parentf6f59072e821901d96c791864a07d57d8ec8d312 (diff)
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/msm_drv.c')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 6176519d8bb0..4443d7b48618 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -682,6 +682,7 @@ static void load_gpu(struct drm_device *dev)
static int context_init(struct drm_device *dev, struct drm_file *file)
{
+ static atomic_t ident = ATOMIC_INIT(0);
struct msm_drm_private *priv = dev->dev_private;
struct msm_file_private *ctx;
@@ -698,6 +699,8 @@ static int context_init(struct drm_device *dev, struct drm_file *file)
ctx->aspace = msm_gpu_create_private_address_space(priv->gpu, current);
file->driver_priv = ctx;
+ ctx->seqno = atomic_inc_return(&ident);
+
return 0;
}