diff mbox series

[v5,5/6] drm/mediatek: Add mbox_free_channel in mtk_drm_crtc_destroy

Message ID 20211027021857.20816-6-jason-jh.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series CMDQ refinement of Mediatek DRM driver | expand

Commit Message

Jason-JH Lin (林睿祥) Oct. 27, 2021, 2:18 a.m. UTC
Add mbox_free_channel in mtk_drm_crtc_destroy.

Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Chun-Kuang Hu Oct. 27, 2021, 11:30 p.m. UTC | #1
Hi, Jason:

jason-jh.lin <jason-jh.lin@mediatek.com> 於 2021年10月27日 週三 上午10:19寫道:
>
> Add mbox_free_channel in mtk_drm_crtc_destroy.
>
> Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index ffa54b416ca7..31f05efc1bc0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -156,6 +156,10 @@ static void mtk_drm_crtc_destroy(struct drm_crtc *crtc)
>         mtk_mutex_put(mtk_crtc->mutex);
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
>         mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_handle);
> +
> +       if (mtk_crtc->cmdq_client.chan)
> +               mbox_free_channel(mtk_crtc->cmdq_client.chan);
> +                                 mtk_crtc->cmdq_client.chan = NULL;

Except the indent,

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>  #endif
>         drm_crtc_cleanup(crtc);
>  }
> --
> 2.18.0
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index ffa54b416ca7..31f05efc1bc0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -156,6 +156,10 @@  static void mtk_drm_crtc_destroy(struct drm_crtc *crtc)
 	mtk_mutex_put(mtk_crtc->mutex);
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
 	mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_handle);
+
+	if (mtk_crtc->cmdq_client.chan)
+		mbox_free_channel(mtk_crtc->cmdq_client.chan);
+				  mtk_crtc->cmdq_client.chan = NULL;
 #endif
 	drm_crtc_cleanup(crtc);
 }