<html><body><p>
<pre>
Hi CK,

On Wed, 2024-06-12 at 01:22 +0000, CK Hu (胡俊光) wrote:
> Hi, Shawn:
>
> On Thu, 2024-06-06 at 17:26 +0800, Shawn Sung wrote:
> > From: Hsiao Chien Sung <shawn.sung@mediatek.com>
> >
> > Register CRC related function pointers to support
> > CRC retrieval.
> >
> > Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > ---
>
> [snip]
>
> >
> > +static void mtk_crtc_crc_work(struct kthread_work *base)
> > +{
> > +struct drm_vblank_work *work = to_drm_vblank_work(base);
> > +struct mtk_crtc *mtk_crtc =
> > +container_of(work, typeof(*mtk_crtc), crc_work);
> > +struct mtk_ddp_comp *comp = mtk_crtc->crc_provider;
> > +
> > +if (!comp) {
> > +DRM_WARN("%s(crtc-%d): no crc provider\n",
> > + __func__, drm_crtc_index(&mtk_crtc->base));
> > +return;
> > +}
> > +
> > +if (mtk_crtc->base.crc.opened) {
> > +u64 vblank = drm_crtc_vblank_count(&mtk_crtc->base);
> > +
> > +comp->funcs->crc_read(comp->dev);
> > +
> > +/* could take more than 50ms to finish */
> > +drm_crtc_add_crc_entry(&mtk_crtc->base, true, vblank,
> > + comp->funcs->crc_entry(comp-
> > >dev));
>
> It seems that you could regenerate cmdq packet for crc here. So crtc
> atomic flush and crc could use the same mailbox channel.
>
> Regards,
> CK
>
It seems that it's possible to call mtk_ddp_update_config() here and
add a new pending_read_crc flag to insert the read crc related
instructions into the same cmdq_pkt and use the same mailbox channel as
atomic flush.

I'll try this, but I'll need some time to modify this and test it to
make sure no other issues arise.

Regards,
Jason-Jh Lin

> > +
> > +drm_vblank_work_schedule(&mtk_crtc->crc_work, vblank +
> > 1, true);
> > +} else {
> > +comp->funcs->crc_stop(comp->dev);
> > +}
> > +}
> > +

</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><!--}-->