Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1fb06e7 authored by tbalden's avatar tbalden Committed by Razziell
Browse files

mdss mdp: kcal for mdss_mdp_v1_7



Adding the kcal interface by @savoca and
@faux123
porting from m9 version by @flar2

Using the MDP 1_7 userspace structs to inject
configurations of kcal to the pp_cache configs.
Overriding userspace copy with memcpy when
copy_from_user fails (in case of kcal interface
used).

Adding a simple mdp ctl struct caching to
the kcal driver to grab ctl struct for config
calls.

Could be done nicer with direct interfacing
to userspace, leaves some space to make the kernel
crash if a third party app sends faulty configs,
but there's no security issue or degradation
of functionality with this memcpy patch.

@tbalden

Signed-off-by: default avatarflar2 <asegaert@gmail.com>
Signed-off-by: default avatarAKabhishek <abhishekkaushik.star@gmail.com>

# Conflicts:
#	drivers/video/msm/mdss/Makefile
parent 2830283f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -72,3 +72,10 @@ config FB_MSM_MDSS_FRC_DEBUG
	frame rate control (FRC) debugging features to: Collect video frame
	statistics and check whether its output pattern matches expected
	cadence.

config FB_MSM_MDSS_KCAL_CTRL
	depends on FB_MSM_MDSS
	bool "MDSS color control"
	---help---
	  Enable sysfs for post-processing control of mdss-mdp5 display
	  controllers in MDSS.
+1 −0
Original line number Diff line number Diff line
@@ -71,3 +71,4 @@ obj-$(CONFIG_FB_MSM_MDSS) += mdss_fb.o mdss_util.o
obj-$(CONFIG_COMPAT) += mdss_compat_utils.o

obj-$(CONFIG_FB_MSM_MDSS) += mdss_livedisplay.o
obj-$(CONFIG_FB_MSM_MDSS_KCAL_CTRL) += mdss_mdp_kcal_ctrl.o
+730 −0

File added.

Preview size limit exceeded, changes collapsed.

+11 −0
Original line number Diff line number Diff line
@@ -671,9 +671,14 @@ static int pp_pcc_cache_params_v1_7(struct mdp_pcc_cfg_data *config,
			(void *) v17_cache_data;
		if (copy_from_user(&v17_usr_config, config->cfg_payload,
				   sizeof(v17_usr_config))) {
#ifdef CONFIG_FB_MSM_MDSS_KCAL_CTRL
			memcpy(&v17_usr_config, config->cfg_payload, sizeof(v17_usr_config));
			ret = 0;
#else
			pr_err("failed to copy v17 pcc\n");
			ret = -EFAULT;
			goto pcc_config_exit;
#endif
		}
		if ((config->ops & MDP_PP_OPS_DISABLE)) {
			pr_debug("disable pcc\n");
@@ -1170,9 +1175,15 @@ static int pp_pa_cache_params_v1_7(struct mdp_pa_v2_cfg_data *config,

	if (copy_from_user(&pa_usr_config, config->cfg_payload,
			   sizeof(pa_usr_config))) {
#ifdef CONFIG_FB_MSM_MDSS_KCAL_CTRL
		pr_err("%s Failed to copy v1_7 PA - copying in kernel \n",__func__);
		memcpy(&pa_usr_config, config->cfg_payload, sizeof(pa_usr_config));
		ret = 0;
#else
		pr_err("Failed to copy v1_7 PA\n");
		ret = -EFAULT;
		goto pa_config_exit;
#endif
	}

	if ((config->flags & MDP_PP_OPS_DISABLE)) {