diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-27 19:13:33 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-27 19:13:33 +0200 |
commit | c0ee50c4ee5ff2c594fdf60c9cb8b952e25644de (patch) | |
tree | b3945862c5fb5cd4a6968fad5767aef9cd46f4c5 /src/i830_rotate.c | |
parent | 7d67324fa3a5b5cf0227550316c366752fe4abfb (diff) |
Add support for the new DRM memory manager.
Some code are duplicated with the new libdrm.
Once this code has been released with xserver,
it can be removed.
See the man page for new options and backwards
3D driver compatibility.
Diffstat (limited to 'src/i830_rotate.c')
-rw-r--r-- | src/i830_rotate.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/i830_rotate.c b/src/i830_rotate.c index 020d7e61..0471b55a 100644 --- a/src/i830_rotate.c +++ b/src/i830_rotate.c @@ -778,7 +778,7 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) /* Do heap teardown here */ - { + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { drmI830MemDestroyHeap destroy; destroy.region = I830_MEM_REGION_AGP; @@ -790,10 +790,11 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) } } - - if (pI8301->TexMem.Key != -1) - xf86UnbindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key); - I830FreeVidMem(pScrn1, &(pI8301->TexMem)); + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { + if (pI8301->TexMem.Key != -1) + xf86UnbindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key); + I830FreeVidMem(pScrn1, &(pI8301->TexMem)); + } if (pI8301->StolenPool.Allocated.Key != -1) { xf86UnbindGARTMemory(pScrn1->scrnIndex, pI8301->StolenPool.Allocated.Key); xf86DeallocateGARTMemory(pScrn1->scrnIndex, pI8301->StolenPool.Allocated.Key); @@ -943,9 +944,11 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) pI8301->disableTiling ? ALLOC_NO_TILING : 0)) goto BAIL3; - if (!I830AllocateTextureMemory(pScrn1, - pI8301->disableTiling ? ALLOC_NO_TILING : 0)) - goto BAIL4; + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { + if (!I830AllocateTextureMemory(pScrn1, + pI8301->disableTiling ? ALLOC_NO_TILING : 0)) + goto BAIL4; + } I830DoPoolAllocation(pScrn1, &(pI8301->StolenPool)); @@ -958,8 +961,10 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->DepthBuffer.Key, pI8301->DepthBuffer.Offset); if (pI8301->StolenPool.Allocated.Key != -1) xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->StolenPool.Allocated.Key, pI8301->StolenPool.Allocated.Offset); - if (pI8301->TexMem.Key != -1) - xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key, pI8301->TexMem.Offset); + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { + if (pI8301->TexMem.Key != -1) + xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key, pI8301->TexMem.Offset); + } I830SetupMemoryTiling(pScrn1); /* update fence registers */ for (i = 0; i < 8; i++) @@ -1031,7 +1036,6 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) pI830->AccelInfoRec->maxOffPixWidth = 1; pI830->AccelInfoRec->maxOffPixHeight = 1; } - return TRUE; BAIL4: @@ -1175,11 +1179,12 @@ BAIL0: pI8301->disableTiling ? ALLOC_NO_TILING : 0)) xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "Oh dear, the depth buffer failed - badness\n"); - - if (!I830AllocateTextureMemory(pScrn1, - pI8301->disableTiling ? ALLOC_NO_TILING : 0)) - xf86DrvMsg(pScrn1->scrnIndex, X_INFO, - "Oh dear, the texture cache failed - badness\n"); + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { + if (!I830AllocateTextureMemory(pScrn1, + pI8301->disableTiling ? ALLOC_NO_TILING : 0)) + xf86DrvMsg(pScrn1->scrnIndex, X_INFO, + "Oh dear, the texture cache failed - badness\n"); + } I830DoPoolAllocation(pScrn1, &(pI8301->StolenPool)); @@ -1192,8 +1197,10 @@ BAIL0: xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->DepthBuffer.Key, pI8301->DepthBuffer.Offset); if (pI8301->StolenPool.Allocated.Key != -1) xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->StolenPool.Allocated.Key, pI8301->StolenPool.Allocated.Offset); - if (pI8301->TexMem.Key != -1) - xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key, pI8301->TexMem.Offset); + if (pI8301->mmModeFlags & I830_KERNEL_TEX) { + if (pI8301->TexMem.Key != -1) + xf86BindGARTMemory(pScrn1->scrnIndex, pI8301->TexMem.Key, pI8301->TexMem.Offset); + } I830SetupMemoryTiling(pScrn1); /* update fence registers */ for (i = 0; i < 8; i++) |