From 024bbc7cbb924daaf3e305ddfc8e74509acd1e15 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 6 Mar 2007 16:18:59 -0800 Subject: [PATCH] Bug #9931: Fix linear allocations with a non-1-byte granularity. This was introduced in 83080809f9a1c1d24b0318e54632f25f5940da25. Instead of aligning the offset, it doubled it. Results were appropriately spectacular. --- hw/xfree86/common/xf86fbman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index d64cfaee4..537d53d7d 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -968,7 +968,7 @@ localAllocateOffscreenLinear( linear->size = h * w; linear->offset = (pitch * area->box.y1) + area->box.x1; if (gran > 1) - linear->offset += ((linear->offset + gran - 1) / gran) * gran; + linear->offset = ((linear->offset + gran - 1) / gran) * gran; linear->granularity = gran; linear->MoveLinearCallback = moveCB; linear->RemoveLinearCallback = removeCB;