Home | History | Annotate | Line # | Download | only in vboxvideo
      1  1.1  riastrad /*	$NetBSD: vboxvideo.h,v 1.2 2021/12/18 23:45:44 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad /* SPDX-License-Identifier: MIT */
      4  1.1  riastrad /* Copyright (C) 2006-2016 Oracle Corporation */
      5  1.1  riastrad 
      6  1.1  riastrad #ifndef __VBOXVIDEO_H__
      7  1.1  riastrad #define __VBOXVIDEO_H__
      8  1.1  riastrad 
      9  1.1  riastrad #define VBOX_VIDEO_MAX_SCREENS 64
     10  1.1  riastrad 
     11  1.1  riastrad /*
     12  1.1  riastrad  * The last 4096 bytes of the guest VRAM contains the generic info for all
     13  1.1  riastrad  * DualView chunks: sizes and offsets of chunks. This is filled by miniport.
     14  1.1  riastrad  *
     15  1.1  riastrad  * Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
     16  1.1  riastrad  * etc. This is used exclusively by the corresponding instance of a display
     17  1.1  riastrad  * driver.
     18  1.1  riastrad  *
     19  1.1  riastrad  * The VRAM layout:
     20  1.1  riastrad  *   Last 4096 bytes - Adapter information area.
     21  1.1  riastrad  *   4096 bytes aligned miniport heap (value specified in the config rouded up).
     22  1.1  riastrad  *   Slack - what left after dividing the VRAM.
     23  1.1  riastrad  *   4096 bytes aligned framebuffers:
     24  1.1  riastrad  *     last 4096 bytes of each framebuffer is the display information area.
     25  1.1  riastrad  *
     26  1.1  riastrad  * The Virtual Graphics Adapter information in the guest VRAM is stored by the
     27  1.1  riastrad  * guest video driver using structures prepended by VBOXVIDEOINFOHDR.
     28  1.1  riastrad  *
     29  1.1  riastrad  * When the guest driver writes dword 0 to the VBE_DISPI_INDEX_VBOX_VIDEO
     30  1.1  riastrad  * the host starts to process the info. The first element at the start of
     31  1.1  riastrad  * the 4096 bytes region should be normally be a LINK that points to
     32  1.1  riastrad  * actual information chain. That way the guest driver can have some
     33  1.1  riastrad  * fixed layout of the information memory block and just rewrite
     34  1.1  riastrad  * the link to point to relevant memory chain.
     35  1.1  riastrad  *
     36  1.1  riastrad  * The processing stops at the END element.
     37  1.1  riastrad  *
     38  1.1  riastrad  * The host can access the memory only when the port IO is processed.
     39  1.1  riastrad  * All data that will be needed later must be copied from these 4096 bytes.
     40  1.1  riastrad  * But other VRAM can be used by host until the mode is disabled.
     41  1.1  riastrad  *
     42  1.1  riastrad  * The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_VBOX_VIDEO
     43  1.1  riastrad  * to disable the mode.
     44  1.1  riastrad  *
     45  1.1  riastrad  * VBE_DISPI_INDEX_VBOX_VIDEO is used to read the configuration information
     46  1.1  riastrad  * from the host and issue commands to the host.
     47  1.1  riastrad  *
     48  1.1  riastrad  * The guest writes the VBE_DISPI_INDEX_VBOX_VIDEO index register, the the
     49  1.1  riastrad  * following operations with the VBE data register can be performed:
     50  1.1  riastrad  *
     51  1.1  riastrad  * Operation            Result
     52  1.1  riastrad  * write 16 bit value   NOP
     53  1.1  riastrad  * read 16 bit value    count of monitors
     54  1.1  riastrad  * write 32 bit value   set the vbox cmd value and the cmd processed by the host
     55  1.1  riastrad  * read 32 bit value    result of the last vbox command is returned
     56  1.1  riastrad  */
     57  1.1  riastrad 
     58  1.1  riastrad struct vbva_cmd_hdr {
     59  1.1  riastrad 	s16 x;
     60  1.1  riastrad 	s16 y;
     61  1.1  riastrad 	u16 w;
     62  1.1  riastrad 	u16 h;
     63  1.1  riastrad } __packed;
     64  1.1  riastrad 
     65  1.1  riastrad /*
     66  1.1  riastrad  * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
     67  1.1  riastrad  * data. For example big bitmaps which do not fit to the buffer.
     68  1.1  riastrad  *
     69  1.1  riastrad  * Guest starts writing to the buffer by initializing a record entry in the
     70  1.1  riastrad  * records queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
     71  1.1  riastrad  * written. As data is written to the ring buffer, the guest increases
     72  1.1  riastrad  * free_offset.
     73  1.1  riastrad  *
     74  1.1  riastrad  * The host reads the records on flushes and processes all completed records.
     75  1.1  riastrad  * When host encounters situation when only a partial record presents and
     76  1.1  riastrad  * len_and_flags & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
     77  1.1  riastrad  * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
     78  1.1  riastrad  * data_offset. After that on each flush the host continues fetching the data
     79  1.1  riastrad  * until the record is completed.
     80  1.1  riastrad  */
     81  1.1  riastrad 
     82  1.1  riastrad #define VBVA_RING_BUFFER_SIZE        (4194304 - 1024)
     83  1.1  riastrad #define VBVA_RING_BUFFER_THRESHOLD   (4096)
     84  1.1  riastrad 
     85  1.1  riastrad #define VBVA_MAX_RECORDS (64)
     86  1.1  riastrad 
     87  1.1  riastrad #define VBVA_F_MODE_ENABLED         0x00000001u
     88  1.1  riastrad #define VBVA_F_MODE_VRDP            0x00000002u
     89  1.1  riastrad #define VBVA_F_MODE_VRDP_RESET      0x00000004u
     90  1.1  riastrad #define VBVA_F_MODE_VRDP_ORDER_MASK 0x00000008u
     91  1.1  riastrad 
     92  1.1  riastrad #define VBVA_F_STATE_PROCESSING     0x00010000u
     93  1.1  riastrad 
     94  1.1  riastrad #define VBVA_F_RECORD_PARTIAL       0x80000000u
     95  1.1  riastrad 
     96  1.1  riastrad struct vbva_record {
     97  1.1  riastrad 	u32 len_and_flags;
     98  1.1  riastrad } __packed;
     99  1.1  riastrad 
    100  1.1  riastrad /*
    101  1.1  riastrad  * The minimum HGSMI heap size is PAGE_SIZE (4096 bytes) and is a restriction of
    102  1.1  riastrad  * the runtime heapsimple API. Use minimum 2 pages here, because the info area
    103  1.1  riastrad  * also may contain other data (for example hgsmi_host_flags structure).
    104  1.1  riastrad  */
    105  1.1  riastrad #define VBVA_ADAPTER_INFORMATION_SIZE 65536
    106  1.1  riastrad #define VBVA_MIN_BUFFER_SIZE          65536
    107  1.1  riastrad 
    108  1.1  riastrad /* The value for port IO to let the adapter to interpret the adapter memory. */
    109  1.1  riastrad #define VBOX_VIDEO_DISABLE_ADAPTER_MEMORY        0xFFFFFFFF
    110  1.1  riastrad 
    111  1.1  riastrad /* The value for port IO to let the adapter to interpret the adapter memory. */
    112  1.1  riastrad #define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY      0x00000000
    113  1.1  riastrad 
    114  1.1  riastrad /*
    115  1.1  riastrad  * The value for port IO to let the adapter to interpret the display memory.
    116  1.1  riastrad  * The display number is encoded in low 16 bits.
    117  1.1  riastrad  */
    118  1.1  riastrad #define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
    119  1.1  riastrad 
    120  1.1  riastrad struct vbva_host_flags {
    121  1.1  riastrad 	u32 host_events;
    122  1.1  riastrad 	u32 supported_orders;
    123  1.1  riastrad } __packed;
    124  1.1  riastrad 
    125  1.1  riastrad struct vbva_buffer {
    126  1.1  riastrad 	struct vbva_host_flags host_flags;
    127  1.1  riastrad 
    128  1.1  riastrad 	/* The offset where the data start in the buffer. */
    129  1.1  riastrad 	u32 data_offset;
    130  1.1  riastrad 	/* The offset where next data must be placed in the buffer. */
    131  1.1  riastrad 	u32 free_offset;
    132  1.1  riastrad 
    133  1.1  riastrad 	/* The queue of record descriptions. */
    134  1.1  riastrad 	struct vbva_record records[VBVA_MAX_RECORDS];
    135  1.1  riastrad 	u32 record_first_index;
    136  1.1  riastrad 	u32 record_free_index;
    137  1.1  riastrad 
    138  1.1  riastrad 	/* Space to leave free when large partial records are transferred. */
    139  1.1  riastrad 	u32 partial_write_tresh;
    140  1.1  riastrad 
    141  1.1  riastrad 	u32 data_len;
    142  1.1  riastrad 	/* variable size for the rest of the vbva_buffer area in VRAM. */
    143  1.1  riastrad 	u8 data[0];
    144  1.1  riastrad } __packed;
    145  1.1  riastrad 
    146  1.1  riastrad #define VBVA_MAX_RECORD_SIZE (128 * 1024 * 1024)
    147  1.1  riastrad 
    148  1.1  riastrad /* guest->host commands */
    149  1.1  riastrad #define VBVA_QUERY_CONF32			 1
    150  1.1  riastrad #define VBVA_SET_CONF32				 2
    151  1.1  riastrad #define VBVA_INFO_VIEW				 3
    152  1.1  riastrad #define VBVA_INFO_HEAP				 4
    153  1.1  riastrad #define VBVA_FLUSH				 5
    154  1.1  riastrad #define VBVA_INFO_SCREEN			 6
    155  1.1  riastrad #define VBVA_ENABLE				 7
    156  1.1  riastrad #define VBVA_MOUSE_POINTER_SHAPE		 8
    157  1.1  riastrad /* informs host about HGSMI caps. see vbva_caps below */
    158  1.1  riastrad #define VBVA_INFO_CAPS				12
    159  1.1  riastrad /* configures scanline, see VBVASCANLINECFG below */
    160  1.1  riastrad #define VBVA_SCANLINE_CFG			13
    161  1.1  riastrad /* requests scanline info, see VBVASCANLINEINFO below */
    162  1.1  riastrad #define VBVA_SCANLINE_INFO			14
    163  1.1  riastrad /* inform host about VBVA Command submission */
    164  1.1  riastrad #define VBVA_CMDVBVA_SUBMIT			16
    165  1.1  riastrad /* inform host about VBVA Command submission */
    166  1.1  riastrad #define VBVA_CMDVBVA_FLUSH			17
    167  1.1  riastrad /* G->H DMA command */
    168  1.1  riastrad #define VBVA_CMDVBVA_CTL			18
    169  1.1  riastrad /* Query most recent mode hints sent */
    170  1.1  riastrad #define VBVA_QUERY_MODE_HINTS			19
    171  1.1  riastrad /*
    172  1.1  riastrad  * Report the guest virtual desktop position and size for mapping host and
    173  1.1  riastrad  * guest pointer positions.
    174  1.1  riastrad  */
    175  1.1  riastrad #define VBVA_REPORT_INPUT_MAPPING		20
    176  1.1  riastrad /* Report the guest cursor position and query the host position. */
    177  1.1  riastrad #define VBVA_CURSOR_POSITION			21
    178  1.1  riastrad 
    179  1.1  riastrad /* host->guest commands */
    180  1.1  riastrad #define VBVAHG_EVENT				1
    181  1.1  riastrad #define VBVAHG_DISPLAY_CUSTOM			2
    182  1.1  riastrad 
    183  1.1  riastrad /* vbva_conf32::index */
    184  1.1  riastrad #define VBOX_VBVA_CONF32_MONITOR_COUNT		0
    185  1.1  riastrad #define VBOX_VBVA_CONF32_HOST_HEAP_SIZE		1
    186  1.1  riastrad /*
    187  1.1  riastrad  * Returns VINF_SUCCESS if the host can report mode hints via VBVA.
    188  1.1  riastrad  * Set value to VERR_NOT_SUPPORTED before calling.
    189  1.1  riastrad  */
    190  1.1  riastrad #define VBOX_VBVA_CONF32_MODE_HINT_REPORTING	2
    191  1.1  riastrad /*
    192  1.1  riastrad  * Returns VINF_SUCCESS if the host can report guest cursor enabled status via
    193  1.1  riastrad  * VBVA.  Set value to VERR_NOT_SUPPORTED before calling.
    194  1.1  riastrad  */
    195  1.1  riastrad #define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING	3
    196  1.1  riastrad /*
    197  1.1  riastrad  * Returns the currently available host cursor capabilities.  Available if
    198  1.1  riastrad  * VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success.
    199  1.1  riastrad  */
    200  1.1  riastrad #define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES	4
    201  1.1  riastrad /* Returns the supported flags in vbva_infoscreen.flags. */
    202  1.1  riastrad #define VBOX_VBVA_CONF32_SCREEN_FLAGS		5
    203  1.1  riastrad /* Returns the max size of VBVA record. */
    204  1.1  riastrad #define VBOX_VBVA_CONF32_MAX_RECORD_SIZE	6
    205  1.1  riastrad 
    206  1.1  riastrad struct vbva_conf32 {
    207  1.1  riastrad 	u32 index;
    208  1.1  riastrad 	u32 value;
    209  1.1  riastrad } __packed;
    210  1.1  riastrad 
    211  1.1  riastrad /* Reserved for historical reasons. */
    212  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0   BIT(0)
    213  1.1  riastrad /*
    214  1.1  riastrad  * Guest cursor capability: can the host show a hardware cursor at the host
    215  1.1  riastrad  * pointer location?
    216  1.1  riastrad  */
    217  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE    BIT(1)
    218  1.1  riastrad /* Reserved for historical reasons. */
    219  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2   BIT(2)
    220  1.1  riastrad /* Reserved for historical reasons.  Must always be unset. */
    221  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3   BIT(3)
    222  1.1  riastrad /* Reserved for historical reasons. */
    223  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4   BIT(4)
    224  1.1  riastrad /* Reserved for historical reasons. */
    225  1.1  riastrad #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5   BIT(5)
    226  1.1  riastrad 
    227  1.1  riastrad struct vbva_infoview {
    228  1.1  riastrad 	/* Index of the screen, assigned by the guest. */
    229  1.1  riastrad 	u32 view_index;
    230  1.1  riastrad 
    231  1.1  riastrad 	/* The screen offset in VRAM, the framebuffer starts here. */
    232  1.1  riastrad 	u32 view_offset;
    233  1.1  riastrad 
    234  1.1  riastrad 	/* The size of the VRAM memory that can be used for the view. */
    235  1.1  riastrad 	u32 view_size;
    236  1.1  riastrad 
    237  1.1  riastrad 	/* The recommended maximum size of the VRAM memory for the screen. */
    238  1.1  riastrad 	u32 max_screen_size;
    239  1.1  riastrad } __packed;
    240  1.1  riastrad 
    241  1.1  riastrad struct vbva_flush {
    242  1.1  riastrad 	u32 reserved;
    243  1.1  riastrad } __packed;
    244  1.1  riastrad 
    245  1.1  riastrad /* vbva_infoscreen.flags */
    246  1.1  riastrad #define VBVA_SCREEN_F_NONE			0x0000
    247  1.1  riastrad #define VBVA_SCREEN_F_ACTIVE			0x0001
    248  1.1  riastrad /*
    249  1.1  riastrad  * The virtual monitor has been disabled by the guest and should be removed
    250  1.1  riastrad  * by the host and ignored for purposes of pointer position calculation.
    251  1.1  riastrad  */
    252  1.1  riastrad #define VBVA_SCREEN_F_DISABLED			0x0002
    253  1.1  riastrad /*
    254  1.1  riastrad  * The virtual monitor has been blanked by the guest and should be blacked
    255  1.1  riastrad  * out by the host using width, height, etc values from the vbva_infoscreen
    256  1.1  riastrad  * request.
    257  1.1  riastrad  */
    258  1.1  riastrad #define VBVA_SCREEN_F_BLANK			0x0004
    259  1.1  riastrad /*
    260  1.1  riastrad  * The virtual monitor has been blanked by the guest and should be blacked
    261  1.1  riastrad  * out by the host using the previous mode values for width. height, etc.
    262  1.1  riastrad  */
    263  1.1  riastrad #define VBVA_SCREEN_F_BLANK2			0x0008
    264  1.1  riastrad 
    265  1.1  riastrad struct vbva_infoscreen {
    266  1.1  riastrad 	/* Which view contains the screen. */
    267  1.1  riastrad 	u32 view_index;
    268  1.1  riastrad 
    269  1.1  riastrad 	/* Physical X origin relative to the primary screen. */
    270  1.1  riastrad 	s32 origin_x;
    271  1.1  riastrad 
    272  1.1  riastrad 	/* Physical Y origin relative to the primary screen. */
    273  1.1  riastrad 	s32 origin_y;
    274  1.1  riastrad 
    275  1.1  riastrad 	/* Offset of visible framebuffer relative to the framebuffer start. */
    276  1.1  riastrad 	u32 start_offset;
    277  1.1  riastrad 
    278  1.1  riastrad 	/* The scan line size in bytes. */
    279  1.1  riastrad 	u32 line_size;
    280  1.1  riastrad 
    281  1.1  riastrad 	/* Width of the screen. */
    282  1.1  riastrad 	u32 width;
    283  1.1  riastrad 
    284  1.1  riastrad 	/* Height of the screen. */
    285  1.1  riastrad 	u32 height;
    286  1.1  riastrad 
    287  1.1  riastrad 	/* Color depth. */
    288  1.1  riastrad 	u16 bits_per_pixel;
    289  1.1  riastrad 
    290  1.1  riastrad 	/* VBVA_SCREEN_F_* */
    291  1.1  riastrad 	u16 flags;
    292  1.1  riastrad } __packed;
    293  1.1  riastrad 
    294  1.1  riastrad /* vbva_enable.flags */
    295  1.1  riastrad #define VBVA_F_NONE				0x00000000
    296  1.1  riastrad #define VBVA_F_ENABLE				0x00000001
    297  1.1  riastrad #define VBVA_F_DISABLE				0x00000002
    298  1.1  riastrad /* extended VBVA to be used with WDDM */
    299  1.1  riastrad #define VBVA_F_EXTENDED				0x00000004
    300  1.1  riastrad /* vbva offset is absolute VRAM offset */
    301  1.1  riastrad #define VBVA_F_ABSOFFSET			0x00000008
    302  1.1  riastrad 
    303  1.1  riastrad struct vbva_enable {
    304  1.1  riastrad 	u32 flags;
    305  1.1  riastrad 	u32 offset;
    306  1.1  riastrad 	s32 result;
    307  1.1  riastrad } __packed;
    308  1.1  riastrad 
    309  1.1  riastrad struct vbva_enable_ex {
    310  1.1  riastrad 	struct vbva_enable base;
    311  1.1  riastrad 	u32 screen_id;
    312  1.1  riastrad } __packed;
    313  1.1  riastrad 
    314  1.1  riastrad struct vbva_mouse_pointer_shape {
    315  1.1  riastrad 	/* The host result. */
    316  1.1  riastrad 	s32 result;
    317  1.1  riastrad 
    318  1.1  riastrad 	/* VBOX_MOUSE_POINTER_* bit flags. */
    319  1.1  riastrad 	u32 flags;
    320  1.1  riastrad 
    321  1.1  riastrad 	/* X coordinate of the hot spot. */
    322  1.1  riastrad 	u32 hot_X;
    323  1.1  riastrad 
    324  1.1  riastrad 	/* Y coordinate of the hot spot. */
    325  1.1  riastrad 	u32 hot_y;
    326  1.1  riastrad 
    327  1.1  riastrad 	/* Width of the pointer in pixels. */
    328  1.1  riastrad 	u32 width;
    329  1.1  riastrad 
    330  1.1  riastrad 	/* Height of the pointer in scanlines. */
    331  1.1  riastrad 	u32 height;
    332  1.1  riastrad 
    333  1.1  riastrad 	/* Pointer data.
    334  1.1  riastrad 	 *
    335  1.1  riastrad 	 * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color)
    336  1.1  riastrad 	 * mask.
    337  1.1  riastrad 	 *
    338  1.1  riastrad 	 * For pointers without alpha channel the XOR mask pixels are 32 bit
    339  1.1  riastrad 	 * values: (lsb)BGR0(msb). For pointers with alpha channel the XOR mask
    340  1.1  riastrad 	 * consists of (lsb)BGRA(msb) 32 bit values.
    341  1.1  riastrad 	 *
    342  1.1  riastrad 	 * Guest driver must create the AND mask for pointers with alpha chan.,
    343  1.1  riastrad 	 * so if host does not support alpha, the pointer could be displayed as
    344  1.1  riastrad 	 * a normal color pointer. The AND mask can be constructed from alpha
    345  1.1  riastrad 	 * values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
    346  1.1  riastrad 	 *
    347  1.1  riastrad 	 * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND
    348  1.1  riastrad 	 * mask, therefore, is and_len = (width + 7) / 8 * height. The padding
    349  1.1  riastrad 	 * bits at the end of any scanline are undefined.
    350  1.1  riastrad 	 *
    351  1.1  riastrad 	 * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
    352  1.1  riastrad 	 * u8 *xor = and + (and_len + 3) & ~3
    353  1.1  riastrad 	 * Bytes in the gap between the AND and the XOR mask are undefined.
    354  1.1  riastrad 	 * XOR mask scanlines have no gap between them and size of XOR mask is:
    355  1.1  riastrad 	 * xor_len = width * 4 * height.
    356  1.1  riastrad 	 *
    357  1.1  riastrad 	 * Preallocate 4 bytes for accessing actual data as p->data.
    358  1.1  riastrad 	 */
    359  1.1  riastrad 	u8 data[4];
    360  1.1  riastrad } __packed;
    361  1.1  riastrad 
    362  1.1  riastrad /* pointer is visible */
    363  1.1  riastrad #define VBOX_MOUSE_POINTER_VISIBLE		0x0001
    364  1.1  riastrad /* pointer has alpha channel */
    365  1.1  riastrad #define VBOX_MOUSE_POINTER_ALPHA		0x0002
    366  1.1  riastrad /* pointerData contains new pointer shape */
    367  1.1  riastrad #define VBOX_MOUSE_POINTER_SHAPE		0x0004
    368  1.1  riastrad 
    369  1.1  riastrad /*
    370  1.1  riastrad  * The guest driver can handle asynch guest cmd completion by reading the
    371  1.1  riastrad  * command offset from io port.
    372  1.1  riastrad  */
    373  1.1  riastrad #define VBVACAPS_COMPLETEGCMD_BY_IOREAD		0x00000001
    374  1.1  riastrad /* the guest driver can handle video adapter IRQs */
    375  1.1  riastrad #define VBVACAPS_IRQ				0x00000002
    376  1.1  riastrad /* The guest can read video mode hints sent via VBVA. */
    377  1.1  riastrad #define VBVACAPS_VIDEO_MODE_HINTS		0x00000004
    378  1.1  riastrad /* The guest can switch to a software cursor on demand. */
    379  1.1  riastrad #define VBVACAPS_DISABLE_CURSOR_INTEGRATION	0x00000008
    380  1.1  riastrad /* The guest does not depend on host handling the VBE registers. */
    381  1.1  riastrad #define VBVACAPS_USE_VBVA_ONLY			0x00000010
    382  1.1  riastrad 
    383  1.1  riastrad struct vbva_caps {
    384  1.1  riastrad 	s32 rc;
    385  1.1  riastrad 	u32 caps;
    386  1.1  riastrad } __packed;
    387  1.1  riastrad 
    388  1.1  riastrad /* Query the most recent mode hints received from the host. */
    389  1.1  riastrad struct vbva_query_mode_hints {
    390  1.1  riastrad 	/* The maximum number of screens to return hints for. */
    391  1.1  riastrad 	u16 hints_queried_count;
    392  1.1  riastrad 	/* The size of the mode hint structures directly following this one. */
    393  1.1  riastrad 	u16 hint_structure_guest_size;
    394  1.1  riastrad 	/* Return code for the operation. Initialise to VERR_NOT_SUPPORTED. */
    395  1.1  riastrad 	s32 rc;
    396  1.1  riastrad } __packed;
    397  1.1  riastrad 
    398  1.1  riastrad /*
    399  1.1  riastrad  * Structure in which a mode hint is returned. The guest allocates an array
    400  1.1  riastrad  * of these immediately after the vbva_query_mode_hints structure.
    401  1.1  riastrad  * To accommodate future extensions, the vbva_query_mode_hints structure
    402  1.1  riastrad  * specifies the size of the vbva_modehint structures allocated by the guest,
    403  1.1  riastrad  * and the host only fills out structure elements which fit into that size. The
    404  1.1  riastrad  * host should fill any unused members (e.g. dx, dy) or structure space on the
    405  1.1  riastrad  * end with ~0. The whole structure can legally be set to ~0 to skip a screen.
    406  1.1  riastrad  */
    407  1.1  riastrad struct vbva_modehint {
    408  1.1  riastrad 	u32 magic;
    409  1.1  riastrad 	u32 cx;
    410  1.1  riastrad 	u32 cy;
    411  1.1  riastrad 	u32 bpp;		/* Which has never been used... */
    412  1.1  riastrad 	u32 display;
    413  1.1  riastrad 	u32 dx;			/* X offset into the virtual frame-buffer. */
    414  1.1  riastrad 	u32 dy;			/* Y offset into the virtual frame-buffer. */
    415  1.1  riastrad 	u32 enabled;		/* Not flags. Add new members for new flags. */
    416  1.1  riastrad } __packed;
    417  1.1  riastrad 
    418  1.1  riastrad #define VBVAMODEHINT_MAGIC 0x0801add9u
    419  1.1  riastrad 
    420  1.1  riastrad /*
    421  1.1  riastrad  * Report the rectangle relative to which absolute pointer events should be
    422  1.1  riastrad  * expressed. This information remains valid until the next VBVA resize event
    423  1.1  riastrad  * for any screen, at which time it is reset to the bounding rectangle of all
    424  1.1  riastrad  * virtual screens and must be re-set.
    425  1.1  riastrad  */
    426  1.1  riastrad struct vbva_report_input_mapping {
    427  1.1  riastrad 	s32 x;	/* Upper left X co-ordinate relative to the first screen. */
    428  1.1  riastrad 	s32 y;	/* Upper left Y co-ordinate relative to the first screen. */
    429  1.1  riastrad 	u32 cx;	/* Rectangle width. */
    430  1.1  riastrad 	u32 cy;	/* Rectangle height. */
    431  1.1  riastrad } __packed;
    432  1.1  riastrad 
    433  1.1  riastrad /*
    434  1.1  riastrad  * Report the guest cursor position and query the host one. The host may wish
    435  1.1  riastrad  * to use the guest information to re-position its own cursor (though this is
    436  1.1  riastrad  * currently unlikely).
    437  1.1  riastrad  */
    438  1.1  riastrad struct vbva_cursor_position {
    439  1.1  riastrad 	u32 report_position;	/* Are we reporting a position? */
    440  1.1  riastrad 	u32 x;			/* Guest cursor X position */
    441  1.1  riastrad 	u32 y;			/* Guest cursor Y position */
    442  1.1  riastrad } __packed;
    443  1.1  riastrad 
    444  1.1  riastrad #endif
    445