summaryrefslogtreecommitdiff
path: root/src/i830_memory.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-04 14:31:37 -0700
committerEric Anholt <eric@anholt.net>2007-10-05 13:02:19 -0700
commit9e770bf69edaa8944048049e11266dbe1ef145e5 (patch)
tree3cdabc49d8a132585569d7a79b9665e9723b1eb7 /src/i830_memory.c
parentc9d6e90c2523096c45d330552f471e6bf1752704 (diff)
Replace setting of LIFETIME_FIXED on cursors with just updating the offsets.
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r--src/i830_memory.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 23d5e0c7..cdb7c47d 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1197,7 +1197,7 @@ i830_allocate_cursor_buffers(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int flags = pI830->CursorNeedsPhysical ? NEED_PHYSICAL_ADDR : NEED_LIFETIME_FIXED;
+ int flags = pI830->CursorNeedsPhysical ? NEED_PHYSICAL_ADDR : 0;
int i;
long size;
@@ -1211,35 +1211,8 @@ i830_allocate_cursor_buffers(ScrnInfoPtr pScrn)
pI830->cursor_mem = i830_allocate_memory(pScrn, "HW cursors",
size, GTT_PAGE_SIZE,
flags);
- if (pI830->cursor_mem != NULL) {
- unsigned long cursor_offset_base = pI830->cursor_mem->offset;
- unsigned long cursor_addr_base, offset = 0;
-
- if (pI830->CursorNeedsPhysical) {
- /* On any hardware that requires physical addresses for cursors,
- * the PTEs don't support memory above 4GB, so we can safely
- * ignore the top 32 bits of cursor_mem->bus_addr.
- */
- cursor_addr_base = (unsigned long)pI830->cursor_mem->bus_addr;
- } else
- cursor_addr_base = pI830->cursor_mem->offset;
-
- /* Set up the offsets for our cursors in each CRTC. */
- for (i = 0; i < xf86_config->num_crtc; i++) {
- xf86CrtcPtr crtc = xf86_config->crtc[i];
- I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
-
- intel_crtc->cursor_argb_addr = cursor_addr_base + offset;
- intel_crtc->cursor_argb_offset = cursor_offset_base + offset;
- offset += HWCURSOR_SIZE_ARGB;
-
- intel_crtc->cursor_addr = cursor_addr_base + offset;
- intel_crtc->cursor_offset = cursor_offset_base + offset;
- offset += HWCURSOR_SIZE;
- }
-
+ if (pI830->cursor_mem != NULL)
return TRUE;
- }
/*
* Allocate four separate buffers when the kernel doesn't support
@@ -1265,21 +1238,6 @@ i830_allocate_cursor_buffers(ScrnInfoPtr pScrn)
if (!pI830->cursor_mem_argb[i])
return FALSE;
- /*
- * Set up the pointers into the allocations
- */
- if (pI830->CursorNeedsPhysical)
- {
- intel_crtc->cursor_addr = pI830->cursor_mem_classic[i]->bus_addr;
- intel_crtc->cursor_argb_addr = pI830->cursor_mem_argb[i]->bus_addr;
- }
- else
- {
- intel_crtc->cursor_addr = pI830->cursor_mem_classic[i]->offset;
- intel_crtc->cursor_argb_addr = pI830->cursor_mem_argb[i]->offset;
- }
- intel_crtc->cursor_offset = pI830->cursor_mem_classic[i]->offset;
- intel_crtc->cursor_argb_offset = pI830->cursor_mem_argb[i]->offset;
}
return TRUE;
}
@@ -1935,6 +1893,7 @@ i830_bind_all_memory(ScrnInfoPtr pScrn)
}
#endif
}
+ i830_update_cursor_offsets(pScrn);
return TRUE;
}