From: CK Hu <ck.hu@mediatek.com>
To: Bibby Hsieh <bibby.hsieh@mediatek.com>
Cc: drinkcat@chromium.org, srv_heupstream@mediatek.com,
David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
tfiga@chromium.org, Thierry Reding <thierry.reding@gmail.com>,
linux-mediatek@lists.infradead.org,
Philipp Zabel <p.zabel@pengutronix.de>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 3/6] drm/mediatek: handle events when enabling/disabling crtc
Date: Mon, 2 Dec 2019 14:43:28 +0800 [thread overview]
Message-ID: <1575269008.3674.1.camel@mtksdaap41> (raw)
In-Reply-To: <20191128024238.9399-4-bibby.hsieh@mediatek.com>
Hi, Bibby:
On Thu, 2019-11-28 at 10:42 +0800, Bibby Hsieh wrote:
> The driver currently handles vblank events only when updating planes on
> an already enabled CRTC. The atomic update API however allows requesting
> an event when enabling or disabling a CRTC. This currently leads to
> event objects being leaked in the kernel and to events not being sent
> out. Fix it.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index 71f4089a8117..cb87a538b8ff 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -334,6 +334,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
> static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
> {
> struct drm_device *drm = mtk_crtc->base.dev;
> + struct drm_crtc *crtc = &mtk_crtc->base;
> int i;
>
> DRM_DEBUG_DRIVER("%s\n", __func__);
> @@ -357,6 +358,13 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)
> mtk_disp_mutex_unprepare(mtk_crtc->mutex);
>
> pm_runtime_put(drm->dev);
> +
> + if (crtc->state->event && !crtc->state->active) {
> + spin_lock_irq(&crtc->dev->event_lock);
> + drm_crtc_send_vblank_event(crtc, crtc->state->event);
> + crtc->state->event = NULL;
> + spin_unlock_irq(&crtc->dev->event_lock);
> + }
> }
>
> static void mtk_crtc_ddp_config(struct drm_crtc *crtc)
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2019-12-02 6:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 2:42 [PATCH v1 0/6] drm/mediatek: fix cursor issue and apply CMDQ in Bibby Hsieh
2019-11-28 2:42 ` [PATCH v1 1/6] drm/mediatek: put "event" in critical section Bibby Hsieh
2019-11-28 2:42 ` [PATCH v1 2/6] drm/mediatek: use DRM core's atomic commit helper Bibby Hsieh
2019-12-02 6:07 ` CK Hu
2019-11-28 2:42 ` [PATCH v1 3/6] drm/mediatek: handle events when enabling/disabling crtc Bibby Hsieh
2019-12-02 6:43 ` CK Hu [this message]
2019-11-28 2:42 ` [PATCH v1 4/6] drm/mediatek: update cursors by using async atomic update Bibby Hsieh
2019-12-02 9:51 ` CK Hu
2019-11-28 2:42 ` [PATCH v1 5/6] drm/mediatek: support CMDQ interface in ddp component Bibby Hsieh
2019-12-03 2:56 ` CK Hu
2019-12-03 3:34 ` CK Hu
2019-11-28 2:42 ` [PATCH v1 6/6] drm/mediatek: apply CMDQ control flow Bibby Hsieh
2019-12-03 1:38 ` CK Hu
2019-12-03 5:58 ` Bibby Hsieh
2019-12-03 6:17 ` CK Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1575269008.3674.1.camel@mtksdaap41 \
--to=ck.hu@mediatek.com \
--cc=airlied@linux.ie \
--cc=bibby.hsieh@mediatek.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=drinkcat@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@chromium.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).