Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4631830pxu; Thu, 10 Dec 2020 01:13:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXGOBhBH17OAmvE2w1sCq8wHe5nBP4QrvRLjR/kGqQqXRlUf5CLlqjCr4XJ+vGOn7JX68u X-Received: by 2002:aa7:d906:: with SMTP id a6mr5899348edr.121.1607591636467; Thu, 10 Dec 2020 01:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607591636; cv=none; d=google.com; s=arc-20160816; b=UcRcXAlBDQW8Ha8V2DRBpck6HAvu19s+T5dsDeTLjDO5FaoWAOTLiitk4aqJT8TId6 Lsa8uJ3HUePXxpRYes4GLZtMRimrQLweQWKIL7u1+Vry3GT+4oOKmU6mbTtmc8nOo1GZ dhXeTE7j+XZcA+zvAFULRIvjLAH2R2zkf2sv1eOY/PGrLnhOHj8cYZG3Qe2sNOWRvxCc j1fmajs1B4jxfTtPSSYJeuQ2PXAUn/0HxU5LrabjXr5mRG6llLqNx1KGezdTUdPMgHzT 9oJnHWAgjkDucObmXq3W9VyNSz6at6QCBobz52S56B8h639Z7TvjbN/s1fftfjhrCAxm qHog== 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=72VINKS1FaUhJjj/5eu0oZ9n9titJTkgB6qQmAerFfE=; b=MnMDK3Mi4bHfwz0AbJqbmAwbVu2YOfrvnh1pAnvA2SBUo1tGM++IRgZeI7BHSu2qJz 7jx1xDajSRzUMGMQEPA3wDTW5h+y2xmzGAyUXPFWLLb+2p/LnT6NbbjFjq2xNn//n/0t KcMJ+2pPiyjgY4wltpS+2HQHKw5W9QZp1zhxSeOvWBijdvsXhnDoiGnIyXbBtc3yvEaT XXtvjFmxfXv+JFhrbJMZEF5UTnH5VjmAjtax6H6Erc5xplddLJO3Sr0mda/Os9xNcI8l bUa8qwbC3G+Xj4uqMYEJ/wFcfWc/DeMPEHoDUnc6Tp0iC5UYt61pePzldoaQ5K5hpSUD OgNg== 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 v7si3047584edj.402.2020.12.10.01.13.33; Thu, 10 Dec 2020 01:13:56 -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; 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 S1733239AbgLJJI4 (ORCPT + 99 others); Thu, 10 Dec 2020 04:08:56 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:56653 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732414AbgLJJIv (ORCPT ); Thu, 10 Dec 2020 04:08:51 -0500 X-UUID: 2f33f35616e54000ae7e9bd962152049-20201210 X-UUID: 2f33f35616e54000ae7e9bd962152049-20201210 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 592565983; Thu, 10 Dec 2020 17:07:49 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 10 Dec 2020 17:07:48 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 10 Dec 2020 17:07:47 +0800 From: Yongqiang Niu To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , Yongqiang Niu Subject: [PATCH v8, 5/6] drm/mediatek: add RDMA fifo size error handle Date: Thu, 10 Dec 2020 17:07:41 +0800 Message-ID: <1607591262-21736-6-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1607591262-21736-1-git-send-email-yongqiang.niu@mediatek.com> References: <1607591262-21736-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 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/mediatek/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 *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; + reg = RDMA_FIFO_UNDERFLOW_EN | RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) | RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold); -- 1.8.1.1.dirty