diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-14 19:46:55 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-14 19:46:55 +0000 |
commit | ebedc8bbb54b9b4e1814bc2758216af2bab93540 (patch) | |
tree | 98b942007c17210130e5cbed9d3f389b296bccb2 | |
parent | e3509c940fa1fc3988d23f884ca8bffc87d091e5 (diff) |
- 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.
-rw-r--r-- | exa/exa.c | 6 | ||||
-rw-r--r-- | exa/exa.h | 4 | ||||
-rw-r--r-- | exa/exa_accel.c | 6 | ||||
-rw-r--r-- | exa/exa_migration.c | 6 | ||||
-rw-r--r-- | exa/exa_offscreen.c | 3 | ||||
-rw-r--r-- | hw/xfree86/exa/exa.c | 6 | ||||
-rw-r--r-- | hw/xfree86/exa/exa.h | 4 | ||||
-rw-r--r-- | hw/xfree86/exa/exa_accel.c | 6 | ||||
-rw-r--r-- | hw/xfree86/exa/exa_migration.c | 6 | ||||
-rw-r--r-- | hw/xfree86/exa/exa_offscreen.c | 3 | ||||
-rw-r--r-- | hw/xfree86/exa/exaoffscreen.c | 3 |
11 files changed, 28 insertions, 25 deletions
@@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) @@ -72,8 +72,8 @@ typedef struct _ExaCardInfo { << 10, >>10 all over the place */ unsigned long memorySize; - int offscreenByteAlign; - int offscreenPitch; + int pixmapOffsetAlign; + int pixmapPitchAlign; int flags; /* The coordinate limitations for rendering for this hardware. diff --git a/exa/exa_accel.c b/exa/exa_accel.c index f7574586d..5ba8af356 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) diff --git a/exa/exa_migration.c b/exa/exa_migration.c index f7574586d..5ba8af356 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c index 6b1a160ed..dbca172c4 100644 --- a/exa/exa_offscreen.c +++ b/exa/exa_offscreen.c @@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align, area->score = 0; 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); diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c index f7574586d..5ba8af356 100644 --- a/hw/xfree86/exa/exa.c +++ b/hw/xfree86/exa/exa.c @@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) diff --git a/hw/xfree86/exa/exa.h b/hw/xfree86/exa/exa.h index 3464b94d2..f4c129756 100644 --- a/hw/xfree86/exa/exa.h +++ b/hw/xfree86/exa/exa.h @@ -72,8 +72,8 @@ typedef struct _ExaCardInfo { << 10, >>10 all over the place */ unsigned long memorySize; - int offscreenByteAlign; - int offscreenPitch; + int pixmapOffsetAlign; + int pixmapPitchAlign; int flags; /* The coordinate limitations for rendering for this hardware. diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c index f7574586d..5ba8af356 100644 --- a/hw/xfree86/exa/exa_accel.c +++ b/hw/xfree86/exa/exa_accel.c @@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c index f7574586d..5ba8af356 100644 --- a/hw/xfree86/exa/exa_migration.c +++ b/hw/xfree86/exa/exa_migration.c @@ -162,13 +162,13 @@ exaPixmapAllocArea (PixmapPtr pPixmap) if (pExaScr->info->card.flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) w = 1 << (exaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pExaScr->info->card.offscreenPitch - 1) & - ~(pExaScr->info->card.offscreenPitch - 1); + pitch = (w * bpp / 8) + (pExaScr->info->card.pixmapPitchAlign - 1); + pitch -= pitch % pExaScr->info->card.pixmapPitchAlign; pExaPixmap->devKind = pPixmap->devKind; pExaPixmap->devPrivate = pPixmap->devPrivate; pExaPixmap->area = exaOffscreenAlloc (pScreen, pitch * h, - pExaScr->info->card.offscreenByteAlign, + pExaScr->info->card.pixmapOffsetAlign, FALSE, exaPixmapSave, (pointer) pPixmap); if (!pExaPixmap->area) diff --git a/hw/xfree86/exa/exa_offscreen.c b/hw/xfree86/exa/exa_offscreen.c index 6b1a160ed..dbca172c4 100644 --- a/hw/xfree86/exa/exa_offscreen.c +++ b/hw/xfree86/exa/exa_offscreen.c @@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align, area->score = 0; 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); diff --git a/hw/xfree86/exa/exaoffscreen.c b/hw/xfree86/exa/exaoffscreen.c index 6b1a160ed..dbca172c4 100644 --- a/hw/xfree86/exa/exaoffscreen.c +++ b/hw/xfree86/exa/exaoffscreen.c @@ -212,7 +212,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align, area->score = 0; 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); |