diff options
author | Keith Packard <keithp@keithp.com> | 2004-05-20 02:42:20 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2004-05-20 02:42:20 +0000 |
commit | 94648799c82e59166155ca5abf22a9391693e6a1 (patch) | |
tree | 78881555935204ee16bccb4e589f07fd8255b393 /hw/kdrive/src/koffscreen.c | |
parent | cade317d31dddab61199d5e90bcff36fb12f3cd1 (diff) |
Pin header-only pixmaps in memory.
Off-screen reallocation could have used a stale pointer.
Separate framebuffer mapping computation from actual frame buffer mapping.
Now map the frame buffer from vesaEnable so that VT switch shares the
same mapping code. This makes sure any shadow framebuffer is allocated
again.
Diffstat (limited to 'hw/kdrive/src/koffscreen.c')
-rw-r--r-- | hw/kdrive/src/koffscreen.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/hw/kdrive/src/koffscreen.c b/hw/kdrive/src/koffscreen.c index 41f0a29e5..09e7273d0 100644 --- a/hw/kdrive/src/koffscreen.c +++ b/hw/kdrive/src/koffscreen.c @@ -55,12 +55,12 @@ KdOffscreenValidate (ScreenPtr pScreen) #define KdOffscreenValidate(s) #endif -static void +static KdOffscreenArea * KdOffscreenKickOut (ScreenPtr pScreen, KdOffscreenArea *area) { if (area->save) (*area->save) (pScreen, area); - KdOffscreenFree (pScreen, area); + return KdOffscreenFree (pScreen, area); } KdOffscreenArea * @@ -161,14 +161,14 @@ KdOffscreenAlloc (ScreenPtr pScreen, int size, int align, * Kick out first area if in use */ if (area->state != KdOffscreenAvail) - KdOffscreenKickOut (pScreen, area); + area = KdOffscreenKickOut (pScreen, area); /* * Now get the system to merge the other needed areas together */ while (area->size < real_size) { assert (area->next && area->next->state == KdOffscreenRemovable); - KdOffscreenKickOut (pScreen, area->next); + (void) KdOffscreenKickOut (pScreen, area->next); } } @@ -225,7 +225,7 @@ KdOffscreenSwapOut (ScreenPtr pScreen) break; } assert (area->state != KdOffscreenAvail); - KdOffscreenKickOut (pScreen, area); + (void) KdOffscreenKickOut (pScreen, area); KdOffscreenValidate (pScreen); } KdOffscreenValidate (pScreen); @@ -251,7 +251,7 @@ KdOffscreenMerge (KdOffscreenArea *area) xfree (next); } -void +KdOffscreenArea * KdOffscreenFree (ScreenPtr pScreen, KdOffscreenArea *area) { KdScreenPriv(pScreen); @@ -281,9 +281,13 @@ KdOffscreenFree (ScreenPtr pScreen, KdOffscreenArea *area) /* link with prev area if free */ if (prev && prev->state == KdOffscreenAvail) - KdOffscreenMerge (prev); + { + area = prev; + KdOffscreenMerge (area); + } KdOffscreenValidate (pScreen); + return area; } Bool |