VirtualBox

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

Last change on this file since 36867 was 36867, checked in by vboxsync, 14 years ago

Additions/Video: display/miniport drivers

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