diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-01-03 11:17:44 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-01-03 11:17:44 +0000 |
commit | 1e1a35e20c1d281bc9700b349cda1e67f65905dd (patch) | |
tree | 9679c9c218898d6bef30adb90696c295254f6903 | |
parent | 354f8f7e943d1a0732f4181420211efff27532b8 (diff) |
Actually align the offset of allocated offscreen areas.
-rw-r--r-- | hw/kdrive/src/kdrive.h | 1 | ||||
-rw-r--r-- | hw/kdrive/src/koffscreen.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 6119128d4..bee6393b7 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -121,6 +121,7 @@ typedef enum _KdOffscreenState { struct _KdOffscreenArea { int offset; + int save_offset; int size; pointer privData; diff --git a/hw/kdrive/src/koffscreen.c b/hw/kdrive/src/koffscreen.c index 5f5c92f11..41f0a29e5 100644 --- a/hw/kdrive/src/koffscreen.c +++ b/hw/kdrive/src/koffscreen.c @@ -195,7 +195,10 @@ KdOffscreenAlloc (ScreenPtr pScreen, int size, int align, area->state = KdOffscreenRemovable; area->privData = privData; area->save = save; - + + area->save_offset = area->offset; + area->offset = (area->offset + align - 1) & ~(align - 1); + KdOffscreenValidate (pScreen); DBG_OFFSCREEN (("Alloc 0x%x -> 0x%x\n", size, area->offset)); @@ -260,6 +263,7 @@ KdOffscreenFree (ScreenPtr pScreen, KdOffscreenArea *area) area->state = KdOffscreenAvail; area->save = 0; + area->offset = area->save_offset; /* * Find previous area |