summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_gem.h
diff options
context:
space:
mode:
authorJordan Crouse2017-03-07 18:02:52 +0100
committerRob Clark2017-04-08 12:59:36 +0200
commitee546cd34ae846a8202b78d1834170e2b3ee063d (patch)
tree38535ae3ad8faf88513b651451c0cc9e51fe6b3c /drivers/gpu/drm/msm/msm_gem.h
parentdrm/msm: Make sure to detach the MMU during GPU cleanup (diff)
downloadkernel-qcow2-linux-ee546cd34ae846a8202b78d1834170e2b3ee063d.tar.gz
kernel-qcow2-linux-ee546cd34ae846a8202b78d1834170e2b3ee063d.tar.xz
kernel-qcow2-linux-ee546cd34ae846a8202b78d1834170e2b3ee063d.zip
drm/msm: Reference count address spaces
There are reasons for a memory object to outlive the file descriptor that created it and so the address space that a buffer object is attached to must also outlive the file descriptor. Reference count the address space so that it can remain viable until all the objects have released their addresses. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem.h')
-rw-r--r--drivers/gpu/drm/msm/msm_gem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h
index 7d529516b332..1b4cf20043ea 100644
--- a/drivers/gpu/drm/msm/msm_gem.h
+++ b/drivers/gpu/drm/msm/msm_gem.h
@@ -18,6 +18,7 @@
#ifndef __MSM_GEM_H__
#define __MSM_GEM_H__
+#include <linux/kref.h>
#include <linux/reservation.h>
#include "msm_drv.h"
@@ -31,6 +32,7 @@ struct msm_gem_address_space {
*/
struct drm_mm mm;
struct msm_mmu *mmu;
+ struct kref kref;
};
struct msm_gem_vma {