VBoxMPDevExt.h revision dc959f60f6d3e0cba86f7da4d39aa475913a7e10
/* $Id$ */
/** @file
* VBox Miniport device extension header
*/
/*
* Copyright (C) 2011 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 VBOXMPDEVEXT_H
#define VBOXMPDEVEXT_H
#include "VBoxMPUtils.h"
#include <VBox/VBoxVideoGuest.h>
#ifdef VBOX_XPDM_MINIPORT
# include <miniport.h>
# include <ntddvdeo.h>
# include <video.h>
# include "common/xpdm/VBoxVideoPortAPI.h"
#endif
#ifdef VBOX_WDDM_MINIPORT
# include "wddm/VBoxMPTypes.h"
#endif
typedef struct VBOXMP_COMMON
{
int cDisplays; /* Number of displays. */
* It is at offset:
* cbAdapterMemorySize - VBOX_VIDEO_ADAPTER_INFORMATION_SIZE - cbMiniportHeap
*/
void *pvMiniportHeap; /* The pointer to the miniport heap VRAM.
* This is mapped by miniport separately.
*/
void *pvAdapterInformation; /* The pointer to the last 4K of VRAM.
* This is mapped by miniport separately.
*/
/** Whether HGSMI is enabled. */
bool bHGSMI;
/** Context information needed to receive commands from the host. */
/** Context information needed to submit commands to the host. */
typedef struct _VBOXMP_DEVEXT
{
* The primary extension is the first one.
*/
#ifdef VBOX_XPDM_MINIPORT
#endif /*VBOX_XPDM_MINIPORT*/
#ifdef VBOX_WDDM_MINIPORT
/* hgsmi allocation manager */
/* mutex for context list operations */
volatile uint32_t cContexts3D;
volatile uint32_t cUnlockedVBVADisabled;
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif
#if 0
#endif
#endif /*VBOX_WDDM_MINIPORT*/
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_XPDM_MINIPORT
/* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */
#endif
#ifdef VBOX_WDDM_MINIPORT
# ifdef VBOXVDMA_WITH_VBVA
# endif
#endif
} primary;
/* Secondary device information. */
struct {
} secondary;
} u;
{
}
{
#ifdef VBOX_XPDM_MINIPORT
#else
#endif
}
#ifdef VBOX_WDDM_MINIPORT
{
#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(PVBOXMP_DEVEXT 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(PVBOXMP_DEVEXT 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 /*VBOX_WDDM_MINIPORT*/
#endif /*VBOXMPDEVEXT_H*/