dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/9] drm: Support simple-framebuffer devices and firmware fbs
@ 2020-06-25 12:00 Thomas Zimmermann
  2020-06-25 12:00 ` [PATCH 1/9] drm/format-helper: Pass destination pitch to drm_fb_memcpy_dstclip() Thomas Zimmermann
                   ` (9 more replies)
  0 siblings, 10 replies; 55+ messages in thread
From: Thomas Zimmermann @ 2020-06-25 12:00 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel, kraxel, lgirdwood,
	broonie, robh, sam, emil.l.velikov, noralf, geert+renesas,
	hdegoede
  Cc: Thomas Zimmermann, dri-devel

This patchset adds support for simple-framebuffer platform devices and
a handover mechanism for native drivers to take-over control of the
hardware.

The new driver, called simplekms, binds to a simple-frambuffer platform
device. The kernel's boot code creates such devices for firmware-provided
framebuffers, such as EFI-GOP or VESA. Typically the BIOS, UEFI or boot
loader sets up the framebuffers. Description via device tree is also an
option.

Simplekms is small enough to be linked into the kernel. The driver's main
purpose is to provide graphical output during the early phases of the boot
process, before the native DRM drivers are available. Native drivers are
typically loaded from an initrd ram disk. Occationally simplekms can also
serve as interim solution on graphics hardware without native DRM driver.

So far distributions rely on fbdev drivers, such as efifb, vesafb or
simplefb, for early-boot graphical output. However fbdev is deprecated and
the drivers do not provide DRM interfaces for modern userspace.

Patches 1 and 2 prepare the DRM format helpers for simplekms.

Patches 3 to 7 add the simplekms driver. It's build on simple DRM helpers
and SHMEM. It supports 16-bit, 24-bit and 32-bit RGB framebuffers. During
pageflips, SHMEM buffers are copied into the framebuffer memory, similar
to cirrus or mgag200. The code in patches 6 and 7 handles clocks and
regulators. It's based on the simplefb drivers, but has been modified for
DRM.

Patches 8 and 9 add a hand-over mechanism. Simplekms acquires it's
framebuffer's I/O-memory range and provides a callback function to be
removed by a native driver. The native driver will remove simplekms before
taking over the hardware. The removal is integrated into existing helpers,
so drivers use it automatically.

I tested simplekms with x86 EFI and VESA framebuffers, which both work
reliably. The fbdev console and Weston work automatically. Xorg requires
manual configuration of the device. Xorgs current modesetting driver does
not work with both, platform and PCI device, for the same physical
hardware. Once configured, X11 works.

One cosmetical issue is that simplekms's device file is card0 and the
native driver's device file is card1. After simplekms has been kicked out,
only card1 is left. This does not seem to be a practical problem however.

TODO/IDEAS:

	* provide deferred takeover
	* provide bootsplash DRM client
	* make simplekms usable with ARM-EFI fbs

Thomas Zimmermann (9):
  drm/format-helper: Pass destination pitch to drm_fb_memcpy_dstclip()
  drm/format-helper: Add blitter functions
  drm: Add simplekms driver
  drm/simplekms: Add fbdev emulation
  drm/simplekms: Initialize framebuffer data from device-tree node
  drm/simplekms: Acquire clocks from DT device node
  drm/simplekms: Acquire regulators from DT device node
  drm: Add infrastructure for platform devices
  drm/simplekms: Acquire memory aperture for framebuffer

 MAINTAINERS                            |   6 +
 drivers/gpu/drm/Kconfig                |   6 +
 drivers/gpu/drm/Makefile               |   1 +
 drivers/gpu/drm/drm_format_helper.c    |  96 ++-
 drivers/gpu/drm/drm_platform.c         | 118 ++++
 drivers/gpu/drm/mgag200/mgag200_mode.c |   2 +-
 drivers/gpu/drm/tiny/Kconfig           |  17 +
 drivers/gpu/drm/tiny/Makefile          |   1 +
 drivers/gpu/drm/tiny/cirrus.c          |   2 +-
 drivers/gpu/drm/tiny/simplekms.c       | 906 +++++++++++++++++++++++++
 include/drm/drm_fb_helper.h            |  18 +-
 include/drm/drm_format_helper.h        |  10 +-
 include/drm/drm_platform.h             |  42 ++
 13 files changed, 1217 insertions(+), 8 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_platform.c
 create mode 100644 drivers/gpu/drm/tiny/simplekms.c
 create mode 100644 include/drm/drm_platform.h

