From 7469563793bc6a85902e287b4530b97155aed604 Mon Sep 17 00:00:00 2001 From: Prabhanjan Kandula Date: Mon, 8 Jul 2019 15:03:50 -0700 Subject: [PATCH] disp: msm: sde: install crtc color property for spr programming This change installs blob property on each crtc for client to program SPR block configuration based on display panel SPR pattern. Property installation is conditional only if MDSS hw has SPR block entries. Change-Id: Ie85423d83b7badc547e75e6eb07ee6b9945f8834 Signed-off-by: Prabhanjan Kandula --- msm/sde/sde_color_processing.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/msm/sde/sde_color_processing.c b/msm/sde/sde_color_processing.c index 97b8df157c56..c56a803211dc 100644 --- a/msm/sde/sde_color_processing.c +++ b/msm/sde/sde_color_processing.c @@ -58,6 +58,8 @@ static void dspp_ltm_install_property(struct drm_crtc *crtc); static void dspp_rc_install_property(struct drm_crtc *crtc); +static void dspp_spr_install_property(struct drm_crtc *crtc); + static void dspp_vlut_install_property(struct drm_crtc *crtc); static void dspp_gamut_install_property(struct drm_crtc *crtc); @@ -108,6 +110,7 @@ do { \ func[SDE_DSPP_SIXZONE] = dspp_sixzone_install_property; \ func[SDE_DSPP_AD] = dspp_ad_install_property; \ func[SDE_DSPP_LTM] = dspp_ltm_install_property; \ + func[SDE_DSPP_SPR] = dspp_spr_install_property; \ func[SDE_DSPP_VLUT] = dspp_vlut_install_property; \ func[SDE_DSPP_GAMUT] = dspp_gamut_install_property; \ func[SDE_DSPP_GC] = dspp_gc_install_property; \ @@ -164,6 +167,7 @@ enum sde_cp_crtc_features { SDE_CP_CRTC_DSPP_LTM_VLUT, SDE_CP_CRTC_DSPP_SB, SDE_CP_CRTC_DSPP_RC_MASK, + SDE_CP_CRTC_DSPP_SPR_INIT, SDE_CP_CRTC_DSPP_MAX, /* DSPP features end */ @@ -2549,6 +2553,30 @@ static void dspp_rc_install_property(struct drm_crtc *crtc) } } +static void dspp_spr_install_property(struct drm_crtc *crtc) +{ + struct sde_kms *kms = NULL; + u32 version = 0; + + kms = get_kms(crtc); + if (!kms) { + DRM_ERROR("!kms = %d\n ", !kms); + return; + } + + version = kms->catalog->dspp[0].sblk->spr.version >> 16; + switch (version) { + case 1: + sde_cp_crtc_install_blob_property(crtc, "SDE_SPR_INIT_CFG_V1", + SDE_CP_CRTC_DSPP_SPR_INIT, + sizeof(struct drm_msm_spr_init_cfg)); + break; + default: + DRM_ERROR("version %d not supported\n", version); + break; + } +} + static void lm_gc_install_property(struct drm_crtc *crtc) { char feature_name[256];