disp: msm: sde: add support for hw-fence feature
Starting mdss 9.0, dpu supports triggering the frame fetch through hw-fencing. This change adds support for this hw-fence feature. Change-Id: Icc7d0b69fc2a51103d14612f5ac89b44a47ed826 Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com> Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
这个提交包含在:

提交者
Gerrit - the friendly Code Review server

父节点
487e4ebec2
当前提交
640c8111d3
@@ -562,6 +562,18 @@ static void _sde_rm_hw_destroy(enum sde_hw_blk_type type, struct sde_hw_blk_reg_
|
||||
}
|
||||
}
|
||||
|
||||
static void _deinit_hw_fences(struct sde_rm *rm)
|
||||
{
|
||||
struct sde_rm_hw_iter iter;
|
||||
|
||||
sde_rm_init_hw_iter(&iter, 0, SDE_HW_BLK_CTL);
|
||||
while (_sde_rm_get_hw_locked(rm, &iter)) {
|
||||
struct sde_hw_ctl *ctl = to_sde_hw_ctl(iter.blk->hw);
|
||||
|
||||
sde_hw_fence_deinit(ctl);
|
||||
}
|
||||
}
|
||||
|
||||
int sde_rm_destroy(struct sde_rm *rm)
|
||||
{
|
||||
|
||||
@@ -574,6 +586,8 @@ int sde_rm_destroy(struct sde_rm *rm)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
_deinit_hw_fences(rm);
|
||||
|
||||
list_for_each_entry_safe(rsvp_cur, rsvp_nxt, &rm->rsvps, list) {
|
||||
list_del(&rsvp_cur->list);
|
||||
kfree(rsvp_cur);
|
||||
@@ -693,6 +707,29 @@ static int _sde_rm_hw_blk_create(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _init_hw_fences(struct sde_rm *rm, bool use_ipcc)
|
||||
{
|
||||
struct sde_rm_hw_iter iter;
|
||||
int ret = 0;
|
||||
|
||||
sde_rm_init_hw_iter(&iter, 0, SDE_HW_BLK_CTL);
|
||||
while (_sde_rm_get_hw_locked(rm, &iter)) {
|
||||
struct sde_hw_ctl *ctl = to_sde_hw_ctl(iter.blk->hw);
|
||||
|
||||
if (sde_hw_fence_init(ctl, use_ipcc)) {
|
||||
pr_err("failed to init hw_fence idx:%d\n", ctl->idx);
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
SDE_DEBUG("init hw-fence for ctl %d", iter.blk->id);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
_deinit_hw_fences(rm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int _sde_rm_hw_blk_create_new(struct sde_rm *rm,
|
||||
struct sde_mdss_cfg *cat,
|
||||
void __iomem *mmio)
|
||||
@@ -778,6 +815,13 @@ static int _sde_rm_hw_blk_create_new(struct sde_rm *rm,
|
||||
}
|
||||
}
|
||||
|
||||
if (cat->hw_fence_rev) {
|
||||
if (_init_hw_fences(rm, test_bit(SDE_FEATURE_HW_FENCE_IPCC, cat->features))) {
|
||||
SDE_INFO("failed to init hw-fences, disabling hw-fences\n");
|
||||
cat->hw_fence_rev = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < cat->cdm_count; i++) {
|
||||
rc = _sde_rm_hw_blk_create(rm, cat, mmio, SDE_HW_BLK_CDM,
|
||||
cat->cdm[i].id, &cat->cdm[i]);
|
||||
|
在新工单中引用
屏蔽一个用户