[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96b3576243f5c6880dd16d36020d2083a8508b44.camel@mediatek.com>
Date: Mon, 18 Nov 2024 08:20:13 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
Singo Chang (張興國) <Singo.Chang@...iatek.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Shawn Sung (宋孝謙) <Shawn.Sung@...iatek.com>,
Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "fshao@...omium.org"
<fshao@...omium.org>, AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH] drm/mediatek: Add no pending_planes flag checking for
mtk_crtc_finish_page_flip()
Hi, Jason:
On Mon, 2024-11-18 at 11:36 +0800, Jason-JH.Lin wrote:
> mtk_crtc_finish_page_flip() is used to notify the page flip that has
> been completed to the userspace, so userspace can free the frame buffer
> of the last frame and commit the next frame.
>
> However, mtk_crtc_finish_page_flip() cannot guarantee the GCE has
> configured all the display hardware settings of the last frame.
> This may cause the display hardware to still access the last frame
> buffer released by the userspace.
>
> So add the checking condition of no pending_plens flags to make sure
> GCE has executed all the pending planes configuration.
What's the probability?
If it's low probability, we could drop calling mtk_crtc_finish_page_flip().
If it's not low probability, I think drop calling mtk_crtc_finish_page_flip() would reduce the fps and we should find another way.
Regards,
CK
>
> Fixes: 7f82d9c43879 ("drm/mediatek: Clear pending flag when cmdq packet is done")
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@...iatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_crtc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
> index eb0e1233ad04..b03b9102ff90 100644
> --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> @@ -113,7 +113,8 @@ static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
> drm_crtc_handle_vblank(&mtk_crtc->base);
>
> spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> - if (!mtk_crtc->config_updating && mtk_crtc->pending_needs_vblank) {
> + if (!mtk_crtc->config_updating && mtk_crtc->pending_needs_vblank &&
> + !mtk_crtc->pending_planes) {
> mtk_crtc_finish_page_flip(mtk_crtc);
> mtk_crtc->pending_needs_vblank = false;
> }
Powered by blists - more mailing lists