mdss: mdp: Free splash memory properly

We were calling free_bootmem_late, which is a __init function,
from a none __init context. We are moving to free_reserved_page.

Change-Id: I53b3b781201d46a6894f8d9fdfab1c3c5f3802b8
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
This commit is contained in:
Terence Hampson 2014-09-26 10:12:03 -04:00 committed by David Keitel
parent cbd31a3ca6
commit b99a1ae573

View file

@ -22,6 +22,8 @@
#include <linux/of_address.h>
#include <linux/fb.h>
#include <linux/dma-buf.h>
#include <linux/mm.h>
#include <asm/page.h>
#include "mdss_fb.h"
#include "mdss_mdp.h"
@ -228,6 +230,22 @@ void mdss_mdp_release_splash_pipe(struct msm_fb_data_type *mfd)
sinfo->splash_pipe_allocated = false;
}
/*
* In order to free reseved memory from bootup we are not
* able to call the __init free functions, as we could be
* passed the init boot sequence. As a reult we need to
* free this memory ourselves using the
* free_reeserved_page() function.
*/
void mdss_free_bootmem(u32 mem_addr, u32 size)
{
unsigned long pfn_start, pfn_end, pfn_idx;
pfn_start = mem_addr >> PAGE_SHIFT;
pfn_end = (mem_addr + size) >> PAGE_SHIFT;
for (pfn_idx = pfn_start; pfn_idx < pfn_end; pfn_idx++)
free_reserved_page(pfn_to_page(pfn_idx));
}
int mdss_mdp_splash_cleanup(struct msm_fb_data_type *mfd,
bool use_borderfill)
{
@ -290,8 +308,8 @@ int mdss_mdp_splash_cleanup(struct msm_fb_data_type *mfd,
/* Give back the reserved memory to the system */
memblock_free(mdp5_data->splash_mem_addr,
mdp5_data->splash_mem_size);
free_bootmem_late(mdp5_data->splash_mem_addr,
mdp5_data->splash_mem_size);
mdss_free_bootmem(mdp5_data->splash_mem_addr,
mdp5_data->splash_mem_size);
}
mdss_mdp_footswitch_ctrl_splash(0);
@ -656,8 +674,8 @@ error:
pr_debug("mem reservation not reqd if cont splash disabled\n");
memblock_free(mdp5_mdata->splash_mem_addr,
mdp5_mdata->splash_mem_size);
free_bootmem_late(mdp5_mdata->splash_mem_addr,
mdp5_mdata->splash_mem_size);
mdss_free_bootmem(mdp5_mdata->splash_mem_addr,
mdp5_mdata->splash_mem_size);
} else if (rc && mfd->panel_info->cont_splash_enabled) {
pr_err("no rsvd mem found in DT for splash screen\n");
} else {