Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp71754pxu; Thu, 10 Dec 2020 18:44:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/m1jeB47Kt072uXmMMw7mgO+H58NNFSJa5zowWv4dHPQyq9taS8USmkN6xzNPJdFLhZzk X-Received: by 2002:a05:6402:687:: with SMTP id f7mr9697950edy.314.1607654682158; Thu, 10 Dec 2020 18:44:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607654682; cv=none; d=google.com; s=arc-20160816; b=puWA32kAMqJ0Ce5LkGxItMjrAeyvGC86GL8gklGF2L9JHXAJirVNDpgS4noSZydlRa pR3O5QJ5clAgZPE3lw7WlINjC8bdN6pow3qlzMe8lPypHBoQClkX4GadLITWIkYM30mi bQzlnWdVDskBTVsSMr2dfkb0gNKxV6wOdMzOtDh/OYTVCIQP5lqFz3NPXcwdFlInm4p7 2wb8DW/57oBzRyk32nteKRY48/MPucSgzRDKM80m+0jVALEMEPOdPPrXPNA6XKWvi+sF M1QHKf9s/N2YIiWhbOwgAdrfFgBtVsufJl1smBVIVYPUBSjK9dCBv6HhfX4gdQ30EG3R D+mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YquZL3zBW2IgrjXdQRXbhlfrbr0Gt34XoGbtR7YqBD0=; b=ZSMh2IGzRPH4wSZ2soPucc3xwqQC1TjMCXayu3Ol0PPJsSe1lgJUoU9wB3WKD/CaxF 9YCR+mWeQY0LopNc9Xa9z9riSSuq7wfgkAK1UPOcid0KuHI0isQ41hsx12i96hF2Cg8U 2xB6ECl7LK999S5TR1fgxYP/SydbnH9LxeoBMCjoQEzVHnFEuv3PvmrBrUpwct+6P7CT Sm5iuHiBnhc1sjMXgT68jbuOtB9uQfpaKxOha4wq1GwHLrdO9RvwMcDIbp0qAtJptZkK lRoP3Yhp2EV8DRHBNiO2iPGsmNATdTy42rql2uGWqZ2TnGGnhK16RsRyBNVbmVAq3V+M bMqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u4vlNxk5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si3999736edv.261.2020.12.10.18.44.06; Thu, 10 Dec 2020 18:44:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u4vlNxk5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403815AbgLJPvO (ORCPT + 99 others); Thu, 10 Dec 2020 10:51:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:55090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403801AbgLJPvJ (ORCPT ); Thu, 10 Dec 2020 10:51:09 -0500 X-Gm-Message-State: AOAM531p2FN++cP3ZtHJfsfdjZh2WEML91I7W6Jj+pojvoyWTSPxMgls wEWPKysRcyfo1GnxY+XpFpgwe0BF8xZhMk/NTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607615429; bh=JswAsdHWyxMnvC+dTai6TVtWwh9Dj+cpwNchJF8bnPo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=u4vlNxk5gZO0CNj3V9ovmXkU8Ld269fUM1zfcIXmVogxFNzaTn9yG8x2ztsLM4Ur/ nX/gR+bkNweRpLwlcut21M19lVWWwrfkh1vGwtO2bKy/3JiUpCjly809+gbZObR/i6 bdvDXyP0hgjzNMFuoM00bgq01lVMolh2pfLtrFRer6SHq7pe+7GGnXwp5n+UgjfHT7 RNgu4aVuPlOt+dY4LDm9YpFmOO00MANM3AtkfXeX8FuQXiTBsWsjjBp0JylYmQ5Xz/ iZ79sr3Lm6Cjo2aNOk9vPt9jtNfUgpFyqotyViLCrK+WWr2x+sLy4vwOdWido36iUy sQPjnfa0mc9jQ== X-Received: by 2002:a05:6402:845:: with SMTP id b5mr7518636edz.38.1607615427120; Thu, 10 Dec 2020 07:50:27 -0800 (PST) MIME-Version: 1.0 References: <1607591262-21736-1-git-send-email-yongqiang.niu@mediatek.com> <1607591262-21736-6-git-send-email-yongqiang.niu@mediatek.com> In-Reply-To: <1607591262-21736-6-git-send-email-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Thu, 10 Dec 2020 23:50:16 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8, 5/6] drm/mediatek: add RDMA fifo size error handle To: Yongqiang Niu Cc: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger , Mark Rutland , DTML , David Airlie , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2020=E5=B9=B412=E6=9C= =8810=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=885:08=E5=AF=AB=E9=81=93= =EF=BC=9A > > 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 | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/m= ediatek/mtk_disp_rdma.c > index 794acc5..0508392 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c > @@ -151,6 +151,10 @@ static void mtk_rdma_config(struct mtk_ddp_comp *com= p, unsigned int width, > * account for blanking, and with a pixel depth of 4 bytes: > */ > threshold =3D width * height * vrefresh * 4 * 7 / 1000000; > + > + if (threshold > rdma_fifo_size) > + threshold =3D rdma_fifo_size; If the formula is not correct, you should fix the formula not work around. Regards, Chun-Kuang. > + > reg =3D RDMA_FIFO_UNDERFLOW_EN | > RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) | > RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold); > -- > 1.8.1.1.dirty > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek