VirtualBox

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

最後變更 在這個檔案從27213是 26969,由 vboxsync 提交於 15 年 前

wddm: bugfixes + stubs for DMA support in VGA device

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.1 KB
 
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.alldomusa.eu.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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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