VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/HGSMI/SHGSMIHost.cpp@ 26969

Last change on this file since 26969 was 26969, checked in by vboxsync, 15 years ago

wddm: bugfixes + stubs for DMA support in VGA device

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/*
2 * Copyright (C) 2010 Sun Microsystems, Inc.
3 *
4 * This file is part of VirtualBox Open Source Edition (OSE), as
5 * available from http://www.virtualbox.org. This file is free software;
6 * you can redistribute it and/or modify it under the terms of the GNU
7 * General Public License (GPL) as published by the Free Software
8 * Foundation, in version 2 as it comes in the "COPYING" file of the
9 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11 *
12 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
13 * Clara, CA 95054 USA or visit http://www.sun.com if you need
14 * additional information or have any questions.
15 */
16#include "SHGSMIHost.h"
17#include <VBox/VBoxVideo.h>
18
19/*
20 * VBOXSHGSMI made on top HGSMI and allows receiving notifications
21 * about G->H command completion
22 */
23static bool vboxSHGSMICommandCanCompleteSynch (PVBOXSHGSMIHEADER pHdr)
24{
25 return !(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_FORCE);
26}
27
28static int vboxSHGSMICommandCompleteAsynch (PHGSMIINSTANCE pIns, PVBOXSHGSMIHEADER pHdr)
29{
30 bool bDoIrq = !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ)
31 || !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE);
32 return HGSMICompleteGuestCommand(pIns, pHdr, bDoIrq);
33}
34
35void VBoxSHGSMICommandMarkAsynchCompletion (void *pvData)
36{
37 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
38 Assert(!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH));
39 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
40}
41
42int VBoxSHGSMICommandCompleteAsynch (PHGSMIINSTANCE pIns, void *pvData)
43{
44 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
45 Assert(!!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH));
46 return vboxSHGSMICommandCompleteAsynch (pIns, pHdr);
47}
48
49int VBoxSHGSMICommandCompleteSynch (PHGSMIINSTANCE pIns, void *pvData)
50{
51 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
52 Assert(!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH));
53 if (vboxSHGSMICommandCanCompleteSynch(pHdr))
54 return VINF_SUCCESS;
55 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
56 return vboxSHGSMICommandCompleteAsynch(pIns, pHdr);
57}
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