]> 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>
Thu, 18 Dec 2025 13:03:05 +0000 (14:03 +0100)
commit295ba29e49f63f9d9b72b160ac466ffb174f7cb8
treeed2a92e400b85777d4b6c5481cfb976ab819a8ea
parent4a3a5c2e93c71dcbe6ba00b87549365eb85130b6
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