diff options
author | Rob Clark <robdclark@gmail.com> | 2016-05-17 16:19:32 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-07-16 10:09:06 -0400 |
commit | 68209390f116034449fa6a3ae03f7b100b3d894a (patch) | |
tree | 00fae111275f1785a910792c21261b6d52876321 /drivers/gpu/drm/msm/msm_gem.h | |
parent | 4fe5f65e66823dcb212a0404af47389b2b1c58f0 (diff) | |
download | lwn-68209390f116034449fa6a3ae03f7b100b3d894a.tar.gz lwn-68209390f116034449fa6a3ae03f7b100b3d894a.zip |
drm/msm: shrinker support
For a first step, only purge obj->madv==DONTNEED objects. We could be
more agressive and next try unpinning inactive objects.. but that is
only useful if you have swap.
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h index fa8e1f16f18e..631dab56b8fd 100644 --- a/drivers/gpu/drm/msm/msm_gem.h +++ b/drivers/gpu/drm/msm/msm_gem.h @@ -77,6 +77,12 @@ static inline bool is_active(struct msm_gem_object *msm_obj) return msm_obj->gpu != NULL; } +static inline bool is_purgeable(struct msm_gem_object *msm_obj) +{ + return (msm_obj->madv == MSM_MADV_DONTNEED) && msm_obj->sgt && + !msm_obj->base.dma_buf && !msm_obj->base.import_attach; +} + #define MAX_CMDS 4 /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc, |