From c1c870d16f9d3716ad8a5b256262fe52b5f4f209 Mon Sep 17 00:00:00 2001 From: tbalden Date: Sat, 8 Sep 2018 17:20:46 -0700 Subject: [PATCH] kcal: color control: upon config change force reprocessing Even when supposedly the rendering is not dirty, force reprocess of filters. [YaAlex3: Adapt to aleksaiko's kcal implementation] Signed-off-by: Yaroslav Furman Signed-off-by: Panchajanya1999 --- .../gpu/drm/msm/sde/sde_color_processing.c | 29 +++++++++++++++++++ drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c | 4 +++ drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h | 6 ++++ 3 files changed, 39 insertions(+) diff --git a/drivers/gpu/drm/msm/sde/sde_color_processing.c b/drivers/gpu/drm/msm/sde/sde_color_processing.c index 7782dffc7e33..e7c3eb90abdb 100644 --- a/drivers/gpu/drm/msm/sde/sde_color_processing.c +++ b/drivers/gpu/drm/msm/sde/sde_color_processing.c @@ -26,6 +26,10 @@ #include "sde_core_irq.h" #include "dsi_panel.h" +#ifdef CONFIG_DRM_MSM_KCAL_CTRL +#include "sde_hw_kcal_ctrl.h" +#endif + struct sde_cp_node { u32 property_id; u32 prop_flags; @@ -1025,6 +1029,12 @@ void sde_cp_crtc_install_properties(struct drm_crtc *crtc) } +#ifdef CONFIG_DRM_MSM_KCAL_CTRL +static struct drm_crtc *g_pcc_crtc; +static struct drm_property *g_pcc_property; +static uint64_t g_pcc_val; +#endif + int sde_cp_crtc_set_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t val) @@ -1058,6 +1068,15 @@ int sde_cp_crtc_set_property(struct drm_crtc *crtc, goto exit; } +#ifdef CONFIG_DRM_MSM_KCAL_CTRL + if (prop_node->feature == SDE_CP_CRTC_DSPP_PCC) { + pr_info("%s pcc kad kcal\n",__func__); + g_pcc_crtc = crtc; + g_pcc_property = property; + g_pcc_val = val; + } +#endif + /** * sde_crtc is virtual ensure that hardware has been attached to the * crtc. Check LM and dspp counts based on whether feature is a @@ -1118,6 +1137,16 @@ int sde_cp_crtc_set_property(struct drm_crtc *crtc, return ret; } +#ifdef CONFIG_DRM_MSM_KCAL_CTRL +void kcal_force_update(void) { + if (g_pcc_crtc) { + pr_info("%s force kad kcal\n",__func__); + sde_cp_crtc_set_property(g_pcc_crtc, g_pcc_property, g_pcc_val); + } +} +EXPORT_SYMBOL(kcal_force_update); +#endif + int sde_cp_crtc_get_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t *val) { diff --git a/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c b/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c index 9382f04a667c..a722000dc6b6 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c @@ -91,6 +91,8 @@ static ssize_t store_##node(struct device *dev, \ \ kcal_lut_data.object = val; \ \ + kcal_force_update(); \ + \ return count; \ } \ \ @@ -125,6 +127,8 @@ static ssize_t store_kcal(struct device *dev, pcc->green = max(kcal_g, kcal_lut_data.min_value); pcc->blue = max(kcal_b, kcal_lut_data.min_value); + kcal_force_update(); + return count; } diff --git a/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h b/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h index 4bc8d6ded6c4..dd8c716efb1e 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h @@ -63,6 +63,12 @@ struct drm_msm_pa_hsic sde_hw_kcal_hsic_struct(void); * @plane: index of pcc color plane. */ void sde_hw_kcal_pcc_adjust(u32 *data, int plane); + +/** + * kcal_force_update() - force reprocessing on config change. + */ +void kcal_force_update(void); + #else static inline struct sde_hw_kcal sde_hw_kcal_get(void) {