diff --git a/msm/sde/sde_hw_catalog.c b/msm/sde/sde_hw_catalog.c index 4e93535a..6a930f70 100644 --- a/msm/sde/sde_hw_catalog.c +++ b/msm/sde/sde_hw_catalog.c @@ -224,6 +224,7 @@ enum sde_prop { TVM_INCLUDE_REG, IPCC_PROTOCOL_ID, SDE_EMULATED_ENV, + IPCC_CLIENT_DPU_PHYS_ID, SDE_PROP_MAX, }; @@ -624,6 +625,7 @@ static struct sde_prop_type sde_prop[] = { {TVM_INCLUDE_REG, "qcom,tvm-include-reg", false, PROP_TYPE_U32_ARRAY}, {IPCC_PROTOCOL_ID, "qcom,sde-ipcc-protocol-id", false, PROP_TYPE_U32}, {SDE_EMULATED_ENV, "qcom,sde-emulated-env", false, PROP_TYPE_BOOL}, + {IPCC_CLIENT_DPU_PHYS_ID, "qcom,sde-ipcc-client-dpu-phys-id", false, PROP_TYPE_U32} }; static struct sde_prop_type sde_perf_prop[] = { @@ -4008,6 +4010,9 @@ static void _sde_top_parse_dt_helper(struct sde_mdss_cfg *cfg, PROP_VALUE_ACCESS(props->values, SMART_PANEL_ALIGN_MODE, 0); cfg->ipcc_protocol_id = PROP_VALUE_ACCESS(props->values, IPCC_PROTOCOL_ID, 0); + cfg->ipcc_client_phys_id = PROP_VALUE_ACCESS(props->values, IPCC_CLIENT_DPU_PHYS_ID, 0); + if (!cfg->ipcc_protocol_id || !cfg->ipcc_client_phys_id) + cfg->hw_fence_rev = 0; /* disable hw fences*/ if (props->exists[SEC_SID_MASK]) { cfg->sec_sid_mask_count = props->counts[SEC_SID_MASK]; diff --git a/msm/sde/sde_hw_catalog.h b/msm/sde/sde_hw_catalog.h index fd9c8dea..f281d61d 100644 --- a/msm/sde/sde_hw_catalog.h +++ b/msm/sde/sde_hw_catalog.h @@ -1854,6 +1854,7 @@ struct sde_perf_cfg { * @dnsc_blur_filters supported filters for downscale blur * @dnsc_blur_filter_count supported filter count for downscale blur * @ipcc_protocol_id ipcc protocol id for the hw + * @ipcc_client_phys_id dpu ipcc client id for the hw, physical client id if supported */ struct sde_mdss_cfg { /* Block Revisions */ @@ -1973,6 +1974,7 @@ struct sde_mdss_cfg { u32 dnsc_blur_filter_count; u32 ipcc_protocol_id; + u32 ipcc_client_phys_id; }; struct sde_mdss_hw_cfg_handler { diff --git a/msm/sde/sde_hw_top.c b/msm/sde/sde_hw_top.c index 72bad93f..d61d6e61 100644 --- a/msm/sde/sde_hw_top.c +++ b/msm/sde/sde_hw_top.c @@ -648,7 +648,7 @@ static void sde_hw_input_hw_fence_status(struct sde_hw_mdp *mdp, u64 *s_val, u64 } static void sde_hw_setup_hw_fences_config(struct sde_hw_mdp *mdp, u32 protocol_id, - unsigned long ipcc_base_addr) + u32 client_phys_id, unsigned long ipcc_base_addr) { u32 val, offset; struct sde_hw_blk_reg_map c; @@ -674,7 +674,7 @@ static void sde_hw_setup_hw_fences_config(struct sde_hw_mdp *mdp, u32 protocol_i /* configure the attribs for the isr read_reg op */ offset = MDP_CTL_HW_FENCE_ID_OFFSET_m(MDP_CTL_HW_FENCE_IDm_ADDR, 0); val = HW_FENCE_IPCC_PROTOCOLp_CLIENTc_RECV_ID(ipcc_base_addr, - protocol_id, HW_FENCE_IPCC_CLIENT_DPU); + protocol_id, client_phys_id); SDE_REG_WRITE(&c, offset, val); offset = MDP_CTL_HW_FENCE_ID_OFFSET_m(MDP_CTL_HW_FENCE_IDm_ATTR, 0); @@ -713,7 +713,7 @@ static void sde_hw_setup_hw_fences_config(struct sde_hw_mdp *mdp, u32 protocol_i /* configure the attribs for the isr load_data op */ offset = MDP_CTL_HW_FENCE_ID_OFFSET_m(MDP_CTL_HW_FENCE_IDm_ADDR, 4); val = HW_FENCE_IPCC_PROTOCOLp_CLIENTc_SEND(ipcc_base_addr, - protocol_id, HW_FENCE_IPCC_CLIENT_DPU); + protocol_id, client_phys_id); SDE_REG_WRITE(&c, offset, val); offset = MDP_CTL_HW_FENCE_ID_OFFSET_m(MDP_CTL_HW_FENCE_IDm_ATTR, 4); diff --git a/msm/sde/sde_hw_top.h b/msm/sde/sde_hw_top.h index eed541d4..694a56ec 100644 --- a/msm/sde/sde_hw_top.h +++ b/msm/sde/sde_hw_top.h @@ -11,7 +11,6 @@ #include "sde_hw_mdss.h" #include "sde_hw_util.h" -#define HW_FENCE_IPCC_CLIENT_DPU 25 #define HW_FENCE_IPCC_PROTOCOLp_CLIENTc(ba, p, c) (ba + (0x40000*p) + (0x1000*c)) struct sde_hw_mdp; @@ -210,9 +209,10 @@ struct sde_hw_mdp_ops { * setup_hw_fences - configure hw fences top registers * @mdp: mdp top context driver * @protocol_id: ipcc protocol id + * @client_phys_id: ipcc client id (physical id if supported) * @ipcc_base_addr: base address for ipcc reg block */ - void (*setup_hw_fences)(struct sde_hw_mdp *mdp, u32 protocol_id, + void (*setup_hw_fences)(struct sde_hw_mdp *mdp, u32 protocol_id, u32 client_phys_id, unsigned long ipcc_base_addr); /** diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index 6e0b51f5..c8884b72 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -4368,7 +4368,7 @@ static int _sde_kms_mmu_init(struct sde_kms *sde_kms) ret = _sde_kms_one2one_mem_map_ipcc_reg(sde_kms, resource_size(res), HW_FENCE_IPCC_PROTOCOLp_CLIENTc(res->start, sde_kms->catalog->ipcc_protocol_id, - HW_FENCE_IPCC_CLIENT_DPU)); + sde_kms->catalog->ipcc_client_phys_id)); /* if mapping fails disable hw-fences */ if (ret) sde_kms->catalog->hw_fence_rev = 0; @@ -4424,7 +4424,8 @@ static void sde_kms_init_hw_fences(struct sde_kms *sde_kms) if (sde_kms->hw_mdp->ops.setup_hw_fences) sde_kms->hw_mdp->ops.setup_hw_fences(sde_kms->hw_mdp, - sde_kms->catalog->ipcc_protocol_id, sde_kms->ipcc_base_addr); + sde_kms->catalog->ipcc_protocol_id, sde_kms->catalog->ipcc_client_phys_id, + sde_kms->ipcc_base_addr); } static void sde_kms_init_shared_hw(struct sde_kms *sde_kms)