linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, deller@gmx.de,
	javierm@redhat.com
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB
Date: Thu,  3 Mar 2022 21:58:30 +0100	[thread overview]
Message-ID: <20220303205839.28484-1-tzimmermann@suse.de> (raw)

Rework the fbdev deferred-I/O to not interfere with fields of struct
page. Make the code more flexible and implement GEM SHMEM mmap on top
of it.

This patchset removes the need for a special shadow framebuffer for
fbdev mmap when using GEM SHMEM. SHMEM pages are now mmap'ed from
/dev/fb directly.

Patches 2 and 3 rework the fbdev deferred I/O code. It now allows
drivers to have better control of the mmap operations. All references
to fields in struct page are gone. The rsp state is help in a 
separate pageref structure.

Patches 4 to 7 provide callbacks an helpers to implement deferred I/O
with DRM drivers. Specifically, patch 6 introduces a callback to create
a dumb buffer for fbdev. This will be useful for many drivers that
currently cannot use generic fbdev emulation because of special placement
needs of the BO, such as amdgpu or radeon. The drivers can handle the
differences to regular dumb buffers in their new callback implementation.

Patch 8 extends the GEM SHMEM memory manager with a new helper for fbdev
dumb-buffer creation. The returned BO has it's mmap set up to implement
deferred I/O with SHMEM pages. No additional shadow buffer is requires
any longer. Many drivers can immediatelly benefit from this change.

Patch 9 extends virtgpu to support fbdev dumb buffers. It's build on
top of GEM SHMEM, but has some modifications that need to be implemented
for fbdev as well.

There's no immediate fbdev performance improvement from this patchset.
Most of all, it removes unnecessary shadow framebuffers and rsp memcpys.
A shadow fb for a FullHD display is ~8 MiB, which we now save. The patches
do reduce latency between drawing to the fbdev buffer to displaying
on the screen. Watching a video on the fbdev console felt smoother and
had less flickering.

Thomas Zimmermann (9):
  drm/simpledrm: Use fbdev defaults for shadow buffering
  fbdev: Put mmap for deferred I/O into drivers
  fbdev: Track deferred-I/O pages in pageref struct
  fbdev: Export helper for implementing page_mkwrite
  drm/fb-helper: Separate deferred I/O from shadow buffers
  drm/fb-helper: Provide callback to create fbdev dumb buffers
  drm/fb-helper: Provide fbdev deferred-I/O helpers
  drm/gem-shmem: Implement fbdev dumb buffer and mmap helpers
  drm/virtio: Implement dumb_create_fbdev with GEM SHMEM helpers

 drivers/gpu/drm/drm_client.c            |  14 +-
 drivers/gpu/drm/drm_crtc_internal.h     |   3 +
 drivers/gpu/drm/drm_dumb_buffers.c      |  36 +++-
 drivers/gpu/drm/drm_fb_helper.c         |  79 +++++++--
 drivers/gpu/drm/drm_gem_shmem_helper.c  | 204 ++++++++++++++++++++---
 drivers/gpu/drm/gud/gud_drv.c           |   2 +-
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c |   2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c   |   2 +-
 drivers/gpu/drm/tiny/cirrus.c           |   2 +-
 drivers/gpu/drm/tiny/gm12u320.c         |   2 +-
 drivers/gpu/drm/tiny/simpledrm.c        |   3 +-
 drivers/gpu/drm/udl/udl_drv.c           |   2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    |   2 +
 drivers/gpu/drm/virtio/virtgpu_drv.h    |   2 +
 drivers/gpu/drm/virtio/virtgpu_object.c |  54 +++++-
 drivers/gpu/drm/vkms/vkms_drv.c         |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c      |   6 +-
 drivers/hid/hid-picolcd_fb.c            |   1 +
 drivers/staging/fbtft/fbtft-core.c      |   6 +-
 drivers/video/fbdev/broadsheetfb.c      |   6 +-
 drivers/video/fbdev/core/fb_defio.c     | 211 +++++++++++++++++-------
 drivers/video/fbdev/core/fbmem.c        |  19 +--
 drivers/video/fbdev/hecubafb.c          |   1 +
 drivers/video/fbdev/hyperv_fb.c         |   6 +-
 drivers/video/fbdev/metronomefb.c       |   6 +-
 drivers/video/fbdev/sh_mobile_lcdcfb.c  |  12 +-
 drivers/video/fbdev/smscufx.c           |   8 +-
 drivers/video/fbdev/ssd1307fb.c         |   1 +
 drivers/video/fbdev/udlfb.c             |   8 +-
 drivers/video/fbdev/xen-fbfront.c       |   6 +-
 include/drm/drm_client.h                |   3 +-
 include/drm/drm_drv.h                   |  27 +++
 include/drm/drm_fb_helper.h             |   9 +
 include/drm/drm_gem_shmem_helper.h      |  63 ++++++-
 include/linux/fb.h                      |  12 +-
 35 files changed, 668 insertions(+), 154 deletions(-)


base-commit: 710a019ad85e96e66f7d75ee7f4733cdd8a2b0d0
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: 6e1032c6302461624f33194c8b8f37103a3fa6ef
-- 
2.35.1


             reply	other threads:[~2022-03-03 20:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 20:58 Thomas Zimmermann [this message]
2022-03-03 20:58 ` [PATCH 1/9] drm/simpledrm: Use fbdev defaults for shadow buffering Thomas Zimmermann
2022-03-08  9:31   ` Javier Martinez Canillas
2022-03-08  9:56     ` Thomas Zimmermann
2022-03-08  9:58       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 2/9] fbdev: Put mmap for deferred I/O into drivers Thomas Zimmermann
2022-03-08 14:03   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 3/9] fbdev: Track deferred-I/O pages in pageref struct Thomas Zimmermann
2022-03-08 14:42   ` Javier Martinez Canillas
2022-03-09  8:36     ` Thomas Zimmermann
2022-03-09 11:21       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 4/9] fbdev: Export helper for implementing page_mkwrite Thomas Zimmermann
2022-03-08 17:21   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 5/9] drm/fb-helper: Separate deferred I/O from shadow buffers Thomas Zimmermann
2022-03-08 17:24   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 6/9] drm/fb-helper: Provide callback to create fbdev dumb buffers Thomas Zimmermann
2022-03-08 17:51   ` Javier Martinez Canillas
2022-03-09  8:42     ` Thomas Zimmermann
2022-03-15 19:11     ` Thomas Zimmermann
2022-03-03 20:58 ` [PATCH 7/9] drm/fb-helper: Provide fbdev deferred-I/O helpers Thomas Zimmermann
2022-03-08 18:56   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 8/9] drm/gem-shmem: Implement fbdev dumb buffer and mmap helpers Thomas Zimmermann
2022-03-08 19:29   ` Javier Martinez Canillas
2022-03-09  8:47     ` Thomas Zimmermann
2022-03-09 11:25       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 9/9] drm/virtio: Implement dumb_create_fbdev with GEM SHMEM helpers Thomas Zimmermann
2022-03-08 19:37   ` Javier Martinez Canillas
2022-03-09  8:52     ` Thomas Zimmermann
2022-03-09 11:29       ` Javier Martinez Canillas
2022-03-08  9:13 ` [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB Javier Martinez Canillas
2022-03-08  9:44   ` 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=20220303205839.28484-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.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).