VirtualBox

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

Last change on this file since 67508 was 65381, checked in by vboxsync, 8 years ago

bugref:8282: Additions/linux: submit DRM driver to the Linux kernel: move all graphics device-related header files to a separate sub-directory and add that to the include path where they are needed. The intention is too be able to remove the VBox/ include folder in the DRM driver package.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/* $Id: SHGSMIHost.cpp 65381 2017-01-20 09:23:53Z vboxsync $ */
2/** @file
3 * Missing description.
4 */
5
6/*
7 * Copyright (C) 2010-2016 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 "SHGSMIHost.h"
19#include <VBoxVideo.h>
20
21/*
22 * VBOXSHGSMI made on top HGSMI and allows receiving notifications
23 * about G->H command completion
24 */
25static bool vboxSHGSMICommandCanCompleteSynch (PVBOXSHGSMIHEADER pHdr)
26{
27 return !(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_FORCE);
28}
29
30static int vboxSHGSMICommandCompleteAsynch (PHGSMIINSTANCE pIns, PVBOXSHGSMIHEADER pHdr)
31{
32 bool bDoIrq = !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ)
33 || !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE);
34 return HGSMICompleteGuestCommand(pIns, pHdr, bDoIrq);
35}
36
37void VBoxSHGSMICommandMarkAsynchCompletion (void *pvData)
38{
39 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
40 Assert(!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH));
41 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
42}
43
44int VBoxSHGSMICommandComplete (PHGSMIINSTANCE pIns, void *pvData)
45{
46 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
47 if (!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH) /* <- check if synchronous completion */
48 && vboxSHGSMICommandCanCompleteSynch(pHdr)) /* <- check if can complete synchronously */
49 return VINF_SUCCESS;
50 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
51 return vboxSHGSMICommandCompleteAsynch(pIns, pHdr);
52}
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