drm/msm: Add a context pointer to the submitqueue
Each submitqueue is attached to a context. Add a pointer to the context to the submitqueue at create time and refcount it so that it stays around through the life of the queue. Co-developed-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
@@ -586,6 +586,7 @@ static int context_init(struct drm_device *dev, struct drm_file *file)
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
||||
kref_init(&ctx->ref);
|
||||
msm_submitqueue_init(dev, ctx);
|
||||
|
||||
ctx->aspace = priv->gpu ? priv->gpu->aspace : NULL;
|
||||
@@ -607,7 +608,7 @@ static int msm_open(struct drm_device *dev, struct drm_file *file)
|
||||
static void context_close(struct msm_file_private *ctx)
|
||||
{
|
||||
msm_submitqueue_close(ctx);
|
||||
kfree(ctx);
|
||||
msm_file_private_put(ctx);
|
||||
}
|
||||
|
||||
static void msm_postclose(struct drm_device *dev, struct drm_file *file)
|
||||
|
Reference in New Issue
Block a user