diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2010-08-18 18:06:38 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2010-08-18 18:06:38 +0300 |
commit | 12d4cae695e9b6e03f7aea9ebac93e29b8ad229b (patch) | |
tree | 2945f4bf500ea17f7f73dfd6e88c2477a1ec54d0 | |
parent | 0871b3df45028aa39105ba15816a0090e760611f (diff) |
aligning surfaces stride to 4
-rw-r--r-- | display/res.c | 10 |
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: |