summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-07-15 16:38:07 -0700
committerEric Anholt <eric@anholt.net>2009-07-22 09:16:00 -0700
commit6b7728491c3b771bcba2c7ffd75330c0a0b37f44 (patch)
treef07b12a878b0948ec90df9588658c202d6bdf663
parent22f7cbc32b70a89d55c79bbea39fb10c50a310ec (diff)
Only align DRI2 tiled pixmaps to the DRI2 tiled pixmap alignment requirement.
This should save significant amounts of memory for glyph and other small pixmap storage. Bug #21387
-rw-r--r--src/i830_accel.c3
-rw-r--r--src/i830_uxa.c16
2 files changed, 11 insertions, 8 deletions
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 96a7bde8..abefa559 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -232,9 +232,6 @@ I830AccelInit(ScreenPtr pScreen)
232 pI830->accel_max_x = 2048; 232 pI830->accel_max_x = 2048;
233 pI830->accel_max_y = 2048; 233 pI830->accel_max_y = 2048;
234 } 234 }
235 /* Bump the pitch so that we can tile any pixmap we create. */
236 if (pI830->directRenderingType >= DRI_DRI2)
237 pI830->accel_pixmap_pitch_alignment = 512;
238 235
239 return i830_uxa_init(pScreen); 236 return i830_uxa_init(pScreen);
240} 237}
diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index 3212582a..3a476a79 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -597,14 +597,20 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
597 { 597 {
598 unsigned int size; 598 unsigned int size;
599 uint32_t tiling = I915_TILING_NONE; 599 uint32_t tiling = I915_TILING_NONE;
600 int pitch_align;
600 601
601 stride = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8, 602 if (usage == INTEL_CREATE_PIXMAP_TILING_X) {
602 i830->accel_pixmap_pitch_alignment);
603
604 if (usage == INTEL_CREATE_PIXMAP_TILING_X)
605 tiling = I915_TILING_X; 603 tiling = I915_TILING_X;
606 else if (usage == INTEL_CREATE_PIXMAP_TILING_Y) 604 pitch_align = 512;
605 } else if (usage == INTEL_CREATE_PIXMAP_TILING_Y) {
607 tiling = I915_TILING_Y; 606 tiling = I915_TILING_Y;
607 pitch_align = 512;
608 } else {
609 pitch_align = i830->accel_pixmap_pitch_alignment;
610 }
611
612 stride = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8,
613 pitch_align);
608 614
609 if (tiling == I915_TILING_NONE) { 615 if (tiling == I915_TILING_NONE) {
610 size = stride * h; 616 size = stride * h;