diff options
Diffstat (limited to 'drivers/video/omap2/vram.c')
-rw-r--r-- | drivers/video/omap2/vram.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index fed2a72bc6b6..9441e2eb3dee 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
@@ -551,12 +551,18 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
551 | if (!size) | 551 | if (!size) |
552 | return; | 552 | return; |
553 | 553 | ||
554 | size = PAGE_ALIGN(size); | 554 | size = ALIGN(size, SZ_2M); |
555 | 555 | ||
556 | if (paddr) { | 556 | if (paddr) { |
557 | if ((paddr & ~PAGE_MASK) || | 557 | if (paddr & ~PAGE_MASK) { |
558 | !memblock_is_region_memory(paddr, size)) { | 558 | pr_err("VRAM start address 0x%08x not page aligned\n", |
559 | pr_err("Illegal SDRAM region for VRAM\n"); | 559 | paddr); |
560 | return; | ||
561 | } | ||
562 | |||
563 | if (!memblock_is_region_memory(paddr, size)) { | ||
564 | pr_err("Illegal SDRAM region 0x%08x..0x%08x for VRAM\n", | ||
565 | paddr, paddr + size - 1); | ||
560 | return; | 566 | return; |
561 | } | 567 | } |
562 | 568 | ||
@@ -570,9 +576,12 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
570 | return; | 576 | return; |
571 | } | 577 | } |
572 | } else { | 578 | } else { |
573 | paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT); | 579 | paddr = memblock_alloc(size, SZ_2M); |
574 | } | 580 | } |
575 | 581 | ||
582 | memblock_free(paddr, size); | ||
583 | memblock_remove(paddr, size); | ||
584 | |||
576 | omap_vram_add_region(paddr, size); | 585 | omap_vram_add_region(paddr, size); |
577 | 586 | ||
578 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); | 587 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); |