Message ID | 1681366162-4949-4-git-send-email-xinlei.lee@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp822798vqo; Wed, 12 Apr 2023 23:25:54 -0700 (PDT) X-Google-Smtp-Source: AKy350bq721fZ5Ushj0ImhiDbpR7P2iX57aVJK+aLKzbopRf+gEy4wJtwaRAdUzSl8JjsBXSUVfT X-Received: by 2002:a17:903:2487:b0:1a1:b5ce:5d03 with SMTP id p7-20020a170903248700b001a1b5ce5d03mr1076638plw.10.1681367154265; Wed, 12 Apr 2023 23:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681367154; cv=none; d=google.com; s=arc-20160816; b=NWAsLRsvtKuxHxHh4Sy9JmK06cnJ/q9eqAlt5M6gdHodxBBeoclTjqzsqYs147ZT/L 5Q5d7wcl9280oI+W9puxYFf3gNb9dG6XHMXmCt+NMn+b8jiv4hnBJu40iwKjt9oBUGC8 vJZa7zqOGvgAnAHNezvmgRBPcO2Gzx9/kyQKAEE4Y7E1UIpHqqEddPUdusDb702hj2is JYqEnvw9+VAMHwOcG9EBJw6Nl80UrMffD8fWbCrMOHzgQDD25J9uSfOMJdTTNeXzURgB cYeIa1Ow5Qd7MAtVusbT5MJ49WXv56OJ5xmzsvIP96FUgO/YOpFmGebpGbgJ7rS5VDKm 32tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cooVt/7DyMIfNymQDJe2zBqzAP0xjJRI2g2y8h0vqO4=; b=IqoWJebDlX2XuVCc4Huw/jGzlyMR8sFOtrI4DIVTsI0PmXM/jqJLhGKAe5yEs82SC9 Ocyfh0nwa4kLTu4sHUKxpN2VRKs/LYDHprkhAttbITsSU4ZrIgNUrylHksVZhE1+/BWf 4UIxGq5ZE4chmpP51fxSd8/MOmZll2JiVPypLiovMS/wXdOXB8b44nE4RiUeTCtMmMBa Hd52s8v5mVqYdvNn8mnS0x+bFPiodgPcrN7MSSwcueKuIhCfJ89m7guOLkOm81ZEitbk 9jyQrrVxiFASXnw6twYMnn6NsMhur0S0zQTBEsa1Z5A+597pWnf8Yhl54/K3jw2O478u sz8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Htq0n6dz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw18-20020a170903045200b001a63b8e071esi1230801plb.28.2023.04.12.23.25.42; Wed, 12 Apr 2023 23:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Htq0n6dz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbjDMGJr (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Thu, 13 Apr 2023 02:09:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbjDMGJl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Apr 2023 02:09:41 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 875E85B9E; Wed, 12 Apr 2023 23:09:39 -0700 (PDT) X-UUID: c1501242d9c111edb6b9f13eb10bd0fe-20230413 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=cooVt/7DyMIfNymQDJe2zBqzAP0xjJRI2g2y8h0vqO4=; b=Htq0n6dz1KPeMU5iAX/9cGoikK/kx3m4D/XzhZfCSL5MIA0vwEFH3nABRsd9FW2qUpVAsguGkbDzE0e9J/TjUqx2nNf98miWNyMWVLSBP8RLkLzO3v9o5j6gidu/OWJznM6Tpm4fw+QAqeD3I5+soXWSCqo1oIgOg5cIxZ8Aluk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:44ef7ec6-2e05-468f-94ad-4ddd4e851da6,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:120426c,CLOUDID:3a55e983-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: c1501242d9c111edb6b9f13eb10bd0fe-20230413 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from <xinlei.lee@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 389169649; Thu, 13 Apr 2023 14:09:31 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Thu, 13 Apr 2023 14:09:29 +0800 Received: from mszsdaap41.gcn.mediatek.inc (10.16.6.141) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Thu, 13 Apr 2023 14:09:29 +0800 From: <xinlei.lee@mediatek.com> To: <chunkuang.hu@kernel.org>, <p.zabel@pengutronix.de>, <airlied@linux.ie>, <daniel@ffwll.ch>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <matthias.bgg@gmail.com>, <jitao.shi@mediatek.com>, <shuijing.li@mediatek.com> CC: <dri-devel@lists.freedesktop.org>, <linux-mediatek@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com>, Xinlei Lee <xinlei.lee@mediatek.com> Subject: [PATCH 3/3] drm/mediatek: dsi: Add dsi cmdq_ctl to send panel initial code Date: Thu, 13 Apr 2023 14:09:22 +0800 Message-ID: <1681366162-4949-4-git-send-email-xinlei.lee@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1681366162-4949-1-git-send-email-xinlei.lee@mediatek.com> References: <1681366162-4949-1-git-send-email-xinlei.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763041245502567317?= X-GMAIL-MSGID: =?utf-8?q?1763041245502567317?= |
Series |
Add mt8188 compatiable for DSI cmd packet control
|
|
Commit Message
Xinlei Lee (李昕磊)
April 13, 2023, 6:09 a.m. UTC
From: Xinlei Lee <xinlei.lee@mediatek.com> For mt8188, add dsi cmdq reg control to send long packets to panel initialization. Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com> Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> --- drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Comments
Hello Xinlei, IMO, [2/3] is weird because the driver_data for mt8186 and mt8188 are the same in [2/3]. So I think [2/3] coulde be squashed into this patch. BRs, Bo-Chen On Thu, 2023-04-13 at 14:09 +0800, xinlei.lee@mediatek.com wrote: > From: Xinlei Lee <xinlei.lee@mediatek.com> > > For mt8188, add dsi cmdq reg control to send long packets to panel > initialization. > > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com> > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c > b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 500a3054282d..cbfe5df4647c 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -86,6 +86,7 @@ > > #define DSI_CMDQ_SIZE 0x60 > #define CMDQ_SIZE 0x3f > +#define CMDQ_SIZE_SEL BIT(15) > > #define DSI_HSTX_CKL_WC 0x64 > > @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { > const u32 reg_cmdq_off; > bool has_shadow_ctl; > bool has_size_ctl; > + bool cmdq_long_packet_ctl; > }; > > struct mtk_dsi { > @@ -965,6 +967,11 @@ static u32 mtk_dsi_recv_cnt(u8 type, u8 > *read_data) > return 0; > } > > +static void mtk_dsi_cmd_packet_ctl(struct mtk_dsi *dsi) > +{ > + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); > +} > + > static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct > mipi_dsi_msg *msg) > { > const char *tx_buf = msg->tx_buf; > @@ -996,6 +1003,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, > const struct mipi_dsi_msg *msg) > > mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); > mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); > + if (dsi->driver_data->cmdq_long_packet_ctl) > + mtk_dsi_cmd_packet_ctl(dsi); > } > > static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, > @@ -1200,18 +1209,21 @@ static const struct mtk_dsi_driver_data > mt8183_dsi_driver_data = { > .reg_cmdq_off = 0x200, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = false, > }; > > static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = { > .reg_cmdq_off = 0xd00, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = false, > }; > > static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = { > .reg_cmdq_off = 0xd00, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = true, > }; > > static const struct of_device_id mtk_dsi_of_match[] = {
On 13/04/2023 08:09, xinlei.lee@mediatek.com wrote: > From: Xinlei Lee <xinlei.lee@mediatek.com> > > For mt8188, add dsi cmdq reg control to send long packets to panel initialization. > > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com> > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 500a3054282d..cbfe5df4647c 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -86,6 +86,7 @@ > > #define DSI_CMDQ_SIZE 0x60 > #define CMDQ_SIZE 0x3f > +#define CMDQ_SIZE_SEL BIT(15) > > #define DSI_HSTX_CKL_WC 0x64 > > @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { > const u32 reg_cmdq_off; > bool has_shadow_ctl; > bool has_size_ctl; > + bool cmdq_long_packet_ctl; > }; > > struct mtk_dsi { > @@ -965,6 +967,11 @@ static u32 mtk_dsi_recv_cnt(u8 type, u8 *read_data) > return 0; > } > > +static void mtk_dsi_cmd_packet_ctl(struct mtk_dsi *dsi) > +{ > + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); > +} > + > static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg) > { > const char *tx_buf = msg->tx_buf; > @@ -996,6 +1003,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg) > > mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); > mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); > + if (dsi->driver_data->cmdq_long_packet_ctl) > + mtk_dsi_cmd_packet_ctl(dsi); Why don't you put the onliner mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); directly here. Please help me understand why adding another indirection is usefull here. Best regards, Matthias > } > > static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, > @@ -1200,18 +1209,21 @@ static const struct mtk_dsi_driver_data mt8183_dsi_driver_data = { > .reg_cmdq_off = 0x200, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = false, > }; > > static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = { > .reg_cmdq_off = 0xd00, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = false, > }; > > static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = { > .reg_cmdq_off = 0xd00, > .has_shadow_ctl = true, > .has_size_ctl = true, > + .cmdq_long_packet_ctl = true, > }; > > static const struct of_device_id mtk_dsi_of_match[] = {
Hi Rex-BC, [2/3] is to add the driver data of 8188, [3/3] is the common content of 8183,8186 and 8188. So we think it should be divided into two patches. BRs, Shuijing On Thu, 2023-04-13 at 07:27 +0000, Rex-BC Chen (陳柏辰) wrote: > Hello Xinlei, > > IMO, [2/3] is weird because the driver_data for mt8186 and mt8188 are > the same in [2/3]. So I think [2/3] coulde be squashed into this > patch. > > BRs, > Bo-Chen > > On Thu, 2023-04-13 at 14:09 +0800, xinlei.lee@mediatek.com wrote: > > From: Xinlei Lee <xinlei.lee@mediatek.com> > > > > For mt8188, add dsi cmdq reg control to send long packets to panel > > initialization. > > > > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com> > > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> > > --- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c > > b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index 500a3054282d..cbfe5df4647c 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -86,6 +86,7 @@ > > > > #define DSI_CMDQ_SIZE 0x60 > > #define CMDQ_SIZE 0x3f > > +#define CMDQ_SIZE_SEL BIT(15) > > > > #define DSI_HSTX_CKL_WC 0x64 > > > > @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { > > const u32 reg_cmdq_off; > > bool has_shadow_ctl; > > bool has_size_ctl; > > + bool cmdq_long_packet_ctl; > > }; > > > > struct mtk_dsi { > > @@ -965,6 +967,11 @@ static u32 mtk_dsi_recv_cnt(u8 type, u8 > > *read_data) > > return 0; > > } > > > > +static void mtk_dsi_cmd_packet_ctl(struct mtk_dsi *dsi) > > +{ > > + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); > > +} > > + > > static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct > > mipi_dsi_msg *msg) > > { > > const char *tx_buf = msg->tx_buf; > > @@ -996,6 +1003,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, > > const struct mipi_dsi_msg *msg) > > > > mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); > > mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); > > + if (dsi->driver_data->cmdq_long_packet_ctl) > > + mtk_dsi_cmd_packet_ctl(dsi); > > } > > > > static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, > > @@ -1200,18 +1209,21 @@ static const struct mtk_dsi_driver_data > > mt8183_dsi_driver_data = { > > .reg_cmdq_off = 0x200, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = false, > > }; > > > > static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = { > > .reg_cmdq_off = 0xd00, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = false, > > }; > > > > static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = { > > .reg_cmdq_off = 0xd00, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = true, > > }; > > > > static const struct of_device_id mtk_dsi_of_match[] = {
Hi Matthias, I will update v2 version as your suggestion. BRs, Shuijing On Thu, 2023-04-13 at 11:09 +0200, Matthias Brugger wrote: > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > On 13/04/2023 08:09, xinlei.lee@mediatek.com wrote: > > From: Xinlei Lee <xinlei.lee@mediatek.com> > > > > For mt8188, add dsi cmdq reg control to send long packets to panel > > initialization. > > > > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com> > > Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> > > --- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c > > b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index 500a3054282d..cbfe5df4647c 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -86,6 +86,7 @@ > > > > #define DSI_CMDQ_SIZE 0x60 > > #define CMDQ_SIZE 0x3f > > +#define CMDQ_SIZE_SEL BIT(15) > > > > #define DSI_HSTX_CKL_WC 0x64 > > > > @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { > > const u32 reg_cmdq_off; > > bool has_shadow_ctl; > > bool has_size_ctl; > > + bool cmdq_long_packet_ctl; > > }; > > > > struct mtk_dsi { > > @@ -965,6 +967,11 @@ static u32 mtk_dsi_recv_cnt(u8 type, u8 > > *read_data) > > return 0; > > } > > > > +static void mtk_dsi_cmd_packet_ctl(struct mtk_dsi *dsi) > > +{ > > + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, > > CMDQ_SIZE_SEL); > > +} > > + > > static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct > > mipi_dsi_msg *msg) > > { > > const char *tx_buf = msg->tx_buf; > > @@ -996,6 +1003,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, > > const struct mipi_dsi_msg *msg) > > > > mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); > > mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); > > + if (dsi->driver_data->cmdq_long_packet_ctl) > > + mtk_dsi_cmd_packet_ctl(dsi); > > Why don't you put the onliner > mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); > directly here. Please help me understand why adding another > indirection is > usefull here. > > Best regards, > Matthias > > > } > > > > static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, > > @@ -1200,18 +1209,21 @@ static const struct mtk_dsi_driver_data > > mt8183_dsi_driver_data = { > > .reg_cmdq_off = 0x200, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = false, > > }; > > > > static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = > > { > > .reg_cmdq_off = 0xd00, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = false, > > }; > > > > static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = > > { > > .reg_cmdq_off = 0xd00, > > .has_shadow_ctl = true, > > .has_size_ctl = true, > > + .cmdq_long_packet_ctl = true, > > }; > > > > static const struct of_device_id mtk_dsi_of_match[] = {
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 500a3054282d..cbfe5df4647c 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -86,6 +86,7 @@ #define DSI_CMDQ_SIZE 0x60 #define CMDQ_SIZE 0x3f +#define CMDQ_SIZE_SEL BIT(15) #define DSI_HSTX_CKL_WC 0x64 @@ -178,6 +179,7 @@ struct mtk_dsi_driver_data { const u32 reg_cmdq_off; bool has_shadow_ctl; bool has_size_ctl; + bool cmdq_long_packet_ctl; }; struct mtk_dsi { @@ -965,6 +967,11 @@ static u32 mtk_dsi_recv_cnt(u8 type, u8 *read_data) return 0; } +static void mtk_dsi_cmd_packet_ctl(struct mtk_dsi *dsi) +{ + mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE_SEL, CMDQ_SIZE_SEL); +} + static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg) { const char *tx_buf = msg->tx_buf; @@ -996,6 +1003,8 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg) mtk_dsi_mask(dsi, reg_cmdq_off, cmdq_mask, reg_val); mtk_dsi_mask(dsi, DSI_CMDQ_SIZE, CMDQ_SIZE, cmdq_size); + if (dsi->driver_data->cmdq_long_packet_ctl) + mtk_dsi_cmd_packet_ctl(dsi); } static ssize_t mtk_dsi_host_send_cmd(struct mtk_dsi *dsi, @@ -1200,18 +1209,21 @@ static const struct mtk_dsi_driver_data mt8183_dsi_driver_data = { .reg_cmdq_off = 0x200, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = false, }; static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = { .reg_cmdq_off = 0xd00, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = false, }; static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = { .reg_cmdq_off = 0xd00, .has_shadow_ctl = true, .has_size_ctl = true, + .cmdq_long_packet_ctl = true, }; static const struct of_device_id mtk_dsi_of_match[] = {