msm: mdss: Override partial update PP block using ioctl
Partial update when enabled blocks all PP ioctls. There is currently no subtle way to enable PP. Providing an ioctl to override the blockage of PP ioctls. This would allow PP to override the blockage caused due to the default enablement of partial update. Change-Id: Ia120caa179bfa0414041bacd80328540f24dd6c8 Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
This commit is contained in:
parent
9e696e5b2c
commit
3d8f14bbc7
7 changed files with 78 additions and 5 deletions
|
@ -217,6 +217,8 @@ struct mdss_data_type {
|
|||
void *video_intf;
|
||||
u32 nintf;
|
||||
|
||||
int pp_enable;
|
||||
|
||||
struct mdss_mdp_ad *ad_off;
|
||||
struct mdss_ad_info *ad_cfgs;
|
||||
u32 nad_cfgs;
|
||||
|
|
|
@ -1716,6 +1716,17 @@ static int __from_user_calib_dcm_state(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __from_user_pp_init_data(
|
||||
struct mdp_pp_init_data32 __user *init_data32,
|
||||
struct mdp_pp_init_data __user *init_data)
|
||||
{
|
||||
if (copy_in_user(&init_data->init_request, &init_data32->init_request,
|
||||
sizeof(uint32_t)))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __pp_compat_alloc(struct msmfb_mdp_pp32 __user *pp32,
|
||||
struct msmfb_mdp_pp __user **pp,
|
||||
uint32_t op)
|
||||
|
@ -1992,6 +2003,14 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
|
|||
goto pp_compat_exit;
|
||||
ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
|
||||
break;
|
||||
case mdp_op_pp_init_cfg:
|
||||
ret = __from_user_pp_init_data(
|
||||
compat_ptr((uintptr_t)&pp32->data.init_data),
|
||||
&pp->data.init_data);
|
||||
if (ret)
|
||||
goto pp_compat_exit;
|
||||
ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -300,6 +300,10 @@ struct mdss_calib_cfg32 {
|
|||
uint32_t calib_mask;
|
||||
};
|
||||
|
||||
struct mdp_pp_init_data32 {
|
||||
uint32_t init_request;
|
||||
};
|
||||
|
||||
struct mdp_histogram_cfg32 {
|
||||
uint32_t ops;
|
||||
uint32_t block;
|
||||
|
@ -346,6 +350,7 @@ struct msmfb_mdp_pp32 {
|
|||
struct mdss_ad_input32 ad_input;
|
||||
struct mdp_calib_config_buffer32 calib_buffer;
|
||||
struct mdp_calib_dcm_state32 calib_dcm;
|
||||
struct mdp_pp_init_data32 init_data;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
|
|
@ -794,6 +794,7 @@ int mdss_mdp_csc_setup_data(u32 block, u32 blk_idx, u32 tbl_idx,
|
|||
|
||||
int mdss_mdp_pp_init(struct device *dev);
|
||||
void mdss_mdp_pp_term(struct device *dev);
|
||||
int mdss_mdp_pp_override_pu(int enable);
|
||||
|
||||
int mdss_mdp_pp_resume(struct mdss_mdp_ctl *ctl, u32 mixer_num);
|
||||
|
||||
|
|
|
@ -2552,18 +2552,26 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd,
|
|||
{
|
||||
int ret;
|
||||
struct msmfb_mdp_pp mdp_pp;
|
||||
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
|
||||
u32 copyback = 0;
|
||||
u32 copy_from_kernel = 0;
|
||||
|
||||
if (mfd->panel_info->partial_update_enabled) {
|
||||
pr_err("Partical update feature is enabled.");
|
||||
if (!mdata)
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
ret = copy_from_user(&mdp_pp, argp, sizeof(mdp_pp));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Support only PP init cfg op if partial update is enabled for allowing
|
||||
* overriding of partial update
|
||||
*/
|
||||
if (mdata->pp_enable == MDP_PP_DISABLE &&
|
||||
mdp_pp.op != mdp_op_pp_init_cfg) {
|
||||
pr_err("Partial update feature is enabled\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
/* Supprt only MDP register read/write and
|
||||
exit_dcm in DCM state*/
|
||||
if (mfd->dcm_state == DCM_ENTER &&
|
||||
|
@ -2652,6 +2660,10 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd,
|
|||
case mdp_op_calib_dcm_state:
|
||||
ret = mdss_fb_dcm(mfd, mdp_pp.data.calib_dcm.dcm_state);
|
||||
break;
|
||||
case mdp_op_pp_init_cfg:
|
||||
ret = mdss_mdp_pp_override_pu(
|
||||
mdp_pp.data.init_data.init_request);
|
||||
break;
|
||||
default:
|
||||
pr_err("Unsupported request to MDP_PP IOCTL. %d = op\n",
|
||||
mdp_pp.op);
|
||||
|
@ -2673,8 +2685,11 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd,
|
|||
u32 block;
|
||||
static int req = -1;
|
||||
|
||||
if (mfd->panel_info->partial_update_enabled) {
|
||||
pr_err("Partical update feature is enabled.");
|
||||
if (!mdata)
|
||||
return -EPERM;
|
||||
|
||||
if (mdata->pp_enable == MDP_PP_DISABLE) {
|
||||
pr_err("Partial update feature is enabled\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
|
@ -3823,6 +3838,11 @@ int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd)
|
|||
if (mfd->panel_info->partial_update_enabled && is_split_lm(mfd))
|
||||
mdp5_data->mdata->has_src_split = false;
|
||||
|
||||
if (mfd->panel_info->partial_update_enabled)
|
||||
mdp5_data->mdata->pp_enable = MDP_PP_DISABLE;
|
||||
else
|
||||
mdp5_data->mdata->pp_enable = MDP_PP_ENABLE;
|
||||
|
||||
rc = mdss_mdp_overlay_fb_parse_dt(mfd);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
|
|
@ -2019,6 +2019,21 @@ void mdss_mdp_pp_term(struct device *dev)
|
|||
mutex_unlock(&mdss_pp_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
int mdss_mdp_pp_override_pu(int enable)
|
||||
{
|
||||
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
|
||||
|
||||
if (!mdata)
|
||||
return -EPERM;
|
||||
|
||||
if ((enable != MDP_PP_ENABLE) && (enable != MDP_PP_DISABLE))
|
||||
return -EINVAL;
|
||||
|
||||
mdata->pp_enable = enable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pp_get_dspp_num(u32 disp_num, u32 *dspp_num)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -848,6 +848,15 @@ struct mdp_calib_dcm_state {
|
|||
uint32_t dcm_state;
|
||||
};
|
||||
|
||||
struct mdp_pp_init_data {
|
||||
uint32_t init_request;
|
||||
};
|
||||
|
||||
enum {
|
||||
MDP_PP_DISABLE,
|
||||
MDP_PP_ENABLE,
|
||||
};
|
||||
|
||||
enum {
|
||||
DCM_UNINIT,
|
||||
DCM_UNBLANK,
|
||||
|
@ -962,6 +971,7 @@ enum {
|
|||
mdp_op_calib_buffer,
|
||||
mdp_op_calib_dcm_state,
|
||||
mdp_op_max,
|
||||
mdp_op_pp_init_cfg,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -992,6 +1002,7 @@ struct msmfb_mdp_pp {
|
|||
struct mdss_ad_input ad_input;
|
||||
struct mdp_calib_config_buffer calib_buffer;
|
||||
struct mdp_calib_dcm_state calib_dcm;
|
||||
struct mdp_pp_init_data init_data;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue