DevVGA.h revision dee9595a04fb1bd1908a48bd602fa1ed0b6967f9
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * DevVGA - VBox VGA/VESA device, internal header.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * Copyright (C) 2006-2007 Oracle Corporation
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * available from http://www.virtualbox.org. This file is free software;
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * General Public License (GPL) as published by the Free Software
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * --------------------------------------------------------------------
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * This code is based on:
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * QEMU internal VGA defines.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * Copyright (c) 2003-2004 Fabrice Bellard
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * Permission is hereby granted, free of charge, to any person obtaining a copy
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * of this software and associated documentation files (the "Software"), to deal
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * in the Software without restriction, including without limitation the rights
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * copies of the Software, and to permit persons to whom the Software is
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * furnished to do so, subject to the following conditions:
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * The above copyright notice and this permission notice shall be included in
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * all copies or substantial portions of the Software.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * THE SOFTWARE.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync/** Use VBE bytewise I/O. Only needed for Windows Longhorn/Vista betas and backwards compatibility. */
f0ab104f070bc7f569404826fea1828ed985638cvboxsync/** Use VBE new dynamic mode list.
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * If this is not defined, no checks are carried out to see if the modes all
f0ab104f070bc7f569404826fea1828ed985638cvboxsync * fit into the framebuffer! See the VRAM_SIZE_FIX define. */
f0ab104f070bc7f569404826fea1828ed985638cvboxsync/** The default amount of VRAM. */
f0ab104f070bc7f569404826fea1828ed985638cvboxsync/** The maximum amount of VRAM. Limited by VBOX_MAX_ALLOC_PAGE_COUNT. */
f0ab104f070bc7f569404826fea1828ed985638cvboxsync/** The minimum amount of VRAM. */
f0ab104f070bc7f569404826fea1828ed985638cvboxsync#endif /* VBOX_WITH_HGSMI */
#include "DevVGASavedState.h"
#define CONFIG_BOCHS_VBE
#ifdef CONFIG_BOCHS_VBE
#define VGA_STATE_COMMON_BOCHS_VBE \
#define VGA_STATE_COMMON_BOCHS_VBE
typedef struct vga_retrace_s {
#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
bool fRealRetrace;
#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);