]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/mediatek: Fix CCORR mtk_ctm_s31_32_to_s1_n function issue
authorJay Liu <jay.liu@mediatek.com>
Sun, 21 Sep 2025 05:53:05 +0000 (13:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:31 +0000 (13:09 +0100)
commit9a76b3b33e52ac65314ce3c84d60cff58ecf47f8
tree0594f21291555b61e9e8c98eb4b97bfb45f4ccda
parente1c7bb405edc30669b3fe6e4b434a15b6aec831f
drm/mediatek: Fix CCORR mtk_ctm_s31_32_to_s1_n function issue

[ Upstream commit 20ac36b71c53b8c36c6903b5ca87c75226700a97 ]

if matrixbit is 11,
The range of color matrix is from 0 to (BIT(12) - 1).
Values from 0 to (BIT(11) - 1) represent positive numbers,
values from BIT(11) to (BIT(12) - 1) represent negative numbers.
For example, -1 need converted to 8191.
so convert S31.32 to HW Q2.11 format by drm_color_ctm_s31_32_to_qm_n,
and set int_bits to 2.

Fixes: 738ed4156fba ("drm/mediatek: Add matrix_bits private data for ccorr")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Jay Liu <jay.liu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250921055416.25588-2-jay.liu@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_ccorr.c