aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/vram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/vram.c')
-rw-r--r--drivers/video/omap2/vram.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c
index fed2a72bc6b6..2fd7e5271be9 100644
--- a/drivers/video/omap2/vram.c
+++ b/drivers/video/omap2/vram.c
@@ -554,9 +554,15 @@ void __init omap_vram_reserve_sdram_memblock(void)
554 size = PAGE_ALIGN(size); 554 size = PAGE_ALIGN(size);
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, PAGE_SIZE);
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);