VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h@ 86855

Last change on this file since 86855 was 86855, checked in by vboxsync, 4 years ago

Devices/Graphics: Monitor the guest access to ObjectTables; use array of OTables; SVGA3D_DEVCAP logging. bugref:9830

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.0 KB
Line 
1/* $Id: DevVGA-SVGA.h 86855 2020-11-11 01:03:54Z vboxsync $ */
2/** @file
3 * VMware SVGA device
4 */
5/*
6 * Copyright (C) 2013-2020 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA_h
18#define VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA_h
19#ifndef RT_WITHOUT_PRAGMA_ONCE
20# pragma once
21#endif
22
23#ifndef VBOX_WITH_VMSVGA
24# error "VBOX_WITH_VMSVGA is not defined"
25#endif
26
27#define VMSVGA_USE_EMT_HALT_CODE
28
29#include <VBox/pci.h>
30#include <VBox/vmm/pdmifs.h>
31#include <VBox/vmm/pdmthread.h>
32#include <VBox/vmm/stam.h>
33#ifdef VMSVGA_USE_EMT_HALT_CODE
34# include <VBox/vmm/vmapi.h>
35# include <VBox/vmm/vmcpuset.h>
36#endif
37
38/*
39 * PCI device IDs.
40 */
41#ifndef PCI_VENDOR_ID_VMWARE
42# define PCI_VENDOR_ID_VMWARE 0x15AD
43#endif
44#ifndef PCI_DEVICE_ID_VMWARE_SVGA2
45# define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
46#endif
47
48/* For "svga_overlay.h" */
49#ifndef TRUE
50# define TRUE 1
51#endif
52#ifndef FALSE
53# define FALSE 0
54#endif
55
56/* GCC complains that 'ISO C++ prohibits anonymous structs' when "-Wpedantic" is enabled. */
57#if RT_GNUC_PREREQ(4, 6)
58# pragma GCC diagnostic push
59# pragma GCC diagnostic ignored "-Wpedantic"
60#endif
61/* VMSVGA headers from SVGA Gallium driver. */
62#pragma pack(1) /* VMSVGA structures are '__packed'. */
63#include <svga3d_caps.h>
64#include <svga3d_reg.h>
65#include <svga3d_shaderdefs.h>
66#include <svga_escape.h>
67#include <svga_overlay.h>
68#pragma pack()
69#if RT_GNUC_PREREQ(4, 6)
70# pragma GCC diagnostic pop
71#endif
72
73/* Deprecated commands. They are not included in the VMSVGA headers anymore. */
74#define SVGA_CMD_RECT_FILL 2
75#define SVGA_CMD_DISPLAY_CURSOR 20
76#define SVGA_CMD_MOVE_CURSOR 21
77
78/*
79 * SVGA_CMD_RECT_FILL --
80 *
81 * Fill a rectangular area in the the GFB, and copy the result
82 * to any screens which intersect it.
83 *
84 * Deprecated?
85 *
86 * Availability:
87 * SVGA_CAP_RECT_FILL
88 */
89
90typedef
91struct {
92 uint32_t pixel;
93 uint32_t destX;
94 uint32_t destY;
95 uint32_t width;
96 uint32_t height;
97} SVGAFifoCmdRectFill;
98
99/*
100 * SVGA_CMD_DISPLAY_CURSOR --
101 *
102 * Turn the cursor on or off.
103 *
104 * Deprecated.
105 *
106 * Availability:
107 * SVGA_CAP_CURSOR?
108 */
109
110typedef
111struct {
112 uint32_t id; // Reserved, must be zero.
113 uint32_t state; // 0=off
114} SVGAFifoCmdDisplayCursor;
115
116/*
117 * SVGA_CMD_MOVE_CURSOR --
118 *
119 * Set the cursor position.
120 *
121 * Deprecated.
122 *
123 * Availability:
124 * SVGA_CAP_CURSOR?
125 */
126
127typedef
128struct {
129 SVGASignedPoint pos;
130} SVGAFifoCmdMoveCursor;
131
132
133/** Default FIFO size. */
134#define VMSVGA_FIFO_SIZE _2M
135/** The old FIFO size. */
136#define VMSVGA_FIFO_SIZE_OLD _128K
137
138/** Default scratch region size. */
139#define VMSVGA_SCRATCH_SIZE 0x100
140/** Surface memory available to the guest. */
141#define VMSVGA_SURFACE_SIZE (512*1024*1024)
142/** Maximum GMR pages. */
143#define VMSVGA_MAX_GMR_PAGES 0x100000
144/** Maximum nr of GMR ids. */
145#define VMSVGA_MAX_GMR_IDS _8K
146/** Maximum number of GMR descriptors. */
147#define VMSVGA_MAX_GMR_DESC_LOOP_COUNT VMSVGA_MAX_GMR_PAGES
148
149#define VMSVGA_VAL_UNINITIALIZED (unsigned)-1
150
151/** For validating X and width values.
152 * The code assumes it's at least an order of magnitude less than UINT32_MAX. */
153#define VMSVGA_MAX_X _1M
154/** For validating Y and height values.
155 * The code assumes it's at least an order of magnitude less than UINT32_MAX. */
156#define VMSVGA_MAX_Y _1M
157
158/* u32ActionFlags */
159#define VMSVGA_ACTION_CHANGEMODE_BIT 0
160#define VMSVGA_ACTION_CHANGEMODE RT_BIT(VMSVGA_ACTION_CHANGEMODE_BIT)
161
162
163#ifdef DEBUG
164/* Enable to log FIFO register accesses. */
165//# define DEBUG_FIFO_ACCESS
166/* Enable to log GMR page accesses. */
167//# define DEBUG_GMR_ACCESS
168#endif
169
170#define VMSVGA_FIFO_EXTCMD_NONE 0
171#define VMSVGA_FIFO_EXTCMD_TERMINATE 1
172#define VMSVGA_FIFO_EXTCMD_SAVESTATE 2
173#define VMSVGA_FIFO_EXTCMD_LOADSTATE 3
174#define VMSVGA_FIFO_EXTCMD_RESET 4
175#define VMSVGA_FIFO_EXTCMD_UPDATE_SURFACE_HEAP_BUFFERS 5
176#define VMSVGA_FIFO_EXTCMD_POWEROFF 6
177
178/** Size of the region to backup when switching into svga mode. */
179#define VMSVGA_VGA_FB_BACKUP_SIZE _512K
180
181/** @def VMSVGA_WITH_VGA_FB_BACKUP
182 * Enables correct VGA MMIO read/write handling when VMSVGA is enabled. It
183 * is SLOW and probably not entirely right, but it helps with getting 3dmark
184 * output and other stuff. */
185#define VMSVGA_WITH_VGA_FB_BACKUP 1
186
187/** @def VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RING3
188 * defined(VMSVGA_WITH_VGA_FB_BACKUP) && defined(IN_RING3) */
189#if (defined(VMSVGA_WITH_VGA_FB_BACKUP) && defined(IN_RING3)) || defined(DOXYGEN_RUNNING)
190# define VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RING3 1
191#else
192# undef VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RING3
193#endif
194
195/** @def VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RZ
196 * defined(VMSVGA_WITH_VGA_FB_BACKUP) && !defined(IN_RING3) */
197#if (defined(VMSVGA_WITH_VGA_FB_BACKUP) && !defined(IN_RING3)) || defined(DOXYGEN_RUNNING)
198# define VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RZ 1
199#else
200# undef VMSVGA_WITH_VGA_FB_BACKUP_AND_IN_RZ
201#endif
202
203
204typedef struct
205{
206 PSSMHANDLE pSSM;
207 uint32_t uVersion;
208 uint32_t uPass;
209} VMSVGA_STATE_LOAD;
210typedef VMSVGA_STATE_LOAD *PVMSVGA_STATE_LOAD;
211
212/** Host screen viewport.
213 * (4th quadrant with negated Y values - usual Windows and X11 world view.) */
214typedef struct VMSVGAVIEWPORT
215{
216 uint32_t x; /**< x coordinate (left). */
217 uint32_t y; /**< y coordinate (top). */
218 uint32_t cx; /**< width. */
219 uint32_t cy; /**< height. */
220 /** Right side coordinate (exclusive). Same as x + cx. */
221 uint32_t xRight;
222 /** First quadrant low y coordinate.
223 * Same as y + cy - 1 in window coordinates. */
224 uint32_t yLowWC;
225 /** First quadrant high y coordinate (exclusive) - yLowWC + cy.
226 * Same as y - 1 in window coordinates. */
227 uint32_t yHighWC;
228 /** Alignment padding. */
229 uint32_t uAlignment;
230} VMSVGAVIEWPORT;
231
232#ifdef VBOX_WITH_VMSVGA3D
233typedef struct VMSVGAHWSCREEN *PVMSVGAHWSCREEN;
234#endif
235
236/**
237 * Screen object state.
238 */
239typedef struct VMSVGASCREENOBJECT
240{
241 /** SVGA_SCREEN_* flags. */
242 uint32_t fuScreen;
243 /** The screen object id. */
244 uint32_t idScreen;
245 /** The screen dimensions. */
246 int32_t xOrigin;
247 int32_t yOrigin;
248 uint32_t cWidth;
249 uint32_t cHeight;
250 /** Offset of the screen buffer in the guest VRAM. */
251 uint32_t offVRAM;
252 /** Scanline pitch. */
253 uint32_t cbPitch;
254 /** Bits per pixel. */
255 uint32_t cBpp;
256 /** The physical DPI that the guest expects for this screen. Zero, if the guest is not DPI aware. */
257 uint32_t cDpi;
258 bool fDefined;
259 bool fModified;
260 void *pvScreenBitmap;
261#ifdef VBOX_WITH_VMSVGA3D
262 /** Pointer to the HW accelerated (3D) screen data. */
263 R3PTRTYPE(PVMSVGAHWSCREEN) pHwScreen;
264#endif
265} VMSVGASCREENOBJECT;
266
267/** Pointer to the private VMSVGA ring-3 state structure.
268 * @todo Still not entirely satisfired with the type name, but better than
269 * the previous lower/upper case only distinction. */
270typedef struct VMSVGAR3STATE *PVMSVGAR3STATE;
271/** Pointer to the private (implementation specific) VMSVGA3d state. */
272typedef struct VMSVGA3DSTATE *PVMSVGA3DSTATE;
273
274
275/**
276 * The VMSVGA device state.
277 *
278 * This instantatiated as VGASTATE::svga.
279 */
280typedef struct VMSVGAState
281{
282 /** Guest physical address of the FIFO memory range. */
283 RTGCPHYS GCPhysFIFO;
284 /** Size in bytes of the FIFO memory range.
285 * This may be smaller than cbFIFOConfig after restoring an old VM state. */
286 uint32_t cbFIFO;
287 /** The configured FIFO size. */
288 uint32_t cbFIFOConfig;
289 /** SVGA id. */
290 uint32_t u32SVGAId;
291 /** SVGA extensions enabled or not. */
292 uint32_t fEnabled;
293 /** SVGA memory area configured status. */
294 uint32_t fConfigured;
295 /** Device is busy handling FIFO requests (VMSVGA_BUSY_F_FIFO,
296 * VMSVGA_BUSY_F_EMT_FORCE). */
297 uint32_t volatile fBusy;
298#define VMSVGA_BUSY_F_FIFO RT_BIT_32(0) /**< The normal true/false busy FIFO bit. */
299#define VMSVGA_BUSY_F_EMT_FORCE RT_BIT_32(1) /**< Bit preventing race status flickering when EMT kicks the FIFO thread. */
300 /** Traces (dirty page detection) enabled or not. */
301 uint32_t fTraces;
302 /** Guest OS identifier. */
303 uint32_t u32GuestId;
304 /** Scratch region size (VMSVGAState::au32ScratchRegion). */
305 uint32_t cScratchRegion;
306 /** Irq status. */
307 uint32_t u32IrqStatus;
308 /** Irq mask. */
309 uint32_t u32IrqMask;
310 /** Pitch lock. */
311 uint32_t u32PitchLock;
312 /** Current GMR id. (SVGA_REG_GMR_ID) */
313 uint32_t u32CurrentGMRId;
314 /** SVGA device capabilities. */
315 uint32_t u32DeviceCaps;
316 uint32_t Padding0; /* Used to be I/O port base address. */
317 /** Port io index register. */
318 uint32_t u32IndexReg;
319 /** FIFO request semaphore. */
320 SUPSEMEVENT hFIFORequestSem;
321 /** The last seen SVGA_FIFO_CURSOR_COUNT value.
322 * Used by the FIFO thread and its watchdog. */
323 uint32_t uLastCursorUpdateCount;
324 /** Indicates that the FIFO thread is sleeping and might need waking up. */
325 bool volatile fFIFOThreadSleeping;
326 /** The legacy GFB mode registers. If used, they correspond to screen 0. */
327 /** True when the guest modifies the GFB mode registers. */
328 bool fGFBRegisters;
329 /** SVGA 3D overlay enabled or not. */
330 bool f3DOverlayEnabled;
331 /** Indicates that the guest behaves incorrectly. */
332 bool volatile fBadGuest;
333 bool afPadding[4];
334 uint32_t uWidth;
335 uint32_t uHeight;
336 uint32_t uBpp;
337 uint32_t cbScanline;
338 uint32_t uHostBpp;
339 /** Maximum width supported. */
340 uint32_t u32MaxWidth;
341 /** Maximum height supported. */
342 uint32_t u32MaxHeight;
343 /** Viewport rectangle, i.e. what's currently visible of the target host
344 * window. This is usually (0,0)(uWidth,uHeight), but if the window is
345 * shrunk and scrolling applied, both the origin and size may differ. */
346 VMSVGAVIEWPORT viewport;
347 /** Action flags */
348 uint32_t u32ActionFlags;
349 /** SVGA 3d extensions enabled or not. */
350 bool f3DEnabled;
351 /** VRAM page monitoring enabled or not. */
352 bool fVRAMTracking;
353 /** External command to be executed in the FIFO thread. */
354 uint8_t volatile u8FIFOExtCommand;
355 /** Set by vmsvgaR3RunExtCmdOnFifoThread when it temporarily resumes the FIFO
356 * thread and does not want it do anything but the command. */
357 bool volatile fFifoExtCommandWakeup;
358#ifdef DEBUG_GMR_ACCESS
359 /** GMR debug access handler type handle. */
360 PGMPHYSHANDLERTYPE hGmrAccessHandlerType;
361#endif
362#if defined(VMSVGA_USE_FIFO_ACCESS_HANDLER) || defined(DEBUG_FIFO_ACCESS)
363 /** FIFO debug access handler type handle. */
364 PGMPHYSHANDLERTYPE hFifoAccessHandlerType;
365#elif defined(DEBUG_GMR_ACCESS)
366 uint32_t uPadding1;
367#endif
368 /** Number of GMRs (VMSVGA_MAX_GMR_IDS, count of elements in VMSVGAR3STATE::paGMR array). */
369 uint32_t cGMR;
370 uint32_t uScreenOffset; /* Used only for loading older saved states. */
371
372 /** Legacy cursor state. */
373 uint32_t uCursorX;
374 uint32_t uCursorY;
375 uint32_t uCursorID;
376 uint32_t uCursorOn;
377
378 /** Scratch array.
379 * Putting this at the end since it's big it probably not . */
380 uint32_t au32ScratchRegion[VMSVGA_SCRATCH_SIZE];
381
382 /** Array of SVGA3D_DEVCAP values, which are accessed via SVGA_REG_DEV_CAP. */
383 uint32_t au32DevCaps[SVGA3D_DEVCAP_MAX];
384 /** Index written to the SVGA_REG_DEV_CAP register. */
385 uint32_t u32DevCapIndex;
386 /** Low 32 bit of a command buffer address written to the SVGA_REG_COMMAND_LOW register. */
387 uint32_t u32RegCommandLow;
388 /** High 32 bit of a command buffer address written to the SVGA_REG_COMMAND_HIGH register. */
389 uint32_t u32RegCommandHigh;
390
391 STAMCOUNTER StatRegBitsPerPixelWr;
392 STAMCOUNTER StatRegBusyWr;
393 STAMCOUNTER StatRegCursorXWr;
394 STAMCOUNTER StatRegCursorYWr;
395 STAMCOUNTER StatRegCursorIdWr;
396 STAMCOUNTER StatRegCursorOnWr;
397 STAMCOUNTER StatRegDepthWr;
398 STAMCOUNTER StatRegDisplayHeightWr;
399 STAMCOUNTER StatRegDisplayIdWr;
400 STAMCOUNTER StatRegDisplayIsPrimaryWr;
401 STAMCOUNTER StatRegDisplayPositionXWr;
402 STAMCOUNTER StatRegDisplayPositionYWr;
403 STAMCOUNTER StatRegDisplayWidthWr;
404 STAMCOUNTER StatRegEnableWr;
405 STAMCOUNTER StatRegGmrIdWr;
406 STAMCOUNTER StatRegGuestIdWr;
407 STAMCOUNTER StatRegHeightWr;
408 STAMCOUNTER StatRegIdWr;
409 STAMCOUNTER StatRegIrqMaskWr;
410 STAMCOUNTER StatRegNumDisplaysWr;
411 STAMCOUNTER StatRegNumGuestDisplaysWr;
412 STAMCOUNTER StatRegPaletteWr;
413 STAMCOUNTER StatRegPitchLockWr;
414 STAMCOUNTER StatRegPseudoColorWr;
415 STAMCOUNTER StatRegReadOnlyWr;
416 STAMCOUNTER StatRegScratchWr;
417 STAMCOUNTER StatRegSyncWr;
418 STAMCOUNTER StatRegTopWr;
419 STAMCOUNTER StatRegTracesWr;
420 STAMCOUNTER StatRegUnknownWr;
421 STAMCOUNTER StatRegWidthWr;
422 STAMCOUNTER StatRegCommandLowWr;
423 STAMCOUNTER StatRegCommandHighWr;
424 STAMCOUNTER StatRegDevCapWr;
425 STAMCOUNTER StatRegCmdPrependLowWr;
426 STAMCOUNTER StatRegCmdPrependHighWr;
427
428 STAMCOUNTER StatRegBitsPerPixelRd;
429 STAMCOUNTER StatRegBlueMaskRd;
430 STAMCOUNTER StatRegBusyRd;
431 STAMCOUNTER StatRegBytesPerLineRd;
432 STAMCOUNTER StatRegCapabilitesRd;
433 STAMCOUNTER StatRegConfigDoneRd;
434 STAMCOUNTER StatRegCursorXRd;
435 STAMCOUNTER StatRegCursorYRd;
436 STAMCOUNTER StatRegCursorIdRd;
437 STAMCOUNTER StatRegCursorOnRd;
438 STAMCOUNTER StatRegDepthRd;
439 STAMCOUNTER StatRegDisplayHeightRd;
440 STAMCOUNTER StatRegDisplayIdRd;
441 STAMCOUNTER StatRegDisplayIsPrimaryRd;
442 STAMCOUNTER StatRegDisplayPositionXRd;
443 STAMCOUNTER StatRegDisplayPositionYRd;
444 STAMCOUNTER StatRegDisplayWidthRd;
445 STAMCOUNTER StatRegEnableRd;
446 STAMCOUNTER StatRegFbOffsetRd;
447 STAMCOUNTER StatRegFbSizeRd;
448 STAMCOUNTER StatRegFbStartRd;
449 STAMCOUNTER StatRegGmrIdRd;
450 STAMCOUNTER StatRegGmrMaxDescriptorLengthRd;
451 STAMCOUNTER StatRegGmrMaxIdsRd;
452 STAMCOUNTER StatRegGmrsMaxPagesRd;
453 STAMCOUNTER StatRegGreenMaskRd;
454 STAMCOUNTER StatRegGuestIdRd;
455 STAMCOUNTER StatRegHeightRd;
456 STAMCOUNTER StatRegHostBitsPerPixelRd;
457 STAMCOUNTER StatRegIdRd;
458 STAMCOUNTER StatRegIrqMaskRd;
459 STAMCOUNTER StatRegMaxHeightRd;
460 STAMCOUNTER StatRegMaxWidthRd;
461 STAMCOUNTER StatRegMemorySizeRd;
462 STAMCOUNTER StatRegMemRegsRd;
463 STAMCOUNTER StatRegMemSizeRd;
464 STAMCOUNTER StatRegMemStartRd;
465 STAMCOUNTER StatRegNumDisplaysRd;
466 STAMCOUNTER StatRegNumGuestDisplaysRd;
467 STAMCOUNTER StatRegPaletteRd;
468 STAMCOUNTER StatRegPitchLockRd;
469 STAMCOUNTER StatRegPsuedoColorRd;
470 STAMCOUNTER StatRegRedMaskRd;
471 STAMCOUNTER StatRegScratchRd;
472 STAMCOUNTER StatRegScratchSizeRd;
473 STAMCOUNTER StatRegSyncRd;
474 STAMCOUNTER StatRegTopRd;
475 STAMCOUNTER StatRegTracesRd;
476 STAMCOUNTER StatRegUnknownRd;
477 STAMCOUNTER StatRegVramSizeRd;
478 STAMCOUNTER StatRegWidthRd;
479 STAMCOUNTER StatRegWriteOnlyRd;
480 STAMCOUNTER StatRegCommandLowRd;
481 STAMCOUNTER StatRegCommandHighRd;
482 STAMCOUNTER StatRegMaxPrimBBMemRd;
483 STAMCOUNTER StatRegGBMemSizeRd;
484 STAMCOUNTER StatRegDevCapRd;
485 STAMCOUNTER StatRegCmdPrependLowRd;
486 STAMCOUNTER StatRegCmdPrependHighRd;
487 STAMCOUNTER StatRegScrnTgtMaxWidthRd;
488 STAMCOUNTER StatRegScrnTgtMaxHeightRd;
489 STAMCOUNTER StatRegMobMaxSizeRd;
490} VMSVGAState, VMSVGASTATE;
491
492
493/**
494 * The VMSVGA device state for ring-3
495 *
496 * This instantatiated as VGASTATER3::svga.
497 */
498typedef struct VMSVGASTATER3
499{
500 /** The R3 FIFO pointer. */
501 R3PTRTYPE(uint32_t *) pau32FIFO;
502 /** R3 Opaque pointer to svga state. */
503 R3PTRTYPE(PVMSVGAR3STATE) pSvgaR3State;
504 /** R3 Opaque pointer to 3d state. */
505 R3PTRTYPE(PVMSVGA3DSTATE) p3dState;
506 /** The separate VGA frame buffer in svga mode.
507 * Unlike the the boch-based VGA device implementation, VMSVGA seems to have a
508 * separate frame buffer for VGA and allows concurrent use of both. The SVGA
509 * SDK is making use of this to do VGA text output while testing other things in
510 * SVGA mode, displaying the result by switching back to VGA text mode. So,
511 * when entering SVGA mode we copy the first part of the frame buffer here and
512 * direct VGA accesses here instead. It is copied back when leaving SVGA mode. */
513 R3PTRTYPE(uint8_t *) pbVgaFrameBufferR3;
514 /** R3 Opaque pointer to an external fifo cmd parameter. */
515 R3PTRTYPE(void * volatile) pvFIFOExtCmdParam;
516
517 /** FIFO external command semaphore. */
518 R3PTRTYPE(RTSEMEVENT) hFIFOExtCmdSem;
519 /** FIFO IO Thread. */
520 R3PTRTYPE(PPDMTHREAD) pFIFOIOThread;
521} VMSVGASTATER3;
522
523
524/**
525 * The VMSVGA device state for ring-0
526 *
527 * This instantatiated as VGASTATER0::svga.
528 */
529typedef struct VMSVGASTATER0
530{
531 /** The R0 FIFO pointer.
532 * @note This only points to the _first_ _page_ of the FIFO! */
533 R0PTRTYPE(uint32_t *) pau32FIFO;
534} VMSVGASTATER0;
535
536
537typedef struct VGAState *PVGASTATE;
538typedef struct VGASTATER3 *PVGASTATER3;
539typedef struct VGASTATER0 *PVGASTATER0;
540typedef struct VGASTATERC *PVGASTATERC;
541typedef CTX_SUFF(PVGASTATE) PVGASTATECC;
542
543DECLCALLBACK(int) vmsvgaR3PciIORegionFifoMapUnmap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
544 RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType);
545DECLCALLBACK(VBOXSTRICTRC) vmsvgaIORead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb);
546DECLCALLBACK(VBOXSTRICTRC) vmsvgaIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb);
547
548DECLCALLBACK(void) vmsvgaR3PortSetViewport(PPDMIDISPLAYPORT pInterface, uint32_t uScreenId,
549 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
550DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PCRTPOINT paPositions);
551
552int vmsvgaR3Init(PPDMDEVINS pDevIns);
553int vmsvgaR3Reset(PPDMDEVINS pDevIns);
554int vmsvgaR3Destruct(PPDMDEVINS pDevIns);
555int vmsvgaR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
556int vmsvgaR3LoadDone(PPDMDEVINS pDevIns);
557int vmsvgaR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
558DECLCALLBACK(void) vmsvgaR3PowerOn(PPDMDEVINS pDevIns);
559DECLCALLBACK(void) vmsvgaR3PowerOff(PPDMDEVINS pDevIns);
560void vmsvgaR3FifoWatchdogTimer(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC);
561
562#ifdef IN_RING3
563VMSVGASCREENOBJECT *vmsvgaR3GetScreenObject(PVGASTATECC pThisCC, uint32_t idScreen);
564int vmsvgaR3UpdateScreen(PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen, int x, int y, int w, int h);
565#endif
566
567int vmsvgaR3GmrTransfer(PVGASTATE pThis, PVGASTATECC pThisCC, const SVGA3dTransferType enmTransferType,
568 uint8_t *pbHstBuf, uint32_t cbHstBuf, uint32_t offHst, int32_t cbHstPitch,
569 SVGAGuestPtr gstPtr, uint32_t offGst, int32_t cbGstPitch,
570 uint32_t cbWidth, uint32_t cHeight);
571
572void vmsvgaR3ClipCopyBox(const SVGA3dSize *pSizeSrc, const SVGA3dSize *pSizeDest, SVGA3dCopyBox *pBox);
573void vmsvgaR3ClipBox(const SVGA3dSize *pSize, SVGA3dBox *pBox);
574void vmsvgaR3ClipRect(SVGASignedRect const *pBound, SVGASignedRect *pRect);
575void vmsvgaR3Clip3dRect(SVGA3dRect const *pBound, SVGA3dRect RT_UNTRUSTED_GUEST *pRect);
576
577#endif /* !VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA_h */
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