summaryrefslogtreecommitdiff
path: root/src/i810_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i810_memory.c')
-rw-r--r--src/i810_memory.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/src/i810_memory.c b/src/i810_memory.c
index 5efa23a9..749997f4 100644
--- a/src/i810_memory.c
+++ b/src/i810_memory.c
@@ -149,7 +149,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
pI810->DcacheKey = key;
if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Allocation of %d bytes for DCACHE failed\n", size);
+ "Allocation of %ld bytes for DCACHE failed\n", size);
pI810->DcacheKey = -1;
} else {
pI810->DcacheMem.Start = tom;
@@ -159,7 +159,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
}
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "No physical memory available for %d bytes of DCACHE\n",
+ "No physical memory available for %ld bytes of DCACHE\n",
size);
pI810->DcacheKey = -1;
}
@@ -188,9 +188,11 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn)
pI810->HwcursKey = key;
if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Allocation of %d bytes for HW cursor failed\n", size);
+ "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 +200,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 +375,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 +405,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;