vboxvideo.h revision e09acefb0842b81eb7651abaa88ddf715e5f9cdb
/** @file
*
* VirtualBox X11 Additions graphics driver
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
* --------------------------------------------------------------------
*
* This code is based on:
*
* X11 VESA driver
*
* Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of Conectiva Linux shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from
* Conectiva Linux.
*
* Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.9 2001/05/04 19:05:49 dawes Exp $
*/
#ifndef _VBOXVIDEO_H_
#define _VBOXVIDEO_H_
#include <VBox/VBoxVideoGuest.h>
#include <VBox/VBoxVideo.h>
#ifdef DEBUG
#define TRACE_ENTRY() \
do { \
} while(0)
#define TRACE_EXIT() \
do { \
} while(0)
#define TRACE_LOG(...) \
do { \
} while(0)
# define TRACE_LINE() do \
{ \
} while(0)
if (!(expr)) \
{ \
ErrorF ("\nAssertion failed!\n\n"); \
FatalError("Aborting"); \
}
#else /* !DEBUG */
#define TRACE_ENTRY() do { } while (0)
#define TRACE_EXIT() do { } while (0)
#define TRACE_LOG(...) do { } while (0)
#endif /* !DEBUG */
/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"
# include "xf86Resources.h"
#endif
#ifndef NO_ANSIC
/* All drivers need this */
# include "xf86_ansic.h"
#endif
#include "compiler.h"
#ifndef PCIACCESS
/* Drivers for PCI hardware need this */
# include "xf86PciInfo.h"
/* Drivers that need to access the PCI config space directly need this */
# include "xf86Pci.h"
#endif
#include "vgaHW.h"
#include "vbe.h"
/* ShadowFB support */
#include "shadowfb.h"
/* Dga definitions */
#include "dgaproc.h"
# include "xf86RAC.h"
#endif
#include "fb.h"
#include "xf86Cursor.h"
#define VBOX_NAME "VBoxVideo"
#define VBOX_DRIVER_NAME "vboxvideo"
#ifdef VBOX_DRI
/* DRI support */
#define _XF86DRI_SERVER_
/* Hack to work around a libdrm header which is broken on Solaris */
/* Get rid of a warning due to a broken header file */
enum drm_bo_type { DRM_BO_TYPE };
#include "dri.h"
#include "sarea.h"
#include "GL/glxtokens.h"
/* For some reason this is not in the header files. */
void **configprivs);
#endif
#define VBOX_VIDEO_MAJOR 1
#define VBOX_VIDEO_MINOR 0
/*XXX*/
typedef struct VBOXRec
{
#ifdef PCIACCESS
struct pci_device *pciInfo;
struct pci_device *vmmDevInfo;
#else
#endif
void *base;
/** The amount of VRAM available for use as a framebuffer */
unsigned long cbFramebuffer;
/** Default X server procedure for enabling and disabling framebuffer access */
/** Is access to the framebuffer currently allowed? */
/** @todo we never actually free this */
/** Do we know that the guest can handle absolute co-ordinates? */
/** Are we currently switched to a virtual terminal? If so, it is not
* safe to touch the hardware. */
/** Does this host support sending graphics commands using HGSMI? */
/** Number of screens attached */
/** Position information for each virtual screen for the purposes of
* sending dirty rectangle information to the right one. */
/** Offsets of VBVA buffers in video RAM */
/** Context information about the VBVA buffers for each screen */
/** HGSMI guest heap context */
#ifdef VBOX_DRI
int cVisualConfigs;
int drmFD;
#endif
extern Bool vboxRetrieveVideoMode(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
/* DRI stuff */
/* Xinerama stuff */
#define VBOXRAMA_MAJOR_VERSION 1
#define VBOXRAMA_MINOR_VERSION 0
#endif /* _VBOXVIDEO_H_ */