From patchwork Wed Jan 9 14:13:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Chiras X-Patchwork-Id: 10755357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 962741708 for ; Thu, 10 Jan 2019 08:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 894732023F for ; Thu, 10 Jan 2019 08:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8735029202; Thu, 10 Jan 2019 08:34:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A7C93291FF for ; Thu, 10 Jan 2019 08:34:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1D6B6ED7D; Thu, 10 Jan 2019 08:34:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id D19726F18C for ; Wed, 9 Jan 2019 14:13:44 +0000 (UTC) Received: from AM6PR04MB4007.eurprd04.prod.outlook.com (52.135.161.10) by AM6PR04MB5157.eurprd04.prod.outlook.com (20.177.34.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.9; Wed, 9 Jan 2019 14:13:42 +0000 Received: from AM6PR04MB4007.eurprd04.prod.outlook.com ([fe80::65e5:2a3b:b9a8:3cd9]) by AM6PR04MB4007.eurprd04.prod.outlook.com ([fe80::65e5:2a3b:b9a8:3cd9%5]) with mapi id 15.20.1516.010; Wed, 9 Jan 2019 14:13:42 +0000 From: Robert Chiras To: Daniel Vetter , Philipp Zabel , Marek Vasut Subject: [PATCH 03/10] drm/mxsfb: Add max-res property for MXSFB Thread-Topic: [PATCH 03/10] drm/mxsfb: Add max-res property for MXSFB Thread-Index: AQHUqCWGtYQ0qHm40Ee/QdOcyQcMqw== 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> In-Reply-To: <1547043209-8283-1-git-send-email-robert.chiras@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P193CA0015.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::28) To AM6PR04MB4007.eurprd04.prod.outlook.com (2603:10a6:209:40::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [95.76.156.53] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR04MB5157; 6:kK58Epz5ipc6/+Fq8ILwygfcJzVgILNJUsVgAu/rl5d514kDE4iVkTfQJ4VwixO5savEqsdIuv4Mzf7O26xIhRbz2Y6NVxSdOk3EPJdTwysIgc5nlbrjiiSMXzF7/fnwtHxizOGgwKvgyzG7VDt3fq+3jfQlWsf6YKSqxYDyBGcq35LBty7UL1lVNSdUWzPYqGnQwfzVQwIzVmFWPvI6Y9uG1fsLRpoZX0r8uegkvBy7xxUouamFeDnksP0PpF6rSbQOaHr/Om1hfq85G/b94BoCUL3vFxGTFsAiSvNIl10+Jl7cbCqeaWDps3CKaDA5VlULXqlyEwzd0Lm+FNaq2D6YU2S2bWTw6/ccd1BA/6UqbaAvK2fSABsTxibhQFkqVToLSGkJyFhw6X6e2NvQaSo54WQmhI6YlizRF8A7GWYCsT+cq9qYfzvagskhdGkdil7ExDnfPh3d0HXGifOXxA==; 5:1by10Mb7LnbesYrEbDQCdiCvRQvm5Dw/kbLYEYo3h8tDk9j620kkeLHk1ZQS8vEDcF4DvNJerReXVXgIepOa/rw1vTp8a8XUcoZP+kfrlGWAb9QjCHQyYGPBb7H95+kBkD8SUt1uWBpXznqNWlc7TWT7+satOPQDTAWMpuaR2qARufeGmLI/prEMk7AYOCiWajftgO4t/OeMvEiV1LedUQ==; 7:T41Yo4jAmu2hPYs7zfhl4nLolznBOxlpZdg4w/9jakedb+qfjCkL7rJ33EgSkgkQV59DlbBjv4ArNrUusZ7p9iF18QN/4jYtM3oFGO82Ml1VW/yioXQbh3pIzOPfUoxvf2B36NCVr/db3MMP+Tq99Q== x-ms-office365-filtering-correlation-id: 85002a64-38d3-4996-542f-08d6763ca8e0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5157; x-ms-traffictypediagnostic: AM6PR04MB5157: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:AM6PR04MB5157; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB5157; x-forefront-prvs: 0912297777 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(366004)(136003)(376002)(199004)(189003)(50226002)(99286004)(11346002)(110136005)(2616005)(575784001)(256004)(316002)(86362001)(14444005)(54906003)(305945005)(7736002)(8676002)(71190400001)(6486002)(71200400001)(446003)(8936002)(105586002)(97736004)(81166006)(81156014)(36756003)(106356001)(476003)(25786009)(486006)(6436002)(186003)(3846002)(6116002)(478600001)(68736007)(53936002)(102836004)(6512007)(14454004)(5660300001)(44832011)(76176011)(52116002)(386003)(26005)(6506007)(2906002)(4326008)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5157; H:AM6PR04MB4007.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TL8EcaMF6ExQ9EVW6CoPyiRjtAlPqLfO2hxhcLfrcvyjAENNDKTsL2mWJ5JYuV+a+AubPn8K3wC4GNHj5eGniGxif3QQLhOvoYVxqjWqQctbqfe4oatuORIqaSZkMZIAb44zM3/eSvGfJU6juPTYJBN+XgqTkq2539AdEuoss7aa+crzWUTD8U+KpUBCdBfHDQZNxrv+wAtfiV/lrYHvkwKoKbeT8hW7tjrYydGAUJc/gkhJTpRlfYt4D25qgdRu4f3H5VSl+UQYczc2ng2KGLSbNay0Hs27QRdDBtsbOKB/DudPrmQp/z6/d1LEKEP2 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85002a64-38d3-4996-542f-08d6763ca8e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2019 14:13:41.6868 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5157 X-Mailman-Approved-At: Thu, 10 Jan 2019 08:34:06 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anson Huang , David Airlie , "linux-kernel@vger.kernel.org" , Fabio Estevam , "dri-devel@lists.freedesktop.org" , "kernel@pengutronix.de" , Robert Chiras , Shawn Guo , dl-linux-imx Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 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;