diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2019-11-29 14:59:08 +0100 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2020-02-03 11:23:21 +0000 |
commit | 7e0cf7e9936c4358b0863357b90aa12afe6489da (patch) | |
tree | dcc48a883e1e10ddef9ba7f8791d2894a66d7bf9 /drivers/gpu/drm/panfrost/panfrost_drv.c | |
parent | 8ccb5bf7619c6523e7a4384a84b72e7be804298c (diff) |
drm/panfrost: Make sure the shrinker does not reclaim referenced BOs
Userspace might tag a BO purgeable while it's still referenced by GPU
jobs. We need to make sure the shrinker does not purge such BOs until
all jobs referencing it are finished.
Fixes: 013b65101315 ("drm/panfrost: Add madvise and shrinker support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191129135908.2439529-9-boris.brezillon@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost/panfrost_drv.c')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_drv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 88b431a267af..273d67e251c2 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -166,6 +166,7 @@ panfrost_lookup_bos(struct drm_device *dev, break; } + atomic_inc(&bo->gpu_usecount); job->mappings[i] = mapping; } |