VirtualBox

source: vbox/trunk/include/VBox/Graphics/HGSMIDefs.h@ 66506

Last change on this file since 66506 was 66506, checked in by vboxsync, 8 years ago

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
Based on a patch series by Hans de Goede/Red Hat with minor adjustments by Oracle.
Graphics: Add VBoxVideoIPRT.h header
Add a VBoxVideoIPRT.h header, this adds 2 versions of this file:
1) Generic include/VBox/Graphics/VBoxVideoIPRT.h which includes all the header

files needed by files shared with the linux drm driver

2) src/VBox/Additions/linux/drm/VBoxVideoIPRT.h, which replaces the generic

gfx-common.h when building the linux drm driver


The purpose of this is to eventually redefines various iprt and HGSMI bits
in the linux drm driver version to use more linux kernel infrastructure.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
Line 
1/** @file
2 *
3 * VBox Host Guest Shared Memory Interface (HGSMI).
4 * Host/Guest shared part: types and defines.
5 */
6
7/*
8 * Copyright (C) 2006-2016 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 */
27
28
29#ifndef ___VBox_Graphics_HGSMIDefs_h
30#define ___VBox_Graphics_HGSMIDefs_h
31
32#include <VBoxVideoIPRT.h>
33
34/* HGSMI uses 32 bit offsets and sizes. */
35typedef uint32_t HGSMISIZE;
36typedef uint32_t HGSMIOFFSET;
37
38#define HGSMIOFFSET_VOID ((HGSMIOFFSET)~0)
39
40/* Describes a shared memory area buffer.
41 * Used for calculations with offsets and for buffers verification.
42 */
43typedef struct HGSMIAREA
44{
45 uint8_t *pu8Base; /* The starting address of the area. Corresponds to offset 'offBase'. */
46 HGSMIOFFSET offBase; /* The starting offset of the area. */
47 HGSMIOFFSET offLast; /* The last valid offset:
48 * offBase + cbArea - 1 - (sizeof(header) + sizeof(tail)).
49 */
50 HGSMISIZE cbArea; /* Size of the area. */
51} HGSMIAREA;
52
53
54/* The buffer description flags. */
55#define HGSMI_BUFFER_HEADER_F_SEQ_MASK 0x03 /* Buffer sequence type mask. */
56#define HGSMI_BUFFER_HEADER_F_SEQ_SINGLE 0x00 /* Single buffer, not a part of a sequence. */
57#define HGSMI_BUFFER_HEADER_F_SEQ_START 0x01 /* The first buffer in a sequence. */
58#define HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE 0x02 /* A middle buffer in a sequence. */
59#define HGSMI_BUFFER_HEADER_F_SEQ_END 0x03 /* The last buffer in a sequence. */
60
61
62#pragma pack(1)
63/* 16 bytes buffer header. */
64typedef struct HGSMIBUFFERHEADER
65{
66 uint32_t u32DataSize; /* Size of data that follows the header. */
67
68 uint8_t u8Flags; /* The buffer description: HGSMI_BUFFER_HEADER_F_* */
69
70 uint8_t u8Channel; /* The channel the data must be routed to. */
71 uint16_t u16ChannelInfo; /* Opaque to the HGSMI, used by the channel. */
72
73 union {
74 uint8_t au8Union[8]; /* Opaque placeholder to make the union 8 bytes. */
75
76 struct
77 { /* HGSMI_BUFFER_HEADER_F_SEQ_SINGLE */
78 uint32_t u32Reserved1; /* A reserved field, initialize to 0. */
79 uint32_t u32Reserved2; /* A reserved field, initialize to 0. */
80 } Buffer;
81
82 struct
83 { /* HGSMI_BUFFER_HEADER_F_SEQ_START */
84 uint32_t u32SequenceNumber; /* The sequence number, the same for all buffers in the sequence. */
85 uint32_t u32SequenceSize; /* The total size of the sequence. */
86 } SequenceStart;
87
88 struct
89 { /* HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE and HGSMI_BUFFER_HEADER_F_SEQ_END */
90 uint32_t u32SequenceNumber; /* The sequence number, the same for all buffers in the sequence. */
91 uint32_t u32SequenceOffset; /* Data offset in the entire sequence. */
92 } SequenceContinue;
93 } u;
94} HGSMIBUFFERHEADER;
95
96/* 8 bytes buffer tail. */
97typedef struct HGSMIBUFFERTAIL
98{
99 uint32_t u32Reserved; /* Reserved, must be initialized to 0. */
100 uint32_t u32Checksum; /* Verifyer for the buffer header and offset and for first 4 bytes of the tail. */
101} HGSMIBUFFERTAIL;
102#pragma pack()
103
104AssertCompileSize(HGSMIBUFFERHEADER, 16);
105AssertCompileSize(HGSMIBUFFERTAIL, 8);
106
107/* The size of the array of channels. Array indexes are uint8_t. Note: the value must not be changed. */
108#define HGSMI_NUMBER_OF_CHANNELS 0x100
109
110typedef struct HGSMIENV
111{
112 /* Environment context pointer. */
113 void *pvEnv;
114
115 /* Allocate system memory. */
116 DECLCALLBACKMEMBER(void *, pfnAlloc)(void *pvEnv, HGSMISIZE cb);
117
118 /* Free system memory. */
119 DECLCALLBACKMEMBER(void, pfnFree)(void *pvEnv, void *pv);
120} HGSMIENV;
121
122#endif /* !___VBox_Graphics_HGSMIDefs_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette