[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fdf2c07-8240-4711-a708-b555932dabc6@collabora.com>
Date: Thu, 15 Feb 2024 11:45:54 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Hsiao Chien Sung <shawn.sung@...iatek.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Matthias Brugger <matthias.bgg@...il.com>,
Bibby Hsieh <bibby.hsieh@...iatek.com>, CK Hu <ck.hu@...iatek.com>,
Sean Paul <seanpaul@...omium.org>, Fei Shao <fshao@...omium.org>,
Jason Chen <jason-ch.chen@...iatek.corp-partner.google.com>,
"Nancy . Lin" <nancy.lin@...iatek.com>, dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 06/13] drm/mediatek: Turn off the layers with zero
width or height
Il 15/02/24 11:11, Hsiao Chien Sung ha scritto:
> We found that IGT (Intel GPU Tool) will try to commit layers with
> zero width or height and lead to undefined behaviors in hardware.
> Disable the layers in such a situation.
>
> Fixes: 777b7bc86a0a3 ("drm/mediatek: Add ovl_adaptor support for MT8195")
> Fixes: fa97fe71f6f93 ("drm/mediatek: Add ETHDR support for MT8195")
>
> Signed-off-by: Hsiao Chien Sung <shawn.sung@...iatek.com>
This commit should be sent separately from this series, as it is fixing things
that are not related just to IGT, but also to corner cases in regular non-testing
usecases.
In any case, it's not mandatory as that depends on what the maintainer prefers,
so it's CK's call anyway.
Besides that,
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 2 +-
> drivers/gpu/drm/mediatek/mtk_ethdr.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> index d4a13a1402148..68a20312ac6f1 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> @@ -157,7 +157,7 @@ void mtk_ovl_adaptor_layer_config(struct device *dev, unsigned int idx,
> merge = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_MERGE0 + idx];
> ethdr = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0];
>
> - if (!pending->enable) {
> + if (!pending->enable || !pending->width || !pending->height) {
> mtk_merge_stop_cmdq(merge, cmdq_pkt);
> mtk_mdp_rdma_stop(rdma_l, cmdq_pkt);
> mtk_mdp_rdma_stop(rdma_r, cmdq_pkt);
> diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> index 73dc4da3ba3bd..69872b77922eb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c
> +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> @@ -160,7 +160,12 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
> if (idx >= 4)
> return;
>
> - if (!pending->enable) {
> + if (!pending->enable || !pending->width || !pending->height) {
> + /*
> + * instead of disabling layer with MIX_SRC_CON directly
> + * set the size to 0 to avoid screen shift due to mixer
> + * mode switch (hardware behavior)
> + */
> mtk_ddp_write(cmdq_pkt, 0, &mixer->cmdq_base, mixer->regs, MIX_L_SRC_SIZE(idx));
> return;
> }
Powered by blists - more mailing lists