Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp669078ybs; Sun, 24 May 2020 17:42:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn8Y69r7TCaSEChwwYk++1SsZNwuJ+SllxP1iZzZQGnm50XEFL4bCNGwAF5JbzKXhr0FpC X-Received: by 2002:a50:b2e1:: with SMTP id p88mr4495886edd.198.1590367320841; Sun, 24 May 2020 17:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590367320; cv=none; d=google.com; s=arc-20160816; b=sHPYDD9/Ii5YYKI18BJk7EoSnEnq1AY/b5Wu5BVyS75kyJ9Z4VYbvo25F5EkVBCBCM zrbW4FvN9T3lZLcxDmClkUe5I5i6SlJsHiQeZngQJ7IW3aFXTzih1x+mY+ycd76KZerG GQ9mCSvL0WBAKhHFIAVvFpuEvP8rN70U8UFC6/GDH2RBOdKj0PDFOzToFFhLPb99bDVS yZ4F4XOWekOtBsVVe/UkcChtn3yIweEMfh+OjNHLs1m1bcMx1QIoGixxD4Kg8RH1qylm x6TrtrNwveMsKD84GyUc2D6YqhXXN5wB97fjw4JINi1c5+pUf0GshVFs3izYYLVHEJ6u VzGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9sG9hTgzByKhEbKsZP3BAfa3s6tKTHLCbB+cKQdDwXE=; b=zb50Zid6th52SGoRjTLvJuglFji3u30bLi3lsbB6SDZPJjIFfRGh1pNkweIs54MKfK URbUPMF9wBnmSfMvHMZcarE4Z33inRkaRKsZ1exsNbKLXwJwKfWUoMt0IX5bAy/sMows vuYsMJkNYHkZ5CElcDi0fRG0nkeAJ1gI9ZZCFDXRnZDhDYo/LVdQexuXKv1tbxsmMfI4 tU+0FDSkDIvqlG6LPYH5lnA+LmqsAEtFabwj2TPG7kw1ddl2oJ4oUFqhlUw2BFko18gI jjWx89EIKxs3y0NY2Q7iOl4nHHLV8BPNJam85ZtaTX1eG5/fBHggWDXGpQTPU8kLI9G7 33JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SSsZhLY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si9315697eds.281.2020.05.24.17.41.38; Sun, 24 May 2020 17:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SSsZhLY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388411AbgEYAX3 (ORCPT + 99 others); Sun, 24 May 2020 20:23:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388300AbgEYAX2 (ORCPT ); Sun, 24 May 2020 20:23:28 -0400 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D6BBA208A7; Mon, 25 May 2020 00:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590366207; bh=3fQWdb2Uv3qePojZmO+4tSxfnjltQG0nFeUsHQam6o4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SSsZhLY9EfC5qU/BYZB5juZ2bjSbJoVAyMNtCB7kiCirQUkaYGHR55KJ0c1fF7/Ef VbIV+wO8v8USBpPo7WhacJSxyY2972LW49K4/yNGsQd4kX8QkJ8G82crzuzRp9LtTq tAeBF9wRdr/GFOIc6eBUm4nZKEJx0SEgWEXwPRpQ= Received: by mail-ej1-f50.google.com with SMTP id a2so18816543ejb.10; Sun, 24 May 2020 17:23:26 -0700 (PDT) X-Gm-Message-State: AOAM530S26jD8Jr8H/JpKR5g8LM3hmU2WPPknN709idSyIpM0dG2A4p0 AUrN7kwYg33mzU3mLZEey2lI130fXxGH/RyjHQ== X-Received: by 2002:a17:906:3041:: with SMTP id d1mr17295243ejd.7.1590366205137; Sun, 24 May 2020 17:23:25 -0700 (PDT) MIME-Version: 1.0 References: <1583664775-19382-1-git-send-email-dennis-yc.hsieh@mediatek.com> <1583664775-19382-11-git-send-email-dennis-yc.hsieh@mediatek.com> <5d6b61b2-23c9-647f-fa22-73e779010bd8@gmail.com> In-Reply-To: <5d6b61b2-23c9-647f-fa22-73e779010bd8@gmail.com> From: Chun-Kuang Hu Date: Mon, 25 May 2020 08:23:13 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 10/13] soc: mediatek: cmdq: export finalize function To: Matthias Brugger Cc: Dennis YC Hsieh , Rob Herring , Mark Rutland , Jassi Brar , Philipp Zabel , David Airlie , Daniel Vetter , devicetree@vger.kernel.org, wsd_upstream@mediatek.com, linux-kernel , DRI Development , HS Liao , "moderated list:ARM/Mediatek SoC support" , Houlong Wei , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Matthias: Matthias Brugger =E6=96=BC 2020=E5=B9=B45=E6=9C=88= 17=E6=97=A5 =E9=80=B1=E6=97=A5 =E4=B8=8A=E5=8D=882:22=E5=AF=AB=E9=81=93=EF= =BC=9A > > > > On 08/03/2020 11:52, Dennis YC Hsieh wrote: > > Export finalize function to client which helps append eoc and jump > > command to pkt. Let client decide call finalize or not. > > > > Signed-off-by: Dennis YC Hsieh > > Reviewed-by: CK Hu > > --- > > drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 1 + > > drivers/soc/mediatek/mtk-cmdq-helper.c | 7 ++----- > > include/linux/soc/mediatek/mtk-cmdq.h | 8 ++++++++ > > 3 files changed, 11 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/= mediatek/mtk_drm_crtc.c > > index 0dfcd1787e65..7daaabc26eb1 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > @@ -490,6 +490,7 @@ static void mtk_drm_crtc_hw_config(struct mtk_drm_c= rtc *mtk_crtc) > > cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event); > > cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event); > > mtk_crtc_ddp_config(crtc, cmdq_handle); > > + cmdq_pkt_finalize(cmdq_handle); > > cmdq_pkt_flush_async(cmdq_handle, ddp_cmdq_cb, cmdq_handl= e); > > } > > #endif > > This should be a independent patch. > Other then that patch looks good. Apply only drm part or only cmdq helpr part, it would be abnormal. Shall we seperate this patch? Or seperate it but make sure these two patches be in the same tree? Regards, Chun-Kuang. > > > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/media= tek/mtk-cmdq-helper.c > > index a9ebbabb7439..59bc1164b411 100644 > > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c > > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c > > @@ -372,7 +372,7 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_i= dx, u32 value) > > } > > EXPORT_SYMBOL(cmdq_pkt_assign); > > > > -static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) > > +int cmdq_pkt_finalize(struct cmdq_pkt *pkt) > > { > > struct cmdq_instruction inst =3D { {0} }; > > int err; > > @@ -392,6 +392,7 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) > > > > return err; > > } > > +EXPORT_SYMBOL(cmdq_pkt_finalize); > > > > static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data) > > { > > @@ -426,10 +427,6 @@ int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmd= q_async_flush_cb cb, > > unsigned long flags =3D 0; > > struct cmdq_client *client =3D (struct cmdq_client *)pkt->cl; > > > > - err =3D cmdq_pkt_finalize(pkt); > > - if (err < 0) > > - return err; > > - > > pkt->cb.cb =3D cb; > > pkt->cb.data =3D data; > > pkt->async_cb.cb =3D cmdq_pkt_flush_async_cb; > > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/= mediatek/mtk-cmdq.h > > index fec292aac83c..99e77155f967 100644 > > --- a/include/linux/soc/mediatek/mtk-cmdq.h > > +++ b/include/linux/soc/mediatek/mtk-cmdq.h > > @@ -213,6 +213,14 @@ int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 su= bsys, > > */ > > int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); > > > > +/** > > + * cmdq_pkt_finalize() - Append EOC and jump command to pkt. > > + * @pkt: the CMDQ packet > > + * > > + * Return: 0 for success; else the error code is returned > > + */ > > +int cmdq_pkt_finalize(struct cmdq_pkt *pkt); > > + > > /** > > * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the= CMDQ > > * packet and call back at the end of done pa= cket > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel