VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.h@ 42217

Last change on this file since 42217 was 42217, checked in by vboxsync, 12 years ago

wddm: autoresize, etc. fixes, more to follow..

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: VBoxMPCommon.h 42217 2012-07-18 20:41:29Z vboxsync $ */
2/** @file
3 * VBox Miniport common functions used by XPDM/WDDM drivers
4 */
5
6/*
7 * Copyright (C) 2011 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOXMPCOMMON_H
19#define VBOXMPCOMMON_H
20
21#include "VBoxMPDevExt.h"
22
23RT_C_DECLS_BEGIN
24
25int VBoxMPCmnMapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv, uint32_t ulOffset, uint32_t ulSize);
26void VBoxMPCmnUnmapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv);
27
28typedef bool(*PFNVIDEOIRQSYNC)(void *);
29bool VBoxMPCmnSyncToVideoIRQ(PVBOXMP_COMMON pCommon, PFNVIDEOIRQSYNC pfnSync, void *pvUser);
30
31/* Video modes related */
32#define VBOXMP_MAX_VIDEO_MODES 128
33void VBoxMPCmnInitCustomVideoModes(PVBOXMP_DEVEXT pExt);
34VIDEO_MODE_INFORMATION* VBoxMPCmnGetCustomVideoModeInfo(ULONG ulIndex);
35VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo(ULONG ulIndex);
36
37#ifdef VBOX_XPDM_MINIPORT
38VIDEO_MODE_INFORMATION* VBoxMPXpdmCurrentVideoMode(PVBOXMP_DEVEXT pExt);
39ULONG VBoxMPXpdmGetVideoModesCount();
40void VBoxMPXpdmBuildVideoModesTable(PVBOXMP_DEVEXT pExt);
41#endif
42
43#ifdef VBOX_WDDM_MINIPORT
44void VBoxWddmInvalidateAllVideoModesInfos(PVBOXMP_DEVEXT pExt);
45void VBoxWddmInvalidateVideoModesInfo(PVBOXMP_DEVEXT pExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
46PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateVideoModesInfoByMask(PVBOXMP_DEVEXT pExt, uint8_t *pScreenIdMask);
47PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateAllVideoModesInfos(PVBOXMP_DEVEXT pExt);
48NTSTATUS VBoxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode,
49 const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes,
50 uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode);
51PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetAllVideoModesInfos(PVBOXMP_DEVEXT pExt);
52PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetVideoModesInfo(PVBOXMP_DEVEXT pExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
53bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
54bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
55void VBoxWddmAdjustMode(PVBOXMP_DEVEXT pExt, PVBOXWDDM_ADJUSTVIDEOMODE pMode);
56void VBoxWddmAdjustModes(PVBOXMP_DEVEXT pExt, uint32_t cModes, PVBOXWDDM_ADJUSTVIDEOMODE aModes);
57#endif
58
59/* Registry access */
60#ifdef VBOX_XPDM_MINIPORT
61typedef PVBOXMP_DEVEXT VBOXMPCMNREGISTRY;
62#else
63typedef HANDLE VBOXMPCMNREGISTRY;
64#endif
65
66VP_STATUS VBoxMPCmnRegInit(IN PVBOXMP_DEVEXT pExt, OUT VBOXMPCMNREGISTRY *pReg);
67VP_STATUS VBoxMPCmnRegFini(IN VBOXMPCMNREGISTRY Reg);
68VP_STATUS VBoxMPCmnRegSetDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t Val);
69VP_STATUS VBoxMPCmnRegQueryDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t *pVal);
70
71/* Pointer related */
72inline bool VBoxMPCmnUpdatePointerShape(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength)
73{
74 return VBoxHGSMIUpdatePointerShape(&pCommon->guestCtx,
75 pAttrs->Enable & 0x0000FFFF,
76 (pAttrs->Enable >> 16) & 0xFF,
77 (pAttrs->Enable >> 24) & 0xFF,
78 pAttrs->Width, pAttrs->Height, pAttrs->Pixels,
79 cbLength - sizeof(VIDEO_POINTER_ATTRIBUTES));
80}
81
82RT_C_DECLS_END
83
84#endif /*VBOXMPCOMMON_H*/
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette