Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4372697pxu; Tue, 1 Dec 2020 03:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGKuFKFX79d42kBLx7hRSEix/NZZfq8/OGKTCbPlYYTNzv46YbCYhymmBIOk7+lsoVMpkC X-Received: by 2002:a17:906:614a:: with SMTP id p10mr2547049ejl.312.1606821846427; Tue, 01 Dec 2020 03:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606821846; cv=none; d=google.com; s=arc-20160816; b=W8a7aZj9y9Y5Rth8UZ42cwDIbS71x9OWITKckvknyik0KrkqKfIVAWjfh4lapSNeno 88jZWyf02TkvnT1d6W5f2XVYG6qJR+sXlVki4kAAuVIbrW8NnvYWv/iRWxx5xxOMFtKe R9h5/cEldhGwiwqvN+49BHeESLS9+LlaYeBnH5QrAbJAuTQm7X+91lf1QZ93C7T5ZzJI 9XF164OXnFldcvS8p4+e2HgBkyhqOlM5O2S7sp4eVsBHDyUIVFZNY6SOL+I3wGtHRoHc KERm1hYAS4S7bBEOO1Dq1YLo/6uL1LniQQixYdQ43r4prdwYVmbef3Z9+BuOHct2AKAl KFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=RBCZE9F2XST4DZbUdzaksZPJBhP3v6ff5Rgj3NVCUUM=; b=et0dLQEKqk5oG09BeFaBDjVMWzEk6xAeZDTZHbjh5+l3dAJLNqfizwYnNJgQ60V2qB 4xscBxA0hE8shZF+OcBZu13leImxk0nt2uaceQhYVgF2atgot/z1LJsUnWNQ+ZuYZGtt 6NF1Tr1ZFp1W9ABbHzqHL4VCu05ib66/uiHu4rpyR2Maju4XOVHQ+rwLc+ESHmMH40oq yv/VRHKJVfNbTQGurUxmParAFVqCAH3FXtnRxbFD6o/LYRG91/pmJPotMGmWKYG597hJ aPcZEVC9pc6QaaXhHPga1OLjslSRGQyDNoG2xELghI3OxlW3hMKh4vkhz9e90T2xSfId 5OKw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si934384edz.485.2020.12.01.03.23.42; Tue, 01 Dec 2020 03:24:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbgLALVH (ORCPT + 99 others); Tue, 1 Dec 2020 06:21:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbgLALVH (ORCPT ); Tue, 1 Dec 2020 06:21:07 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D1DDC0613CF for ; Tue, 1 Dec 2020 03:20:27 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kk3hl-00063f-Ft; Tue, 01 Dec 2020 12:20:21 +0100 Message-ID: <0a7f2c0e8618f89c1e2eede661cf5a59d68cecad.camel@pengutronix.de> Subject: Re: [PATCH] drm: mxsfb: Add interconnect path request From: Lucas Stach To: Martin Kepplinger , marex@denx.de, stefan@agner.ch, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Date: Tue, 01 Dec 2020 12:20:18 +0100 In-Reply-To: <20201201103757.32165-1-martin.kepplinger@puri.sm> References: <20201201103757.32165-1-martin.kepplinger@puri.sm> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1 (3.38.1-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, den 01.12.2020, 11:37 +0100 schrieb Martin Kepplinger: > Add interconnect support to mxsfb so that it is able to request enough > bandwidth to DDR for display output to work. > > Signed-off-by: Martin Kepplinger > --- >  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 33 +++++++++++++++++++++++++++++++ >  drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 ++ >  drivers/gpu/drm/mxsfb/mxsfb_kms.c | 13 ++++++++++++ >  3 files changed, 48 insertions(+) > > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > index 6faf17b6408d..b05e8e5f1e38 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > @@ -15,6 +15,7 @@ >  #include >  #include >  #include > +#include >   > > > >  #include >  #include > @@ -311,6 +312,34 @@ static const struct of_device_id mxsfb_dt_ids[] = { >  }; >  MODULE_DEVICE_TABLE(of, mxsfb_dt_ids); > > + > +static int mxsfb_init_icc(struct platform_device *pdev) > +{ > + struct drm_device *drm = platform_get_drvdata(pdev); > + struct mxsfb_drm_private *mxsfb = drm->dev_private; > + int ret; > + > + /* Optional interconnect request */ > + mxsfb->icc_path = devm_of_icc_get(&pdev->dev, "lcdif-dram"); > + if (IS_ERR(mxsfb->icc_path)) { > + ret = PTR_ERR(mxsfb->icc_path); > + if (ret == -EPROBE_DEFER) > + return ret; > + > + mxsfb->icc_path = NULL; > + dev_dbg(drm->dev, > + "No interconnect may cause display underflows!\n"); > + } > + > + ret = icc_set_bw(mxsfb->icc_path, 0, MBps_to_icc(700)); Shouldn't this be proportional to the current mode, instead of a fixed value? 700MB looks like 1080p@60Hz@32bpp with a bit of headroom, but there are many valid use-cases where significantly smaller displays are connected to the eLCDIF. Also it doesn't cover the case where an overlay is active, which needs additional bandwidth. > + if (ret) { > + dev_err(drm->dev, "%s: icc_set_bw failed: %d\n", __func__, ret); > + return ret; > + } > + > + return 0; > +} > + [...] >  #include >  #include > @@ -310,6 +311,12 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, >   struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); >   struct drm_device *drm = mxsfb->drm; >   dma_addr_t paddr; > + int ret; > + > + ret = icc_enable(mxsfb->icc_path); > + if (ret) > + dev_err_ratelimited(drm->dev, "%s: icc_enable failed: %d\n", > + __func__, ret); Why ratelimited? I wouldn't expect atomic enable/disable to be called often enough for this to make any difference. Regards, Lucas > >   pm_runtime_get_sync(drm->dev); >   mxsfb_enable_axi_clk(mxsfb);