VirtualBox

Changeset 59235 in vbox


Ignore:
Timestamp:
Dec 31, 2015 10:45:50 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104863
Message:

bugref:8087: Additions/x11: support non-root X server: refuse to load our DDX user space driver if the kernel driver is found. This is more an emergency solution than anything else, since if we reach this code the X server will refuse to load altogether. The set-up script code should prevent it happening though. I wonder whether there is a more graceful way to handle it nonetheless.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r59194 r59235  
    9494# include <stdlib.h>
    9595# include <string.h>
     96# include <sys/stat.h>
     97# define xf86stat stat
     98# define xf86stat_s stat
     99#else
     100# include <xf86_ansic.h>
    96101#endif
    97102
     
    823828    Gamma gzeros = {0.0, 0.0, 0.0};
    824829    rgb rzeros = {0, 0, 0};
     830    struct xf86stat_s sstat;
    825831
    826832    TRACE_ENTRY();
     
    831837    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VirtualBox guest additions video driver version " VBOX_VERSION_STRING "r%d\n",
    832838               VBOX_SVN_REV);
     839
     840    /* The ramdac module is needed for the hardware cursor. */
     841    if (!xf86LoadSubModule(pScrn, "ramdac"))
     842        return FALSE;
     843
     844    /* The framebuffer module. */
     845    if (!xf86LoadSubModule(pScrn, "fb"))
     846        return (FALSE);
     847
     848    if (!xf86LoadSubModule(pScrn, "shadowfb"))
     849        return FALSE;
     850
     851    if (!xf86LoadSubModule(pScrn, "vgahw"))
     852        return FALSE;
     853
     854    if (xf86stat("/dev/dri/card0", &sstat) == 0)
     855    {
     856        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "kernel driver found, not loading.\n");
     857        return FALSE;
     858    }
    833859
    834860    /* Get our private data from the ScrnInfoRec structure. */
     
    840866    /* Entity information seems to mean bus information. */
    841867    pVBox->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
    842 
    843     /* The ramdac module is needed for the hardware cursor. */
    844     if (!xf86LoadSubModule(pScrn, "ramdac"))
    845         return FALSE;
    846 
    847     /* The framebuffer module. */
    848     if (!xf86LoadSubModule(pScrn, "fb"))
    849         return (FALSE);
    850 
    851     if (!xf86LoadSubModule(pScrn, "shadowfb"))
    852         return FALSE;
    853 
    854     if (!xf86LoadSubModule(pScrn, "vgahw"))
    855         return FALSE;
    856868
    857869#ifndef PCIACCESS
Note: See TracChangeset for help on using the changeset viewer.

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