mbox series

[v8,0/7] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

Message ID 20221105232719.302619-1-dmitry.osipenko@collabora.com (mailing list archive)
Headers show
Series Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers | expand

Message

Dmitry Osipenko Nov. 5, 2022, 11:27 p.m. UTC
This series:

  1. Adds common drm-shmem memory shrinker
  2. Enables shrinker for VirtIO-GPU driver
  3. Switches Panfrost driver to the common shrinker

Related patches:

Mesa: https://gitlab.freedesktop.org/digetx/mesa/-/commits/virgl-madvise
igt:  https://gitlab.freedesktop.org/digetx/igt-gpu-tools/-/commits/virtio-madvise
      https://gitlab.freedesktop.org/digetx/igt-gpu-tools/-/commits/panfrost-madvise

I'll upstream Mesa and igt patches once kernel part will be merged.

Changelog:

v8: - Rebased on top of recent linux-next that now has dma-buf locking
      convention patches merged, which was blocking shmem shrinker before.

    - Shmem shrinker now uses new drm_gem_lru helper.

    - Dropped Steven Price t-b from the Panfrost patch because code
      changed significantly since v6 and should be re-tested.

v7: - dma-buf locking convention

v6: https://lore.kernel.org/dri-devel/20220526235040.678984-1-dmitry.osipenko@collabora.com/

Dmitry Osipenko (7):
  drm/msm/gem: Prevent blocking within shrinker loop
  drm/shmem-helper: Don't use vmap_use_count for dma-bufs
  drm/shmem-helper: Switch to reservation lock
  drm/shmem-helper: Add memory shrinker
  drm/gem: Add drm_gem_pin_unlocked()
  drm/virtio: Support memory shrinking
  drm/panfrost: Switch to generic memory shrinker

 drivers/gpu/drm/drm_gem.c                     |  38 +-
 drivers/gpu/drm/drm_gem_shmem_helper.c        | 648 ++++++++++++++----
 drivers/gpu/drm/lima/lima_gem.c               |   8 +-
 drivers/gpu/drm/msm/msm_gem_shrinker.c        |   8 +-
 drivers/gpu/drm/panfrost/Makefile             |   1 -
 drivers/gpu/drm/panfrost/panfrost_device.h    |   4 -
 drivers/gpu/drm/panfrost/panfrost_drv.c       |  26 +-
 drivers/gpu/drm/panfrost/panfrost_gem.c       |  33 +-
 drivers/gpu/drm/panfrost/panfrost_gem.h       |   9 -
 .../gpu/drm/panfrost/panfrost_gem_shrinker.c  | 122 ----
 drivers/gpu/drm/panfrost/panfrost_job.c       |  18 +-
 drivers/gpu/drm/panfrost/panfrost_mmu.c       |  19 +-
 drivers/gpu/drm/virtio/virtgpu_drv.h          |  18 +-
 drivers/gpu/drm/virtio/virtgpu_gem.c          |  55 ++
 drivers/gpu/drm/virtio/virtgpu_ioctl.c        |  37 +
 drivers/gpu/drm/virtio/virtgpu_kms.c          |   9 +
 drivers/gpu/drm/virtio/virtgpu_object.c       | 138 +++-
 drivers/gpu/drm/virtio/virtgpu_plane.c        |  22 +-
 drivers/gpu/drm/virtio/virtgpu_vq.c           |  40 ++
 include/drm/drm_device.h                      |   4 +
 include/drm/drm_gem.h                         |   7 +-
 include/drm/drm_gem_shmem_helper.h            |  99 ++-
 include/uapi/drm/virtgpu_drm.h                |  14 +
 23 files changed, 1003 insertions(+), 374 deletions(-)
 delete mode 100644 drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c