Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9013pxu; Wed, 6 Jan 2021 19:14:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJywIarEp6fTBhkATyw2UcfGi1nbJaQeOvMc15R84RmKOrVK6pqOqSX8TaxfzwcUMKAI3WxS X-Received: by 2002:a17:906:1ed6:: with SMTP id m22mr5090137ejj.231.1609989282540; Wed, 06 Jan 2021 19:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609989282; cv=none; d=google.com; s=arc-20160816; b=nKdo7DCVivi+7Eg9NRn8TjzyCCW8xc2r/1+l6Ml0lrgxgK0pSZIfWv7FEve+8RGuJO HyxngTOsOd21Svd4B6cvqMQ+MqGsIHNM3LB+KJOO6oOeYdROMO87x1mCV9l6RFbaXxi4 VxkVD4qeJouNtm+3hcKFTDANDlWNHNQRM+9ZMcNn+PivcnGRsE9PRNkproKIVkKAlnRg FZtD3ikA40sThnXWVGcqiMKonJviMq/Qx0979XU6OIWPqfkh5HKjcYB+ywmVBPwtiaXN Ubb99ij5gMzWlW+dYIzCaCs4zJ+R8Sn+ZEV1oTtESwDeKu62VNwwmqYqxN8a3HOtCf9v Obzg== 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=pcabmRwoAoGBTTn+Z/U5M1FjqyYUzaYPmW2pTMgi0zs=; b=xLf2g34YdCukMIGtR2voT+iyzvKvvsiGxPl2FdGK5DdHRgwVtl0i6of5e7DljfAa+Y dWmVylVHzUIpsIlfBXLE3lWJEvKWIB2eV3S0/XdWFoCOOkKtzHuX3rmmBjKqLGeuvhqs WXm3CVUU6ABuONWznaC0SjNKvD5+X/wsKnRFkzJctgA9qs36duEws6oXNTR+/8NWKKuk 9/CTW1n/SC1ks1h/uEIzetkJGvokzJJ4Ut8m4kWPYEf8mXVGpa2MYdEUe9BsiZfkurKA ma4CHgy7Ge16Au9Z6eoxD8AuJwGw6fD0oXa5zfn6kR4BQUlWH7JGe+YSOZDtIesDYF5g lsyw== 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 oz19si1679223ejb.560.2021.01.06.19.14.18; Wed, 06 Jan 2021 19:14: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; 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 S1727155AbhAGDMa (ORCPT + 99 others); Wed, 6 Jan 2021 22:12:30 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:56438 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726371AbhAGDMa (ORCPT ); Wed, 6 Jan 2021 22:12:30 -0500 X-UUID: a834ae67d8244088aad9469e76c7e324-20210107 X-UUID: a834ae67d8244088aad9469e76c7e324-20210107 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.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 154188386; Thu, 07 Jan 2021 11:11:30 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 Jan 2021 11:11:30 +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; Thu, 7 Jan 2021 11:11:29 +0800 From: Yongqiang Niu To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , , Hsin-Yi Wang , Yongqiang Niu Subject: [PATCH v9, 06/11] drm/mediatek: add RDMA fifo size error handle Date: Thu, 7 Jan 2021 11:11:16 +0800 Message-ID: <1609989081-29353-7-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1609989081-29353-1-git-send-email-yongqiang.niu@mediatek.com> References: <1609989081-29353-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 8c64d5c..2d2cca2 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c @@ -152,6 +152,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