-
- Downloads
drm/shmem-helper: Add generic memory shrinker
Introduce a common DRM SHMEM shrinker framework that allows to reduce code duplication among DRM drivers by replacing theirs custom shrinker implementations with the generic shrinker. In order to start using DRM SHMEM shrinker drivers should: 1. Implement new evict() shmem object callback. 2. Register shrinker using drm_gem_shmem_shrinker_register(drm_device). 3. Use drm_gem_shmem_set_purgeable(shmem) and alike API functions to activate shrinking of shmem GEMs. This patch is based on a ideas borrowed from Rob's Clark MSM shrinker, Thomas' Zimmermann variant of SHMEM shrinker and Intel's i915 shrinker. Signed-off-by:Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by:
Dmitry Osipenko <dmitry.osipenko@collabora.com>
Showing
- drivers/gpu/drm/drm_gem_shmem_helper.c 497 additions, 43 deletionsdrivers/gpu/drm/drm_gem_shmem_helper.c
- drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c 8 additions, 1 deletiondrivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
- drivers/gpu/drm/virtio/virtgpu_drv.h 3 additions, 0 deletionsdrivers/gpu/drm/virtio/virtgpu_drv.h
- include/drm/drm_device.h 4 additions, 0 deletionsinclude/drm/drm_device.h
- include/drm/drm_gem_shmem_helper.h 82 additions, 5 deletionsinclude/drm/drm_gem_shmem_helper.h
Loading
Please register or sign in to comment