From aa20b1c1889227e1dbeb1696321c24cb3b0fbfe9 Mon Sep 17 00:00:00 2001 From: Andhavarapu Karthik Date: Tue, 12 Jan 2021 16:03:04 +0530 Subject: [PATCH] disp: msm: sde: add cwb virtual mixers support In yupik target, cwb path has pingpong block without any layer mixer. Add virtual mixer to support reservation of pp block in such case. This virtual mixer will be used only for cwb use case. Change-Id: Iacc1a3f5e7d99d9fc36288450b0e19081b3ef763 Signed-off-by: Andhavarapu Karthik --- msm/sde/sde_hw_catalog.c | 4 ++++ msm/sde/sde_hw_catalog.h | 4 +++- msm/sde/sde_rm.c | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_hw_catalog.c b/msm/sde/sde_hw_catalog.c index ad74cc946069..dc881bcb262a 100644 --- a/msm/sde/sde_hw_catalog.c +++ b/msm/sde/sde_hw_catalog.c @@ -2109,6 +2109,9 @@ static int sde_mixer_parse_dt(struct device_node *np, if (cwb_pref && !strcmp(cwb_pref, "cwb")) set_bit(SDE_DISP_CWB_PREF, &mixer->features); + if (BIT(mixer->id - LM_0) & sde_cfg->cwb_virtual_mixers_mask) + set_bit(SDE_MIXER_IS_VIRTUAL, &mixer->features); + mixer->pingpong = pp_count > 0 ? pp_idx + PINGPONG_0 : PINGPONG_MAX; mixer->dspp = dspp_count > 0 ? dspp_idx + DSPP_0 @@ -4828,6 +4831,7 @@ static int _sde_hardware_pre_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev) sde_cfg->mdss_hw_block_size = 0x158; sde_cfg->has_trusted_vm_support = true; sde_cfg->rc_lm_flush_override = false; + sde_cfg->cwb_virtual_mixers_mask = 0x2; } else { SDE_ERROR("unsupported chipset id:%X\n", hw_rev); sde_cfg->perf.min_prefill_lines = 0xffff; diff --git a/msm/sde/sde_hw_catalog.h b/msm/sde/sde_hw_catalog.h index a8358e3f7884..55abf8244326 100644 --- a/msm/sde/sde_hw_catalog.h +++ b/msm/sde/sde_hw_catalog.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #ifndef _SDE_HW_CATALOG_H @@ -333,6 +333,7 @@ enum { SDE_DISP_SECONDARY_PREF, SDE_DISP_CWB_PREF, SDE_MIXER_COMBINED_ALPHA, + SDE_MIXER_IS_VIRTUAL, SDE_MIXER_MAX }; @@ -1540,6 +1541,7 @@ struct sde_mdss_cfg { u32 mixer_count; struct sde_lm_cfg mixer[MAX_BLOCKS]; + u32 cwb_virtual_mixers_mask; struct sde_dspp_top_cfg dspp_top; diff --git a/msm/sde/sde_rm.c b/msm/sde/sde_rm.c index fd25b861db37..fd76b4352576 100644 --- a/msm/sde/sde_rm.c +++ b/msm/sde/sde_rm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "[drm:%s] " fmt, __func__ @@ -1002,6 +1002,12 @@ static bool _sde_rm_check_lm_and_get_connected_blks( lm_cfg->id, lm_cfg->dspp, lm_cfg->ds, lm_cfg->pingpong, lm_cfg->features, (int)reqs->hw_res.display_type); + if (!RM_RQ_CWB(reqs) && (lm_cfg->features & BIT(SDE_MIXER_IS_VIRTUAL))) { + SDE_DEBUG("lm %d is a virtual mixer and use case is not CWB", + lm_cfg->id); + return false; + } + /* Check if this layer mixer is a peer of the proposed primary LM */ if (primary_lm) { const struct sde_lm_cfg *prim_lm_cfg =