fmem: Do not place fmem at the top of memory
Placing fmem at the top of memory causes a failure
of camcorder preview and video playback.
Place fmem one page below the top of memory to
prevent this from happening.
Change-Id: I60cbfd5c8a19b83f994d1f5b3df580954b5aee4c
CRs-fixed: 335974
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
diff --git a/arch/arm/mach-msm/memory.c b/arch/arm/mach-msm/memory.c
index 46695c4..3b064ff 100644
--- a/arch/arm/mach-msm/memory.c
+++ b/arch/arm/mach-msm/memory.c
@@ -315,7 +315,12 @@
return 0;
mb = &meminfo.bank[meminfo.nr_banks - 1];
- fmem_phys = mb->start + (mb->size - fmem_size);
+ /*
+ * Placing fmem at the top of memory causes multimedia issues.
+ * Instead, place it 1 page below the top of memory to prevent
+ * the issues from occurring.
+ */
+ fmem_phys = mb->start + (mb->size - fmem_size) - PAGE_SIZE;
ret = memblock_remove(fmem_phys, fmem_size);
BUG_ON(ret);