diff options
author | Eric Anholt <eric@anholt.net> | 2008-09-03 16:49:07 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-09-04 16:26:44 +0100 |
commit | fba9b5aff450d874ef98cafd3ecc0fd85f9597b5 (patch) | |
tree | bace8cc736d9ca9f1430c9236c09379061ca68ff | |
parent | 71ec627c3a65cfc7bca7353af43c60b18e73230d (diff) |
DRI2: Move pixmap pitch alignment for use with depth to pixmap create.
The previous location for pitch fixup would have only worked when depth was
used with the backbuffer, and no page flipping or other adventures occurred.
-rw-r--r-- | src/i830_accel.c | 3 | ||||
-rw-r--r-- | src/i830_dri.c | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/i830_accel.c b/src/i830_accel.c index 4059121f..c6044a56 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -302,6 +302,7 @@ I830AccelInit(ScreenPtr pScreen) * i915 limits 3D textures to pitch of 16B - 8kB, in dwords. * i915 limits 3D destination to ~4kB-aligned offset if tiled. * i915 limits 3D destination to pitch of 16B - 8kB, in dwords, if un-tiled. + * i915 limits 3D destination to pitch 64B-aligned if used with depth. * i915 limits 3D destination to pitch of 512B - 8kB, in tiles, if tiled. * i915 limits 3D destination to POT aligned pitch if tiled. * i915 limits 3D destination drawing rect to w,h of 2048,2048. @@ -326,7 +327,7 @@ I830AccelInit(ScreenPtr pScreen) pI830->accel_max_y = 8192; } else { pI830->accel_pixmap_offset_alignment = 4; - pI830->accel_pixmap_pitch_alignment = 16; + pI830->accel_pixmap_pitch_alignment = 64; pI830->accel_max_x = 2048; pI830->accel_max_y = 2048; } diff --git a/src/i830_dri.c b/src/i830_dri.c index 56339f39..3168a4b0 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -1830,7 +1830,7 @@ I830DRI2CreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) ScreenPtr pScreen = pDraw->pScreen; DRI2BufferPtr buffers; dri_bo *bo; - int i, depth, width, cpp; + int i; I830DRI2BufferPrivatePtr privates; PixmapPtr pPixmap, pDepthPixmap; @@ -1841,11 +1841,7 @@ I830DRI2CreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) if (privates == NULL) { xfree(buffers); return NULL; - } - - /* The byte rowstride for 3D buffers must be a multiple of 64 bytes. */ - cpp = pDraw->bitsPerPixel / 8; - width = ((pDraw->width * cpp + 63) & ~63) / cpp; + } pDepthPixmap = NULL; for (i = 0; i < count; i++) { @@ -1860,9 +1856,9 @@ I830DRI2CreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) pPixmap->refcnt++; } else { pPixmap = (*pScreen->CreatePixmap)(pScreen, - width, - pDraw->height, - pDraw->depth, 0); + pDraw->width, + pDraw->height, + pDraw->depth, 0); } if (attachments[i] == DRI2_BUFFER_DEPTH) |