From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Chiras Subject: [PATCH 03/10] drm/mxsfb: Add max-res property for MXSFB Date: Wed, 9 Jan 2019 14:13:42 +0000 Message-ID: <1547043209-8283-4-git-send-email-robert.chiras@nxp.com> References: <1547043209-8283-1-git-send-email-robert.chiras@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1547043209-8283-1-git-send-email-robert.chiras@nxp.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Daniel Vetter , Philipp Zabel , Marek Vasut Cc: Robert Chiras , Stefan Agner , Shawn Guo , Fabio Estevam , David Airlie , Anson Huang , "dri-devel@lists.freedesktop.org" , dl-linux-imx , "kernel@pengutronix.de" , "linux-kernel@vger.kernel.org" List-Id: dri-devel@lists.freedesktop.org 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 --- 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/mxsf= b_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 =3D to_platform_device(drm->dev); struct mxsfb_drm_private *mxsfb; struct resource *res; + u32 max_res[2] =3D {0, 0}; int ret; =20 mxsfb =3D devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL); @@ -279,10 +280,17 @@ static int mxsfb_load(struct drm_device *drm, unsigne= d long flags) } } =20 + of_property_read_u32_array(drm->dev->of_node, "max-res", + &max_res[0], 2); + if (!max_res[0]) + max_res[0] =3D MXSFB_MAX_XRES; + if (!max_res[1]) + max_res[1] =3D MXSFB_MAX_YRES; + drm->mode_config.min_width =3D MXSFB_MIN_XRES; drm->mode_config.min_height =3D MXSFB_MIN_YRES; - drm->mode_config.max_width =3D MXSFB_MAX_XRES; - drm->mode_config.max_height =3D MXSFB_MAX_YRES; + drm->mode_config.max_width =3D max_res[0]; + drm->mode_config.max_height =3D max_res[1]; drm->mode_config.funcs =3D &mxsfb_mode_config_funcs; drm->mode_config.helper_private =3D &mxsfb_mode_config_helpers; =20 --=20 2.7.4