Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7064595imu; Mon, 21 Jan 2019 23:04:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DPZPfz00xkJfOWLf8diWO3sCm1IzP538RC7o9HIixFO2vNwE70rpbhYBSdOlumXIO2H2i X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr33383180plb.244.1548140690845; Mon, 21 Jan 2019 23:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548140690; cv=none; d=google.com; s=arc-20160816; b=rYdPJjYjJzECWhh7QCUWMC7QXAYljKmm/et8+fZ43h68cKMPaiSFwRp1i4DoAxotDZ jwl9WUDBKaGgkeKzCxCdIAjreHIjkaGUtpjZobQUnLODVs6CYGFYpkWgWeYh5nKs48Zc Z7dw8VtKDWaB7XkgSFUSv0mCYUO5HdexPsWLaGwyB6r42emIfTiez4QvmyOCArxIrQfo N1Cp/1iFWEppA9BBiQHmOWXnwLokqf0i9ZVYvBWfEmcWEKPEF0VRDn7tvlLJ9wpZ1Pqg Jel1/7/O0MJnfpzWhUlgZZeFOBe6rXO7FOY0V7H+pJi5bxrBRSiwFrRWTpWrueMX3MCN z26g== 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=HgSAzwxZeoVq1k67JdAIZPJ7tYsE8gaLMMOuOR6lWCc=; b=iP4txMS2HCSCnULu9HDa6cg4gemOTvs19B73DxJr8QLfxyVQnPmb4w8d5zcFrf0l6i S3lMwJ5MDKwKVoXWw6SgjD7g0abIdasu7ai1JbW+fYGJR2BLoS1Lw/cwSLKOx+L+LQC+ WwEqPd8K8DNeIKcc5RFuxac2wk9SWaoXcfc9iIzflqhVE55ca3yKXHfWTYKMmYnUYtwD iZItw1vfrbABja/16WjYz4u7QmAQYyqBT/vH3D1aXrZJnWIsSyqxNGLjFFmtpaEbTEIX 4VBH9t/NQJv/U/xh40nxzXMTjFA3NqT7NwcrEzqw0HgdDqcdSgz2adKg1Dxu+KiK6Ual SXwQ== 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 e129si14987464pgc.333.2019.01.21.23.04.34; Mon, 21 Jan 2019 23:04:50 -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 S1727055AbfAVHD1 (ORCPT + 99 others); Tue, 22 Jan 2019 02:03:27 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:28904 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725862AbfAVHD0 (ORCPT ); Tue, 22 Jan 2019 02:03:26 -0500 X-UUID: ad779792603f4bf59f9a30947b10b8f4-20190122 X-UUID: ad779792603f4bf59f9a30947b10b8f4-20190122 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1123729437; Tue, 22 Jan 2019 15:03:21 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 22 Jan 2019 15:03:19 +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 15:03:18 +0800 Message-ID: <1548140598.5648.1.camel@mszsdaap41> Subject: Re: [PATCH 9/9] drm/mediatek: add dpi dual edge support From: Jitao Shi To: Matthias Brugger CC: chunhui dai , --to=Michael Turquette , Stephen Boyd , CK Hu , Philipp Zabel , David Airlie , Sean Wang , Ryder Lee , Colin Ian King , , , , , , , , Date: Tue, 22 Jan 2019 15:03:18 +0800 In-Reply-To: References: <1546585439-30455-1-git-send-email-chunhui.dai@mediatek.com> <1546585439-30455-10-git-send-email-chunhui.dai@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-01-09 at 17:58 +0100, Matthias Brugger wrote: > > On 04/01/2019 08:03, chunhui dai wrote: > > DPI sample on rising and falling edge. It can reduce half data io. > > > > 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) > > I think it is clearer if you rename the function to something like: > mtk_dpi_enable_dual_edge and call it in mtk_dpi_set_display_mode if > dpi->conf->dual_edge is true. > > Regards, > Matthias > I'll fix it in next patch. Best Regards Jitao > > +{ > > + 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, > > + }, > > { }, > > }; > > > >