From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@linux.ie,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
kraxel@redhat.com, hdegoede@redhat.com, sean@poorly.run,
sam@ravnborg.org, noralf@tronnes.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org,
virtualization@lists.linux-foundation.org
Subject: [PATCH v2 0/7] drm: Move vmap out of commit tail for SHMEM-based drivers
Date: Fri, 5 Feb 2021 16:06:21 +0100 [thread overview]
Message-ID: <20210205150628.28072-1-tzimmermann@suse.de> (raw)
Several SHMEM-based drivers use the BO as shadow buffer for the real
framebuffer memory. Damage handling requires a vmap of the BO memory.
But 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. Wrappers for 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.
Patches 2 and 3 provide plane state for shadow-buffered planes. It's a
DRM plane with BO mappings into kernel address space. The involved
helpers take care of the details. The code is independent from GEM
SHMEM and can be used with other shadow-buffered planes. I put all
this in a new file. In a later patch, drm_gem_fb_prepare_fb() et al
could be moved there as well.
Patches 4 to 7 convert each involved driver to the new 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.
v2:
* export drm_gem_vmap()/_vunmap() (kernel test robot)
* make duplicate_state interface compatible with
struct drm_plane_funcs
Thomas Zimmermann (7):
drm/simple-kms: Add plane-state helpers
drm/gem: Export drm_gem_vmap() and drm_gem_vunmap()
drm: Add additional atomic helpers for shadow-buffered planes
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
Documentation/gpu/drm-kms-helpers.rst | 12 ++
drivers/gpu/drm/Makefile | 3 +-
drivers/gpu/drm/drm_gem.c | 2 +
drivers/gpu/drm/drm_gem_atomic_helper.c | 208 ++++++++++++++++++++++++
drivers/gpu/drm/drm_simple_kms_helper.c | 40 ++++-
drivers/gpu/drm/mgag200/mgag200_mode.c | 23 +--
drivers/gpu/drm/tiny/cirrus.c | 43 ++---
drivers/gpu/drm/tiny/gm12u320.c | 28 ++--
drivers/gpu/drm/udl/udl_modeset.c | 34 ++--
include/drm/drm_gem_atomic_helper.h | 73 +++++++++
include/drm/drm_simple_kms_helper.h | 27 +++
11 files changed, 412 insertions(+), 81 deletions(-)
create mode 100644 drivers/gpu/drm/drm_gem_atomic_helper.c
create mode 100644 include/drm/drm_gem_atomic_helper.h
base-commit: f9173d6435c6a9bb0b0076ebf9122d876da208ae
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: f8140f08b77c49beb6243d9a2a88ebcc7097e391
prerequisite-patch-id: 6bffaf03d01daeb29a0b0ffbc78b415e72907a17
prerequisite-patch-id: 6386ca949b8b677a7eada2672990dab2f84f734f
prerequisite-patch-id: 706e35d0b2185d2332f725e1c22d8ffed910ea7b
prerequisite-patch-id: e30631cc73b905efa477be3f56daf1ff5112fe03
--
2.30.0
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next reply other threads:[~2021-02-05 15:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 15:06 Thomas Zimmermann [this message]
2021-02-05 15:06 ` [PATCH v2 1/7] drm/simple-kms: Add plane-state helpers Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 2/7] drm/gem: Export drm_gem_vmap() and drm_gem_vunmap() Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 3/7] drm: Add additional atomic helpers for shadow-buffered planes Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 4/7] drm/mgag200: Move vmap out of commit tail Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 5/7] drm/cirrus: " Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 6/7] drm/gm12u320: " Thomas Zimmermann
2021-02-05 15:06 ` [PATCH v2 7/7] drm/udl: " Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210205150628.28072-1-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=kraxel@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=noralf@tronnes.org \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).