- Fix the exa pixmap offset/pitch alignment to deal with non-POT alignment
requirements. MGA, notably, uses a multiple of 3 in some cases. - Rename the pixmap offset/pitch alignment fields to more clearly state their meaning.
This commit is contained in:
parent
e3509c940f
commit
ebedc8bbb5
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -72,8 +72,8 @@ typedef struct _ExaCardInfo {
|
||||||
<< 10, >>10 all over the place */
|
<< 10, >>10 all over the place */
|
||||||
unsigned long memorySize;
|
unsigned long memorySize;
|
||||||
|
|
||||||
int offscreenByteAlign;
|
int pixmapOffsetAlign;
|
||||||
int offscreenPitch;
|
int pixmapPitchAlign;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
/* The coordinate limitations for rendering for this hardware.
|
/* The coordinate limitations for rendering for this hardware.
|
||||||
|
|
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
|
||||||
area->score = 0;
|
area->score = 0;
|
||||||
|
|
||||||
area->save_offset = area->offset;
|
area->save_offset = area->offset;
|
||||||
area->offset = (area->offset + align - 1) & ~(align - 1);
|
area->offset = (area->offset + align - 1);
|
||||||
|
area->offset -= area->offset % align;
|
||||||
|
|
||||||
ExaOffscreenValidate (pScreen);
|
ExaOffscreenValidate (pScreen);
|
||||||
|
|
||||||
|
|
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -72,8 +72,8 @@ typedef struct _ExaCardInfo {
|
||||||
<< 10, >>10 all over the place */
|
<< 10, >>10 all over the place */
|
||||||
unsigned long memorySize;
|
unsigned long memorySize;
|
||||||
|
|
||||||
int offscreenByteAlign;
|
int pixmapOffsetAlign;
|
||||||
int offscreenPitch;
|
int pixmapPitchAlign;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
/* The coordinate limitations for rendering for this hardware.
|
/* The coordinate limitations for rendering for this hardware.
|
||||||
|
|
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
|
||||||
w = 1 << (exaLog2(w - 1) + 1);
|
w = 1 << (exaLog2(w - 1) + 1);
|
||||||
pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) &
|
pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1);
|
||||||
~(pExaScr->info->card.offscreenPitch - 1);
|
pitch -= pitch % pExaScr->info->card.pixmapPitchAlign;
|
||||||
|
|
||||||
pExaPixmap->devKind = pPixmap->devKind;
|
pExaPixmap->devKind = pPixmap->devKind;
|
||||||
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
pExaPixmap->devPrivate = pPixmap->devPrivate;
|
||||||
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h,
|
||||||
pExaScr->info->card.offscreenByteAlign,
|
pExaScr->info->card.pixmapOffsetAlign,
|
||||||
FALSE,
|
FALSE,
|
||||||
exaPixmapSave, (pointer) pPixmap);
|
exaPixmapSave, (pointer) pPixmap);
|
||||||
if (!pExaPixmap->area)
|
if (!pExaPixmap->area)
|
||||||
|
|
|
@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
|
||||||
area->score = 0;
|
area->score = 0;
|
||||||
|
|
||||||
area->save_offset = area->offset;
|
area->save_offset = area->offset;
|
||||||
area->offset = (area->offset + align - 1) & ~(align - 1);
|
area->offset = (area->offset + align - 1);
|
||||||
|
area->offset -= area->offset % align;
|
||||||
|
|
||||||
ExaOffscreenValidate (pScreen);
|
ExaOffscreenValidate (pScreen);
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
|
||||||
area->score = 0;
|
area->score = 0;
|
||||||
|
|
||||||
area->save_offset = area->offset;
|
area->save_offset = area->offset;
|
||||||
area->offset = (area->offset + align - 1) & ~(align - 1);
|
area->offset = (area->offset + align - 1);
|
||||||
|
area->offset -= area->offset % align;
|
||||||
|
|
||||||
ExaOffscreenValidate (pScreen);
|
ExaOffscreenValidate (pScreen);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue