diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-12-14 07:16:59 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-12-15 04:16:08 -0500 |
commit | 4422c04bbb09f1864e2ce27296457f86d4167fe2 (patch) | |
tree | 43df9d94a388b61174ff99b3e768ed4ce3020cd0 | |
parent | cf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff) |
OMAP: DSS: VRAM: Align start & size of vram to 2M
Align the start address and size of VRAM area to 2M as per comments from
Russell King:
> > So, why SZ_2M?
>
> Firstly, that's the granularity which we allocate page tables - one
> Linux page table covers 2MB of memory. We want to avoid creating page
> tables for the main memory mapping as that increases TLB pressure through
> the use of additional TLB entries, and more page table walks.
>
> Plus, we never used to allow the kernel's direct memory mapping to be
> mapped at anything less than section size - this restriction has since
> been lifted due to OMAP SRAM problems, but I'd rather we stuck with it
> to ensure that we have proper behaviour from all parts of the system.
>
> Secondly, we don't want to end up with lots of fragmentation at the end
> of the memory mapping as that'll reduce performance, not only by making
> the pfn_valid() search more expensive.
>
> Emsuring a minimum allocation size and alignment makes sure that the
> regions can be coalesced together into one block, and minimises run-time
> expenses.
>
> So please, 2MB, or if you object, at the _very_ _least_ 1MB. But
> definitely not PAGE_SIZE.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | drivers/video/omap2/vram.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index 2fd7e5271be9..9441e2eb3dee 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
@@ -551,7 +551,7 @@ 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) { |
@@ -576,7 +576,7 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
576 | return; | 576 | return; |
577 | } | 577 | } |
578 | } else { | 578 | } else { |
579 | paddr = memblock_alloc(size, PAGE_SIZE); | 579 | paddr = memblock_alloc(size, SZ_2M); |
580 | } | 580 | } |
581 | 581 | ||
582 | memblock_free(paddr, size); | 582 | memblock_free(paddr, size); |