[PATCH v2] drm/mediatek: Add wait_event_timeout when disabling plane
Jason-JH Lin (林睿祥)
Jason-JH.Lin at mediatek.com
Wed Jun 25 00:39:54 PDT 2025
On Wed, 2025-06-25 at 06:54 +0000, CK Hu (胡俊光) wrote:
> On Tue, 2025-06-24 at 19:31 +0800, Jason-JH Lin wrote:
> > Our hardware registers are set through GCE, not by the CPU.
> > DRM might assume the hardware is disabled immediately after calling
> > atomic_disable() of drm_plane, but it is only truly disabled after
> > the
> > GCE IRQ is triggered.
> >
> > Additionally, the cursor plane in DRM uses async_commit, so DRM
> > will
> > not wait for vblank and will free the buffer immediately after
> > calling
> > atomic_disable().
> >
> > To prevent the framebuffer from being freed before the layer
> > disable
> > settings are configured into the hardware, which can cause an IOMMU
> > fault error, a wait_event_timeout has been added to wait for the
> > ddp_cmdq_cb() callback,indicating that the GCE IRQ has been
> > triggered.
> >
> > Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC
> > MT8173.")
>
> This patch looks good to me, so
>
> Reviewed-by: CK Hu <ck.hu at mediatek.com>
>
> But fixes patch is not correct.
> In "drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.", it does
> not support cmdq.
> The first patch to support cmdq is 2f965be7f900 "drm/mediatek: apply
> CMDQ control flow"
> I would change fixes tag when I apply this patch.
>
Thank you very much!
Regards,
Jason-JH Lin
> > Signed-off-by: Jason-JH Lin <jason-jh.lin at mediatek.com>
> > Reviewed-by: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno at collabora.com>
More information about the Linux-mediatek
mailing list