Skip to content

Linux Gadget Driver

Noralf Trønnes edited this page Apr 26, 2022 · 1 revision

The Linux Gadget driver is currently out-of-tree.
The intention was initially to get it into mainline but now I'm not sure if I will get the time to do so.
If someone wants to take on the task, please go ahead.

The gadget driver consists of two kernel modules:

Documentation/ABI/testing/configfs-usb-gadget-gud

What:		/config/usb-gadget/gadget/functions/gud.name
Date:		Dec 2020
KernelVersion:	5.10
Description:
		The attributes:

		drm_dev - DRM device number
		backlight_dev - Backlight device name (optional)
				The backlight brightness scale should be
				perceptual not linear.
		compression - 8-bit mask of compressions to include.
		formats - Byte string of GUD_PIXEL_FORMAT_* values to include.
		connectors - 32-bit mask of connectors to include.

Flushing

When the gadget driver receives an update, it will wait if the previous update hasn't finished yet. Then it will decompress the buffer and memcpy it directly into the framebuffer that is being scanned out. If the DRM device requires a manual framebuffer flush, a kernel thread is woken up to handle this so this doesn't hold up the next update (SPI displays with onboard memory benefits form this).

Clone this wiki locally