162306a36Sopenharmony_ci/* SPDX-License-Identifier: MIT */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2020 Noralf Trønnes
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef __LINUX_GUD_H
762306a36Sopenharmony_ci#define __LINUX_GUD_H
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/types.h>
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/*
1262306a36Sopenharmony_ci * struct gud_display_descriptor_req - Display descriptor
1362306a36Sopenharmony_ci * @magic: Magic value GUD_DISPLAY_MAGIC
1462306a36Sopenharmony_ci * @version: Protocol version
1562306a36Sopenharmony_ci * @flags: Flags
1662306a36Sopenharmony_ci *         - STATUS_ON_SET: Always do a status request after a SET request.
1762306a36Sopenharmony_ci *                          This is used by the Linux gadget driver since it has
1862306a36Sopenharmony_ci *                          no way to control the status stage of a control OUT
1962306a36Sopenharmony_ci *                          request that has a payload.
2062306a36Sopenharmony_ci *         - FULL_UPDATE:   Always send the entire framebuffer when flushing changes.
2162306a36Sopenharmony_ci *                          The GUD_REQ_SET_BUFFER request will not be sent
2262306a36Sopenharmony_ci *                          before each bulk transfer, it will only be sent if the
2362306a36Sopenharmony_ci *                          previous bulk transfer had failed. This gives the device
2462306a36Sopenharmony_ci *                          a chance to reset its state machine if needed.
2562306a36Sopenharmony_ci *                          This flag can not be used in combination with compression.
2662306a36Sopenharmony_ci * @compression: Supported compression types
2762306a36Sopenharmony_ci *               - GUD_COMPRESSION_LZ4: LZ4 lossless compression.
2862306a36Sopenharmony_ci * @max_buffer_size: Maximum buffer size the device can handle (optional).
2962306a36Sopenharmony_ci *                   This is useful for devices that don't have a big enough
3062306a36Sopenharmony_ci *                   buffer to decompress the entire framebuffer in one go.
3162306a36Sopenharmony_ci * @min_width: Minimum pixel width the controller can handle
3262306a36Sopenharmony_ci * @max_width: Maximum width
3362306a36Sopenharmony_ci * @min_height: Minimum height
3462306a36Sopenharmony_ci * @max_height: Maximum height
3562306a36Sopenharmony_ci *
3662306a36Sopenharmony_ci * Devices that have only one display mode will have min_width == max_width
3762306a36Sopenharmony_ci * and min_height == max_height.
3862306a36Sopenharmony_ci */
3962306a36Sopenharmony_cistruct gud_display_descriptor_req {
4062306a36Sopenharmony_ci	__le32 magic;
4162306a36Sopenharmony_ci#define GUD_DISPLAY_MAGIC			0x1d50614d
4262306a36Sopenharmony_ci	__u8 version;
4362306a36Sopenharmony_ci	__le32 flags;
4462306a36Sopenharmony_ci#define GUD_DISPLAY_FLAG_STATUS_ON_SET		BIT(0)
4562306a36Sopenharmony_ci#define GUD_DISPLAY_FLAG_FULL_UPDATE		BIT(1)
4662306a36Sopenharmony_ci	__u8 compression;
4762306a36Sopenharmony_ci#define GUD_COMPRESSION_LZ4			BIT(0)
4862306a36Sopenharmony_ci	__le32 max_buffer_size;
4962306a36Sopenharmony_ci	__le32 min_width;
5062306a36Sopenharmony_ci	__le32 max_width;
5162306a36Sopenharmony_ci	__le32 min_height;
5262306a36Sopenharmony_ci	__le32 max_height;
5362306a36Sopenharmony_ci} __packed;
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/*
5662306a36Sopenharmony_ci * struct gud_property_req - Property
5762306a36Sopenharmony_ci * @prop: Property
5862306a36Sopenharmony_ci * @val: Value
5962306a36Sopenharmony_ci */
6062306a36Sopenharmony_cistruct gud_property_req {
6162306a36Sopenharmony_ci	__le16 prop;
6262306a36Sopenharmony_ci	__le64 val;
6362306a36Sopenharmony_ci} __packed;
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci/*
6662306a36Sopenharmony_ci * struct gud_display_mode_req - Display mode
6762306a36Sopenharmony_ci * @clock: Pixel clock in kHz
6862306a36Sopenharmony_ci * @hdisplay: Horizontal display size
6962306a36Sopenharmony_ci * @hsync_start: Horizontal sync start
7062306a36Sopenharmony_ci * @hsync_end: Horizontal sync end
7162306a36Sopenharmony_ci * @htotal: Horizontal total size
7262306a36Sopenharmony_ci * @vdisplay: Vertical display size
7362306a36Sopenharmony_ci * @vsync_start: Vertical sync start
7462306a36Sopenharmony_ci * @vsync_end: Vertical sync end
7562306a36Sopenharmony_ci * @vtotal: Vertical total size
7662306a36Sopenharmony_ci * @flags: Bits 0-13 are the same as in the RandR protocol and also what DRM uses.
7762306a36Sopenharmony_ci *         The deprecated bits are reused for internal protocol flags leaving us
7862306a36Sopenharmony_ci *         free to follow DRM for the other bits in the future.
7962306a36Sopenharmony_ci *         - FLAG_PREFERRED: Set on the preferred display mode.
8062306a36Sopenharmony_ci */
8162306a36Sopenharmony_cistruct gud_display_mode_req {
8262306a36Sopenharmony_ci	__le32 clock;
8362306a36Sopenharmony_ci	__le16 hdisplay;
8462306a36Sopenharmony_ci	__le16 hsync_start;
8562306a36Sopenharmony_ci	__le16 hsync_end;
8662306a36Sopenharmony_ci	__le16 htotal;
8762306a36Sopenharmony_ci	__le16 vdisplay;
8862306a36Sopenharmony_ci	__le16 vsync_start;
8962306a36Sopenharmony_ci	__le16 vsync_end;
9062306a36Sopenharmony_ci	__le16 vtotal;
9162306a36Sopenharmony_ci	__le32 flags;
9262306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_PHSYNC		BIT(0)
9362306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_NHSYNC		BIT(1)
9462306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_PVSYNC		BIT(2)
9562306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_NVSYNC		BIT(3)
9662306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_INTERLACE		BIT(4)
9762306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_DBLSCAN		BIT(5)
9862306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_CSYNC		BIT(6)
9962306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_PCSYNC		BIT(7)
10062306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_NCSYNC		BIT(8)
10162306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_HSKEW		BIT(9)
10262306a36Sopenharmony_ci/* BCast and PixelMultiplex are deprecated */
10362306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_DBLCLK		BIT(12)
10462306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_CLKDIV2		BIT(13)
10562306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_USER_MASK		\
10662306a36Sopenharmony_ci		(GUD_DISPLAY_MODE_FLAG_PHSYNC | GUD_DISPLAY_MODE_FLAG_NHSYNC | \
10762306a36Sopenharmony_ci		GUD_DISPLAY_MODE_FLAG_PVSYNC | GUD_DISPLAY_MODE_FLAG_NVSYNC | \
10862306a36Sopenharmony_ci		GUD_DISPLAY_MODE_FLAG_INTERLACE | GUD_DISPLAY_MODE_FLAG_DBLSCAN | \
10962306a36Sopenharmony_ci		GUD_DISPLAY_MODE_FLAG_CSYNC | GUD_DISPLAY_MODE_FLAG_PCSYNC | \
11062306a36Sopenharmony_ci		GUD_DISPLAY_MODE_FLAG_NCSYNC | GUD_DISPLAY_MODE_FLAG_HSKEW | \
11162306a36Sopenharmony_ci		GUD_DISPLAY_MODE_FLAG_DBLCLK | GUD_DISPLAY_MODE_FLAG_CLKDIV2)
11262306a36Sopenharmony_ci/* Internal protocol flags */
11362306a36Sopenharmony_ci#define GUD_DISPLAY_MODE_FLAG_PREFERRED		BIT(10)
11462306a36Sopenharmony_ci} __packed;
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/*
11762306a36Sopenharmony_ci * struct gud_connector_descriptor_req - Connector descriptor
11862306a36Sopenharmony_ci * @connector_type: Connector type (GUD_CONNECTOR_TYPE_*).
11962306a36Sopenharmony_ci *                  If the host doesn't support the type it should fall back to PANEL.
12062306a36Sopenharmony_ci * @flags: Flags
12162306a36Sopenharmony_ci *         - POLL_STATUS: Connector status can change (polled every 10 seconds)
12262306a36Sopenharmony_ci *         - INTERLACE: Interlaced modes are supported
12362306a36Sopenharmony_ci *         - DOUBLESCAN: Doublescan modes are supported
12462306a36Sopenharmony_ci */
12562306a36Sopenharmony_cistruct gud_connector_descriptor_req {
12662306a36Sopenharmony_ci	__u8 connector_type;
12762306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_PANEL		0
12862306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_VGA			1
12962306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_COMPOSITE		2
13062306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_SVIDEO		3
13162306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_COMPONENT		4
13262306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_DVI			5
13362306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_DISPLAYPORT		6
13462306a36Sopenharmony_ci#define GUD_CONNECTOR_TYPE_HDMI			7
13562306a36Sopenharmony_ci	__le32 flags;
13662306a36Sopenharmony_ci#define GUD_CONNECTOR_FLAGS_POLL_STATUS		BIT(0)
13762306a36Sopenharmony_ci#define GUD_CONNECTOR_FLAGS_INTERLACE		BIT(1)
13862306a36Sopenharmony_ci#define GUD_CONNECTOR_FLAGS_DOUBLESCAN		BIT(2)
13962306a36Sopenharmony_ci} __packed;
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci/*
14262306a36Sopenharmony_ci * struct gud_set_buffer_req - Set buffer transfer info
14362306a36Sopenharmony_ci * @x: X position of rectangle
14462306a36Sopenharmony_ci * @y: Y position
14562306a36Sopenharmony_ci * @width: Pixel width of rectangle
14662306a36Sopenharmony_ci * @height: Pixel height
14762306a36Sopenharmony_ci * @length: Buffer length in bytes
14862306a36Sopenharmony_ci * @compression: Transfer compression
14962306a36Sopenharmony_ci * @compressed_length: Compressed buffer length
15062306a36Sopenharmony_ci *
15162306a36Sopenharmony_ci * This request is issued right before the bulk transfer.
15262306a36Sopenharmony_ci * @x, @y, @width and @height specifies the rectangle where the buffer should be
15362306a36Sopenharmony_ci * placed inside the framebuffer.
15462306a36Sopenharmony_ci */
15562306a36Sopenharmony_cistruct gud_set_buffer_req {
15662306a36Sopenharmony_ci	__le32 x;
15762306a36Sopenharmony_ci	__le32 y;
15862306a36Sopenharmony_ci	__le32 width;
15962306a36Sopenharmony_ci	__le32 height;
16062306a36Sopenharmony_ci	__le32 length;
16162306a36Sopenharmony_ci	__u8 compression;
16262306a36Sopenharmony_ci	__le32 compressed_length;
16362306a36Sopenharmony_ci} __packed;
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci/*
16662306a36Sopenharmony_ci * struct gud_state_req - Display state
16762306a36Sopenharmony_ci * @mode: Display mode
16862306a36Sopenharmony_ci * @format: Pixel format GUD_PIXEL_FORMAT_*
16962306a36Sopenharmony_ci * @connector: Connector index
17062306a36Sopenharmony_ci * @properties: Array of properties
17162306a36Sopenharmony_ci *
17262306a36Sopenharmony_ci * The entire state is transferred each time there's a change.
17362306a36Sopenharmony_ci */
17462306a36Sopenharmony_cistruct gud_state_req {
17562306a36Sopenharmony_ci	struct gud_display_mode_req mode;
17662306a36Sopenharmony_ci	__u8 format;
17762306a36Sopenharmony_ci	__u8 connector;
17862306a36Sopenharmony_ci	struct gud_property_req properties[];
17962306a36Sopenharmony_ci} __packed;
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci/* List of supported connector properties: */
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci/* Margins in pixels to deal with overscan, range 0-100 */
18462306a36Sopenharmony_ci#define GUD_PROPERTY_TV_LEFT_MARGIN			1
18562306a36Sopenharmony_ci#define GUD_PROPERTY_TV_RIGHT_MARGIN			2
18662306a36Sopenharmony_ci#define GUD_PROPERTY_TV_TOP_MARGIN			3
18762306a36Sopenharmony_ci#define GUD_PROPERTY_TV_BOTTOM_MARGIN			4
18862306a36Sopenharmony_ci#define GUD_PROPERTY_TV_MODE				5
18962306a36Sopenharmony_ci/* Brightness in percent, range 0-100 */
19062306a36Sopenharmony_ci#define GUD_PROPERTY_TV_BRIGHTNESS			6
19162306a36Sopenharmony_ci/* Contrast in percent, range 0-100 */
19262306a36Sopenharmony_ci#define GUD_PROPERTY_TV_CONTRAST			7
19362306a36Sopenharmony_ci/* Flicker reduction in percent, range 0-100 */
19462306a36Sopenharmony_ci#define GUD_PROPERTY_TV_FLICKER_REDUCTION		8
19562306a36Sopenharmony_ci/* Overscan in percent, range 0-100 */
19662306a36Sopenharmony_ci#define GUD_PROPERTY_TV_OVERSCAN			9
19762306a36Sopenharmony_ci/* Saturation in percent, range 0-100 */
19862306a36Sopenharmony_ci#define GUD_PROPERTY_TV_SATURATION			10
19962306a36Sopenharmony_ci/* Hue in percent, range 0-100 */
20062306a36Sopenharmony_ci#define GUD_PROPERTY_TV_HUE				11
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ci/*
20362306a36Sopenharmony_ci * Backlight brightness is in the range 0-100 inclusive. The value represents the human perceptual
20462306a36Sopenharmony_ci * brightness and not a linear PWM value. 0 is minimum brightness which should not turn the
20562306a36Sopenharmony_ci * backlight completely off. The DPMS connector property should be used to control power which will
20662306a36Sopenharmony_ci * trigger a GUD_REQ_SET_DISPLAY_ENABLE request.
20762306a36Sopenharmony_ci *
20862306a36Sopenharmony_ci * This does not map to a DRM property, it is used with the backlight device.
20962306a36Sopenharmony_ci */
21062306a36Sopenharmony_ci#define GUD_PROPERTY_BACKLIGHT_BRIGHTNESS		12
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_ci/* List of supported properties that are not connector propeties: */
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci/*
21562306a36Sopenharmony_ci * Plane rotation. Should return the supported bitmask on
21662306a36Sopenharmony_ci * GUD_REQ_GET_PROPERTIES. GUD_ROTATION_0 is mandatory.
21762306a36Sopenharmony_ci *
21862306a36Sopenharmony_ci * Note: This is not display rotation so 90/270 will need scaling to make it fit (unless squared).
21962306a36Sopenharmony_ci */
22062306a36Sopenharmony_ci#define GUD_PROPERTY_ROTATION				50
22162306a36Sopenharmony_ci  #define GUD_ROTATION_0			BIT(0)
22262306a36Sopenharmony_ci  #define GUD_ROTATION_90			BIT(1)
22362306a36Sopenharmony_ci  #define GUD_ROTATION_180			BIT(2)
22462306a36Sopenharmony_ci  #define GUD_ROTATION_270			BIT(3)
22562306a36Sopenharmony_ci  #define GUD_ROTATION_REFLECT_X		BIT(4)
22662306a36Sopenharmony_ci  #define GUD_ROTATION_REFLECT_Y		BIT(5)
22762306a36Sopenharmony_ci  #define GUD_ROTATION_MASK			(GUD_ROTATION_0 | GUD_ROTATION_90 | \
22862306a36Sopenharmony_ci						GUD_ROTATION_180 | GUD_ROTATION_270 | \
22962306a36Sopenharmony_ci						GUD_ROTATION_REFLECT_X | GUD_ROTATION_REFLECT_Y)
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci/* USB Control requests: */
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ci/* Get status from the last GET/SET control request. Value is u8. */
23462306a36Sopenharmony_ci#define GUD_REQ_GET_STATUS				0x00
23562306a36Sopenharmony_ci  /* Status values: */
23662306a36Sopenharmony_ci  #define GUD_STATUS_OK				0x00
23762306a36Sopenharmony_ci  #define GUD_STATUS_BUSY			0x01
23862306a36Sopenharmony_ci  #define GUD_STATUS_REQUEST_NOT_SUPPORTED	0x02
23962306a36Sopenharmony_ci  #define GUD_STATUS_PROTOCOL_ERROR		0x03
24062306a36Sopenharmony_ci  #define GUD_STATUS_INVALID_PARAMETER		0x04
24162306a36Sopenharmony_ci  #define GUD_STATUS_ERROR			0x05
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_ci/* Get display descriptor as a &gud_display_descriptor_req */
24462306a36Sopenharmony_ci#define GUD_REQ_GET_DESCRIPTOR				0x01
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci/* Get supported pixel formats as a byte array of GUD_PIXEL_FORMAT_* */
24762306a36Sopenharmony_ci#define GUD_REQ_GET_FORMATS				0x40
24862306a36Sopenharmony_ci  #define GUD_FORMATS_MAX_NUM			32
24962306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_R1			0x01 /* 1-bit monochrome */
25062306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_R8			0x08 /* 8-bit greyscale */
25162306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_XRGB1111		0x20
25262306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_RGB332		0x30
25362306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_RGB565		0x40
25462306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_RGB888		0x50
25562306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_XRGB8888		0x80
25662306a36Sopenharmony_ci  #define GUD_PIXEL_FORMAT_ARGB8888		0x81
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci/*
25962306a36Sopenharmony_ci * Get supported properties that are not connector propeties as a &gud_property_req array.
26062306a36Sopenharmony_ci * gud_property_req.val often contains the initial value for the property.
26162306a36Sopenharmony_ci */
26262306a36Sopenharmony_ci#define GUD_REQ_GET_PROPERTIES				0x41
26362306a36Sopenharmony_ci  #define GUD_PROPERTIES_MAX_NUM		32
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci/* Connector requests have the connector index passed in the wValue field */
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci/* Get connector descriptors as an array of &gud_connector_descriptor_req */
26862306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTORS				0x50
26962306a36Sopenharmony_ci  #define GUD_CONNECTORS_MAX_NUM		32
27062306a36Sopenharmony_ci
27162306a36Sopenharmony_ci/*
27262306a36Sopenharmony_ci * Get properties supported by the connector as a &gud_property_req array.
27362306a36Sopenharmony_ci * gud_property_req.val often contains the initial value for the property.
27462306a36Sopenharmony_ci */
27562306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTOR_PROPERTIES		0x51
27662306a36Sopenharmony_ci  #define GUD_CONNECTOR_PROPERTIES_MAX_NUM	32
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_ci/*
27962306a36Sopenharmony_ci * Issued when there's a TV_MODE property present.
28062306a36Sopenharmony_ci * Gets an array of the supported TV_MODE names each entry of length
28162306a36Sopenharmony_ci * GUD_CONNECTOR_TV_MODE_NAME_LEN. Names must be NUL-terminated.
28262306a36Sopenharmony_ci */
28362306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTOR_TV_MODE_VALUES		0x52
28462306a36Sopenharmony_ci  #define GUD_CONNECTOR_TV_MODE_NAME_LEN	16
28562306a36Sopenharmony_ci  #define GUD_CONNECTOR_TV_MODE_MAX_NUM		16
28662306a36Sopenharmony_ci
28762306a36Sopenharmony_ci/* When userspace checks connector status, this is issued first, not used for poll requests. */
28862306a36Sopenharmony_ci#define GUD_REQ_SET_CONNECTOR_FORCE_DETECT		0x53
28962306a36Sopenharmony_ci
29062306a36Sopenharmony_ci/*
29162306a36Sopenharmony_ci * Get connector status. Value is u8.
29262306a36Sopenharmony_ci *
29362306a36Sopenharmony_ci * Userspace will get a HOTPLUG uevent if one of the following is true:
29462306a36Sopenharmony_ci * - Connection status has changed since last
29562306a36Sopenharmony_ci * - CHANGED is set
29662306a36Sopenharmony_ci */
29762306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTOR_STATUS			0x54
29862306a36Sopenharmony_ci  #define GUD_CONNECTOR_STATUS_DISCONNECTED	0x00
29962306a36Sopenharmony_ci  #define GUD_CONNECTOR_STATUS_CONNECTED	0x01
30062306a36Sopenharmony_ci  #define GUD_CONNECTOR_STATUS_UNKNOWN		0x02
30162306a36Sopenharmony_ci  #define GUD_CONNECTOR_STATUS_CONNECTED_MASK	0x03
30262306a36Sopenharmony_ci  #define GUD_CONNECTOR_STATUS_CHANGED		BIT(7)
30362306a36Sopenharmony_ci
30462306a36Sopenharmony_ci/*
30562306a36Sopenharmony_ci * Display modes can be fetched as either EDID data or an array of &gud_display_mode_req.
30662306a36Sopenharmony_ci *
30762306a36Sopenharmony_ci * If GUD_REQ_GET_CONNECTOR_MODES returns zero, EDID is used to create display modes.
30862306a36Sopenharmony_ci * If both display modes and EDID are returned, EDID is just passed on to userspace
30962306a36Sopenharmony_ci * in the EDID connector property.
31062306a36Sopenharmony_ci */
31162306a36Sopenharmony_ci
31262306a36Sopenharmony_ci/* Get &gud_display_mode_req array of supported display modes */
31362306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTOR_MODES			0x55
31462306a36Sopenharmony_ci  #define GUD_CONNECTOR_MAX_NUM_MODES		128
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci/* Get Extended Display Identification Data */
31762306a36Sopenharmony_ci#define GUD_REQ_GET_CONNECTOR_EDID			0x56
31862306a36Sopenharmony_ci  #define GUD_CONNECTOR_MAX_EDID_LEN		2048
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_ci/* Set buffer properties before bulk transfer as &gud_set_buffer_req */
32162306a36Sopenharmony_ci#define GUD_REQ_SET_BUFFER				0x60
32262306a36Sopenharmony_ci
32362306a36Sopenharmony_ci/* Check display configuration as &gud_state_req */
32462306a36Sopenharmony_ci#define GUD_REQ_SET_STATE_CHECK				0x61
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci/* Apply the previous STATE_CHECK configuration */
32762306a36Sopenharmony_ci#define GUD_REQ_SET_STATE_COMMIT			0x62
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ci/* Enable/disable the display controller, value is u8: 0/1 */
33062306a36Sopenharmony_ci#define GUD_REQ_SET_CONTROLLER_ENABLE			0x63
33162306a36Sopenharmony_ci
33262306a36Sopenharmony_ci/* Enable/disable display/output (DPMS), value is u8: 0/1 */
33362306a36Sopenharmony_ci#define GUD_REQ_SET_DISPLAY_ENABLE			0x64
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci#endif
336