Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp822293ybd; Wed, 26 Jun 2019 06:35:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrO9C7fOR+XCmaZ1kGzFsjDArKMc/wo/9gQJ6nAvIkl0+9SGJGH/OzdWMosI6hoTD8PY4l X-Received: by 2002:a17:90a:a09:: with SMTP id o9mr4805460pjo.95.1561556107724; Wed, 26 Jun 2019 06:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561556107; cv=none; d=google.com; s=arc-20160816; b=XYb/gm3dVOVhfieKA6FZiJAVzsmAgqVRUDIER/vQ5vV5cJNI11GV+2Knin71l9f4Lf Et5Rt4hFLQfAdfrLcZg+FiOlDmVJHjGWYx0kZ7LXSZqO5ns72wBjCyMuaYdBgS1i2vxK yoSyz8pmetTn5Z19aEJ0GoC+VTySKrbOCFZJE9hHqx7BSSWF7Fmn6lMv63nMH/gVVW3S hBI9ncD03Hv9PE9gsXGfowv6IRSSKz4l5GTWkTIy18vqrkGxkNFRt4bbDWRJ3n53uwun PM6QV5sSeE7J1yBZT3aXhXamwXHv6rngPdqz8NOIkyYWkcXboPmyV6Bj9FRbXgcz0Ojj QkHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=bIaCXuGv67G9hs/uqLhaYMyBzqqhBOjrBlO2rnm7wTY=; b=v1UBCRjYkgFBW9Ww7ugC2J8X8+afoIAEbeqcWydFUOEV1nKM5fGBFoCjTlFhhihh4+ kCt/89XZFw85Gu7kDCiB6xttiDvdUYFb8lR8/vxGMXMpTg/d3flgTRiyVkiqRQ36YsrO JkhmrS3pPcced22Uq6ffKqZcgrA1u22fAegKqLtmU/B4s0DyLZXETcDMaU2xIjdNe3Uo pzwJEuG5SC7+e1Y0CZrrvufw32R0TN+D1hFytOtVpLdAQjCA3oRP33kOV1My8txHoSBU yV7htvq2GSpvmZGakIar9iC3Ac3l+bi91ZmJcrSg/N8sgth9P5foshV1ZmoWcxDW6Hst CWJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si3377083pln.386.2019.06.26.06.34.51; Wed, 26 Jun 2019 06:35:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbfFZNdF (ORCPT + 99 others); Wed, 26 Jun 2019 09:33:05 -0400 Received: from inva020.nxp.com ([92.121.34.13]:58236 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbfFZNc2 (ORCPT ); Wed, 26 Jun 2019 09:32:28 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A147A1A0FC7; Wed, 26 Jun 2019 15:32:26 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 93E311A0FC2; Wed, 26 Jun 2019 15:32:26 +0200 (CEST) Received: from fsr-ub1664-120.ea.freescale.net (fsr-ub1664-120.ea.freescale.net [10.171.82.81]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id E2272205DB; Wed, 26 Jun 2019 15:32:25 +0200 (CEST) From: Robert Chiras To: Marek Vasut , Stefan Agner , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Chiras Subject: [PATCH 06/10] drm/mxsfb: Add max-res property for MXSFB Date: Wed, 26 Jun 2019 16:32:14 +0300 Message-Id: <1561555938-21595-7-git-send-email-robert.chiras@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561555938-21595-1-git-send-email-robert.chiras@nxp.com> References: <1561555938-21595-1-git-send-email-robert.chiras@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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/mxsfb_drv.c index 64575df..9a1ee70 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -260,6 +260,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); @@ -340,10 +341,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