--
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2021-02-10 16:14 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-25 12:00 [RFC][PATCH 0/9] drm: Support simple-framebuffer devices and firmware fbs Thomas Zimmermann
2020-06-25 12:00 ` [PATCH 1/9] drm/format-helper: Pass destination pitch to drm_fb_memcpy_dstclip() Thomas Zimmermann
2020-06-29  8:40   ` Daniel Vetter
2020-09-25 14:55     ` Thomas Zimmermann
2020-09-26 16:42       ` Daniel Vetter
2020-09-28  7:22         ` Thomas Zimmermann
2020-09-28  8:53           ` Daniel Vetter
2020-09-28  9:13             ` Thomas Zimmermann
2020-09-29  9:19               ` Daniel Vetter
2020-09-29  9:39                 ` Thomas Zimmermann
2020-09-29 11:32                   ` Daniel Vetter
2020-09-28 10:24             ` Gerd Hoffmann
2020-09-28 13:42               ` Pekka Paalanen
2020-06-25 12:00 ` [PATCH 2/9] drm/format-helper: Add blitter functions Thomas Zimmermann
2020-06-29  8:46   ` Daniel Vetter
2020-06-25 12:00 ` [PATCH 3/9] drm: Add simplekms driver Thomas Zimmermann
2020-06-29  9:06   ` Daniel Vetter
2020-09-25 15:01     ` Thomas Zimmermann
2020-09-25 15:14       ` Maxime Ripard
2020-09-28  7:25         ` Thomas Zimmermann
2021-02-10 16:14     ` Thomas Zimmermann
2020-06-25 12:00 ` [PATCH 4/9] drm/simplekms: Add fbdev emulation Thomas Zimmermann
2020-06-29  9:11   ` Daniel Vetter
2020-06-25 12:00 ` [PATCH 5/9] drm/simplekms: Initialize framebuffer data from device-tree node Thomas Zimmermann
2020-06-30  2:36   ` Rob Herring
2020-06-25 12:00 ` [PATCH 6/9] drm/simplekms: Acquire clocks from DT device node Thomas Zimmermann
2020-06-25 13:34   ` Geert Uytterhoeven
2020-06-29  9:07     ` Daniel Vetter
2020-06-25 12:00 ` [PATCH 7/9] drm/simplekms: Acquire regulators " Thomas Zimmermann
2020-06-25 13:36   ` Geert Uytterhoeven
2020-06-25 12:00 ` [PATCH 8/9] drm: Add infrastructure for platform devices Thomas Zimmermann
2020-06-29  9:27   ` Daniel Vetter
2020-09-28  8:40     ` Thomas Zimmermann
2020-09-28  8:50       ` Daniel Vetter
2020-09-28  9:14         ` Thomas Zimmermann
2020-09-29  8:59     ` Thomas Zimmermann
2020-09-29  9:20       ` Daniel Vetter
2020-06-30  9:11   ` Daniel Vetter
2020-06-25 12:00 ` [PATCH 9/9] drm/simplekms: Acquire memory aperture for framebuffer Thomas Zimmermann
2020-06-29  9:22   ` Daniel Vetter
2020-06-29 16:04     ` Greg KH
2020-06-29 16:23       ` Mark Brown
2020-06-29 16:57         ` Greg KH
2020-06-30  2:13       ` Rob Herring
2020-06-30  8:50         ` Greg KH
2020-06-29  9:38 ` [RFC][PATCH 0/9] drm: Support simple-framebuffer devices and firmware fbs Hans de Goede
2020-06-30  9:06   ` Daniel Vetter
2020-06-30  9:13     ` Hans de Goede
2020-07-01 14:10     ` Thomas Zimmermann
2020-07-03 10:55       ` Hans de Goede
2020-07-03 11:42         ` Thomas Zimmermann
2020-07-03 12:58         ` Daniel Vetter
2020-07-03 14:11           ` Hans de Goede
2020-07-01 13:48   ` Thomas Zimmermann
2020-07-03 10:44     ` Hans de Goede

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).