]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/mediatek: Fix mode valid issue for dp
authorLiankun Yang <liankun.yang@mediatek.com>
Fri, 25 Oct 2024 08:28:28 +0000 (16:28 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 30 Dec 2024 14:25:03 +0000 (14:25 +0000)
commit0d68b55887cedc7487036ed34cb4c2097c4228f1
tree6732376a1def9be6e3776728d98543d2e5298c41
parentef24fbd8f12015ff827973fffefed3902ffd61cc
drm/mediatek: Fix mode valid issue for dp

Fix dp mode valid issue to avoid abnormal display of limit state.

After DP passes link training, it can express the lane count of the
current link status is good. Calculate the maximum bandwidth supported
by DP using the current lane count.

The color format will select the best one based on the bandwidth
requirements of the current timing mode. If the current timing mode
uses RGB and meets the DP link bandwidth requirements, RGB will be used.

If the timing mode uses RGB but does not meet the DP link bandwidthi
requirements, it will continue to check whether YUV422 meets
the DP link bandwidth.

FEC overhead is approximately 2.4% from DP 1.4a spec 2.2.1.4.2.
The down-spread amplitude shall either be disabled (0.0%) or up
to 0.5% from 1.4a 3.5.2.6. Add up to approximately 3% total overhead.

Because rate is already divided by 10,
mode->clock does not need to be multiplied by 10.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Liankun Yang <liankun.yang@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241025083036.8829-3-liankun.yang@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_dp.c