diff options
author | Dave Airlie <airlied@linux.ie> | 2005-10-09 10:36:50 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-10-09 10:36:50 +0000 |
commit | 524fb1440760a14c53fb3f238aad6c3cdb7e6a08 (patch) | |
tree | f6c825d3f990238c7229614d2ac739f59335feda /src/radeon_dri.c | |
parent | e526211b86ec5343002978debfcf78f74a10c69e (diff) |
Secure the Radeon PCIE GART tables in framebuffer memory by not allowingXORG-6_8_99_901
the clients to get access to a secure area of framebuffer.
Diffstat (limited to 'src/radeon_dri.c')
-rw-r--r-- | src/radeon_dri.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 57c5b15c..40c1296c 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1283,7 +1283,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) pDRIInfo->ddxDriverMinorVersion = RADEON_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = RADEON_VERSION_PATCH; pDRIInfo->frameBufferPhysicalAddress = (void *)info->LinearAddr; - pDRIInfo->frameBufferSize = info->FbMapSize; + pDRIInfo->frameBufferSize = info->FbMapSize - info->FbSecureSize; pDRIInfo->frameBufferStride = (pScrn->displayWidth * info->CurrentLayout.pixel_bytes); pDRIInfo->ddxDrawableTableEntry = RADEON_MAX_DRAWABLES; @@ -1987,28 +1987,13 @@ void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; RADEONInfoPtr info = RADEONPTR(pScrn); - FBAreaPtr fbarea; - int width; - int height; - int width_bytes; - int size_bytes; if (info->cardType!=CARD_PCIE || info->drmMinor<19) return; - size_bytes = RADEON_PCIGART_TABLE_SIZE; - width = pScrn->displayWidth; - width_bytes = width * (pScrn->bitsPerPixel / 8); - height = (size_bytes + width_bytes - 1)/width_bytes; - - fbarea = xf86AllocateOffscreenArea(pScreen, width, height, 256, NULL, NULL, NULL); + if (info->FbSecureSize==0) + return; - if (!fbarea) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "PCI GART Table allocation failed due to stupid memory manager\n"); - } else { - info->pciGartSize = size_bytes; - info->pciGartOffset = RADEON_ALIGN((fbarea->box.x1 + fbarea->box.y1 * width) * - info->CurrentLayout.pixel_bytes, 256); - - } + info->pciGartSize = RADEON_PCIGART_TABLE_SIZE; + info->pciGartOffset = (info->FbMapSize - info->FbSecureSize); } |