Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7048892imu; Mon, 21 Jan 2019 22:43:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN4nj6r7CiGhIh121TRn1BCCfHpRzJPQbaEJiS0MfBE+LUO0b1pAd6Kz+oiSRJeJKVQ/4wtG X-Received: by 2002:a17:902:20b:: with SMTP id 11mr33212686plc.57.1548139409996; Mon, 21 Jan 2019 22:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548139409; cv=none; d=google.com; s=arc-20160816; b=t8hkGVTv/q8T7VylTSfD9ncf0BGpZcq8CpB+wlO9+644+myFdFTOmdaYxNVPJCFZzD HAd7DmEbKYjiEzhYyVAzCYWmsnK2sU2OhoC5XxdV3z9eqCBYLNHt+B/4pUSgugTMkfVe VPVpIwd6ouuweCS//ZCTCVzYgOL9RMe4C0qEY7ofOjeLTXG+Ibs3tTmt5KaAF7hOV1xr M/U1I8XRAtdckOVqj33nG0dJRYH+nkSVNTZmBlitajoW8s6P7n16+FTZcJ8994LtIw+1 yNGypBxIFibmsfdEjt5iYoRAE+qOb/6S7GoD95sVCGpafKA9MIyTykZwkrLK6jRcN6Pk YhYA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=X1j5538yK1aP8oPVNaQ6Oa2a+Tq03rg98HcTQJ4UERs=; b=IBDQHuuqpTuFIZ62mJN+WCZW8keR/LkDOXh0aMOepEgKO05vjla5mnxs4wqFeLgYOI F2CsFDTQagflhiCWqkLtqu0S3igzhyR3MtxtZb2I4ZOAzY+/WWeOJFZEY5kbUeRci9sT xwUa8Xylu4M2MmCIwjL47sKiHQ4CaF/95ed3N0Ggzaj3mxWck5oh3i8RaNI0v96nJLaY bKcqNtks8rwecLkak+8VNUZmF3ocvJlOYuAii+le0eBDQc+TMQjwlY3hVBnwfVqe57ZB BY41nCN+wGwTKdOhk/lIwl9rtPMC5HqbdLxyEtjYUpgDqXlnT4sbuphI38b/ukU1P5Gn mCbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si8282597pgs.8.2019.01.21.22.43.14; Mon, 21 Jan 2019 22:43:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfAVGlj (ORCPT + 99 others); Tue, 22 Jan 2019 01:41:39 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:47259 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727070AbfAVGlj (ORCPT ); Tue, 22 Jan 2019 01:41:39 -0500 X-UUID: ad60eacbd7694476a514c725c879d81b-20190122 X-UUID: ad60eacbd7694476a514c725c879d81b-20190122 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 154833029; Tue, 22 Jan 2019 14:41:13 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 22 Jan 2019 14:41:11 +0800 Received: from [10.16.6.141] (10.16.6.141) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 22 Jan 2019 14:41:10 +0800 Message-ID: <1548139270.1697.1.camel@mszsdaap41> Subject: Re: [PATCH 9/9] drm/mediatek: add dpi dual edge support From: Jitao Shi To: CK Hu =?UTF-8?Q?=28=E8=83=A1=E4=BF=8A=E5=85=89=29?= CC: Chunhui Dai =?UTF-8?Q?=28=E6=88=B4=E6=98=A5=E6=99=96=29?= , --to=Michael Turquette , Stephen Boyd , "Matthias Brugger" , Philipp Zabel , David Airlie , Sean Wang , "Ryder Lee =?UTF-8?Q?=28=E6=9D=8E=E5=BA=9A=E8=AB=BA=29?=" , Colin Ian King , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "dri-devel@lists.freedesktop.org" , srv_heupstream , Bibby Hsieh =?UTF-8?Q?=28=E8=AC=9D=E6=BF=9F=E9=81=A0=29?= , JamesJJ Liao =?UTF-8?Q?=28=E5=BB=96=E5=BB=BA=E6=99=BA=29?= Date: Tue, 22 Jan 2019 14:41:10 +0800 In-Reply-To: <6021c8950c3146bb941ed1355391106d@mtkmbs01n1.mediatek.inc> References: <1546585439-30455-1-git-send-email-chunhui.dai@mediatek.com> <1546585439-30455-10-git-send-email-chunhui.dai@mediatek.com> <6021c8950c3146bb941ed1355391106d@mtkmbs01n1.mediatek.inc> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi CK, Ok, I'll send it again in an independent patch. Best Regards Jitao On Wed, 2019-01-16 at 14:52 +0800, CK Hu (胡俊光) wrote: > Hi, Chunhui: > > > -----Original Message----- > > From: chunhui dai [mailto:chunhui.dai@mediatek.com] > > Sent: Friday, January 04, 2019 3:04 PM > > To: --to=Michael Turquette; Stephen Boyd; CK Hu (胡俊光) > > Cc: Matthias Brugger; Philipp Zabel; David Airlie; Chunhui Dai (戴春晖); Sean > > Wang; Ryder Lee (李庚諺); Colin Ian King; linux-clk@vger.kernel.org; > > linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > > linux-mediatek@lists.infradead.org; dri-devel@lists.freedesktop.org; > > srv_heupstream; Bibby Hsieh (謝濟遠); JamesJJ Liao (廖建智); Jitao Shi (石记 > > 涛) > > Subject: [PATCH 9/9] drm/mediatek: add dpi dual edge support > > > > DPI sample on rising and falling edge. It can reduce half data io. > > This patch looks like a patch for MT8183. For MT8173 and MT2701, dual_edge is false. > For now, we have not support MT8183 yet. > So you could just set dual_edge to false and remove MT8183 part in this patch. > You could send the MT8183 part in an independent patch, not in a series of MT2701. > > Regards, > CK > > > > > Signed-off-by: Jitao Shi > > Signed-off-by: chunhui dai > > --- > > drivers/gpu/drm/mediatek/mtk_dpi.c | 30 > > ++++++++++++++++++++++++++++++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c > > b/drivers/gpu/drm/mediatek/mtk_dpi.c > > index 4a2f4a6..acb4f47 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > > @@ -117,6 +117,7 @@ struct mtk_dpi_conf { > > unsigned int (*cal_factor)(int clock); > > u32 reg_h_fre_con; > > bool edge_sel_en; > > + bool dual_edge; > > }; > > > > static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask) > > @@ -353,6 +354,15 @@ static void mtk_dpi_config_disable_edge(struct > > mtk_dpi *dpi) > > mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, 0, EDGE_SEL_EN); } > > > > +static void mtk_dpi_config_dual_edge(struct mtk_dpi *dpi) { > > + if (dpi->conf->dual_edge) { > > + mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | > > + DDR_4PHASE, DDR_EN | DDR_4PHASE); > > + mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, EDGE_SEL, EDGE_SEL); > > + } > > +} > > + > > static void mtk_dpi_config_color_format(struct mtk_dpi *dpi, > > enum mtk_dpi_out_color_format format) { @@ > > -509,6 +519,7 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, > > mtk_dpi_config_color_format(dpi, dpi->color_format); > > mtk_dpi_config_2n_h_fre(dpi); > > mtk_dpi_config_disable_edge(dpi); > > + mtk_dpi_config_dual_edge(dpi); > > mtk_dpi_sw_reset(dpi, false); > > > > return 0; > > @@ -669,6 +680,16 @@ static unsigned int mt2701_calculate_factor(int > > clock) > > return 1; > > } > > > > +static unsigned int mt8183_calculate_factor(int clock) { > > + if (clock <= 27000) > > + return 8; > > + else if (clock <= 167000) > > + return 4; > > + else > > + return 2; > > +} > > + > > static const struct mtk_dpi_conf mt8173_conf = { > > .cal_factor = mt8173_calculate_factor, > > .reg_h_fre_con = 0xe0, > > @@ -680,6 +701,12 @@ static unsigned int mt2701_calculate_factor(int > > clock) > > .edge_sel_en = true, > > }; > > > > +static const struct mtk_dpi_conf mt8183_conf = { > > + .cal_factor = mt8183_calculate_factor, > > + .reg_h_fre_con = 0xe0, > > + .dual_edge = true, > > +}; > > + > > static int mtk_dpi_probe(struct platform_device *pdev) { > > struct device *dev = &pdev->dev; > > @@ -775,6 +802,9 @@ static int mtk_dpi_remove(struct platform_device > > *pdev) > > { .compatible = "mediatek,mt8173-dpi", > > .data = &mt8173_conf, > > }, > > + { .compatible = "mediatek,mt8183-dpi", > > + .data = &mt8183_conf, > > + }, > > { }, > > }; > > > > -- > > 1.9.1 >