VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp@ 94927

Last change on this file since 94927 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/* $Id: VBoxMPVdma.cpp 93115 2022-01-01 11:31:46Z vboxsync $ */
2/** @file
3 * VBox WDDM Miniport driver
4 */
5
6/*
7 * Copyright (C) 2011-2022 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#include "VBoxMPWddm.h"
19#include "common/VBoxMPCommon.h"
20#include "VBoxMPVdma.h"
21#ifdef VBOX_WITH_VIDEOHWACCEL
22#include "VBoxMPVhwa.h"
23#endif
24#include <iprt/asm.h>
25#include <iprt/mem.h>
26
27
28static DECLCALLBACK(void *) hgsmiEnvAlloc(void *pvEnv, HGSMISIZE cb)
29{
30 NOREF(pvEnv);
31 return RTMemAlloc(cb);
32}
33
34static DECLCALLBACK(void) hgsmiEnvFree(void *pvEnv, void *pv)
35{
36 NOREF(pvEnv);
37 RTMemFree(pv);
38}
39
40static HGSMIENV g_hgsmiEnvVdma =
41{
42 NULL,
43 hgsmiEnvAlloc,
44 hgsmiEnvFree
45};
46
47/* create a DMACommand buffer */
48int vboxVdmaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVDMAINFO *pInfo
49 )
50{
51 RT_NOREF(pDevExt);
52 pInfo->fEnabled = FALSE;
53
54 return VINF_SUCCESS;
55}
56
57int vboxVdmaDisable (PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo)
58{
59 RT_NOREF(pDevExt);
60
61 if (!pInfo->fEnabled)
62 return VINF_ALREADY_INITIALIZED;
63
64 /* ensure nothing else is submitted */
65 pInfo->fEnabled = FALSE;
66 return VINF_SUCCESS;
67}
68
69int vboxVdmaEnable (PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo)
70{
71 RT_NOREF(pDevExt);
72 Assert(!pInfo->fEnabled);
73 if (pInfo->fEnabled)
74 return VINF_ALREADY_INITIALIZED;
75 return VINF_SUCCESS;
76}
77
78int vboxVdmaDestroy (PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo)
79{
80 int rc = VINF_SUCCESS;
81 Assert(!pInfo->fEnabled);
82 if (pInfo->fEnabled)
83 rc = vboxVdmaDisable (pDevExt, pInfo);
84 return rc;
85}
Note: See TracBrowser for help on using the repository browser.

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