[PATCH v2 00/12] drm: Add generic fbdev emulation

Noralf Trønnes noralf at tronnes.org
Mon Jun 18 14:17:27 UTC 2018


This patchset adds generic fbdev emulation for drivers that supports GEM
based dumb buffers which support .gem_prime_vmap and gem_prime_mmap. An
API is begun to support in-kernel clients in general.

Notable changes since version 1:

- Rework client unregister code. I've used reference counting to manage
  the fact that both the client itself and the driver through
  drm_dev_unregister() can release the client. The client is now released
  using drm_client_put() instead of drm_client_free().

- fbdev: Use a shadow buffer for framebuffers that have a dirty
  callback. This makes the fbdev client truly generic and useable for all
  drivers. There's a blitting penalty, but this is generic emulation after
  all. The reason for needing a shadow buffer is that deferred I/O only
  works with kmalloc/vmalloc buffers and not with shmem buffers
  (page->lru/mapping).

- Let tinydrm use the full fbdev client

Noralf.

Changes since version 1:
- Make it possible to embed struct drm_client_dev and drop the private
  pointer
- Use kref reference counting to control client release since both the
  client and the driver can release.
- Add comment about using dma-buf as a possibility with some rework
- Move buffer NULL check to drm_client_framebuffer_delete()
- Move client name to struct drm_client_dev
- Move up drm_dev_get/put calls to make them more visible
- Move drm_client_dev.list definition to later patch that makes use of it

- Embed drm_client at the beginning of drm_fb_helper to avoid a fragile
  transitional kfree hack in drm_client_release()
- Set owner in drm_fbdev_fb_ops
- Add kerneldoc to drm_fb_helper_generic_probe()

- Remove unused functions
- Change name drm_client_funcs.lastclose -> .restore
- Change name drm_client_funcs.remove -> .unregister
- Rework unregister code

- tinydrm: Use drm_fbdev_generic_setup() and remove
  drm_fb_cma_fbdev_init_with_funcs()

David Herrmann (1):
  drm: provide management functions for drm_file

Noralf Trønnes (11):
  drm/file: Don't set master on in-kernel clients
  drm: Make ioctls available for in-kernel clients
  drm: Begin an API for in-kernel clients
  drm/fb-helper: Add generic fbdev emulation .fb_probe function
  drm/pl111: Set .gem_prime_vmap and .gem_prime_mmap
  drm/cma-helper: Use the generic fbdev emulation
  drm/client: Add client callbacks
  drm/debugfs: Add internal client debugfs file
  drm/fb-helper: Finish the generic fbdev emulation
  drm/tinydrm: Use drm_fbdev_generic_setup()
  drm/cma-helper: Remove drm_fb_cma_fbdev_init_with_funcs()

 Documentation/gpu/drm-client.rst            |  12 +
 Documentation/gpu/index.rst                 |   1 +
 drivers/gpu/drm/Makefile                    |   2 +-
 drivers/gpu/drm/drm_client.c                | 435 ++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_internal.h         |  19 +-
 drivers/gpu/drm/drm_debugfs.c               |   7 +
 drivers/gpu/drm/drm_drv.c                   |   8 +
 drivers/gpu/drm/drm_dumb_buffers.c          |  33 ++-
 drivers/gpu/drm/drm_fb_cma_helper.c         | 380 +++---------------------
 drivers/gpu/drm/drm_fb_helper.c             | 330 ++++++++++++++++++++-
 drivers/gpu/drm/drm_file.c                  | 304 ++++++++++---------
 drivers/gpu/drm/drm_framebuffer.c           |  42 ++-
 drivers/gpu/drm/drm_internal.h              |   2 +
 drivers/gpu/drm/drm_ioctl.c                 |   4 +-
 drivers/gpu/drm/drm_probe_helper.c          |   3 +
 drivers/gpu/drm/pl111/pl111_drv.c           |   2 +
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c |   3 +-
 drivers/gpu/drm/tinydrm/ili9225.c           |   1 -
 drivers/gpu/drm/tinydrm/mi0283qt.c          |   1 -
 drivers/gpu/drm/tinydrm/st7586.c            |   1 -
 drivers/gpu/drm/tinydrm/st7735r.c           |   1 -
 include/drm/drm_client.h                    | 156 ++++++++++
 include/drm/drm_device.h                    |  21 ++
 include/drm/drm_fb_cma_helper.h             |   6 -
 include/drm/drm_fb_helper.h                 |  38 +++
 25 files changed, 1298 insertions(+), 514 deletions(-)
 create mode 100644 Documentation/gpu/drm-client.rst
 create mode 100644 drivers/gpu/drm/drm_client.c
 create mode 100644 include/drm/drm_client.h

-- 
2.15.1



More information about the dri-devel mailing list