driver.h revision de2776d805502a4e9527f31c37ff57fb7171c452
/******************************Module*Header*******************************\
*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*
* Based in part on Microsoft DDK sample code
*
* *******************
* * GDI SAMPLE CODE *
* *******************
*
* Module Name: driver.h
*
* contains prototypes for the frame buffer driver.
*
* Copyright (c) 1992-1998 Microsoft Corporation
\**************************************************************************/
#include "stddef.h"
#include <stdarg.h>
#include "windef.h"
#include "wingdi.h"
#include "winddi.h"
#include "devioctl.h"
#include "ntddvdeo.h"
#include "debug.h"
#include "../Miniport/vboxioctl.h"
#include <VBox/VBoxVideo.h>
/* Forward declaration. */
struct _PDEV;
typedef struct _VBOXDISPLAYINFO
{
#include "vbvavrdp.h"
#include "vrdpbmp.h"
/* Saved screen bits information. */
typedef struct _SSB
{
ULONG ident; /* 1 based index in the stack = the handle returned by DrvSaveScreenBits (SS_SAVE) */
} SSB;
/* VRAM
* | | | | |
* 0+framebuffer+ddraw heap+VBVA buffer+displayinfo=cScreenSize
*/
typedef struct _VRAMLAYOUT
{
} VRAMLAYOUT;
typedef struct
{
#ifdef VBOX_WITH_VIDEOHWACCEL
typedef struct _VBOXVHWASURFDESC
{
volatile uint32_t cPendingBltsSrc;
volatile uint32_t cPendingBltsDst;
volatile uint32_t cPendingFlips;
typedef struct _VBOXVHWAINFO
{
} VBOXVHWAINFO;
#endif
struct _PDEV
{
// the virtual desktop.
// be shifted by to fit in the hardware
// palette.
#ifndef VBOX_WITH_HGSMI
#endif /* !VBOX_WITH_HGSMI */
#ifndef VBOX_WITH_HGSMI
#endif /* !VBOX_WITH_HGSMI */
#ifdef VBOX_WITH_DDRAW
struct {
} ddLock;
#endif /* VBOX_WITH_DDRAW */
#ifdef VBOX_WITH_HGSMI
VBVABUFFER *pVBVA; /* Pointer to the pjScreen + layout->offVBVABuffer. NULL if VBVA is not enabled. */
PFNVBOXVIDEOHGSMICOMPLETION pfnHGSMICommandComplete; /* called to complete the command we receive from the miniport */
PFNVBOXVIDEOHGSMICOMMANDS pfnHGSMIRequestCommands; /* called to requests the commands posted to us from the host */
#endif /* VBOX_WITH_HGSMI */
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif
};
#ifdef VBOX_WITH_OPENGL
typedef struct
{
} OPENGL_INFO, *POPENGL_INFO;
#endif
#ifndef VBOX_WITH_HGSMI
/* The global semaphore handle for all driver instances. */
extern HSEMAPHORE ghsemHwBuffer;
#endif /* !VBOX_WITH_HGSMI */
#ifdef VBOX_WITH_HGSMI
#define VBE_DISPI_IOPORT_INDEX 0x01CE
#define VBE_DISPI_IOPORT_DATA 0x01CF
#define VBE_DISPI_INDEX_VBVA_GUEST 0xc
#endif /* VBOX_WITH_HGSMI */
//
// Determines the size of the DriverExtra information in the DEVMODE
// structure passed to and from the display driver.
//
#define DRIVER_EXTRA_SIZE 0
// reverse order) used for memory
// allocations
// VBOX
typedef struct _CLIPRECTS {
ULONG c;
} CLIPRECTS;
typedef struct _VRDPCLIPRECTS
{
void drvLoadEng (void);
#ifdef VBOX_WITH_HGSMI
#ifdef VBOX_WITH_VIDEOHWACCEL
typedef DECLCALLBACK(void) FNVBOXVHWACMDCOMPLETION(PPDEV ppdev, VBOXVHWACMD * pCmd, void * pContext);
VBOXVHWACMD* vboxVHWACommandCreate (PPDEV ppdev, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd);
void vboxVHWACommandSubmitAsynch (PPDEV ppdev, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext);
void vboxVHWAInit();
void vboxVHWATerm();
#endif
#endif
{
if (pso)
{
if (ppdev)
{
{
/* Convert the device PSO to the bitmap PSO which can be passed to Eng*. */
}
}
}
return pso;
}
{
switch (pso->iBitmapFormat)
{
case BMF_16BPP: return 2;
case BMF_24BPP: return 3;
case BMF_32BPP: return 4;
}
return 0;
}
#ifdef VBOX_VBVA_ADJUST_RECT
#endif /* VBOX_VBVA_ADJUST_RECT */
#define VRDP_TEXT_MAX_GLYPH_SIZE 0x100
#define VRDP_TEXT_MAX_GLYPHS 0xfe
);
const VRDPCLIPRECTS *pClipRects,
const void *pvOrder,
unsigned cbOrder,
unsigned code);
#define VBVA_ASSERT(expr) \
do { \
if (!(expr)) \
{ \
AssertMsg2("!!!\n"); \
} \
} while (0)
#ifdef STAT_sunlover
extern ULONG gStatCopyBitsOffscreenToScreen;
extern ULONG gStatCopyBitsScreenToScreen;
extern ULONG gStatBitBltOffscreenToScreen;
extern ULONG gStatBitBltScreenToScreen;
extern ULONG gStatUnchangedOffscreenToScreen;
extern ULONG gStatNonTransientEngineBitmaps;
extern ULONG gStatTransientEngineBitmaps;
extern ULONG gStatUnchangedBitmapsCRC;
extern ULONG gStatUnchangedBitmapsDeviceCRC;
extern ULONG gStatBitmapsCRC;
extern ULONG gStatBitBltScreenPattern;
extern ULONG gStatBitBltScreenSquare;
extern ULONG gStatBitBltScreenSquareReported;
extern ULONG gStatCopyBitsScreenSquare;
extern ULONG gStatEnablePDEV;
extern ULONG gStatCompletePDEV;
extern ULONG gStatDisablePDEV;
extern ULONG gStatEnableSurface;
extern ULONG gStatDisableSurface;
extern ULONG gStatAssertMode;
extern ULONG gStatDisableDriver;
extern ULONG gStatCreateDeviceBitmap;
extern ULONG gStatDeleteDeviceBitmap;
extern ULONG gStatDitherColor;
extern ULONG gStatStrokePath;
extern ULONG gStatFillPath;
extern ULONG gStatStrokeAndFillPath;
extern ULONG gStatPaint;
extern ULONG gStatBitBlt;
extern ULONG gStatCopyBits;
extern ULONG gStatStretchBlt;
extern ULONG gStatSetPalette;
extern ULONG gStatTextOut;
extern ULONG gStatSetPointerShape;
extern ULONG gStatMovePointer;
extern ULONG gStatLineTo;
extern ULONG gStatSynchronize;
extern ULONG gStatGetModes;
extern ULONG gStatGradientFill;
extern ULONG gStatStretchBltROP;
extern ULONG gStatPlgBlt;
extern ULONG gStatAlphaBlend;
extern ULONG gStatTransparentBlt;
void statPrint (void);
#else
#define STATDRVENTRY(a, b)
#define STATPRINT
#endif /* STAT_sunlover */