From: Pi-Hsun Shih <pihsun@chromium.org>
To: Bibby Hsieh <bibby.hsieh@mediatek.com>
Cc: David Airlie <airlied@linux.ie>,
Matthias Brugger <matthias.bgg@gmail.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
YT Shen <yt.shen@mediatek.com>,
Thierry Reding <thierry.reding@gmail.com>,
CK Hu <ck.hu@mediatek.com>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@lists.infradead.org>,
Tomasz Figa <tfiga@chromium.org>,
Nicolas Boichat <drinkcat@chromium.org>,
open list <linux-kernel@vger.kernel.org>,
Yongqiang Niu <yongqiang.niu@mediatek.com>
Subject: Re: [PATCH 2/2] drm/mediatek: Apply CMDQ control flow
Date: Mon, 23 Sep 2019 16:14:55 +0800 [thread overview]
Message-ID: <CANdKZ0du8unMedhmdjCyXR7xKYBoWEZ7YLmrvd6Y_W-Y=u3TfQ@mail.gmail.com> (raw)
In-Reply-To: <20190830074103.16671-3-bibby.hsieh@mediatek.com>
Hi Bibby,
On Fri, Aug 30, 2019 at 3:41 PM Bibby Hsieh <bibby.hsieh@mediatek.com> wrote:
> ...
> +static void ddp_cmdq_cb(struct cmdq_cb_data data)
> +{
> +
> +#if IS_ENABLED(CONFIG_MTK_CMDQ)
> + struct mtk_cmdq_cb_data *cb_data = data.data;
> + struct drm_crtc_state *crtc_state = cb_data->state;
> + struct drm_atomic_state *atomic_state = crtc_state->state;
> + struct drm_crtc *crtc = crtc_state->crtc;
> + struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
> +
> + DRM_DEBUG_DRIVER("%s\n", __func__);
This debug message is printed about twice per second when enabled,
which makes debugging other things that also use DRM_DEBUG_DRIVER
harder. Can this be rate-limited or removed?
> +
> + if (mtk_crtc->pending_needs_vblank) {
> + /* cmdq_vblank_event must be read after cmdq_needs_event */
> + smp_rmb();
> +
> ...
> +void mtk_drm_crtc_plane_update(struct drm_crtc *crtc, struct drm_plane *plane,
> + struct mtk_plane_state *state)
> +{
> + struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
> + struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
> + struct drm_crtc_state *crtc_state = crtc->state;
> + struct mtk_crtc_state *mtk_crtc_state = to_mtk_crtc_state(crtc_state);
> + struct cmdq_pkt *cmdq_handle = mtk_crtc_state->cmdq_handle;
> + unsigned int comp_layer_nr = mtk_ddp_comp_layer_nr(comp);
> + unsigned int local_layer;
> + unsigned int plane_index = plane - mtk_crtc->planes;
> +
> + DRM_DEBUG_DRIVER("%s\n", __func__);
Same with this one.
> + if (mtk_crtc->cmdq_client) {
> + if (plane_index >= comp_layer_nr) {
> + comp = mtk_crtc->ddp_comp[1];
> + local_layer = plane_index - comp_layer_nr;
> ...
> @@ -494,13 +599,29 @@ static void mtk_drm_crtc_atomic_flush(struct drm_crtc *crtc,
> struct drm_crtc_state *old_crtc_state)
> {
> struct drm_atomic_state *old_atomic_state = old_crtc_state->state;
> + struct drm_crtc_state *crtc_state = crtc->state;
> + struct mtk_crtc_state *state = to_mtk_crtc_state(crtc_state);
> + struct cmdq_pkt *cmdq_handle = state->cmdq_handle;
> struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
> struct mtk_drm_private *priv = crtc->dev->dev_private;
> + struct mtk_cmdq_cb_data *cb_data;
> unsigned int pending_planes = 0;
> int i;
>
> - if (mtk_crtc->event)
> - mtk_crtc->pending_needs_vblank = true;
> + DRM_DEBUG_DRIVER("[CRTC:%u] [STATE:%p(%p)->%p(%p)]\n", crtc->base.id,
> + old_crtc_state, old_crtc_state->state,
> + crtc_state, crtc_state->state);
Same with this one.
> +
> + if (IS_ENABLED(CONFIG_MTK_CMDQ) && mtk_crtc->cmdq_client) {
> + drm_atomic_state_get(old_atomic_state);
> + cb_data = kmalloc(sizeof(*cb_data), GFP_KERNEL);
> + cb_data->state = old_crtc_state;
> ...
next prev parent reply other threads:[~2019-09-23 8:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-30 7:41 [PATCH 0/2] Support CMDQ interface and control flow Bibby Hsieh
2019-08-30 7:41 ` [PATCH 1/2] drm/mediatek: Support CMDQ interface in ddp component Bibby Hsieh
2019-09-02 1:36 ` CK Hu
2019-09-02 7:44 ` Nicolas Boichat
2019-09-05 22:49 ` Nicolas Boichat
2019-08-30 7:41 ` [PATCH 2/2] drm/mediatek: Apply CMDQ control flow Bibby Hsieh
2019-08-30 7:58 ` CK Hu
2019-09-23 8:14 ` Pi-Hsun Shih [this message]
2019-11-18 9:34 ` Hsin-Yi Wang
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='CANdKZ0du8unMedhmdjCyXR7xKYBoWEZ7YLmrvd6Y_W-Y=u3TfQ@mail.gmail.com' \
--to=pihsun@chromium.org \
--cc=airlied@linux.ie \
--cc=bibby.hsieh@mediatek.com \
--cc=ck.hu@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=tfiga@chromium.org \
--cc=thierry.reding@gmail.com \
--cc=yongqiang.niu@mediatek.com \
--cc=yt.shen@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).