From 4c8199537e43f7bdb6f8013e5edf001837c7c3d7 Mon Sep 17 00:00:00 2001 From: Dhaval Patel Date: Wed, 29 Oct 2014 11:23:15 -0700 Subject: [PATCH] msm: mdss: attach iommu dynamically for video mode panel MDSS driver supports iommu dynamic attach only when splash thread is enabled. Client might want to attach the iommu dynamically without using splash thread to avoid blink for video mode panel. That is possible by doing 1-to-1 memory mapping before iommu attach and splash memory late release. This change supports the dynamic memory mapping to avoid splash thread. Release the splash memory in first commit instead of first suspend resume. CRs-fixed: 755804 Change-Id: I7dcb415644a54a4b80f700c4d0914511a5685830 Signed-off-by: Dhaval Patel Signed-off-by: Jayant Shekhar --- drivers/video/fbdev/msm/mdss_mdp_overlay.c | 1 + .../video/fbdev/msm/mdss_mdp_splash_logo.c | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index 09907632f0c5..6692d2834053 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1315,6 +1315,7 @@ int mdss_mdp_overlay_start(struct msm_fb_data_type *mfd) if (!mdp5_data->mdata->batfet) mdss_mdp_batfet_ctrl(mdp5_data->mdata, true); mdss_mdp_release_splash_pipe(mfd); + mdss_mdp_splash_cleanup(mfd, true); return 0; } else if (mfd->panel_info->cont_splash_enabled) { mutex_lock(&mdp5_data->list_lock); diff --git a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c index 3b44f362091c..f3e2b7e12e37 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c +++ b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c @@ -253,11 +253,24 @@ int mdss_mdp_splash_cleanup(struct msm_fb_data_type *mfd, if (!ctl) return -EINVAL; - if (mfd->splash_info.iommu_dynamic_attached || - !mfd->panel_info->cont_splash_enabled) + if (!mfd->panel_info->cont_splash_enabled || + (mfd->splash_info.iommu_dynamic_attached && !use_borderfill)) { + if (mfd->splash_info.iommu_dynamic_attached && + use_borderfill) { + mdss_mdp_splash_unmap_splash_mem(mfd); + memblock_free(mdp5_data->splash_mem_addr, + mdp5_data->splash_mem_size); + mdss_free_bootmem(mdp5_data->splash_mem_addr, + mdp5_data->splash_mem_size); + } goto end; + } - if (use_borderfill && mdp5_data->handoff) { + /* 1-to-1 mapping */ + mdss_mdp_splash_iommu_attach(mfd); + + if (use_borderfill && mdp5_data->handoff && + !mfd->splash_info.iommu_dynamic_attached) { /* * Set up border-fill on the handed off pipes. * This is needed to ensure that there are no memory @@ -293,7 +306,8 @@ int mdss_mdp_splash_cleanup(struct msm_fb_data_type *mfd, mdss_mdp_ctl_splash_finish(ctl, mdp5_data->handoff); - if (mdp5_data->splash_mem_addr) { + if (mdp5_data->splash_mem_addr && + !mfd->splash_info.iommu_dynamic_attached) { /* Give back the reserved memory to the system */ memblock_free(mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size);