drm/mediatek: gamma: Add support for 12-bit LUT
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 12 Oct 2023 09:57:30 +0000 (11:57 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 16 Oct 2023 15:21:06 +0000 (15:21 +0000)
commitaf0e042e162a5899f11996abc17d648a2c82f7cd
treedf5b08ac05b4ddce6fe83902192879d6c7df706c
parent4708b01a49171ad6d88499bd9c437629ec4a92d1
drm/mediatek: gamma: Add support for 12-bit LUT

New SoCs, like MT8195, not only may support bigger lookup tables, but
have got a different register layout to support bigger precision:
support specifying the number of `lut_bits` for each SoC and use it
in mtk_gamma_set_common() to perform the right calculations and add
support for 12-bit gamma lookup tables.

While at it, also reorder the variables in mtk_gamma_set_common()
and rename `lut_base` to `lut0_base` to improve readability.

Reviewed-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-11-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_gamma.c