mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "CK Hu (胡俊光)" <ck.hu@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"fshao@chromium.org" <fshao@chromium.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH] drm/mediatek: Add no pending_planes flag checking for mtk_crtc_finish_page_flip()
Date: Tue, 19 Nov 2024 06:33:00 +0000	[thread overview]
Message-ID: <a92217eb88afae8ce947be8f064e9c96ca568497.camel@mediatek.com> (raw)
In-Reply-To: <96b3576243f5c6880dd16d36020d2083a8508b44.camel@mediatek.com>

On Mon, 2024-11-18 at 08:20 +0000, CK Hu (胡俊光) wrote:
> 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.

It won't happen in display normal flow, which uses the
mbox_send_message() in IRQ context.
But it's easy to reproduce in display SVP flow, which uses the
mbox_send_message() to queue a work to the workqueue out of the IRQ
context for communicating with TEE world.

In mediaTek hardware design of configuring display hardware by GCE, I
think we should use mtk_crtc_finish_page_flip() to notify 
`DRM_EVENT_FLIP_COMPLETED` to userspace when GCE finished configuring
all display hardware settings for each atomic_commit().

Although it's still no problem in display normal flow without this
modification.
But I believe we can increase the accuracy of the timing to notify
`DRM_EVENT_FLIP_COMPLETED` to userspace, if we called
mtk_crtc_finished_page_flip() when the all the display hardware
settings is configured.

Maybe this patch is not quite straightforward to express the meaning of
calling mtk_crtc_finish_page_flip() after GCE completing all the
display configuration.
So after I verifying it in my local environment with SVP flow, I'll
move mtk_crtc_finish_page_flip() to the ddp_cmdq_cb() directly and send
the v2.

Regards,
Jason-JH.Lin

> 
> Regards,
> CK
> 

      reply	other threads:[~2024-11-19  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18  3:36 Jason-JH.Lin
2024-11-18  8:20 ` CK Hu (胡俊光)
2024-11-19  6:33   ` Jason-JH Lin (林睿祥) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a92217eb88afae8ce947be8f064e9c96ca568497.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Shawn.Sung@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=ck.hu@mediatek.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fshao@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®