diff options
-rw-r--r-- | man/i810.man | 7 | ||||
-rw-r--r-- | src/common.h | 4 | ||||
-rw-r--r-- | src/i830_memory.c | 35 |
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; /* |