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:
@@ -57,6 +57,7 @@ struct msm_file_private {
|
||||
struct list_head submitqueues;
|
||||
int queueid;
|
||||
struct msm_gem_address_space *aspace;
|
||||
struct kref ref;
|
||||
};
|
||||
|
||||
enum msm_mdp_plane_property {
|
||||
@@ -428,6 +429,25 @@ void msm_submitqueue_close(struct msm_file_private *ctx);
|
||||
|
||||
void msm_submitqueue_destroy(struct kref *kref);
|
||||
|
||||
static inline void __msm_file_private_destroy(struct kref *kref)
|
||||
{
|
||||
struct msm_file_private *ctx = container_of(kref,
|
||||
struct msm_file_private, ref);
|
||||
|
||||
kfree(ctx);
|
||||
}
|
||||
|
||||
static inline void msm_file_private_put(struct msm_file_private *ctx)
|
||||
{
|
||||
kref_put(&ctx->ref, __msm_file_private_destroy);
|
||||
}
|
||||
|
||||
static inline struct msm_file_private *msm_file_private_get(
|
||||
struct msm_file_private *ctx)
|
||||
{
|
||||
kref_get(&ctx->ref);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
#define DBG(fmt, ...) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__)
|
||||
#define VERB(fmt, ...) if (0) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__)
|
||||
|
Reference in New Issue
Block a user