VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/DevVGA.h@ 33875

Last change on this file since 33875 was 33855, checked in by vboxsync, 14 years ago

VGA: 64-bit build fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.6 KB
Line 
1/* $Id: DevVGA.h 33855 2010-11-08 15:37:09Z vboxsync $ */
2/** @file
3 * DevVGA - VBox VGA/VESA device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 * --------------------------------------------------------------------
17 *
18 * This code is based on:
19 *
20 * QEMU internal VGA defines.
21 *
22 * Copyright (c) 2003-2004 Fabrice Bellard
23 *
24 * Permission is hereby granted, free of charge, to any person obtaining a copy
25 * of this software and associated documentation files (the "Software"), to deal
26 * in the Software without restriction, including without limitation the rights
27 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28 * copies of the Software, and to permit persons to whom the Software is
29 * furnished to do so, subject to the following conditions:
30 *
31 * The above copyright notice and this permission notice shall be included in
32 * all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
40 * THE SOFTWARE.
41 */
42
43/** Use VBE bytewise I/O. Only needed for Windows Longhorn/Vista betas and backwards compatibility. */
44#define VBE_BYTEWISE_IO
45
46/** Use VBE new dynamic mode list.
47 * If this is not defined, no checks are carried out to see if the modes all
48 * fit into the framebuffer! See the VRAM_SIZE_FIX define. */
49#define VBE_NEW_DYN_LIST
50
51#ifdef VBOX
52/** The default amount of VRAM. */
53# define VGA_VRAM_DEFAULT (_4M)
54/** The maximum amount of VRAM. Limited by VBOX_MAX_ALLOC_PAGE_COUNT. */
55# define VGA_VRAM_MAX (256 * _1M)
56/** The minimum amount of VRAM. */
57# define VGA_VRAM_MIN (_1M)
58#endif
59
60#ifdef VBOX_WITH_HGSMI
61# include "HGSMI/HGSMIHost.h"
62#endif /* VBOX_WITH_HGSMI */
63#include "DevVGASavedState.h"
64
65#define MSR_COLOR_EMULATION 0x01
66#define MSR_PAGE_SELECT 0x20
67
68#define ST01_V_RETRACE 0x08
69#define ST01_DISP_ENABLE 0x01
70
71/* bochs VBE support */
72#define CONFIG_BOCHS_VBE
73
74#ifdef VBOX
75#define VBE_DISPI_MAX_XRES 16384
76#define VBE_DISPI_MAX_YRES 16384
77#else
78#define VBE_DISPI_MAX_XRES 1600
79#define VBE_DISPI_MAX_YRES 1200
80#endif
81#define VBE_DISPI_MAX_BPP 32
82
83#define VBE_DISPI_INDEX_ID 0x0
84#define VBE_DISPI_INDEX_XRES 0x1
85#define VBE_DISPI_INDEX_YRES 0x2
86#define VBE_DISPI_INDEX_BPP 0x3
87#define VBE_DISPI_INDEX_ENABLE 0x4
88#define VBE_DISPI_INDEX_BANK 0x5
89#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
90#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
91#define VBE_DISPI_INDEX_X_OFFSET 0x8
92#define VBE_DISPI_INDEX_Y_OFFSET 0x9
93#define VBE_DISPI_INDEX_VBOX_VIDEO 0xa
94#define VBE_DISPI_INDEX_NB_SAVED 0xb /* Number of saved registers (vbe_regs array) */
95#define VBE_DISPI_INDEX_NB 0xb /* Total number of VBE registers */
96
97#define VBE_DISPI_ID0 0xB0C0
98#define VBE_DISPI_ID1 0xB0C1
99#define VBE_DISPI_ID2 0xB0C2
100#define VBE_DISPI_ID3 0xB0C3
101#define VBE_DISPI_ID4 0xB0C4
102
103#ifdef VBOX
104/* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_VBOX_VIDEO. */
105#define VBE_DISPI_ID_VBOX_VIDEO 0xBE00
106#ifdef VBOX_WITH_HGSMI
107/* The VBOX interface id. Indicates support for VBVA shared memory interface. */
108#define VBE_DISPI_ID_HGSMI 0xBE01
109#endif /* VBOX_WITH_HGSMI */
110/* Indicates support for unrestricted horizontal resolutions (not multiple of 8). */
111#define VBE_DISPI_ID_ANYX 0xBE02
112#endif /* VBOX */
113
114#define VBE_DISPI_DISABLED 0x00
115#define VBE_DISPI_ENABLED 0x01
116#define VBE_DISPI_GETCAPS 0x02
117#define VBE_DISPI_8BIT_DAC 0x20
118#define VBE_DISPI_LFB_ENABLED 0x40
119#define VBE_DISPI_NOCLEARMEM 0x80
120
121#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
122
123#ifdef CONFIG_BOCHS_VBE
124
125#define VGA_STATE_COMMON_BOCHS_VBE \
126 uint16_t vbe_index; \
127 uint16_t vbe_regs[VBE_DISPI_INDEX_NB_SAVED];\
128 uint32_t vbe_start_addr; \
129 uint32_t vbe_line_offset; \
130 uint32_t vbe_bank_max;
131
132#else
133
134#define VGA_STATE_COMMON_BOCHS_VBE
135
136#endif /* !CONFIG_BOCHS_VBE */
137
138#define CH_ATTR_SIZE (160 * 100)
139#define VGA_MAX_HEIGHT VBE_DISPI_MAX_YRES
140
141typedef struct vga_retrace_s {
142 unsigned frame_cclks; /* Character clocks per frame. */
143 unsigned frame_ns; /* Frame duration in ns. */
144 unsigned cclk_ns; /* Character clock duration in ns. */
145 unsigned vb_start; /* Vertical blanking start (scanline). */
146 unsigned vb_end; /* Vertical blanking end (scanline). */
147 unsigned vb_end_ns; /* Vertical blanking end time (length) in ns. */
148 unsigned vs_start; /* Vertical sync start (scanline). */
149 unsigned vs_end; /* Vertical sync end (scanline). */
150 unsigned vs_start_ns; /* Vertical sync start time in ns. */
151 unsigned vs_end_ns; /* Vertical sync end time in ns. */
152 unsigned h_total; /* Horizontal total (cclks per scanline). */
153 unsigned h_total_ns; /* Scanline duration in ns. */
154 unsigned hb_start; /* Horizontal blanking start (cclk). */
155 unsigned hb_end; /* Horizontal blanking end (cclk). */
156 unsigned hb_end_ns; /* Horizontal blanking end time (length) in ns. */
157 unsigned v_freq_hz; /* Vertical refresh rate to emulate. */
158} vga_retrace_s;
159
160#ifndef VBOX
161#define VGA_STATE_COMMON \
162 uint8_t *vram_ptr; \
163 unsigned long vram_offset; \
164 unsigned int vram_size; \
165 uint32_t latch; \
166 uint8_t sr_index; \
167 uint8_t sr[256]; \
168 uint8_t gr_index; \
169 uint8_t gr[256]; \
170 uint8_t ar_index; \
171 uint8_t ar[21]; \
172 int ar_flip_flop; \
173 uint8_t cr_index; \
174 uint8_t cr[256]; /* CRT registers */ \
175 uint8_t msr; /* Misc Output Register */ \
176 uint8_t fcr; /* Feature Control Register */ \
177 uint8_t st00; /* status 0 */ \
178 uint8_t st01; /* status 1 */ \
179 uint8_t dac_state; \
180 uint8_t dac_sub_index; \
181 uint8_t dac_read_index; \
182 uint8_t dac_write_index; \
183 uint8_t dac_cache[3]; /* used when writing */ \
184 uint8_t palette[768]; \
185 int32_t bank_offset; \
186 int (*get_bpp)(struct VGAState *s); \
187 void (*get_offsets)(struct VGAState *s, \
188 uint32_t *pline_offset, \
189 uint32_t *pstart_addr, \
190 uint32_t *pline_compare); \
191 void (*get_resolution)(struct VGAState *s, \
192 int *pwidth, \
193 int *pheight); \
194 VGA_STATE_COMMON_BOCHS_VBE \
195 /* display refresh support */ \
196 DisplayState *ds; \
197 uint32_t font_offsets[2]; \
198 int graphic_mode; \
199 uint8_t shift_control; \
200 uint8_t double_scan; \
201 uint32_t line_offset; \
202 uint32_t line_compare; \
203 uint32_t start_addr; \
204 uint32_t plane_updated; \
205 uint8_t last_cw, last_ch; \
206 uint32_t last_width, last_height; /* in chars or pixels */ \
207 uint32_t last_scr_width, last_scr_height; /* in pixels */ \
208 uint8_t cursor_start, cursor_end; \
209 uint32_t cursor_offset; \
210 unsigned int (*rgb_to_pixel)(unsigned int r, \
211 unsigned int g, unsigned b); \
212 /* hardware mouse cursor support */ \
213 uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; \
214 void (*cursor_invalidate)(struct VGAState *s); \
215 void (*cursor_draw_line)(struct VGAState *s, uint8_t *d, int y); \
216 /* tell for each page if it has been updated since the last time */ \
217 uint32_t last_palette[256]; \
218 uint32_t last_ch_attr[CH_ATTR_SIZE]; /* XXX: make it dynamic */
219
220#else /* VBOX */
221
222struct VGAState;
223typedef int FNGETBPP(struct VGAState *s);
224typedef void FNGETOFFSETS(struct VGAState *s, uint32_t *pline_offset, uint32_t *pstart_addr, uint32_t *pline_compare);
225typedef void FNGETRESOLUTION(struct VGAState *s, int *pwidth, int *pheight);
226typedef unsigned int FNRGBTOPIXEL(unsigned int r, unsigned int g, unsigned b);
227typedef void FNCURSORINVALIDATE(struct VGAState *s);
228typedef void FNCURSORDRAWLINE(struct VGAState *s, uint8_t *d, int y);
229
230/* bird: vram_offset have been remove, function pointers declared external,
231 some type changes, and some padding have been added. */
232#define VGA_STATE_COMMON \
233 R3PTRTYPE(uint8_t *) vram_ptrR3; \
234 uint32_t vram_size; \
235 uint32_t latch; \
236 uint8_t sr_index; \
237 uint8_t sr[256]; \
238 uint8_t gr_index; \
239 uint8_t gr[256]; \
240 uint8_t ar_index; \
241 uint8_t ar[21]; \
242 int32_t ar_flip_flop; \
243 uint8_t cr_index; \
244 uint8_t cr[256]; /* CRT registers */ \
245 uint8_t msr; /* Misc Output Register */ \
246 uint8_t fcr; /* Feature Control Register */ \
247 uint8_t st00; /* status 0 */ \
248 uint8_t st01; /* status 1 */ \
249 uint8_t dac_state; \
250 uint8_t dac_sub_index; \
251 uint8_t dac_read_index; \
252 uint8_t dac_write_index; \
253 uint8_t dac_cache[3]; /* used when writing */ \
254 uint8_t palette[768]; \
255 int32_t bank_offset; \
256 int32_t padding0; \
257 R3PTRTYPE(FNGETBPP *) get_bpp; \
258 R3PTRTYPE(FNGETOFFSETS *) get_offsets; \
259 R3PTRTYPE(FNGETRESOLUTION *) get_resolution; \
260 VGA_STATE_COMMON_BOCHS_VBE \
261 /* display refresh support */ \
262 uint32_t font_offsets[2]; \
263 int32_t graphic_mode; \
264 uint8_t shift_control; \
265 uint8_t double_scan; \
266 uint8_t padding1[2]; \
267 uint32_t line_offset; \
268 uint32_t line_compare; \
269 uint32_t start_addr; \
270 uint32_t plane_updated; \
271 uint8_t last_cw, last_ch, padding2[2]; \
272 uint32_t last_width, last_height; /* in chars or pixels */ \
273 uint32_t last_scr_width, last_scr_height; /* in pixels */ \
274 uint32_t last_bpp; \
275 uint8_t cursor_start, cursor_end, padding3[2]; \
276 uint32_t cursor_offset; \
277 uint32_t padding4; \
278 R3PTRTYPE(FNRGBTOPIXEL *) rgb_to_pixel; \
279 /* hardware mouse cursor support */ \
280 uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; \
281 R3PTRTYPE(FNCURSORINVALIDATE *) cursor_invalidate; \
282 R3PTRTYPE(FNCURSORDRAWLINE *) cursor_draw_line; \
283 /* tell for each page if it has been updated since the last time */ \
284 uint32_t last_palette[256]; \
285 uint32_t last_ch_attr[CH_ATTR_SIZE]; /* XXX: make it dynamic */
286
287#endif /* VBOX */
288
289#ifdef VBOX_WITH_VDMA
290typedef struct VBOXVDMAHOST *PVBOXVDMAHOST;
291#endif
292
293typedef struct VGAState {
294 VGA_STATE_COMMON
295#ifdef VBOX
296 /** end-of-common-state-marker */
297 uint32_t u32Marker;
298 /** The physical address the VRAM was assigned. */
299 RTGCPHYS32 GCPhysVRAM;
300 /** The R0 vram pointer... */
301 R0PTRTYPE(uint8_t *) vram_ptrR0;
302 /** Pointer to the GC vram mapping. */
303 RCPTRTYPE(uint8_t *) vram_ptrRC;
304 /** LFB was updated flag. */
305 bool fLFBUpdated;
306 /** Indicates if the GC extensions are enabled or not. */
307 bool fGCEnabled;
308 /** Indicates if the R0 extensions are enabled or not. */
309 bool fR0Enabled;
310 /** Flag indicating that there are dirty bits. This is used to optimize the handler resetting. */
311 bool fHasDirtyBits;
312 /** Flag indicating that the VGA memory in the 0xa0000-0xbffff region has been remapped to allow direct access. */
313 bool fRemappedVGA;
314 /** Whether to render the guest VRAM to the framebuffer memory. False only for some LFB modes. */
315 bool fRenderVRAM;
316 bool Padding1[2];
317
318#if HC_ARCH_BITS == 64
319 uint32_t Padding2;
320#endif
321
322#ifdef VBOX_WITH_HGSMI
323 R3PTRTYPE(PHGSMIINSTANCE) pHGSMI;
324#endif /* VBOX_WITH_HGSMI */
325#ifdef VBOX_WITH_VDMA
326 R3PTRTYPE(PVBOXVDMAHOST) pVdma;
327#endif
328
329 uint32_t cMonitors;
330 /** Current refresh timer interval. */
331 uint32_t cMilliesRefreshInterval;
332 /** Refresh timer handle - HC. */
333 PTMTIMERR3 RefreshTimer;
334
335 /** Bitmap tracking dirty pages. */
336 uint32_t au32DirtyBitmap[VGA_VRAM_MAX / PAGE_SIZE / 32];
337 /** Pointer to vgaGCLFBAccessHandler(). */
338 RTRCPTR RCPtrLFBHandler;
339 /** Pointer to the device instance - RC Ptr. */
340 PPDMDEVINSRC pDevInsRC;
341 /** Pointer to the device instance - R3 Ptr. */
342 PPDMDEVINSR3 pDevInsR3;
343 /** Pointer to the device instance - R0 Ptr. */
344 PPDMDEVINSR0 pDevInsR0;
345
346 /** The critical section. */
347 PDMCRITSECT lock;
348
349 /** LUN\#0: The display port base interface. */
350 PDMIBASE IBase;
351 /** LUN\#0: The display port interface. */
352 PDMIDISPLAYPORT IPort;
353#if defined(VBOX_WITH_HGSMI) && (defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_WITH_CRHGSMI))
354 /** LUN\#0: VBVA callbacks interface */
355 PDMIDISPLAYVBVACALLBACKS IVBVACallbacks;
356#else
357# if HC_ARCH_BITS == 32
358 uint32_t Padding3;
359# endif
360#endif
361 /** Pointer to base interface of the driver. */
362 R3PTRTYPE(PPDMIBASE) pDrvBase;
363 /** Pointer to display connector interface of the driver. */
364 R3PTRTYPE(PPDMIDISPLAYCONNECTOR) pDrv;
365
366 /** The PCI device. */
367 PCIDEVICE Dev;
368
369 STAMPROFILE StatRZMemoryRead;
370 STAMPROFILE StatR3MemoryRead;
371 STAMPROFILE StatRZMemoryWrite;
372 STAMPROFILE StatR3MemoryWrite;
373 STAMCOUNTER StatMapPage; /**< Counts IOMMMIOMapMMIO2Page calls. */
374 STAMCOUNTER StatUpdateDisp; /**< Counts vgaPortUpdateDisplay calls. */
375
376 /* Keep track of ring 0 latched accesses to the VGA MMIO memory. */
377 uint64_t u64LastLatchedAccess;
378 uint32_t cLatchAccesses;
379 uint16_t uMaskLatchAccess;
380 uint16_t iMask;
381
382#ifdef VBE_BYTEWISE_IO
383 /** VBE read/write data/index flags */
384 uint8_t fReadVBEData;
385 uint8_t fWriteVBEData;
386 uint8_t fReadVBEIndex;
387 uint8_t fWriteVBEIndex;
388 /** VBE write data/index one byte buffer */
389 uint8_t cbWriteVBEData;
390 uint8_t cbWriteVBEIndex;
391# ifdef VBE_NEW_DYN_LIST
392 /** VBE Extra Data write address one byte buffer */
393 uint8_t cbWriteVBEExtraAddress;
394 uint8_t Padding4;
395# else
396 uint8_t Padding4[2];
397# endif
398#endif
399
400 /** Retrace emulation state */
401 bool fRealRetrace;
402 bool Padding5[HC_ARCH_BITS == 64 ? 7 : 3];
403 vga_retrace_s retrace_state;
404
405#ifdef VBE_NEW_DYN_LIST
406 /** The VBE BIOS extra data. */
407 R3PTRTYPE(uint8_t *) pu8VBEExtraData;
408 /** The size of the VBE BIOS extra data. */
409 uint16_t cbVBEExtraData;
410 /** The VBE BIOS current memory address. */
411 uint16_t u16VBEExtraAddress;
412 uint16_t Padding6[2];
413#endif
414 /** Current logo data offset. */
415 uint32_t offLogoData;
416 /** The size of the BIOS logo data. */
417 uint32_t cbLogo;
418 /** The BIOS logo data. */
419 R3PTRTYPE(uint8_t *) pu8Logo;
420 /** The name of the logo file. */
421 R3PTRTYPE(char *) pszLogoFile;
422 /** Bitmap image data. */
423 R3PTRTYPE(uint8_t *) pu8LogoBitmap;
424 /** Current logo command. */
425 uint16_t LogoCommand;
426 /** Bitmap width. */
427 uint16_t cxLogo;
428 /** Bitmap height. */
429 uint16_t cyLogo;
430 /** Bitmap planes. */
431 uint16_t cLogoPlanes;
432 /** Bitmap depth. */
433 uint16_t cLogoBits;
434 /** Bitmap compression. */
435 uint16_t LogoCompression;
436 /** Bitmap colors used. */
437 uint16_t cLogoUsedColors;
438 /** Palette size. */
439 uint16_t cLogoPalEntries;
440 /** Clear screen flag. */
441 uint8_t fLogoClearScreen;
442 uint8_t Padding7[7];
443 /** Palette data. */
444 uint32_t au32LogoPalette[256];
445 /** The VGA BIOS ROM data. */
446 R3PTRTYPE(uint8_t *) pu8VgaBios;
447 /** The size of the VGA BIOS ROM. */
448 uint64_t cbVgaBios;
449 /** The name of the VGA BIOS ROM file. */
450 R3PTRTYPE(char *) pszVgaBiosFile;
451#endif /* VBOX */
452#ifdef VBOX_WITH_HGSMI
453 /** Base port in the assigned PCI I/O space. */
454 RTIOPORT IOPortBase;
455#ifdef VBOX_WITH_WDDM
456 uint8_t Padding8[2];
457 /* specifies guest driver caps, i.e. whether it can handle IRQs from the adapter,
458 * the way it can handle async HGSMI command completion, etc. */
459 uint32_t fGuestCaps;
460#else
461 uint8_t Padding8[6];
462#endif
463#endif /* VBOX_WITH_HGSMI */
464} VGAState;
465#ifdef VBOX
466/** VGA state. */
467typedef VGAState VGASTATE;
468/** Pointer to the VGA state. */
469typedef VGASTATE *PVGASTATE;
470#endif
471
472#ifdef VBE_NEW_DYN_LIST
473/**
474 * VBE Bios Extra Data structure.
475 * @remark duplicated in vbe.h.
476 */
477typedef struct VBEHeader
478{
479 /** Signature (VBEHEADER_MAGIC). */
480 uint16_t u16Signature;
481 /** Data size. */
482 uint16_t cbData;
483} VBEHeader;
484
485/** VBE Extra Data. */
486typedef VBEHeader VBEHEADER;
487/** Pointer to the VBE Extra Data. */
488typedef VBEHEADER *PVBEHEADER;
489
490/** The value of the VBEHEADER::u16Signature field.
491 * @remark duplicated in vbe.h. */
492#define VBEHEADER_MAGIC 0x77CC
493
494/** The extra port which is used to read the mode list.
495 * @remark duplicated in vbe.h. */
496#define VBE_EXTRA_PORT 0x3b6
497
498/** The extra port which is used for debug printf.
499 * @remark duplicated in vbe.h. */
500#define VBE_PRINTF_PORT 0x3b7
501
502#endif /* VBE_NEW_DYN_LIST */
503
504#if !defined(VBOX) || defined(IN_RING3)
505static inline int c6_to_8(int v)
506{
507 int b;
508 v &= 0x3f;
509 b = v & 1;
510 return (v << 2) | (b << 1) | b;
511}
512#endif /* !VBOX || IN_RING3 */
513
514
515#ifdef VBOX_WITH_HGSMI
516int VBVAInit (PVGASTATE pVGAState);
517void VBVADestroy (PVGASTATE pVGAState);
518int VBVAUpdateDisplay (PVGASTATE pVGAState);
519void VBVAReset (PVGASTATE pVGAState);
520
521bool VBVAIsEnabled(PVGASTATE pVGAState);
522
523/* @return host-guest flags that were set on reset
524 * this allows the caller to make further cleaning when needed,
525 * e.g. reset the IRQ */
526uint32_t HGSMIReset (PHGSMIINSTANCE pIns);
527
528# ifdef VBOX_WITH_VIDEOHWACCEL
529int vbvaVHWACommandCompleteAsynch(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd);
530int vbvaVHWAConstruct (PVGASTATE pVGAState);
531int vbvaVHWADisable (PVGASTATE pVGAState);
532int vbvaVHWAReset (PVGASTATE pVGAState);
533
534int vboxVBVASaveStatePrep (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
535# endif
536
537#ifdef VBOX_WITH_HGSMI
538#define PPDMIDISPLAYVBVACALLBACKS_2_PVGASTATE(_pcb) ( (PVGASTATE)((uint8_t *)(_pcb) - RT_OFFSETOF(VGASTATE, IVBVACallbacks)) )
539#endif
540
541# ifdef VBOX_WITH_CRHGSMI
542int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
543int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
544# endif
545
546int vboxVBVASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
547int vboxVBVALoadStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t u32Version);
548int vboxVBVALoadStateDone (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
549
550# ifdef VBOX_WITH_VDMA
551typedef struct VBOXVDMAHOST *PVBOXVDMAHOST;
552int vboxVDMAConstruct(PVGASTATE pVGAState, struct VBOXVDMAHOST **ppVdma, uint32_t cPipeElements);
553int vboxVDMADestruct(PVBOXVDMAHOST pVdma);
554void vboxVDMAControl(PVBOXVDMAHOST pVdma, PVBOXVDMA_CTL pCmd);
555void vboxVDMACommand(PVBOXVDMAHOST pVdma, PVBOXVDMACBUF_DR pCmd);
556bool vboxVDMAIsEnabled(PVBOXVDMAHOST pVdma);
557# endif /* VBOX_WITH_VDMA */
558
559#endif /* VBOX_WITH_HGSMI */
560
561#ifndef VBOX
562void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
563 unsigned long vga_ram_offset, int vga_ram_size);
564uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr);
565void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val);
566void vga_invalidate_scanlines(VGAState *s, int y1, int y2);
567
568void vga_draw_cursor_line_8(uint8_t *d1, const uint8_t *src1,
569 int poffset, int w,
570 unsigned int color0, unsigned int color1,
571 unsigned int color_xor);
572void vga_draw_cursor_line_16(uint8_t *d1, const uint8_t *src1,
573 int poffset, int w,
574 unsigned int color0, unsigned int color1,
575 unsigned int color_xor);
576void vga_draw_cursor_line_32(uint8_t *d1, const uint8_t *src1,
577 int poffset, int w,
578 unsigned int color0, unsigned int color1,
579 unsigned int color_xor);
580
581extern const uint8_t sr_mask[8];
582extern const uint8_t gr_mask[16];
583#endif /* !VBOX */
584
Note: See TracBrowser for help on using the repository browser.

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