xf86-video-intel: 3 commits - src/i830_cursor.c src/i830.h src/i830_memory.c
Eric Anholt
anholt at kemper.freedesktop.org
Fri Oct 5 13:03:38 PDT 2007
src/i830.h | 1
src/i830_cursor.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/i830_memory.c | 59 ++++++------------------------------------------------
3 files changed, 65 insertions(+), 53 deletions(-)
New commits:
diff-tree 9e770bf69edaa8944048049e11266dbe1ef145e5 (from c9d6e90c2523096c45d330552f471e6bf1752704)
Author: Eric Anholt <eric at anholt.net>
Date: Thu Oct 4 14:31:37 2007 -0700
Replace setting of LIFETIME_FIXED on cursors with just updating the offsets.
diff --git a/src/i830.h b/src/i830.h
index 0a4b4a7..a04f937 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -583,6 +583,7 @@ extern void IntelEmitInvarientState(Scrn
extern void I830EmitInvarientState(ScrnInfoPtr pScrn);
extern void I915EmitInvarientState(ScrnInfoPtr pScrn);
extern void I830SelectBuffer(ScrnInfoPtr pScrn, int buffer);
+void i830_update_cursor_offsets(ScrnInfoPtr pScrn);
/* CRTC-based cursor functions */
void
diff --git a/src/i830_cursor.c b/src/i830_cursor.c
index 667b0a6..52eb266 100644
--- a/src/i830_cursor.c
+++ b/src/i830_cursor.c
@@ -1,4 +1,4 @@
-/* -*- c-basic-offset: 3 -*- */
+/* -*- c-basic-offset: 4 -*- */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -275,3 +275,59 @@ i830_crtc_set_cursor_colors (xf86CrtcPtr
OUTREG(pal0 + 8, fg & 0x00ffffff);
OUTREG(pal0 + 12, bg & 0x00ffffff);
}
+
+void
+i830_update_cursor_offsets (ScrnInfoPtr pScrn)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int i;
+
+ if (pI830->cursor_mem) {
+ unsigned long cursor_offset_base = pI830->cursor_mem->offset;
+ unsigned long cursor_addr_base, offset = 0;
+
+ /* Single memory buffer for cursors */
+ 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;
+
+ 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;
+ }
+ } else {
+ /* Separate allocations per cursor */
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
+
+ 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;
+ }
+ }
+}
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 23d5e0c..cdb7c47 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1197,7 +1197,7 @@ i830_allocate_cursor_buffers(ScrnInfoPtr
{
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
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
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;
}
diff-tree c9d6e90c2523096c45d330552f471e6bf1752704 (from 1cc6bec4628a4ca04a68919a84148a1e6312072f)
Author: Eric Anholt <eric at anholt.net>
Date: Thu Oct 4 14:27:07 2007 -0700
Don't set overlay registers LIFETIME_FIXED. It always uses the current offset.
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 7671b5b..23d5e0c 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -993,20 +993,16 @@ static Bool
i830_allocate_overlay(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- int flags = NEED_PHYSICAL_ADDR | NEED_LIFETIME_FIXED;
+ int flags = 0;
/* Only allocate if overlay is going to be enabled. */
if (!pI830->XvEnabled)
return TRUE;
- if (OVERLAY_NOPHYSICAL(pI830))
- flags &= ~NEED_PHYSICAL_ADDR;
+ if (!OVERLAY_NOPHYSICAL(pI830))
+ flags |= NEED_PHYSICAL_ADDR;
if (!IS_I965G(pI830)) {
- /* XXX: The lifetime fixed offset for overlay register is bogus, and we
- * should just tell i830_video.c about the new location at EnterVT
- * time.
- */
pI830->overlay_regs = i830_allocate_memory(pScrn, "overlay registers",
OVERLAY_SIZE, GTT_PAGE_SIZE,
flags);
diff-tree 1cc6bec4628a4ca04a68919a84148a1e6312072f (from dfa22df8ce7713b491c4766ce6ce652db91b5f90)
Author: Eric Anholt <eric at anholt.net>
Date: Thu Oct 4 14:23:48 2007 -0700
Revert setting of exa_965_state as LIFETIME_FIXED.
The current offset is used every time in render setup.
diff --git a/src/i830_memory.c b/src/i830_memory.c
index d2aa327..7671b5b 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1389,7 +1389,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScr
if (IS_I965G(pI830) && !pI830->noAccel && pI830->exa_965_state == NULL) {
pI830->exa_965_state =
i830_allocate_memory(pScrn, "exa G965 state buffer",
- EXA_LINEAR_EXTRA, GTT_PAGE_SIZE, NEED_LIFETIME_FIXED);
+ EXA_LINEAR_EXTRA, GTT_PAGE_SIZE, 0);
if (pI830->exa_965_state == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Failed to allocate exa state buffer for 965.\n");
More information about the xorg-commit
mailing list