VirtualBox

Changeset 51374 in vbox for trunk


Ignore:
Timestamp:
May 23, 2014 3:59:13 PM (11 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: properly report the file descriptor for the kernel driver to allow authentication to work.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/undefined

    r51242 r51374  
    3636close
    3737drmClose
     38drmDropMaster
    3839drmFreeVersion
    3940drmGetVersion
    4041drmIoctl
     42drmSetMaster
    4143fbPictureInit
    4244fbScreenInit
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r51242 r51374  
    12251225#elif defined(VBOX_DRI)  /* DRI2 */
    12261226    if (pVBox->drmFD >= 0)
     1227    {
    12271228        /* Tell the kernel driver, if present, that we are taking over. */
    12281229        drmIoctl(pVBox->drmFD, VBOXVIDEO_IOCTL_DISABLE_HGSMI, NULL);
     1230        drmSetMaster(pVBox->drmFD);
     1231    }
    12291232#endif
    12301233    if (pVBox->fHaveHGSMI)
     
    12601263        DRILock(xf86ScrnToScreen(pScrn), 0);
    12611264#elif defined(VBOX_DRI)  /* DRI2 */
     1265    if (pVBox->drmFD >= 0)
     1266        drmDropMaster(pVBox->drmFD);
     1267    /* Tell the kernel driver, if present, that it can use the framebuffer
     1268     * driver again.  If not, or if that fails, restore the old mode ourselves.
     1269     */
    12621270    if (   pVBox->drmFD < 0
    1263         /* Tell the kernel driver, if present, that it can use the framebuffer
    1264          * driver again. */
    12651271        || drmIoctl(pVBox->drmFD, VBOXVIDEO_IOCTL_ENABLE_HGSMI, NULL) < 0)
    12661272#endif
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri2.c

    r49628 r51374  
    6262
    6363    memset(&DRI2Info, 0, sizeof(DRI2Info));
     64    pVBox->drmFD = -1;
    6465    for (i = 0; i < RT_ELEMENTS(devicePaths); ++i)
    6566    {
     
    7071            if (   pVersion
    7172                && pVersion->name_len
    72                 && !strcmp(pVersion->name, VBOX_DRM_DRIVER_NAME))
     73                && !strcmp(pVersion->name, VBOX_DRM_DRIVER_NAME)
     74                && drmSetMaster(fd) == 0)
    7375            {
    7476                TRACE_LOG("Opened drm device %s\n", devicePaths[i]);
     
    8688        return FALSE;
    8789    DRI2Info.version = 3;
    88     DRI2Info.fd = -1;
     90    DRI2Info.fd = pVBox->drmFD;
    8991    DRI2Info.driverName = VBOX_DRI_DRIVER_NAME;
    9092    DRI2Info.CopyRegion = VBOXDRICopyRegion;
     
    98100{
    99101    DRI2CloseScreen(pScreen);
    100     if (pVBox->drmFD)
     102    if (pVBox->drmFD >= 0)
    101103        close(pVBox->drmFD);
    102104}
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