<html><body><p>
<pre>
Hi CK,
[snip]
> > @@ -109,9 +109,14 @@ static void mtk_crtc_finish_page_flip(struct
> > mtk_crtc *mtk_crtc)
> > static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
> > {
> > unsigned long flags;
> > +struct drm_crtc *crtc = &mtk_crtc->base;
> > +struct mtk_drm_private *priv = crtc->dev->dev_private;
> >
> > drm_crtc_handle_vblank(&mtk_crtc->base);
> >
> > +if (!priv->data->shadow_register)
> > +return;
> > +
>
> I forget one case.
> For the CPU case (SoC has no shadow register and CONFIG_MTK_CMDQ is
> not enable),
> this driver should still work.
> CPU case is not a usual case, but it could be used in some
> verification case.
> So the condition may be
>
> #if IS_REACHABLE(CONFIG_MTK_CMDQ)
> if (mtk_crtc->cmdq_client.chan)
> return;
> #endif
>
OK, I'll change the condition like this.
> > spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > if (!mtk_crtc->config_updating && mtk_crtc-
> > >pending_needs_vblank) {
> > mtk_crtc_finish_page_flip(mtk_crtc);
[snip]
> > @@ -584,6 +592,10 @@ static void mtk_crtc_update_config(struct
> > mtk_crtc *mtk_crtc, bool needs_vblank)
> > mtk_mutex_acquire(mtk_crtc->mutex);
> > mtk_crtc_ddp_config(crtc, NULL);
> > mtk_mutex_release(mtk_crtc->mutex);
> > +
> > +spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > +mtk_crtc->config_updating = false;
> > +spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> > }
> > #if IS_REACHABLE(CONFIG_MTK_CMDQ)
> > if (mtk_crtc->cmdq_client.chan) {
> > @@ -606,13 +618,14 @@ static void mtk_crtc_update_config(struct
> > mtk_crtc *mtk_crtc, bool needs_vblank)
> > */
> > mtk_crtc->cmdq_vblank_cnt = 3;
> >
> > +spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > +mtk_crtc->config_updating = false;
> > +spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> > +
> > mbox_send_message(mtk_crtc->cmdq_client.chan,
> > cmdq_handle);
> > mbox_client_txdone(mtk_crtc->cmdq_client.chan, 0);
> > }
> > #endif
> > -spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > -mtk_crtc->config_updating = false;
> > -spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
>
> For the CPU case (SoC has no shadow register and CONFIG_MTK_CMDQ is
> not enable),
> This code is necessary.
> Maybe keep these code or some modification for CPU case.
>
OK, I'll keep the original flow and only modify for
IS_REACHABLE(CONFIG_MTK_CMDQ) case.
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><!--}-->