Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2967512yba; Tue, 16 Apr 2019 01:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPSLDjWMPpp3au1UaXkUeD+5gLKKi1ybWDVW1QzWCRKvxRN0Yqhcdt4RAlE4KivjyLxQLK X-Received: by 2002:a17:902:20c9:: with SMTP id v9mr60036817plg.239.1555403900474; Tue, 16 Apr 2019 01:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555403900; cv=none; d=google.com; s=arc-20160816; b=PGRRga2hLBljMHoqTomJyPwkHkDZjL4pU5okXb0y9E8FFY3j/RfxKClCE+ANfNAHV9 +xL6bKuv13P0RRyU96sqqhi6/Y2ciCibufXRwp6GplkyaRvIGXONq2qtfhH2nGfyoUWS sK8tqLuzmHSiuiWz9vCeHw+nGkpAFm9GlEoKPU3x/D65QkBdauZDh7MNSuyCQ0oTrnGt xvHZOlQcQ92x4+/lsPKlOqaNz5fbEHUZ3dqmR+J1KlRYQP3WdPzlhe+S/joTj+2x+r8R Bq0HWAhOALG/uYBn7yl3WOOv8apDDgKurWdBmcqK/K9nyaaSxn4RYiJiMIOtBSpYRT8y g/hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id; bh=bmicLVBjOBp3PkTCQzMJroVe058djMQ6Ccgpjog90Xw=; b=r2X800MbSr347+6WqeKVVKwYtgYbaE4TXP/40EaWDJVJZ+gMIGsOTJjZLAHFIjAL21 7BR69z7U2ao09I8VxlVcydVUvTpmdFrq2rVQ1SYrMTVj4rSndK4mRHm3AqEMClPUPGIG Bnp0zG+6zxr7MvteBuhVRZZyBaI7TllcBPnFhWUHlq1pVYdaJipZ4uy6zWKHxqoK2gEK DQRSCoP/4qorWVd8DHjq37BguGoVt4T1x9yR5GJ6/bKn/TNDdQqPHGhm031Yyvverz9z gt5i6h4+V1G8iHkH9M80iMLJH1TYtVbYE48Luu5vj+abTDWSgNGqU64vSAbKzcHfjURN MLmA== 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 b41si22819310pla.241.2019.04.16.01.38.04; Tue, 16 Apr 2019 01:38:20 -0700 (PDT) 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 S1727783AbfDPIhZ (ORCPT + 99 others); Tue, 16 Apr 2019 04:37:25 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:30559 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726576AbfDPIhZ (ORCPT ); Tue, 16 Apr 2019 04:37:25 -0400 X-UUID: 34edd3c0ae6f46cc8673060dcf04d360-20190416 X-UUID: 34edd3c0ae6f46cc8673060dcf04d360-20190416 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1177869614; Tue, 16 Apr 2019 16:37:19 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 16:37:18 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 16:37:17 +0800 Message-ID: <1555403837.31200.31.camel@mhfsdcap03> Subject: Re: [PATCH v2 18/25] drm/mediatek: add RDMA fifo size error handle From: Yongqiang Niu Reply-To: To: CK Hu CC: , , , , , , , , , , , Date: Tue, 16 Apr 2019 16:37:17 +0800 In-Reply-To: <1555401647.11519.2.camel@mtksdaap41> 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > + > > 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); > > } > >