VirtualBox

Changeset 60317 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 4, 2016 8:41:07 PM (9 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: in the X.Org video driver, check whether the kernel driver is loaded in PCIProbe(), not in PreInit(). If PCIProbe() fails, the server continues to try the next driver (modesetting in this case), whereas if PreInit() fails it aborts altogether. This simplifies our life: now we can install the X.Org driver unconditionally and it will just not be used if the kernel driver is there (or the hardware is not), but will be used if it can be and the kernel driver is loaded too late. This should solve problems when starting Ubuntu 12.04 guests, where we previously tried to load the kernel driver and install the X.Org driver exactly if it failed to load. We sometimes ended up with both loaded and sometimes with neither.

Location:
trunk/src/VBox/Additions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh

    r60286 r60317  
    374374            ;;
    375375    esac
    376     if $MODPROBE vboxvideo; then
    377         # Do not install if we can use the kernel driver.
    378         rm -f "$modules_dir/drivers/vboxvideo_drv.so"
    379         vboxvideo_src=""
    380         dox11config=""
    381     fi
    382376    test -n "${dox11config}" &&
    383377        begin "Installing $xserver_version modules"
    384     rm "$modules_dir/drivers/vboxvideo_drv$driver_ext" 2>/dev/null
    385     rm "$modules_dir/input/vboxmouse_drv$driver_ext" 2>/dev/null
    386     case "$vboxvideo_src" in ?*)
    387         ln -s "$lib_dir/$vboxvideo_src" "$modules_dir/drivers/vboxvideo_drv$driver_ext";;
     378    case "$vboxvideo_src" in
     379        ?*)
     380        ln -s "$lib_dir/$vboxvideo_src" "$modules_dir/drivers/vboxvideo_drv$driver_ext.new" &&
     381            mv "$modules_dir/drivers/vboxvideo_drv$driver_ext.new" "$modules_dir/drivers/vboxvideo_drv$driver_ext";;
     382        *)
     383        rm "$modules_dir/drivers/vboxvideo_drv$driver_ext" 2>/dev/null
    388384    esac
    389     case "$vboxmouse_src" in ?*)
    390         ln -s "$lib_dir/$vboxmouse_src" "$modules_dir/input/vboxmouse_drv$driver_ext";;
     385    case "$vboxmouse_src" in
     386        ?*)
     387        ln -s "$lib_dir/$vboxmouse_src" "$modules_dir/input/vboxmouse_drv$driver_ext.new" &&
     388            mv "$modules_dir/input/vboxmouse_drv$driver_ext.new" "$modules_dir/input/vboxmouse_drv$driver_ext.new";;
     389        *)
     390        rm "$modules_dir/input/vboxmouse_drv$driver_ext" 2>/dev/null
    391391    esac
    392392    succ_msg "$xserver_version modules installed"
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r60103 r60317  
    1717
    1818
    19 # chkconfig: 345 30 70
     19# chkconfig: 345 10 90
    2020# description: VirtualBox Linux Additions kernel modules
    2121#
     
    210210        }
    211211    }
    212 
     212    # Load the kernel video driver if we can.
     213    $MODPROBE vboxvideo > /dev/null 2>&1
     214
     215    # Put the X.Org driver in place.  This is harmless if it is not needed.
    213216    /sbin/rcvboxadd-x11 setup
    214217    # Install the guest OpenGL drivers.  For now we don't support
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r60190 r60317  
    728728{
    729729    ScrnInfoPtr pScrn;
     730    struct xf86stat_s sstat;
    730731
    731732    TRACE_ENTRY();
     733
     734    if (xf86stat("/dev/dri/card0", &sstat) == 0)
     735    {
     736        xf86Msg(X_INFO, "vboxvideo: kernel driver found, not loading.\n");
     737        return FALSE;
     738    }
    732739    pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, VBOXPCIchipsets,
    733740                                NULL, NULL, NULL, NULL, NULL);
     
    830837    Gamma gzeros = {0.0, 0.0, 0.0};
    831838    rgb rzeros = {0, 0, 0};
    832     struct xf86stat_s sstat;
    833839
    834840    TRACE_ENTRY();
     
    853859    if (!xf86LoadSubModule(pScrn, "vgahw"))
    854860        return FALSE;
    855 
    856     if (xf86stat("/dev/dri/card0", &sstat) == 0)
    857     {
    858         xf86DrvMsg(pScrn->scrnIndex, X_INFO, "kernel driver found, not loading.\n");
    859         return FALSE;
    860     }
    861861
    862862    /* Get our private data from the ScrnInfoRec structure. */
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