Expand description
GUD (Generic USB Display) class implementation.
Class driver for the Linux GUD driver. See https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/gud.
Pixel transfer can be done in a streaming manner: GudClass::read_packet
returns one bulk packet and GudClass::read_buffer streams a whole update
through a small caller-provided chunk buffer, so total framebuffer size can
exceed microcontroller RAM.
Structs§
- Buffer
Info - Pixel rectangle announced by
SET_BUFFER; the target of a streaming read. - Config
- Static class driver configuration passed to
GudClass::new. - Connector
State - Current monitor data for one physical connector.
- Display
Mode - A display mode (24 bytes on the wire,
gud_display_mode_req). - Display
State - Display state accepted by a
SET_STATE_CHECKrequest. - GudClass
- GUD USB display class.
- GudConnector
- Static connector descriptor.
- Property
- A property value (10 bytes on the wire,
gud_property_req). - State
- Internal state for the GUD class. Pass to
GudClass::new.
Enums§
- Connector
Update Error - Error publishing a connector’s current monitor data.
- GudEvent
- Events delivered to the user task in host request order.
- Pixel
Format - A pixel format (
gud.hGUD_PIXEL_FORMAT_*). - Read
Buffer Error - Failure receiving a buffer or consuming its pixel data.
Constants§
- CONNECTOR_
FLAGS_ DOUBLESCAN - Connector flag: doublescan modes are supported.
- CONNECTOR_
FLAGS_ INTERLACE - Connector flag: interlaced modes are supported.
- CONNECTOR_
FLAGS_ POLL_ STATUS - Connector flag: status can change (host polls it every 10 s).
- CONNECTOR_
STATUS_ CHANGED - Status bit set when the status changed since the last read. Internal.
- CONNECTOR_
STATUS_ CONNECTED - Connector status: display attached.
- CONNECTOR_
STATUS_ CONNECTED_ MASK - Mask of the status bits reported in the status byte.
- CONNECTOR_
STATUS_ DISCONNECTED - Connector status: no display attached.
- CONNECTOR_
STATUS_ UNKNOWN - Connector status: attachment unknown.
- CONNECTOR_
TV_ MODE_ NAME_ LEN - Length of one TV mode name entry.
- CONNECTOR_
TYPE_ COMPONENT - Connector type: component.
- CONNECTOR_
TYPE_ COMPOSITE - Connector type: composite TV out.
- CONNECTOR_
TYPE_ DISPLAYPORT - Connector type: DisplayPort.
- CONNECTOR_
TYPE_ DVI - Connector type: DVI.
- CONNECTOR_
TYPE_ HDMI - Connector type: HDMI.
- CONNECTOR_
TYPE_ PANEL - Connector type: laptop panel.
- CONNECTOR_
TYPE_ SVIDEO - Connector type: S-Video.
- CONNECTOR_
TYPE_ VGA - Connector type: VGA.
- DISPLAY_
MODE_ FLAG_ CLKDI V2 - Mode flag: clock divided by 2.
- DISPLAY_
MODE_ FLAG_ CSYNC - Mode flag: composite sync.
- DISPLAY_
MODE_ FLAG_ DBLCLK - Mode flag: double clock mode.
- DISPLAY_
MODE_ FLAG_ DBLSCAN - Mode flag: doublescan mode.
- DISPLAY_
MODE_ FLAG_ HSKEW - Mode flag: hsync skew.
- DISPLAY_
MODE_ FLAG_ INTERLACE - Mode flag: interlaced mode.
- DISPLAY_
MODE_ FLAG_ NCSYNC - Mode flag: negative composite sync polarity.
- DISPLAY_
MODE_ FLAG_ NHSYNC - Mode flag: negative hsync polarity.
- DISPLAY_
MODE_ FLAG_ NVSYNC - Mode flag: negative vsync polarity.
- DISPLAY_
MODE_ FLAG_ PCSYNC - Mode flag: positive composite sync polarity.
- DISPLAY_
MODE_ FLAG_ PHSYNC - Mode flag: positive hsync polarity.
- DISPLAY_
MODE_ FLAG_ PREFERRED - Mode flag: internal protocol flag marking the preferred mode.
- DISPLAY_
MODE_ FLAG_ PVSYNC - Mode flag: positive vsync polarity.
- DISPLAY_
MODE_ FLAG_ USER_ MASK - Mask of mode flag bits defined for user configuration.
- GUD_
COMPRESSION_ LZ4 - LZ4 compression bit. This driver advertises no compression.
- GUD_
CONNECTORS_ MAX_ NUM - Maximum number of connectors a device may advertise.
- GUD_
CONNECTOR_ PROPERTIES_ MAX_ NUM - Maximum number of connector properties a device may advertise.
- GUD_
DISPLAY_ MAGIC - Magic value in the display descriptor (
gud.hGUD_DISPLAY_MAGIC). - GUD_
FORMATS_ MAX_ NUM - Maximum number of pixel formats a device may advertise.
- GUD_
PRODUCT_ ID - Product ID paired with
GUD_VENDOR_ID. - GUD_
PROTOCOL_ VERSION - GUD protocol version reported in the display descriptor.
- GUD_
REQ_ GET_ CONNECTORS - Get connector descriptors (5 bytes each); wValue is the connector index.
- GUD_
REQ_ GET_ CONNECTOR_ EDID - Get EDID data; wValue is the connector index.
- GUD_
REQ_ GET_ CONNECTOR_ MODES - Get display modes (24 bytes each); wValue is the connector index.
- GUD_
REQ_ GET_ CONNECTOR_ PROPERTIES - Get connector properties (10 bytes each); wValue is the connector index.
- GUD_
REQ_ GET_ CONNECTOR_ STATUS - Get connector status (u8); wValue is the connector index.
- GUD_
REQ_ GET_ CONNECTOR_ TV_ MODE_ VALUES - Get TV mode names (16 bytes each); wValue is the connector index.
- GUD_
REQ_ GET_ DESCRIPTOR - Get display descriptor (30 bytes).
- GUD_
REQ_ GET_ FORMATS - Get supported pixel formats as a byte array of
GUD_PIXEL_FORMAT_*. - GUD_
REQ_ GET_ PROPERTIES - Get non-connector properties (currently only
PROPERTY_ROTATION). - GUD_
REQ_ GET_ STATUS - Get status from the last GUD control request. Value is u8.
- GUD_
REQ_ SET_ BUFFER - Set buffer transfer info (25 bytes) right before a bulk OUT transfer.
- GUD_
REQ_ SET_ CONNECTOR_ FORCE_ DETECT - Issued when userspace checks connector status; wValue is the connector index.
- GUD_
REQ_ SET_ CONTROLLER_ ENABLE - Enable/disable the display controller. Value is u8: 0/1.
- GUD_
REQ_ SET_ DISPLAY_ ENABLE - Enable/disable display/output (DPMS). Value is u8: 0/1.
- GUD_
REQ_ SET_ STATE_ CHECK - Check display configuration (
mode+ format + connector + properties). - GUD_
REQ_ SET_ STATE_ COMMIT - Apply the previously checked display configuration.
- GUD_
STATUS_ BUSY - Result of the last GUD request: device busy, host should retry.
- GUD_
STATUS_ ERROR - Result of the last GUD request: generic error.
- GUD_
STATUS_ INVALID_ PARAMETER - Result of the last GUD request: a parameter was invalid.
- GUD_
STATUS_ OK - Result of the last GUD request: ok.
- GUD_
STATUS_ PROTOCOL_ ERROR - Result of the last GUD request: malformed request.
- GUD_
STATUS_ REQUEST_ NOT_ SUPPORTED - Result of the last GUD request: the request is not supported.
- GUD_
VENDOR_ ID - Vendor ID to use for the device so that the Linux GUD driver binds to it.
- MAX_
PROPERTIES - Maximum number of properties stored from a
SET_STATE_CHECKrequest. - PROPERTY_
BACKLIGHT_ BRIGHTNESS - Property: backlight brightness percent, range 0-100.
- PROPERTY_
ROTATION - Non-connector property id: plane rotation (
ROTATION_*bitmask). - PROPERTY_
TV_ BOTTOM_ MARGIN - Property: bottom margin in pixels for overscan, range 0-100.
- PROPERTY_
TV_ BRIGHTNESS - Property: brightness percent, range 0-100.
- PROPERTY_
TV_ CONTRAST - Property: contrast percent, range 0-100.
- PROPERTY_
TV_ FLICKER_ REDUCTION - Property: flicker reduction percent, range 0-100.
- PROPERTY_
TV_ HUE - Property: hue percent, range 0-100.
- PROPERTY_
TV_ LEFT_ MARGIN - Property: left margin in pixels for overscan, range 0-100.
- PROPERTY_
TV_ MODE - Property: TV mode selector (index into
tv_mode_values). - PROPERTY_
TV_ OVERSCAN - Property: overscan percent, range 0-100.
- PROPERTY_
TV_ RIGHT_ MARGIN - Property: right margin in pixels for overscan, range 0-100.
- PROPERTY_
TV_ SATURATION - Property: saturation percent, range 0-100.
- PROPERTY_
TV_ TOP_ MARGIN - Property: top margin in pixels for overscan, range 0-100.
- ROTATION_
0 - Rotation property bit: 0 degrees.
- ROTATION_
90 - Rotation property bit: 90 degrees.
- ROTATION_
180 - Rotation property bit: 180 degrees.
- ROTATION_
270 - Rotation property bit: 270 degrees.
- ROTATION_
MASK - Mask of all rotation property bits.
- ROTATION_
REFLECT_ X - Rotation property bit: horizontal reflection.
- ROTATION_
REFLECT_ Y - Rotation property bit: vertical reflection.