linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Chiras <robert.chiras@nxp.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Marek Vasut <marex@denx.de>
Cc: Robert Chiras <robert.chiras@nxp.com>,
	Stefan Agner <stefan@agner.ch>, Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	David Airlie <airlied@linux.ie>,
	Anson Huang <anson.huang@nxp.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 03/10] drm/mxsfb: Add max-res property for MXSFB
Date: Wed, 9 Jan 2019 14:13:42 +0000	[thread overview]
Message-ID: <1547043209-8283-4-git-send-email-robert.chiras@nxp.com> (raw)
In-Reply-To: <1547043209-8283-1-git-send-email-robert.chiras@nxp.com>

Because of stability issues, we may want to limit the maximum resolution
supported by the MXSFB (eLCDIF) driver.
This patch add support for a new property which we can use to impose such
limitation.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 9a73564..c0b6198 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -201,6 +201,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 	struct platform_device *pdev = to_platform_device(drm->dev);
 	struct mxsfb_drm_private *mxsfb;
 	struct resource *res;
+	u32 max_res[2] = {0, 0};
 	int ret;
 
 	mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL);
@@ -279,10 +280,17 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 		}
 	}
 
+	of_property_read_u32_array(drm->dev->of_node, "max-res",
+				   &max_res[0], 2);
+	if (!max_res[0])
+		max_res[0] = MXSFB_MAX_XRES;
+	if (!max_res[1])
+		max_res[1] = MXSFB_MAX_YRES;
+
 	drm->mode_config.min_width	= MXSFB_MIN_XRES;
 	drm->mode_config.min_height	= MXSFB_MIN_YRES;
-	drm->mode_config.max_width	= MXSFB_MAX_XRES;
-	drm->mode_config.max_height	= MXSFB_MAX_YRES;
+	drm->mode_config.max_width	= max_res[0];
+	drm->mode_config.max_height	= max_res[1];
 	drm->mode_config.funcs		= &mxsfb_mode_config_funcs;
 	drm->mode_config.helper_private	= &mxsfb_mode_config_helpers;
 
-- 
2.7.4


  parent reply	other threads:[~2019-01-09 14:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 14:13 [PATCH 00/10] Add support for DRM bridge and additional pixel formats Robert Chiras
2019-01-09 14:13 ` [PATCH 01/10] drm/mxsfb: Update mxsfb to support a bridge Robert Chiras
2019-01-09 14:13 ` [PATCH 02/10] dt-bindings: display: Add max-res property for mxsfb Robert Chiras
2019-01-09 14:13 ` Robert Chiras [this message]
2019-01-09 14:13 ` [PATCH 04/10] drm/mxsfb: Update mxsfb with additional pixel formats Robert Chiras
2019-01-14 16:38   ` Guido Günther
2019-01-09 14:13 ` [PATCH 05/10] drm/mxsfb: Fix the vblank events Robert Chiras
2019-01-09 14:13 ` [PATCH 06/10] drm/mxsfb: Add support for new pixel formats in eLCDIF Robert Chiras
2019-01-09 14:13 ` [PATCH 07/10] drm/mxsfb: Signal mode changed when bpp changed Robert Chiras
2019-01-14 16:37   ` Guido Günther
2019-01-09 14:13 ` [PATCH 08/10] drm/mxsfb: Update mxsfb to support LCD reset Robert Chiras
2019-01-10 21:19   ` Fabio Estevam
2019-01-09 14:13 ` [PATCH 09/10] drm/mxsfb: Improve the axi clock usage Robert Chiras
2019-01-09 17:09   ` Stefan Agner
2019-01-15  9:53     ` Robert Chiras
2019-01-09 14:13 ` [PATCH 10/10] drm/mxsfb: Clear OUTSTANDING_REQS bits Robert Chiras

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=1547043209-8283-4-git-send-email-robert.chiras@nxp.com \
    --to=robert.chiras@nxp.com \
    --cc=airlied@linux.ie \
    --cc=anson.huang@nxp.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=p.zabel@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).