VirtualBox

Ignore:
Timestamp:
Dec 4, 2015 4:26:50 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104521
Message:

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.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk

    r56301 r58993  
    6767        seamless-x11.cpp \
    6868        display.cpp \
    69         hostversion.cpp
     69        hostversion.cpp \
     70        check3d.cpp
    7071 VBoxClient_LIBS += \
    7172        Xext Xmu
  • trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h

    r57357 r58993  
    7878extern struct VBCLSERVICE **VBClGetDragAndDropService();
    7979#endif /* VBOX_WITH_DRAG_AND_DROP */
     80extern struct VBCLSERVICE **VBClCheck3DService();
    8081
    8182#endif /* !___vboxclient_vboxclient_h */
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r57357 r58993  
    5353/** The name of our pidfile.  It is global for the benefit of the cleanup
    5454 * routine. */
    55 static char g_szPidFile[RTPATH_MAX];
     55static char g_szPidFile[RTPATH_MAX] = "";
    5656/** The file handle of our pidfile.  It is global for the benefit of the
    5757 * cleanup routine. */
     
    165165             "--checkhostversion|"
    166166#endif
    167              "--seamless [-d|--nodaemon]\n", pcszFileName);
     167             "--seamless|check3d [-d|--nodaemon]\n", pcszFileName);
    168168    RTPrintf("Starts the VirtualBox X Window System guest services.\n\n");
    169169    RTPrintf("Options:\n");
     
    176176    RTPrintf("  --checkhostversion starts the host version notifier service\n");
    177177#endif
     178    RTPrintf("  --check3d          tests whether 3D pass-through is enabled\n");
    178179    RTPrintf("  --seamless         starts the seamless windows service\n");
    179180    RTPrintf("  -d, --nodaemon     continues running as a system service\n");
     
    260261        }
    261262#endif /* VBOX_WITH_DRAG_AND_DROP */
     263        else if (!strcmp(argv[i], "--check3d"))
     264        {
     265            if (g_pService)
     266                break;
     267            g_pService = VBClCheck3DService();
     268        }
    262269        else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help"))
    263270        {
     
    287294    if (RT_FAILURE(rc))
    288295        VBClFatalError(("Initialising critical section: %Rrc\n", rc));
    289     rc = RTPathUserHome(g_szPidFile, sizeof(g_szPidFile));
    290     if (RT_FAILURE(rc))
    291         VBClFatalError(("Getting home directory for pid-file: %Rrc\n", rc));
    292     rc = RTPathAppend(g_szPidFile, sizeof(g_szPidFile),
    293                       (*g_pService)->getPidFilePath());
    294     if (RT_FAILURE(rc))
    295         VBClFatalError(("Creating pid-file path: %Rrc\n", rc));
    296     if (fDaemonise)
    297         rc = VbglR3Daemonize(false /* fNoChDir */, false /* fNoClose */, fRespawn, &cRespawn);
    298     if (RT_FAILURE(rc))
    299         VBClFatalError(("Daemonizing: %Rrc\n", rc));
    300     if (g_szPidFile[0])
    301         rc = VbglR3PidFile(g_szPidFile, &g_hPidFile);
    302     if (rc == VERR_FILE_LOCK_VIOLATION)  /* Already running. */
    303         return 0;
    304     if (RT_FAILURE(rc))
    305         VBClFatalError(("Creating pid-file: %Rrc\n", rc));
     296    if ((*g_pService)->getPidFilePath)
     297    {
     298        rc = RTPathUserHome(g_szPidFile, sizeof(g_szPidFile));
     299        if (RT_FAILURE(rc))
     300            VBClFatalError(("Getting home directory for pid-file: %Rrc\n", rc));
     301        rc = RTPathAppend(g_szPidFile, sizeof(g_szPidFile),
     302                          (*g_pService)->getPidFilePath());
     303        if (RT_FAILURE(rc))
     304            VBClFatalError(("Creating pid-file path: %Rrc\n", rc));
     305        if (fDaemonise)
     306            rc = VbglR3Daemonize(false /* fNoChDir */, false /* fNoClose */, fRespawn, &cRespawn);
     307        if (RT_FAILURE(rc))
     308            VBClFatalError(("Daemonizing: %Rrc\n", rc));
     309        if (g_szPidFile[0])
     310            rc = VbglR3PidFile(g_szPidFile, &g_hPidFile);
     311        if (rc == VERR_FILE_LOCK_VIOLATION)  /* Already running. */
     312            return 0;
     313        if (RT_FAILURE(rc))
     314            VBClFatalError(("Creating pid-file: %Rrc\n", rc));
     315    }
    306316    /* Set signal handlers to clean up on exit. */
    307317    vboxClientSetSignalHandlers();
Note: See TracChangeset for help on using the changeset viewer.

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