DevVGA.h revision 5e8c0a7c352f2c22df71c2c9a7be01a9b337f688
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * DevVGA - VBox VGA/VESA device, internal header.
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * Copyright (C) 2006-2007 Oracle Corporation
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * This file is part of VirtualBox Open Source Edition (OSE), as
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * available from http://www.virtualbox.org. This file is free software;
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * you can redistribute it and/or modify it under the terms of the GNU
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * General Public License (GPL) as published by the Free Software
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * Foundation, in version 2 as it comes in the "COPYING" file of the
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * --------------------------------------------------------------------
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * This code is based on:
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * QEMU internal VGA defines.
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * Copyright (c) 2003-2004 Fabrice Bellard
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * Permission is hereby granted, free of charge, to any person obtaining a copy
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * of this software and associated documentation files (the "Software"), to deal
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * in the Software without restriction, including without limitation the rights
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * copies of the Software, and to permit persons to whom the Software is
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * furnished to do so, subject to the following conditions:
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * The above copyright notice and this permission notice shall be included in
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * all copies or substantial portions of the Software.
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major * THE SOFTWARE.
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/** The default amount of VRAM. */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/** The maximum amount of VRAM. Limited by VBOX_MAX_ALLOC_PAGE_COUNT. */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/** The minimum amount of VRAM. */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major#endif /* VBOX_WITH_HGSMI */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/* bochs VBE support */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major#define VBE_DISPI_INDEX_NB_SAVED 0xb /* Number of saved registers (vbe_regs array) */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major#define VBE_DISPI_INDEX_NB 0xb /* Total number of VBE registers */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_VBOX_VIDEO. */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/* The VBOX interface id. Indicates support for VBVA shared memory interface. */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major#endif /* VBOX_WITH_HGSMI */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major/* Indicates support for unrestricted horizontal resolutions (not multiple of 8). */
f015d695b84915f1c2c3fcf81f339548af1852c4Peter Major#endif /* VBOX */
#ifdef CONFIG_BOCHS_VBE
#define VGA_STATE_COMMON_BOCHS_VBE \
#define VGA_STATE_COMMON_BOCHS_VBE
#ifndef VBOX
#define VGA_STATE_COMMON \
unsigned long vram_offset; \
unsigned int vram_size; \
int ar_flip_flop; \
int *pwidth, \
int *pheight); \
int graphic_mode; \
unsigned int (*rgb_to_pixel)(unsigned int r, \
struct VGAState;
typedef void FNGETOFFSETS(struct VGAState *s, uint32_t *pline_offset, uint32_t *pstart_addr, uint32_t *pline_compare);
typedef unsigned int FNRGBTOPIXEL(unsigned int r, unsigned int g, unsigned b);
#define VGA_STATE_COMMON \
#ifdef VBOX_WITH_VDMA
typedef struct VGAState {
#ifdef VBOX
bool fLFBUpdated;
bool fGCEnabled;
bool fR0Enabled;
bool fHasDirtyBits;
/** Flag indicating that the VGA memory in the 0xa0000-0xbffff region has been remapped to allow direct access. */
bool fRemappedVGA;
bool fRenderVRAM;
#ifdef VBOX_WITH_HGSMI
#ifdef VBOX_WITH_VDMA
#ifdef VBE_BYTEWISE_IO
# ifdef VBE_NEW_DYN_LIST
#ifdef VBE_NEW_DYN_LIST
#ifdef VBOX_WITH_HGSMI
#ifdef VBOX_WITH_WDDM
} VGAState;
#ifdef VBOX
#ifdef VBE_NEW_DYN_LIST
* @remark duplicated in vbe.h.
typedef struct VBEHeader
} VBEHeader;
* @remark duplicated in vbe.h. */
* @remark duplicated in vbe.h. */
* @remark duplicated in vbe.h. */
static inline int c6_to_8(int v)
#ifdef VBOX_WITH_HGSMI
# ifdef VBOX_WITH_VIDEOHWACCEL
#ifdef VBOX_WITH_HGSMI
#define PPDMIDISPLAYVBVACALLBACKS_2_PVGASTATE(_pcb) ( (PVGASTATE)((uint8_t *)(_pcb) - RT_OFFSETOF(VGASTATE, IVBVACallbacks)) )
# ifdef VBOX_WITH_CRHGSMI
int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
# ifdef VBOX_WITH_VDMA
#ifndef VBOX
int poffset, int w,
unsigned int color_xor);
int poffset, int w,
unsigned int color_xor);
int poffset, int w,
unsigned int color_xor);