* [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported
@ 2024-12-15 22:09 Daniel Golle
2024-12-16 11:11 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Golle @ 2024-12-15 22:09 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno, Justin Green,
Frank Wunderlich, John Crispin, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel, stable
Touching DISP_REG_OVL_PITCH_MSB leads to video overlay on MT2701, MT7623N
and probably other older SoCs being broken.
Only touching it on hardware which actually supports AFBC like it was
before commit c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek
DRM driver") fixes it.
Fixes: c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek DRM driver")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index f731d4fbe8b6..321b40a387cd 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -545,7 +545,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs,
DISP_REG_OVL_HDR_PITCH(ovl, idx));
- } else {
+ } else if (ovl->data->supports_afbc) {
mtk_ddp_write_relaxed(cmdq_pkt,
overlay_pitch.split_pitch.msb,
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
--
2.47.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported
2024-12-15 22:09 [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported Daniel Golle
@ 2024-12-16 11:11 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-12-16 11:11 UTC (permalink / raw)
To: Daniel Golle, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, Justin Green, Frank Wunderlich,
John Crispin, dri-devel, linux-mediatek, linux-kernel,
linux-arm-kernel, stable
Il 15/12/24 23:09, Daniel Golle ha scritto:
> Touching DISP_REG_OVL_PITCH_MSB leads to video overlay on MT2701, MT7623N
> and probably other older SoCs being broken.
>
> Only touching it on hardware which actually supports AFBC like it was
> before commit c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek
> DRM driver") fixes it.
>
> Fixes: c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek DRM driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index f731d4fbe8b6..321b40a387cd 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> @@ -545,7 +545,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
> &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
> mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs,
> DISP_REG_OVL_HDR_PITCH(ovl, idx));
> - } else {
> + } else if (ovl->data->supports_afbc) {
> mtk_ddp_write_relaxed(cmdq_pkt,
> overlay_pitch.split_pitch.msb,
> &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
At this point you should just move the block over a new function....
if (ovl->data->supports_afbc)
mtk_ovl_afbc_layer_config(ovl, cmdq_pkt, idx, is_afbc);
static void mtk_ovl_afbc_layer_config( .... )
{
if (is_afbc) {
.....
} else {
.....
}
}
Cheers,
Angelo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-16 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-15 22:09 [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported Daniel Golle
2024-12-16 11:11 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®