summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-01-11 10:36:33 -0800
committerEric Anholt <eric@anholt.net>2007-01-11 11:03:13 -0800
commitf5d528f8ea27de31054e7f1843e34d8379f811ea (patch)
tree08473ddc682e2d38381d1f2efab0e34e2ae3e80d
parentd13bc016c0723f1df633ddaf5610ad73003b7c96 (diff)
Don't limit cachelines to a vertical of 2048, and increase default allocation.
The cachelines are used for two things: XAA pixmap cache and XV memory. Only XAA pixmap cache is referred to using an offset pointing at the beginning of the front buffer in rendering, and XAA only uses the 2d BLT engine, which actually has a vertical limit of 65536. So, pixmap cache is now limited to that much vertical. Additionally, the previous cachelines allocation was too small for our advertised XV limits, so video at the limits would fail with BadAlloc. Now, XAA allocates the same approximate amount of offscreen memory as EXA: 3 times the screen size, plus one packed HD video.
-rw-r--r--man/i810.man7
-rw-r--r--src/common.h4
-rw-r--r--src/i830_memory.c35
3 files changed, 23 insertions, 23 deletions
diff --git a/man/i810.man b/man/i810.man
index ff458098..d1ee2da0 100644
--- a/man/i810.man
+++ b/man/i810.man
@@ -84,9 +84,12 @@ This allows the user to change the amount of graphics memory used for
2D acceleration and video. Decreasing this amount leaves more for 3D
textures. Increasing it can improve 2D performance at the expense of
3D performance.
+.TP
+This option only takes effect when XAA acceleration is enabled.
+.TP
Default: depends on the resolution, depth, and available video memory. The
-driver attempts to allocate at least enough to hold two DVD-sized YUV buffers
-by default. The default used for a specific configuration can be found
+driver attempts to allocate space for at 3 screenfuls of pixmaps plus an
+HD-sized XV video. The default used for a specific configuration can be found
by examining the __xservername__ log file.
.TP
.BI "Option \*qDRI\*q \*q" boolean \*q
diff --git a/src/common.h b/src/common.h
index 2035862f..561dfac7 100644
--- a/src/common.h
+++ b/src/common.h
@@ -339,10 +339,6 @@ extern int I810_DEBUG;
#define I810_CURSOR_X 64
#define I810_CURSOR_Y I810_CURSOR_X
-/* XXX Need to check if these are reasonable. */
-#define MAX_DISPLAY_PITCH 2048
-#define MAX_DISPLAY_HEIGHT 2048
-
#define PIPE_NAME(n) ('A' + (n))
#endif /* _INTEL_COMMON_H_ */
diff --git a/src/i830_memory.c b/src/i830_memory.c
index af866889..426242a9 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -637,6 +637,13 @@ GetFreeSpace(ScrnInfoPtr pScrn)
return extra;
}
+/* This is the 2D rendering vertical coordinate limit. We can ignore
+ * the 3D rendering limits in our 2d pixmap cache allocation, because XAA
+ * doesn't do any 3D rendering to/from the cache lines when using an offset
+ * at the start of framebuffer.
+ */
+#define MAX_2D_HEIGHT 65536
+
/**
* Allocates a framebuffer for a screen.
*
@@ -698,25 +705,19 @@ I830AllocateFramebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
"maxCacheLines < 0 in I830Allocate2DMemory()\n");
maxCacheLines = 0;
}
- if (maxCacheLines > (MAX_DISPLAY_HEIGHT - pScrn->virtualY))
- maxCacheLines = MAX_DISPLAY_HEIGHT - pScrn->virtualY;
+ if (maxCacheLines > (MAX_2D_HEIGHT - pScrn->virtualY))
+ maxCacheLines = MAX_2D_HEIGHT - pScrn->virtualY;
if (pI830->CacheLines >= 0) {
cacheLines = pI830->CacheLines;
} else {
-#if 1
- /* Make sure there is enough for two DVD sized YUV buffers */
- cacheLines = (pScrn->depth == 24) ? 256 : 384;
- if (pScrn->displayWidth <= 1024)
- cacheLines *= 2;
-#else
- /*
- * Make sure there is enough for two DVD sized YUV buffers.
- * Make that 1.5MB, which is around what was allocated with
- * the old algorithm
- */
- cacheLines = (MB(1) + KB(512)) / pI830->cpp / pScrn->displayWidth;
-#endif
+ int size;
+
+ size = 3 * lineSize * pScrn->virtualY;
+ size += 1920 * 1088 * 2 * 2;
+ size = ROUND_TO_PAGE(size);
+
+ cacheLines = (size + lineSize - 1) / lineSize;
}
if (cacheLines > maxCacheLines)
cacheLines = maxCacheLines;
@@ -902,8 +903,8 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags)
maxFb = pI830->FrontBuffer.Size + extra;
lineSize = pScrn->displayWidth * pI830->cpp;
maxFb = ROUND_DOWN_TO(maxFb, lineSize);
- if (maxFb > lineSize * MAX_DISPLAY_HEIGHT)
- maxFb = lineSize * MAX_DISPLAY_HEIGHT;
+ if (maxFb > lineSize * MAX_2D_HEIGHT)
+ maxFb = lineSize * MAX_2D_HEIGHT;
if (0/*maxFb > pI830->FrontBuffer.Size*/) {
unsigned long oldsize;
/*