From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4EFC433DF for ; Sun, 24 May 2020 17:32:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9D522076C for ; Sun, 24 May 2020 17:32:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Aay/vxpz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="rjB/g/PY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9D522076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NDDeHnY92bJ8uO9V8r9ZK11KHSKdw5Fpv3dcaytPDKw=; b=Aay/vxpzbuHc4z 0DGn2+sg15+TKw7CZDYUWsQlEgXTFKt02UpOaOpkMbWt8ZqpvROBZ/M2iT83hdyTERJUJUyuwp/qc rvvHKQJw+GsSsm8h7kGeQVx3SNspLxCRvlR0cokfkXeW7Jdf5G3hFhcWDn0w2xLcSxo9lzZSqkqGF am9juG1cbUrJrLA/lAOXkuLumUgeSSA8cKLgbXVYP2Wt2VozQmZo9SUfpvxjWcjpNVibUAwfdLX+f l7yVJURKYEaOIHSTKP84GuoqUawHeLLSy7GbuWJANj3fOt1DhSOxyEbLMZ8jkh1ElN8YKUCsD3wAb dfezG93KkiUzQyBSGAmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcuTy-0004LY-Ul; Sun, 24 May 2020 17:32:18 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcuTp-0004Jk-9G; Sun, 24 May 2020 17:32:16 +0000 X-UUID: ab796e99effe4d7b8b6a9cfe3f7fdb83-20200524 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=bEukpIDc33kmSBnyaSWesUR3coz87RG9SGtY78KDiQM=; b=rjB/g/PYoVvsoAeButEc65q4Ml22yNb+QvyhY2w8xqxgta7N/5GD7nNL4ki47C4h0pkRq+QNiGRWnyqWEnr32TdrSGnQjnVLgyIEU2Xlh+CywLgKsC/H+0sDEOK7lw05ldhiA8fBPvkfKV3aBYKu5DbxwWn6kXLOIk4e2Uk0/rk=; X-UUID: ab796e99effe4d7b8b6a9cfe3f7fdb83-20200524 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 678140827; Sun, 24 May 2020 09:31:36 -0800 Received: from mtkmbs05n2.mediatek.inc (172.21.101.140) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 24 May 2020 10:32:00 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 May 2020 01:31:59 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 25 May 2020 01:31:59 +0800 Message-ID: <1590341522.31286.20.camel@mtkswgap22> Subject: Re: [PATCH v5 10/13] soc: mediatek: cmdq: export finalize function From: Dennis-YC Hsieh To: Matthias Brugger Date: Mon, 25 May 2020 01:32:02 +0800 In-Reply-To: <5d6b61b2-23c9-647f-fa22-73e779010bd8@gmail.com> 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> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200524_103214_648450_1637CB9D X-CRM114-Status: GOOD ( 18.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Philipp Zabel , wsd_upstream@mediatek.com, David Airlie , Jassi Brar , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, HS Liao , Rob Herring , linux-mediatek@lists.infradead.org, Houlong Wei , Daniel Vetter , CK Hu , Bibby Hsieh , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Matthias, Thanks for your comment. On Sat, 2020-05-16 at 20:22 +0200, Matthias Brugger wrote: > > 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_crtc *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_handle); > > } > > #endif > > This should be a independent patch. > Other then that patch looks good. ok, I'll separate this part. Regards, Dennis > > > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/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_idx, 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 = { {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, cmdq_async_flush_cb cb, > > unsigned long flags = 0; > > struct cmdq_client *client = (struct cmdq_client *)pkt->cl; > > > > - err = cmdq_pkt_finalize(pkt); > > - if (err < 0) > > - return err; > > - > > pkt->cb.cb = cb; > > pkt->cb.data = data; > > pkt->async_cb.cb = 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 subsys, > > */ > > 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 packet > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel