diff options
Diffstat (limited to 'src/i810_memory.c')
-rw-r--r-- | src/i810_memory.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/i810_memory.c b/src/i810_memory.c index 0ff63a5b..8b899fbe 100644 --- a/src/i810_memory.c +++ b/src/i810_memory.c @@ -128,6 +128,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) pI810->DcacheMem.End = 0; pI810->DcacheMem.Size = 0; pI810->CursorPhysical = 0; + pI810->CursorARGBPhysical = 0; /* * Dcache - half the speed of normal ram, so not really useful for @@ -191,6 +192,8 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) "Allocation of %ld bytes for HW cursor failed\n", size); pI810->HwcursKey = -1; } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Allocated of %ld bytes for HW cursor\n", size); pI810->CursorPhysical = physical; pI810->CursorStart = tom; tom += size; @@ -198,6 +201,34 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) } /* + * 16k for the ARGB cursor + */ + + size = 16384; + + if ((key = + xf86AllocateGARTMemory(pScrn->scrnIndex, size, 2, &physical)) == -1) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "No physical memory available for ARGB HW cursor\n"); + pI810->ARGBHwcursKey = -1; + pI810->CursorARGBStart = 0; + } else { + pI810->ARGBHwcursOffset = tom; + pI810->ARGBHwcursKey = key; + if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Allocation of %ld bytes for ARGB HW cursor failed\n", size); + pI810->ARGBHwcursKey = -1; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Allocated of %ld bytes for ARGB HW cursor\n", size); + pI810->CursorARGBPhysical = physical; + pI810->CursorARGBStart = tom; + tom += size; + } + } + + /* * Overlay register buffer -- Just like the cursor, the i810 needs a * physical address in system memory from which to upload the overlay * registers. @@ -345,6 +376,11 @@ I810BindGARTMemory(ScrnInfoPtr pScrn) pI810->HwcursOffset)) return FALSE; + if (pI810->ARGBHwcursKey != -1 + && !xf86BindGARTMemory(pScrn->scrnIndex, pI810->ARGBHwcursKey, + pI810->ARGBHwcursOffset)) + return FALSE; + pI810->GttBound = 1; } @@ -370,6 +406,10 @@ I810UnbindGARTMemory(ScrnInfoPtr pScrn) && !xf86UnbindGARTMemory(pScrn->scrnIndex, pI810->HwcursKey)) return FALSE; + if (pI810->ARGBHwcursKey != -1 + && !xf86UnbindGARTMemory(pScrn->scrnIndex, pI810->ARGBHwcursKey)) + return FALSE; + if (!xf86ReleaseGART(pScrn->scrnIndex)) return FALSE; |