Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2026996pxv; Sun, 11 Jul 2021 00:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydN+u4ZHiqPgktS14eyuyM3fxerz9xuR/HILLWH4fgTwcT9YiVAgFNgwO+918BKgNuGjrZ X-Received: by 2002:a50:8d54:: with SMTP id t20mr7308900edt.288.1625987141569; Sun, 11 Jul 2021 00:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625987141; cv=none; d=google.com; s=arc-20160816; b=VvquhzXVG7JmJRUa7sp1dfKEoxEyYGIMtKKpqtKZpaxsPbj+01nTd0jB2grs1kMzc4 XgFYNWZqPgdseH61LhFJZ4DghYcTn3TdukoCLxZpxEjfAkChMB3BURt0s4Bf2a7BwTyj NHk/DMGki3RMIg/L/p7rxBbnm/RBBlFmUGMKRLZD8eoapCxq13BRC+Hc2bSdVporBblX F7hbtPXPk/abnaoxV2oOB2oKM5XBiVoqgSL3tG4VOMDXaO+RRvmmFbwmIgEoTeSgxTVg 3vbo7rQ879qLnM1wKZcqpwq8EI3sfvHEcEM2vqeh33i53SJEbo4anS+Z7KCvYl0qJZKt jfVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=iTW3NvEA1f/ODjofk/KkVcEkzvYZ7Qi/q1KB+5E+Fu8=; b=DHjOG1U/yn5C8TAN5xL9//EiveGJkIfn+w4ABe6QIdPZQVM+6SSYyqm9Cij0OUfNEX 0EJJH69GlhxWoT2UUSkvHrpFzGz3JR/fmFDnNjan6v6+x1JOwKds6ohdEffMo1kPMt/A MrkqVNUWcIS0MoHuACiG4ciF18/c5C/1OyqLf+pX/ojBvwJYq6PYMXr3GhhRbZFW4bMz vdDxgxbrZDCHo9p2gtew9zD0Po+pBCAuEQYg6/xdSsvm+tCNk52NGRBRfjuASqFkebhZ pMig0sIjdtqC/AGlDoS9lM2Ll07pM19mItDMXr7I2HGZAe4jPTZEQrbcfTNLns6By02t Y7Zg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv32si240355ejc.321.2021.07.11.00.04.50; Sun, 11 Jul 2021 00:05:41 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229755AbhGKG4x (ORCPT + 99 others); Sun, 11 Jul 2021 02:56:53 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:45234 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229523AbhGKG4x (ORCPT ); Sun, 11 Jul 2021 02:56:53 -0400 X-UUID: e14a25b030b544668773146215d51956-20210711 X-UUID: e14a25b030b544668773146215d51956-20210711 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1654619029; Sun, 11 Jul 2021 14:53:57 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 11 Jul 2021 14:53:55 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 11 Jul 2021 14:53:54 +0800 From: Yongqiang Niu To: Chun-Kuang Hu CC: Rob Herring , Matthias Brugger , Philipp Zabel , David Airlie , Daniel Vetter , Jassi Brar , Yongqiang Niu , Fabien Parent , Dennis YC Hsieh , , , , , , , Hsin-Yi Wang Subject: [PATCH v3] drm/mediatek: adjust rdma fifo threshold calculate formula Date: Sun, 11 Jul 2021 14:53:51 +0800 Message-ID: <1625986431-27399-2-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1625986431-27399-1-git-send-email-yongqiang.niu@mediatek.com> References: <1625986431-27399-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org the orginal formula will caused rdma fifo threshold config overflow and no one could come out a solution for all SoC, set threshold to 70% of max fifo size to make sure it will not overflow, and 70% is a empirical vlaue Signed-off-by: Yongqiang Niu --- drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c index f123fc0..f1f6a2e 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c @@ -164,10 +164,10 @@ void mtk_rdma_config(struct device *dev, unsigned int width, /* * Enable FIFO underflow since DSI and DPI can't be blocked. * Keep the FIFO pseudo size reset default of 8 KiB. Set the - * output threshold to 6 microseconds with 7/6 overhead to - * account for blanking, and with a pixel depth of 4 bytes: + * output threshold to 70% of max fifo size to make sure the + * threhold will not overflow */ - threshold = width * height * vrefresh * 4 * 7 / 1000000; + threshold = rdma_fifo_size * 7 / 10; reg = RDMA_FIFO_UNDERFLOW_EN | RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) | RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold); -- 1.8.1.1.dirty