Skip to content

RFC drm: Move vmap out of commit tail for SHMEM drivers

Thomas Zimmermann dri-devel virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm/simple-kms: Add plane-state helpersdrivers/gpu/drm/drm_simple_kms_helper.c include/drm/drm_simple_kms_helper.h+65 -30 replies
2/6drm/shmem-helper: Add additional KMS helpersdrivers/gpu/drm/Kconfig drivers/gpu/drm/Makefile drivers/gpu/drm/drm_gem_shmem_kms_helper.c +1 more+223 -03 replies
3/6drm/mgag200: Move vmap out of commit taildrivers/gpu/drm/mgag200/Kconfig drivers/gpu/drm/mgag200/mgag200_mode.c+11 -150 replies
4/6drm/cirrus: Move vmap out of commit taildrivers/gpu/drm/tiny/Kconfig drivers/gpu/drm/tiny/cirrus.c+21 -270 replies
5/6drm/gm12u320: Move vmap out of commit taildrivers/gpu/drm/tiny/Kconfig drivers/gpu/drm/tiny/gm12u320.c+17 -160 replies
6/6drm/udl: Move vmap out of commit taildrivers/gpu/drm/udl/Kconfig drivers/gpu/drm/udl/udl_modeset.c+16 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6 RFC] drm: Move vmap out of commit tail for SHMEM drivers

Several SHMEM-based drivers use the BO as shadow buffer for the real framebuffer memory. Damage handling requires a vmap of the BO memory. Vmap/vunmap can acquire the dma-buf reservation lock, which is not allowed in commit tails.

This patchset introduces a set of helpers that implement vmap/vunmap in the plane's prepare_fb and cleanup_fb; and provide the mapping's address to commit-tail functions. Wrapper sfor simple KMS are provides, as all of the involved drivers are built upon simple-KMS helpers.

Patch 1 adds the support for private plane state to the simple-KMS helper library.

Patch 2 provides plane state for SHMEM-based shadow planes. It's a DRM plane with BO mappings into kernel address space. The involved helpers take care of the details.

Patches 3 to 6 convert each involved driver to the new shadow-plane helpers. The vmap operations are being removed from commit-tail functions. An additional benefit is that vmap errors are now detected before the commit starts. The original commit-tail functions could not handle failed vmap operations.

I smoke-tested the code by running fbdev, Xorg and weston with the converted mgag200 driver.

Thomas Zimmermann (6):
drm/simple-kms: Add plane-state helpers
drm/shmem-helper: Add additional KMS helpers
drm/mgag200: Move vmap out of commit tail
drm/cirrus: Move vmap out of commit tail
drm/gm12u320: Move vmap out of commit tail
drm/udl: Move vmap out of commit tail

 drivers/gpu/drm/Kconfig                    |   7 +
 drivers/gpu/drm/Makefile                   |   1 +
 drivers/gpu/drm/drm_gem_shmem_kms_helper.c | 159 +++++++++++++++++++++
 drivers/gpu/drm/drm_simple_kms_helper.c    |  40 +++++-
 drivers/gpu/drm/mgag200/Kconfig            |   1 +
 drivers/gpu/drm/mgag200/mgag200_mode.c     |  25 ++--
 drivers/gpu/drm/tiny/Kconfig               |   6 +-
 drivers/gpu/drm/tiny/cirrus.c              |  45 +++---
 drivers/gpu/drm/tiny/gm12u320.c            |  30 ++--
 drivers/gpu/drm/udl/Kconfig                |   1 +
 drivers/gpu/drm/udl/udl_modeset.c          |  36 ++---
 include/drm/drm_gem_shmem_kms_helper.h     |  56 ++++++++
 include/drm/drm_simple_kms_helper.h        |  28 ++++
 13 files changed, 353 insertions(+), 82 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_gem_shmem_kms_helper.c
 create mode 100644 include/drm/drm_gem_shmem_kms_helper.h

base-commit: 1e37c3960fd3910f3f65cd6927a6ebab8e8efc26 --
2.30.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel