dri-devel Archive on lore.kernel.org
 help / color / Atom feed
From: Hsin-Yi Wang <hsinyi@chromium.org>
To: CK Hu <ck.hu@mediatek.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	Yongqiang Niu <yongqiang.niu@mediatek.com>,
	David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v10 3/9] drm/mediatek: add RDMA fifo size error handle
Date: Wed, 27 Jan 2021 12:54:16 +0800
Message-ID: <20210127045422.2418917-4-hsinyi@chromium.org> (raw)
In-Reply-To: <20210127045422.2418917-1-hsinyi@chromium.org>

From: Yongqiang Niu <yongqiang.niu@mediatek.com>

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 <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
 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 b84004394970f..04b9542010b00 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
@@ -168,6 +168,10 @@ void mtk_rdma_config(struct device *dev, 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);
-- 
2.30.0.280.ga3ce27912f-goog

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply index

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27  4:54 [PATCH v10 0/9] drm/mediatek: add support for mediatek SOC MT8183 Hsin-Yi Wang
2021-01-27  4:54 ` [PATCH v10 1/9] arm64: dts: mt8183: rename rdma fifo size Hsin-Yi Wang
2021-01-27  4:54 ` [PATCH v10 2/9] arm64: dts: mt8183: refine gamma compatible name Hsin-Yi Wang
2021-01-27  4:54 ` Hsin-Yi Wang [this message]
2021-01-27  7:59   ` [PATCH v10 3/9] drm/mediatek: add RDMA fifo size error handle CK Hu
2021-01-27  4:54 ` [PATCH v10 4/9] drm/mediatek: generalize mtk_dither_set() function Hsin-Yi Wang
2021-01-28  4:39   ` CK Hu
2021-01-28  5:09     ` Hsin-Yi Wang
2021-01-28  5:21       ` CK Hu
2021-01-27  4:54 ` [PATCH v10 5/9] drm/mediatek: separate gamma module Hsin-Yi Wang
2021-01-28  5:33   ` CK Hu
2021-01-27  4:54 ` [PATCH v10 6/9] drm/mediatek: add has_dither private data for gamma Hsin-Yi Wang
2021-01-28  5:34   ` CK Hu
2021-01-27  4:54 ` [PATCH v10 7/9] drm/mediatek: enable dither function Hsin-Yi Wang
2021-01-28  6:01   ` CK Hu
2021-01-27  4:54 ` [PATCH v10 8/9] drm/mediatek: add DDP support for MT8183 Hsin-Yi Wang
2021-01-28  6:13   ` CK Hu
2021-01-28  6:15     ` Hsin-Yi Wang
2021-01-28  7:00       ` CK Hu
2021-01-28  6:19     ` CK Hu
2021-01-27  4:54 ` [PATCH v10 9/9] drm/mediatek: add support for mediatek SOC MT8183 Hsin-Yi Wang
2021-01-28  6:17   ` CK Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127045422.2418917-4-hsinyi@chromium.org \
    --to=hsinyi@chromium.org \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=airlied@linux.ie \
    --cc=ck.hu@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=yongqiang.niu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

dri-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dri-devel/0 dri-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dri-devel dri-devel/ https://lore.kernel.org/dri-devel \
		dri-devel@lists.freedesktop.org
	public-inbox-index dri-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.dri-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git