VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/check3d.cpp@ 60967

Last change on this file since 60967 was 58993, checked in by vboxsync, 9 years ago

bugref:8153: vboxvideo: ABI issues / software rendering on Linux guests: add a new service to VBoxClient to test whether accelerated 3D pass-through is currently available by trying to connect to the HGCM service and signalling success or failure in the process exit code. Add generic HGCM connect and disconnect functionality to VBoxGuestR3Lib to support this. Add the concept of non-daemon services to VBoxClient as we do not need to daemonise or create a pid-file for this quick test.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1/* $Id: check3d.cpp 58993 2015-12-04 16:26:50Z vboxsync $ */
2/** @file
3 * X11 guest client - 3D pass-through check.
4 */
5
6/*
7 * Copyright (C) 2011-2012 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 "VBoxClient.h"
19
20#include <VBox/VBoxGuestLib.h>
21
22#include <stdlib.h>
23
24static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
25{
26 int rc;
27 HGCMCLIENTID cClientID;
28 LogFlowFunc(("\n"));
29
30 NOREF(ppInterface);
31 NOREF(fDaemonised);
32 /* Initialise the guest library. */
33 rc = VbglR3InitUser();
34 if (RT_FAILURE(rc))
35 exit(1);
36 rc = VbglR3HGCMConnect("VBoxSharedCrOpenGL", &cClientID);
37 if (RT_FAILURE(rc))
38 exit(1);
39 VbglR3HGCMDisconnect(cClientID);
40 VbglR3Term();
41 LogFlowFunc(("returning %Rrc\n", rc));
42 return rc;
43}
44
45static struct VBCLSERVICE g_vbclCheck3DInterface =
46{
47 NULL,
48 VBClServiceDefaultHandler, /* init */
49 run,
50 VBClServiceDefaultCleanup
51};
52static struct VBCLSERVICE *g_pvbclCheck3DInterface = &g_vbclCheck3DInterface;
53
54/* Static factory */
55struct VBCLSERVICE **VBClCheck3DService()
56{
57 return &g_pvbclCheck3DInterface;
58}
59
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