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
@@ -234,5 +234,2 @@ I830AccelInit(ScreenPtr pScreen)
}
- /* Bump the pitch so that we can tile any pixmap we create. */
- if (pI830->directRenderingType >= DRI_DRI2)
- pI830->accel_pixmap_pitch_alignment = 512;
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
@@ -599,10 +599,16 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
uint32_t tiling = I915_TILING_NONE;
+ int pitch_align;
- stride = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8,
- i830->accel_pixmap_pitch_alignment);
-
- if (usage == INTEL_CREATE_PIXMAP_TILING_X)
+ if (usage == INTEL_CREATE_PIXMAP_TILING_X) {
tiling = I915_TILING_X;
- else if (usage == INTEL_CREATE_PIXMAP_TILING_Y)
+ pitch_align = 512;
+ } else if (usage == INTEL_CREATE_PIXMAP_TILING_Y) {
tiling = I915_TILING_Y;
+ pitch_align = 512;
+ } else {
+ pitch_align = i830->accel_pixmap_pitch_alignment;
+ }
+
+ stride = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8,
+ pitch_align);