summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2010-08-18 18:06:38 +0300
committerYonit Halperin <yhalperi@redhat.com>2010-08-18 18:06:38 +0300
commit12d4cae695e9b6e03f7aea9ebac93e29b8ad229b (patch)
tree2945f4bf500ea17f7f73dfd6e88c2477a1ec54d0
parent0871b3df45028aa39105ba15816a0090e760611f (diff)
aligning surfaces stride to 4
-rw-r--r--display/res.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/display/res.c b/display/res.c
index 3fe5fe6..6be006e 100644
--- a/display/res.c
+++ b/display/res.c
@@ -600,15 +600,17 @@ _inline void GetSurfaceMemory(PDev *pdev, UINT32 x, UINT32 y, UINT32 depth, UINT
*stride = x * depth / 8;
break;
case DEVICE_BITMAP_ALLOCATION_TYPE_DEVRAM:
- *base_mem = AllocMem(pdev, MSPACE_TYPE_DEVRAM, x * y * depth / 8);
- *phys_mem = PA(pdev, *base_mem, pdev->main_mem_slot);
*stride = x * depth / 8;
+ *stride = ALIGN(*stride, 4);
+ *base_mem = AllocMem(pdev, MSPACE_TYPE_DEVRAM, (*stride) * y);
+ *phys_mem = PA(pdev, *base_mem, pdev->main_mem_slot);
break;
case DEVICE_BITMAP_ALLOCATION_TYPE_VRAM: {
- *base_mem = __AllocMem(pdev, MSPACE_TYPE_VRAM, x * y * depth / 8, FALSE,
+ *stride = x * depth / 8;
+ *stride = ALIGN(*stride, 4);
+ *base_mem = __AllocMem(pdev, MSPACE_TYPE_VRAM, (*stride) * y, FALSE,
SURFACE_ALLOC_RELEASE_BUNCH_SIZE);
*phys_mem = PA(pdev, (PVOID)((UINT64)*base_mem), pdev->vram_mem_slot);
- *stride = x * depth / 8;
break;
}
default: