VirtualBox

Changeset 20550 in vbox for trunk/src


Ignore:
Timestamp:
Jun 14, 2009 4:25:49 PM (16 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: dri fixes

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

Legend:

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

    r17451 r20550  
    253253extern Bool VBOXDRIScreenInit(int scrnIndex, ScreenPtr pScreen, VBOXPtr pVBox);
    254254extern Bool VBOXDRIFinishScreenInit(ScreenPtr pScreen);
     255extern void VBOXDRIUpdateStride(ScrnInfoPtr pScrn, VBOXPtr pVBox);
    255256extern void VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox);
    256257
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_15.c

    r17318 r20550  
    245245        scrn->virtualY = height;
    246246        scrn->displayWidth = width;
     247        VBOXDRIUpdateStride(scrn, pVBox);
    247248    }
    248249    TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
     
    986987        return (FALSE);
    987988
     989    /* Needed before we initialise DRI. */
     990    pScrn->displayWidth = pScrn->virtualX;
     991
    988992#ifdef VBOX_DRI
    989993    pVBox->useDRI = VBOXDRIScreenInit(scrnIndex, pScreen, pVBox);
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_dri.c

    r17451 r20550  
    173173        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
    174174                   "DRI is only available in 16bpp or 32bpp graphics modes.\n");
     175        rc = FALSE;
     176    }
     177    /* Assertion */
     178    if (   (pScrn->displayWidth == 0)
     179        || (pVBox->pciInfo == NULL)
     180        || (pVBox->base == NULL)
     181        || (pVBox->mapSize == 0))
     182    {
     183        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: preconditions failed\n",
     184                   __PRETTY_FUNCTION__);
    175185        rc = FALSE;
    176186    }
     
    251261        pDRIInfo->frameBufferPhysicalAddress = pVBox->base;
    252262        pDRIInfo->frameBufferSize = pVBox->mapSize;
    253         pDRIInfo->frameBufferStride = pScrn->displayWidth;
     263        pDRIInfo->frameBufferStride =   pScrn->displayWidth
     264                                      * pScrn->bitsPerPixel / 8;
    254265        pDRIInfo->SAREASize = SAREA_MAX;  /* we have no private bits yet. */
    255266        /* This can't be zero, as the server callocs this size and checks for
     
    305316}
    306317
     318void VBOXDRIUpdateStride(ScrnInfoPtr pScrn, VBOXPtr pVBox)
     319{
     320    DRIInfoPtr pDRIInfo = pVBox->pDRIInfo;
     321    pDRIInfo->frameBufferStride =   pScrn->displayWidth
     322                                  * pScrn->bitsPerPixel / 8;
     323}
     324
    307325void
    308326VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox)
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