VBoxVideo-win.h revision 92c6075e59a61be1eb07bf370501a93e6cd2d6ca
/** @file
* VirtualBox Video miniport driver, Windows-specific header
*
* 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.
*/
#ifndef VBOXVIDEO_WIN_H
#define VBOXVIDEO_WIN_H
#include "VBoxVideo.h"
#ifndef VBOX_WITH_WDDM
#include "dderror.h"
#include "devioctl.h"
#include "miniport.h"
#include "ntddvdeo.h"
#include "video.h"
#else
# ifdef PAGE_SIZE
# endif
# ifdef PAGE_SHIFT
# endif
# define VBOX_WITH_WORKAROUND_MISSING_PACK
# endif
# include <ntddk.h>
# pragma warning(default : 4163)
# pragma pack()
# pragma warning(default : 4103)
# endif
# else
# include <ntddk.h>
# endif
#include "dispmprt.h"
#include "ntddvdeo.h"
#include "dderror.h"
#endif
/* common API types */
#ifdef VBOX_WITH_WDDM
#define VBOX_WITH_GENERIC_MULTIMONITOR
typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION;
#include <VBox/VBoxVideo.h>
#include "wddm/VBoxVideoIf.h"
#include "wddm/VBoxVideoMisc.h"
#include "wddm/VBoxVideoShgsmi.h"
#include "wddm/VBoxVideoCm.h"
#include "wddm/VBoxVideoVdma.h"
#include "wddm/VBoxVideoWddm.h"
#include "wddm/VBoxVideoVidPn.h"
#ifdef VBOXWDDM_WITH_VBVA
# include "wddm/VBoxVideoVbva.h"
#endif
#ifdef VBOX_WITH_VIDEOHWACCEL
# include "wddm/VBoxVideoVhwa.h"
#endif
, 8)
typedef struct VBOXWDDM_POINTER_INFO
{
union
{
} Attributes;
typedef struct VBOXWDDM_GLOBAL_POINTER_INFO
{
#ifdef VBOX_WITH_VIDEOHWACCEL
typedef struct VBOXWDDM_VHWA
{
volatile uint32_t cOverlaysCreated;
#endif
typedef struct VBOXWDDM_SOURCE
{
struct VBOXWDDM_ALLOCATION * pPrimaryAllocation;
#ifdef VBOXWDDM_RENDER_FROM_SHADOW
struct VBOXWDDM_ALLOCATION * pShadowAllocation;
#endif
#ifdef VBOX_WITH_VIDEOHWACCEL
/* @todo: in our case this seems more like a target property,
* but keep it here for now */
#endif
typedef struct VBOXWDDM_TARGET
{
#endif
typedef struct _DEVICE_EXTENSION
{
* The primary extension is the first one.
*/
#ifndef VBOX_WITH_WDDM
#endif
union {
/* Information that is only relevant to the primary device or is the same for all devices. */
struct {
void *pvReqFlush; /* Pointer to preallocated generic request structure for
* VMMDevReq_VideoAccelFlush. Allocated when VBVA status
* is changed. Deallocated on HwReset.
*/
#ifdef VBOX_WITH_WDDM
# ifdef VBOXVDMA_WITH_VBVA
# endif
#endif
#ifndef VBOX_WITH_WDDM
/* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */
#else
/* committed VidPn handle */
/* Display Port handle and callbacks */
#endif
} primary;
/* Secondary device information. */
struct {
} secondary;
} u;
#ifdef VBOX_WITH_WDDM
/* hgsmi allocation manager */
/* mutex for context list operations */
volatile uint32_t cContexts3D;
volatile uint32_t cUnlockedVBVADisabled;
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif
// BOOL bSetNotifyDxDpc;
#endif
{
#ifndef VBOX_WITH_WDDM
#else
#endif
}
{
}
{
return vboxUpdatePointerShape(pCommon,
cbLength - sizeof(VIDEO_POINTER_ATTRIBUTES));
}
#ifndef VBOX_WITH_WDDM
#define DEV_SET_MOUSE_HIDDEN(dev) \
do { \
} while (0)
#define DEV_SET_MOUSE_SHOWN(dev) \
do { \
} while (0)
#else
#define DEV_SET_MOUSE_HIDDEN(dev) \
do { \
} while (0)
#define DEV_SET_MOUSE_SHOWN(dev) \
do { \
} while (0)
#endif
extern "C"
{
#ifndef VBOX_WITH_WDDM
#else
);
PVBOXWDDM_VIDEOMODES_INFO vboxWddmGetVideoModesInfo(PDEVICE_EXTENSION DeviceExtension, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
PVBOXWDDM_VIDEOMODES_INFO vboxWddmUpdateVideoModesInfo(PDEVICE_EXTENSION DeviceExtension, PVBOXWDDM_RECOMMENDVIDPN pVidPnInfo);
/* @return STATUS_BUFFER_TOO_SMALL - if buffer is too small, STATUS_SUCCESS - on success */
NTSTATUS vboxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode,
const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes, uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode);
int vboxVideoModeFind(const VIDEO_MODE_INFORMATION *pModes, int cModes, const VIDEO_MODE_INFORMATION *pM);
int vboxWddmVideoResolutionFind(const D3DKMDT_2DREGION *pResolutions, int cResolutions, const D3DKMDT_2DREGION *pRes);
bool vboxWddmVideoResolutionsMatch(const D3DKMDT_2DREGION *pResolutions1, const D3DKMDT_2DREGION *pResolutions2, int cResolutions);
bool vboxWddmVideoModesMatch(const VIDEO_MODE_INFORMATION *pModes1, const VIDEO_MODE_INFORMATION *pModes2, int cModes);
{
#ifdef VBOXWDDM_RENDER_FROM_SHADOW
/* all memory layout info should be initialized */
/* page aligned */
#else
/* all memory layout info should be initialized */
/* page aligned */
#endif
}
{
return vboxWddmVramCpuVisibleSize(pDevExt);
}
#ifdef VBOXWDDM_RENDER_FROM_SHADOW
{
return vboxWddmVramCpuVisibleSegmentSize(pDevExt);
}
DECLINLINE(bool) vboxWddmCmpSurfDescsBase(VBOXWDDM_SURFACE_DESC *pDesc1, VBOXWDDM_SURFACE_DESC *pDesc2)
{
return false;
return false;
return false;
return false;
return false;
return true;
}
DECLINLINE(void) vboxWddmAssignShadow(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
{
{
return;
}
if (pSource->pShadowAllocation)
{
/* clear the visibility info fo the current primary */
/* release the shadow surface */
}
if (pAllocation)
{
/* this check ensures the shadow is not used for other source simultaneously */
}
}
#endif
DECLINLINE(VOID) vboxWddmAssignPrimary(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
{
return;
if (pSource->pPrimaryAllocation)
{
/* clear the visibility info fo the current primary */
}
if (pAllocation)
{
}
}
#endif
#ifdef VBOX_WITH_WDDM
#endif
);
} /* extern "C" */
#endif /* VBOXVIDEO_WIN_H */