Changeset View
Changeset View
Standalone View
Standalone View
sys/xen/interface/io/displif.h
Show All 32 Lines | |||||
#include "ring.h" | #include "ring.h" | ||||
#include "../grant_table.h" | #include "../grant_table.h" | ||||
/* | /* | ||||
****************************************************************************** | ****************************************************************************** | ||||
* Protocol version | * Protocol version | ||||
****************************************************************************** | ****************************************************************************** | ||||
*/ | */ | ||||
#define XENDISPL_PROTOCOL_VERSION "1" | #define XENDISPL_PROTOCOL_VERSION "2" | ||||
#define XENDISPL_PROTOCOL_VERSION_INT 2 | |||||
/* | /* | ||||
****************************************************************************** | ****************************************************************************** | ||||
* Main features provided by the protocol | * Main features provided by the protocol | ||||
****************************************************************************** | ****************************************************************************** | ||||
* This protocol aims to provide a unified protocol which fits more | * This protocol aims to provide a unified protocol which fits more | ||||
* sophisticated use-cases than a framebuffer device can handle. At the | * sophisticated use-cases than a framebuffer device can handle. At the | ||||
* moment basic functionality is supported with the intention to be extended: | * moment basic functionality is supported with the intention to be extended: | ||||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
* This can be UUID or such. | * This can be UUID or such. | ||||
* | * | ||||
* resolution | * resolution | ||||
* Values: <width, uint32_t>x<height, uint32_t> | * Values: <width, uint32_t>x<height, uint32_t> | ||||
* | * | ||||
* Width and height of the connector in pixels separated by | * Width and height of the connector in pixels separated by | ||||
* XENDISPL_RESOLUTION_SEPARATOR. This defines visible area of the | * XENDISPL_RESOLUTION_SEPARATOR. This defines visible area of the | ||||
* display. | * display. | ||||
* If backend provides extended display identification data (EDID) with | |||||
* XENDISPL_OP_GET_EDID request then EDID values must take precedence | |||||
* over the resolutions defined here. | |||||
* | * | ||||
*------------------ Connector Request Transport Parameters ------------------- | *------------------ Connector Request Transport Parameters ------------------- | ||||
* | * | ||||
* This communication path is used to deliver requests from frontend to backend | * This communication path is used to deliver requests from frontend to backend | ||||
* and get the corresponding responses from backend to frontend, | * and get the corresponding responses from backend to frontend, | ||||
* set up per connector. | * set up per connector. | ||||
* | * | ||||
* req-event-channel | * req-event-channel | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#define XENDISPL_OP_DBUF_CREATE 0x10 | #define XENDISPL_OP_DBUF_CREATE 0x10 | ||||
#define XENDISPL_OP_DBUF_DESTROY 0x11 | #define XENDISPL_OP_DBUF_DESTROY 0x11 | ||||
#define XENDISPL_OP_FB_ATTACH 0x12 | #define XENDISPL_OP_FB_ATTACH 0x12 | ||||
#define XENDISPL_OP_FB_DETACH 0x13 | #define XENDISPL_OP_FB_DETACH 0x13 | ||||
#define XENDISPL_OP_SET_CONFIG 0x14 | #define XENDISPL_OP_SET_CONFIG 0x14 | ||||
#define XENDISPL_OP_PG_FLIP 0x15 | #define XENDISPL_OP_PG_FLIP 0x15 | ||||
/* The below command is available in protocol version 2 and above. */ | |||||
#define XENDISPL_OP_GET_EDID 0x16 | |||||
/* | /* | ||||
****************************************************************************** | ****************************************************************************** | ||||
* EVENT CODES | * EVENT CODES | ||||
****************************************************************************** | ****************************************************************************** | ||||
*/ | */ | ||||
#define XENDISPL_EVT_PG_FLIP 0x00 | #define XENDISPL_EVT_PG_FLIP 0x00 | ||||
Show All 12 Lines | |||||
#define XENDISPL_FIELD_REQ_RING_REF "req-ring-ref" | #define XENDISPL_FIELD_REQ_RING_REF "req-ring-ref" | ||||
#define XENDISPL_FIELD_REQ_CHANNEL "req-event-channel" | #define XENDISPL_FIELD_REQ_CHANNEL "req-event-channel" | ||||
#define XENDISPL_FIELD_EVT_RING_REF "evt-ring-ref" | #define XENDISPL_FIELD_EVT_RING_REF "evt-ring-ref" | ||||
#define XENDISPL_FIELD_EVT_CHANNEL "evt-event-channel" | #define XENDISPL_FIELD_EVT_CHANNEL "evt-event-channel" | ||||
#define XENDISPL_FIELD_RESOLUTION "resolution" | #define XENDISPL_FIELD_RESOLUTION "resolution" | ||||
#define XENDISPL_FIELD_BE_ALLOC "be-alloc" | #define XENDISPL_FIELD_BE_ALLOC "be-alloc" | ||||
#define XENDISPL_FIELD_UNIQUE_ID "unique-id" | #define XENDISPL_FIELD_UNIQUE_ID "unique-id" | ||||
#define XENDISPL_EDID_BLOCK_SIZE 128 | |||||
#define XENDISPL_EDID_BLOCK_COUNT 256 | |||||
#define XENDISPL_EDID_MAX_SIZE (XENDISPL_EDID_BLOCK_SIZE * XENDISPL_EDID_BLOCK_COUNT) | |||||
/* | /* | ||||
****************************************************************************** | ****************************************************************************** | ||||
* STATUS RETURN CODES | * STATUS RETURN CODES | ||||
****************************************************************************** | ****************************************************************************** | ||||
* | * | ||||
* Status return code is zero on success and -XEN_EXX on failure. | * Status return code is zero on success and -XEN_EXX on failure. | ||||
* | * | ||||
****************************************************************************** | ****************************************************************************** | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
* | bpp | 28 | * | bpp | 28 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | buffer_sz | 32 | * | buffer_sz | 32 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | flags | 36 | * | flags | 36 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | gref_directory | 40 | * | gref_directory | 40 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | reserved | 44 | * | data_ofs | 44 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | reserved | 48 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | reserved | 64 | * | reserved | 64 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | * | ||||
* Must be sent over control ring of the connector which has the index | * Must be sent over control ring of the connector which has the index | ||||
* value of 0: | * value of 0: | ||||
* /local/domain/<dom-id>/device/vdispl/<dev-id>/0/req-ring-ref | * /local/domain/<dom-id>/device/vdispl/<dev-id>/0/req-ring-ref | ||||
Show All 25 Lines | |||||
* the frontend | * the frontend | ||||
* o fills in page directory with grant references | * o fills in page directory with grant references | ||||
* (gref[] in struct xendispl_page_directory) | * (gref[] in struct xendispl_page_directory) | ||||
* gref_directory - grant_ref_t, a reference to the first shared page | * gref_directory - grant_ref_t, a reference to the first shared page | ||||
* describing shared buffer references. At least one page exists. If shared | * describing shared buffer references. At least one page exists. If shared | ||||
* buffer size (buffer_sz) exceeds what can be addressed by this single page, | * buffer size (buffer_sz) exceeds what can be addressed by this single page, | ||||
* then reference to the next page must be supplied (see gref_dir_next_page | * then reference to the next page must be supplied (see gref_dir_next_page | ||||
* below) | * below) | ||||
* data_ofs - uint32_t, offset of the data in the buffer, octets | |||||
*/ | */ | ||||
#define XENDISPL_DBUF_FLG_REQ_ALLOC (1 << 0) | #define XENDISPL_DBUF_FLG_REQ_ALLOC (1 << 0) | ||||
struct xendispl_dbuf_create_req { | struct xendispl_dbuf_create_req { | ||||
uint64_t dbuf_cookie; | uint64_t dbuf_cookie; | ||||
uint32_t width; | uint32_t width; | ||||
uint32_t height; | uint32_t height; | ||||
uint32_t bpp; | uint32_t bpp; | ||||
uint32_t buffer_sz; | uint32_t buffer_sz; | ||||
uint32_t flags; | uint32_t flags; | ||||
grant_ref_t gref_directory; | grant_ref_t gref_directory; | ||||
uint32_t data_ofs; | |||||
}; | }; | ||||
/* | /* | ||||
* Shared page for XENDISPL_OP_DBUF_CREATE buffer descriptor (gref_directory in | * Shared page for XENDISPL_OP_DBUF_CREATE buffer descriptor (gref_directory in | ||||
* the request) employs a list of pages, describing all pages of the shared | * the request) employs a list of pages, describing all pages of the shared | ||||
* data buffer: | * data buffer: | ||||
* 0 1 2 3 octet | * 0 1 2 3 octet | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | |||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
*/ | */ | ||||
struct xendispl_page_flip_req { | struct xendispl_page_flip_req { | ||||
uint64_t fb_cookie; | uint64_t fb_cookie; | ||||
}; | }; | ||||
/* | /* | ||||
* Request EDID - request EDID describing current connector: | |||||
* 0 1 2 3 octet | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | id | _OP_GET_EDID | reserved | 4 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | buffer_sz | 8 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | gref_directory | 12 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | reserved | 16 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | reserved | 64 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | |||||
* Notes: | |||||
* - This command is not available in protocol version 1 and should be | |||||
* ignored. | |||||
* - This request is optional and if not supported then visible area | |||||
* is defined by the relevant XenStore's "resolution" property. | |||||
* - Shared buffer, allocated for EDID storage, must not be less then | |||||
* XENDISPL_EDID_MAX_SIZE octets. | |||||
* | |||||
* buffer_sz - uint32_t, buffer size to be allocated, octets | |||||
* gref_directory - grant_ref_t, a reference to the first shared page | |||||
* describing EDID buffer references. See XENDISPL_OP_DBUF_CREATE for | |||||
* grant page directory structure (struct xendispl_page_directory). | |||||
* | |||||
* See response format for this request. | |||||
*/ | |||||
struct xendispl_get_edid_req { | |||||
uint32_t buffer_sz; | |||||
grant_ref_t gref_directory; | |||||
}; | |||||
/* | |||||
*---------------------------------- Responses -------------------------------- | *---------------------------------- Responses -------------------------------- | ||||
* | * | ||||
* All response packets have the same length (64 octets) | * All response packets have the same length (64 octets) | ||||
* | * | ||||
* All response packets have common header: | * All response packets have common header: | ||||
* 0 1 2 3 octet | * 0 1 2 3 octet | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | id | reserved | 4 | * | id | reserved | 4 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | status | 8 | * | status | 8 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | reserved | 12 | * | reserved | 12 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | reserved | 64 | * | reserved | 64 | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
* | * | ||||
* id - uint16_t, private guest value, echoed from request | * id - uint16_t, private guest value, echoed from request | ||||
* status - int32_t, response status, zero on success and -XEN_EXX on failure | * status - int32_t, response status, zero on success and -XEN_EXX on failure | ||||
* | * | ||||
* | |||||
* Get EDID response - response for XENDISPL_OP_GET_EDID: | |||||
* 0 1 2 3 octet | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | id | operation | reserved | 4 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | status | 8 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | edid_sz | 12 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | reserved | 16 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/| | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | reserved | 64 | |||||
* +----------------+----------------+----------------+----------------+ | |||||
* | |||||
* Notes: | |||||
* - This response is not available in protocol version 1 and should be | |||||
* ignored. | |||||
* | |||||
* edid_sz - uint32_t, size of the EDID, octets | |||||
*/ | |||||
struct xendispl_get_edid_resp { | |||||
uint32_t edid_sz; | |||||
}; | |||||
/* | |||||
*----------------------------------- Events ---------------------------------- | *----------------------------------- Events ---------------------------------- | ||||
* | * | ||||
* Events are sent via a shared page allocated by the front and propagated by | * Events are sent via a shared page allocated by the front and propagated by | ||||
* evt-event-channel/evt-ring-ref XenStore entries | * evt-event-channel/evt-ring-ref XenStore entries | ||||
* All event packets have the same length (64 octets) | * All event packets have the same length (64 octets) | ||||
* All event packets have common header: | * All event packets have common header: | ||||
* 0 1 2 3 octet | * 0 1 2 3 octet | ||||
* +----------------+----------------+----------------+----------------+ | * +----------------+----------------+----------------+----------------+ | ||||
Show All 35 Lines | struct xendispl_req { | ||||
uint8_t reserved[5]; | uint8_t reserved[5]; | ||||
union { | union { | ||||
struct xendispl_dbuf_create_req dbuf_create; | struct xendispl_dbuf_create_req dbuf_create; | ||||
struct xendispl_dbuf_destroy_req dbuf_destroy; | struct xendispl_dbuf_destroy_req dbuf_destroy; | ||||
struct xendispl_fb_attach_req fb_attach; | struct xendispl_fb_attach_req fb_attach; | ||||
struct xendispl_fb_detach_req fb_detach; | struct xendispl_fb_detach_req fb_detach; | ||||
struct xendispl_set_config_req set_config; | struct xendispl_set_config_req set_config; | ||||
struct xendispl_page_flip_req pg_flip; | struct xendispl_page_flip_req pg_flip; | ||||
struct xendispl_get_edid_req get_edid; | |||||
uint8_t reserved[56]; | uint8_t reserved[56]; | ||||
} op; | } op; | ||||
}; | }; | ||||
struct xendispl_resp { | struct xendispl_resp { | ||||
uint16_t id; | uint16_t id; | ||||
uint8_t operation; | uint8_t operation; | ||||
uint8_t reserved; | uint8_t reserved; | ||||
int32_t status; | int32_t status; | ||||
union { | |||||
struct xendispl_get_edid_resp get_edid; | |||||
uint8_t reserved1[56]; | uint8_t reserved1[56]; | ||||
} op; | |||||
}; | }; | ||||
struct xendispl_evt { | struct xendispl_evt { | ||||
uint16_t id; | uint16_t id; | ||||
uint8_t type; | uint8_t type; | ||||
uint8_t reserved[5]; | uint8_t reserved[5]; | ||||
union { | union { | ||||
struct xendispl_pg_flip_evt pg_flip; | struct xendispl_pg_flip_evt pg_flip; | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |