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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED 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 EDE16C10F13 for ; Tue, 16 Apr 2019 11:31:54 +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 BC8A12073F for ; Tue, 16 Apr 2019 11:31:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mIn6IZ/1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC8A12073F Authentication-Results: mail.kernel.org; dmarc=none (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=UK0hlURqHQiZ7tpSvl0A5ogp77K1FhGCnrBn2r6z1nI=; b=mIn6IZ/1tMJ55K 06l0PNM9UJTWaV/0hjiCRom71gAO8npwzXB+B4sY7q0DCww5Oq5WEdglKG835BUhxCohfbkahXntX 2yljH3Jpbkmo9HiJjYY7AZypOqky+v/X0+JmwNUuSEEMWPwLoIxJeXulUTdDX0b7F7GN0Nfuz6nlq obonTHS2q5izqQHXQGIGABGKnbLOCa1pqAA3i87xZwCO+uEKKei27uWdS0cOqQmccq8ibJVjZRbqb hIgovd4IdWYSuDYZ55XnLFRUfatahwhpuuOnkIAnc5RCmXTvFBfCvAaFrhPhhu3WLWN3NVkjuLHke hH/trGIxlr4ozMvNpnfg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGMJX-0001Bs-Jw; Tue, 16 Apr 2019 11:31:47 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGMJU-0001BU-Id; Tue, 16 Apr 2019 11:31:45 +0000 X-UUID: 1c89e56858e0442cbfd375437cadc33d-20190416 X-UUID: 1c89e56858e0442cbfd375437cadc33d-20190416 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1008895242; Tue, 16 Apr 2019 03:31:35 -0800 Received: from MTKMBS01N2.mediatek.inc (172.21.101.79) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 04:31:33 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 19:31:24 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 19:31:24 +0800 Message-ID: <1555414284.27572.17.camel@mtksdaap41> Subject: Re: [PATCH v2 18/25] drm/mediatek: add RDMA fifo size error handle From: YT Shen To: Date: Tue, 16 Apr 2019 19:31:24 +0800 In-Reply-To: <1555403837.31200.31.camel@mhfsdcap03> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> <1553667561-25447-19-git-send-email-yongqiang.niu@mediatek.com> <1555401647.11519.2.camel@mtksdaap41> <1555403837.31200.31.camel@mhfsdcap03> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 0CFAE686EB01360CCCFF5A2E6741B223103FB85D4EF17B6E68F97C5B11C9EE062000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_043144_615926_EA143ED1 X-CRM114-Status: GOOD ( 20.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, Bibby.Hsieh@mediatek.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, matthias.bgg@gmail.com, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, p.zabel@pengutronix.de, CK Hu , 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 On Tue, 2019-04-16 at 16:37 +0800, Yongqiang Niu wrote: > On Tue, 2019-04-16 at 16:00 +0800, CK Hu wrote: > > Hi, Yongqiang: > > > > On Wed, 2019-03-27 at 14:19 +0800, yongqiang.niu@mediatek.com wrote: > > > From: Yongqiang Niu > > > > > > This patch add RDMA fifo size error handle > > > rdma fifo size will not always bigger than the calculated threshold > > > if that case happened, we need set fifo size as the threshold > > > > > > Signed-off-by: Yongqiang Niu > > > --- > > > drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 9 ++++++++- > > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c > > > index b0a5cff..ead38ba 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c > > > @@ -137,11 +137,14 @@ static void mtk_rdma_config(struct mtk_ddp_comp *comp, unsigned int width, > > > { > > > unsigned int threshold; > > > unsigned int reg; > > > + unsigned int rdma_fifo_size; > > > struct mtk_disp_rdma *rdma = comp_to_rdma(comp); > > > > > > rdma_update_bits(comp, DISP_REG_RDMA_SIZE_CON_0, 0xfff, width); > > > rdma_update_bits(comp, DISP_REG_RDMA_SIZE_CON_1, 0xfffff, height); > > > > > > + rdma_fifo_size = RDMA_FIFO_SIZE(rdma); > > > + > > > /* > > > * Enable FIFO underflow since DSI and DPI can't be blocked. > > > * Keep the FIFO pseudo size reset default of 8 KiB. Set the > > > @@ -149,8 +152,12 @@ static void mtk_rdma_config(struct mtk_ddp_comp *comp, unsigned int width, > > > * account for blanking, and with a pixel depth of 4 bytes: > > > */ > > > threshold = width * height * vrefresh * 4 * 7 / 1000000; > > > + > > > + if (threshold > rdma_fifo_size) > > > + threshold = rdma_fifo_size; > > > > I think this is a work around not a correct solution. Why MT8173 has no > > this problem but MT8183 has? Is the formula of threshold different in > > MT8173 and MT8183? > > > > Regards, > > CK > > > > fifo size of RDMA0 and RDMA1 in MT8173 are same, which is SZ_8K. > this formula calculate result will not overflow if the screen size is > not big enough. > > but fifo size of RDMA1 in MT8183 only SZ_2K, if RDMA1 display with > solution 1080p60hz, this formula calculate result 3483 will overflow > SZ_2K. RDMA1 with SZ_2K can support up to 1080p60hz, even the formula shows overflow, is it correct? The formula shows all resolution something more than 1280x1080@60hz will overflow SZ_2K, and in this patch all set to maximum value. The patch should implement different FIFO size depends on RDMA0 (SZ_5K)and RDMA1 (SZ_2K), and use the value from the formula. Regards, yt.shen > > > > + > > > reg = RDMA_FIFO_UNDERFLOW_EN | > > > - RDMA_FIFO_PSEUDO_SIZE(RDMA_FIFO_SIZE(rdma)) | > > > + RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) | > > > RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold); > > > writel(reg, comp->regs + DISP_REG_RDMA_FIFO_CON); > > > } > > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel