<html><body><p>
<pre>
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
>
</pre>
</p></body></html><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->