summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gem.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-05-27 18:16:28 +0300
committerRob Clark <robdclark@gmail.com>2016-07-16 17:09:07 +0300
commite1e9db2ca79575b8d6b4b5891194bb29c630c42d (patch)
tree645b6ec8caf75d2a26d6e62836eb514a5f78ad90 /drivers/gpu/drm/msm/msm_gem.h
parent18f23049f640e2590930c34009418c66e6ebf7b6 (diff)
downloadlinux-e1e9db2ca79575b8d6b4b5891194bb29c630c42d.tar.xz
drm/msm: wire up vmap shrinker
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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h
index 631dab56b8fd..7a4da819731a 100644
--- a/drivers/gpu/drm/msm/msm_gem.h
+++ b/drivers/gpu/drm/msm/msm_gem.h
@@ -34,6 +34,11 @@ struct msm_gem_object {
*/
uint8_t madv;
+ /**
+ * count of active vmap'ing
+ */
+ uint8_t vmap_count;
+
/* And object is either:
* inactive - on priv->inactive_list
* active - on one one of the gpu's active_list.. well, at
@@ -83,6 +88,11 @@ static inline bool is_purgeable(struct msm_gem_object *msm_obj)
!msm_obj->base.dma_buf && !msm_obj->base.import_attach;
}
+static inline bool is_vunmapable(struct msm_gem_object *msm_obj)
+{
+ return (msm_obj->vmap_count == 0) && msm_obj->vaddr;
+}
+
#define MAX_CMDS 4
/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,