Commit 2d503773 authored by Shuijing Li's avatar Shuijing Li Committed by Chun-Kuang Hu

drm/mediatek: dp: Add the audio packet flag to mtk_dp_data struct

The audio packet arrangement function is to only arrange audio
packets into the Hblanking area. In order to align with the HW
default setting of mt8195, this function needs to be turned off.
Signed-off-by: default avatarShuijing Li <shuijing.li@mediatek.com>
Reviewed-by: default avatarCK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230822024155.26670-3-shuijing.li@mediatek.com/Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 57993244
......@@ -141,6 +141,7 @@ struct mtk_dp_data {
unsigned int smc_cmd;
const struct mtk_dp_efuse_fmt *efuse_fmt;
bool audio_supported;
bool audio_pkt_in_hblank_area;
};
static const struct mtk_dp_efuse_fmt mt8195_edp_efuse_fmt[MTK_DP_CAL_MAX] = {
......@@ -1394,6 +1395,18 @@ static void mtk_dp_sdp_set_down_cnt_init_in_hblank(struct mtk_dp *mtk_dp)
SDP_DOWN_CNT_INIT_IN_HBLANK_DP_ENC1_P0_MASK);
}
static void mtk_dp_audio_sample_arrange_disable(struct mtk_dp *mtk_dp)
{
/* arrange audio packets into the Hblanking and Vblanking area */
if (!mtk_dp->data->audio_pkt_in_hblank_area)
return;
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC1_P0_3374, 0,
SDP_ASP_INSERT_IN_HBLANK_DP_ENC1_P0_MASK);
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC1_P0_3374, 0,
SDP_DOWN_ASP_CNT_INIT_DP_ENC1_P0_MASK);
}
static void mtk_dp_setup_tu(struct mtk_dp *mtk_dp)
{
u32 sram_read_start = min_t(u32, MTK_DP_TBC_BUF_READ_START_ADDR,
......@@ -1403,6 +1416,7 @@ static void mtk_dp_setup_tu(struct mtk_dp *mtk_dp)
MTK_DP_PIX_PER_ADDR);
mtk_dp_set_sram_read_start(mtk_dp, sram_read_start);
mtk_dp_setup_encoder(mtk_dp);
mtk_dp_audio_sample_arrange_disable(mtk_dp);
mtk_dp_sdp_set_down_cnt_init_in_hblank(mtk_dp);
mtk_dp_sdp_set_down_cnt_init(mtk_dp, sram_read_start);
}
......
......@@ -228,6 +228,11 @@
VIDEO_STABLE_CNT_THRD_DP_ENC1_P0 | \
SDP_DP13_EN_DP_ENC1_P0 | \
BS2BS_MODE_DP_ENC1_P0)
#define MTK_DP_ENC1_P0_3374 0x3374
#define SDP_ASP_INSERT_IN_HBLANK_DP_ENC1_P0_MASK BIT(12)
#define SDP_DOWN_ASP_CNT_INIT_DP_ENC1_P0_MASK GENMASK(11, 0)
#define MTK_DP_ENC1_P0_33F4 0x33f4
#define DP_ENC_DUMMY_RW_1_AUDIO_RST_EN BIT(0)
#define DP_ENC_DUMMY_RW_1 BIT(9)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment