Commit 921e902b authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Chun-Kuang Hu

drm/mediatek: gamma: Make sure relay mode is disabled

Disable relay mode at the end of LUT programming to make sure that the
processed image goes through in both DISP_GAMMA and DISP_AAL for gamma
setting.
Reviewed-by: default avatarJason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: default avatarAlexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: default avatarCK Hu <ck.hu@mediatek.com>
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-13-angelogioacchino.delregno@collabora.com/Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 6841f6f9
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define DISP_AAL_EN 0x0000 #define DISP_AAL_EN 0x0000
#define AAL_EN BIT(0) #define AAL_EN BIT(0)
#define DISP_AAL_CFG 0x0020 #define DISP_AAL_CFG 0x0020
#define AAL_RELAY_MODE BIT(0)
#define AAL_GAMMA_LUT_EN BIT(1) #define AAL_GAMMA_LUT_EN BIT(1)
#define DISP_AAL_SIZE 0x0030 #define DISP_AAL_SIZE 0x0030
#define DISP_AAL_SIZE_HSIZE GENMASK(28, 16) #define DISP_AAL_SIZE_HSIZE GENMASK(28, 16)
...@@ -119,6 +120,9 @@ void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state) ...@@ -119,6 +120,9 @@ void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state)
/* Enable the gamma table */ /* Enable the gamma table */
cfg_val |= FIELD_PREP(AAL_GAMMA_LUT_EN, 1); cfg_val |= FIELD_PREP(AAL_GAMMA_LUT_EN, 1);
/* Disable RELAY mode to pass the processed image */
cfg_val &= ~AAL_RELAY_MODE;
writel(cfg_val, aal->regs + DISP_AAL_CFG); writel(cfg_val, aal->regs + DISP_AAL_CFG);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define DISP_GAMMA_EN 0x0000 #define DISP_GAMMA_EN 0x0000
#define GAMMA_EN BIT(0) #define GAMMA_EN BIT(0)
#define DISP_GAMMA_CFG 0x0020 #define DISP_GAMMA_CFG 0x0020
#define GAMMA_RELAY_MODE BIT(0)
#define GAMMA_LUT_EN BIT(1) #define GAMMA_LUT_EN BIT(1)
#define GAMMA_DITHERING BIT(2) #define GAMMA_DITHERING BIT(2)
#define DISP_GAMMA_SIZE 0x0030 #define DISP_GAMMA_SIZE 0x0030
...@@ -175,6 +176,9 @@ void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state) ...@@ -175,6 +176,9 @@ void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state)
/* Enable the gamma table */ /* Enable the gamma table */
cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1); cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1);
/* Disable RELAY mode to pass the processed image */
cfg_val &= ~GAMMA_RELAY_MODE;
cfg_val = readl(gamma->regs + DISP_GAMMA_CFG); cfg_val = readl(gamma->regs + DISP_GAMMA_CFG);
} }
......
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