From 6b7728491c3b771bcba2c7ffd75330c0a0b37f44 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 15 Jul 2009 16:38:07 -0700 Subject: [PATCH] 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 --- src/i830_accel.c | 3 --- src/i830_uxa.c | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 9 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) pI830->accel_max_x = 2048; pI830->accel_max_y = 2048; } - /* Bump the pitch so that we can tile any pixmap we create. */ - if (pI830->directRenderingType >= DRI_DRI2) - pI830->accel_pixmap_pitch_alignment = 512; return i830_uxa_init(pScreen); } 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 { unsigned int size; uint32_t tiling = I915_TILING_NONE; + int pitch_align; + + if (usage == INTEL_CREATE_PIXMAP_TILING_X) { + tiling = I915_TILING_X; + 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, - i830->accel_pixmap_pitch_alignment); - - if (usage == INTEL_CREATE_PIXMAP_TILING_X) - tiling = I915_TILING_X; - else if (usage == INTEL_CREATE_PIXMAP_TILING_Y) - tiling = I915_TILING_Y; + pitch_align); if (tiling == I915_TILING_NONE) { size = stride * h;