From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@linux.ie>,
linux-kernel <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
Yongqiang Niu <yongqiang.niu@mediatek.com>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
Daniel Vetter <daniel@ffwll.ch>,
Matthias Brugger <matthias.bgg@gmail.com>,
Tomasz Figa <tfiga@chromium.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4] drm/mediatek: check plane visibility in atomic_update
Date: Sat, 27 Jun 2020 10:35:46 +0800 [thread overview]
Message-ID: <CAAOTY_-mB5EC7_fHzpn+NFPRxAHEzY-f5dRv3g1TKfR5Hui58A@mail.gmail.com> (raw)
In-Reply-To: <20200622155753.130181-1-hsinyi@chromium.org>
Hi, Hsin-Yi:
Hsin-Yi Wang <hsinyi@chromium.org> 於 2020年6月22日 週一 下午11:57寫道:
>
> Disable the plane if it's not visible. Otherwise mtk_ovl_layer_config()
> would proceed with invalid plane and we may see vblank timeout.
>
Applied to mediatek-drm-next [1], thanks.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
Regards,
Chun-Kuang.
> Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> ---
> v4: fix commit message
> v3: Address comment
> v2: Add fixes tag
> ---
> drivers/gpu/drm/mediatek/mtk_drm_plane.c | 25 ++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index c2bd683a87c8..92141a19681b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -164,6 +164,16 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
> true, true);
> }
>
> +static void mtk_plane_atomic_disable(struct drm_plane *plane,
> + struct drm_plane_state *old_state)
> +{
> + struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
> +
> + state->pending.enable = false;
> + wmb(); /* Make sure the above parameter is set before update */
> + state->pending.dirty = true;
> +}
> +
> static void mtk_plane_atomic_update(struct drm_plane *plane,
> struct drm_plane_state *old_state)
> {
> @@ -178,6 +188,11 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
> if (!crtc || WARN_ON(!fb))
> return;
>
> + if (!plane->state->visible) {
> + mtk_plane_atomic_disable(plane, old_state);
> + return;
> + }
> +
> gem = fb->obj[0];
> mtk_gem = to_mtk_gem_obj(gem);
> addr = mtk_gem->dma_addr;
> @@ -200,16 +215,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
> state->pending.dirty = true;
> }
>
> -static void mtk_plane_atomic_disable(struct drm_plane *plane,
> - struct drm_plane_state *old_state)
> -{
> - struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
> -
> - state->pending.enable = false;
> - wmb(); /* Make sure the above parameter is set before update */
> - state->pending.dirty = true;
> -}
> -
> static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
> .prepare_fb = drm_gem_fb_prepare_fb,
> .atomic_check = mtk_plane_atomic_check,
> --
> 2.27.0.111.gc72c7da667-goog
>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
parent reply other threads:[~2020-06-27 2:36 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20200622155753.130181-1-hsinyi@chromium.org>]
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=CAAOTY_-mB5EC7_fHzpn+NFPRxAHEzY-f5dRv3g1TKfR5Hui58A@mail.gmail.com \
--to=chunkuang.hu@kernel.org \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hsinyi@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=tfiga@chromium.org \
--cc=yongqiang.niu@mediatek.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).