Skip to content

Commit

Permalink
kcal: color control: upon config change force reprocessing
Browse files Browse the repository at this point in the history
Even when supposedly the rendering is not dirty, force reprocess
of filters.

[YaAlex3: Adapt to aleksaiko's kcal implementation]

Signed-off-by: Yaroslav Furman <[email protected]>
Signed-off-by: Panchajanya1999 <[email protected]>
  • Loading branch information
tbalden authored and Joker-V2 committed Jul 24, 2021
1 parent 95fd923 commit c1c870d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
29 changes: 29 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_color_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ static ssize_t store_##node(struct device *dev, \
\
kcal_lut_data.object = val; \
\
kcal_force_update(); \
\
return count; \
} \
\
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_hw_kcal_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit c1c870d

Please sign in to comment.