Skip to content

Commit 921e902

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
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: Jason-JH.Lin <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 6841f6f commit 921e902

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/gpu/drm/mediatek/mtk_disp_aal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define DISP_AAL_EN 0x0000
1919
#define AAL_EN BIT(0)
2020
#define DISP_AAL_CFG 0x0020
21+
#define AAL_RELAY_MODE BIT(0)
2122
#define AAL_GAMMA_LUT_EN BIT(1)
2223
#define DISP_AAL_SIZE 0x0030
2324
#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)
119120
/* Enable the gamma table */
120121
cfg_val |= FIELD_PREP(AAL_GAMMA_LUT_EN, 1);
121122

123+
/* Disable RELAY mode to pass the processed image */
124+
cfg_val &= ~AAL_RELAY_MODE;
125+
122126
writel(cfg_val, aal->regs + DISP_AAL_CFG);
123127
}
124128

drivers/gpu/drm/mediatek/mtk_disp_gamma.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define DISP_GAMMA_EN 0x0000
2020
#define GAMMA_EN BIT(0)
2121
#define DISP_GAMMA_CFG 0x0020
22+
#define GAMMA_RELAY_MODE BIT(0)
2223
#define GAMMA_LUT_EN BIT(1)
2324
#define GAMMA_DITHERING BIT(2)
2425
#define DISP_GAMMA_SIZE 0x0030
@@ -175,6 +176,9 @@ void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state)
175176
/* Enable the gamma table */
176177
cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1);
177178

179+
/* Disable RELAY mode to pass the processed image */
180+
cfg_val &= ~GAMMA_RELAY_MODE;
181+
178182
cfg_val = readl(gamma->regs + DISP_GAMMA_CFG);
179183
}
180184

0 commit comments

Comments
 (0)