From patchwork Mon Feb 22 21:33:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8383791 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 571CFC0553 for ; Mon, 22 Feb 2016 21:34:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DFE9205C1 for ; Mon, 22 Feb 2016 21:34:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 27C61205B9 for ; Mon, 22 Feb 2016 21:34:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74A6589A62; Mon, 22 Feb 2016 21:34:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4F9E89A62 for ; Mon, 22 Feb 2016 21:34:02 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M89Tt-1ZlLhP3w01-00vgL2; Mon, 22 Feb 2016 22:33:51 +0100 From: Arnd Bergmann To: Alison Wang , Jianwei Wang , Alison Wang , David Airlie Subject: [PATCH] drm/layerscape: reduce excessive stack usage Date: Mon, 22 Feb 2016 22:33:31 +0100 Message-Id: <1456176818-1207477-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:bZLXlI1aGUdpYAM+U0cqiOS0ByuNXwbn40GoXWf4z0D+vsQE4lH MXoQ3I4leTqbAbZPKb4ZKJxNTwJ/9qhzzAoFaAkFDu23Zz/Na8UrqxK7fdBALZ7ShnPI+33 zFD7sooHfTUV8NAZOvOACUTCdhhuSvaF5i3ezaGLh48sZ5uKPwq9GmEoL36TMWBHsg10FCX A75+tZnEJfskcf0/EgSvw== X-UI-Out-Filterresults: notjunk:1; V01:K0:rh2cYgsXKQc=:Sv/LxVtqrmFzghZE1o+i8U HnEd3GiwBTJBrh4EwE+l6/7DR9/fVfrVdDkk3vbcfyqf/MESX85NUB1ReRck3aJ5NcwD70IY+ dPS2wxWTDKA0+gRRc2z03KT3WJ1lTzWQOhqqx2LE6bgMAPYawhoF50Kqlw9vNO8qAOrKsbw8D 7uOiHqkZkO4LQcXL60bn69/m+qpER87bYOLOa9hKtn8gbg2yktOsBgnU0+zwvFYyjoBZkU/Re TJ/IU00k82cgnhdpuWv1TCBphvgNpEGP/J6AnextUjaBHenPTGK8XPG4l/U7fhrVLaLQKvKVb BjOr9I5yLNQ7OC/4QschCjU+KTN1hyP3a9Fx2N9lkwcpbynuFz41Qb1t8gKiUaS4NF/Ay70bl rGPqCZ4ZlcLeoqXrz9/5WOWtXBVJN4yFg/g9XJgBNFSK0wiShyxFBmJZqRH0OwXyrCTUkHgpP CjzaI7HdJ76706Es5oraBw5FS0eLQOzi3ihZGtdsFADRX75dTxQYxXiU1YquSc9nS/Qr4Q7iE Pfws/BZRIi9kcJec/Oi3RdVyr/CcX+m99GfGRYR9aORv4yYl30rhULbtPZpQGaiPZ05TMsjjy mDgC1+3sCRZAXTySJ4gSbldUCLii/3SipWBAxEzDFRuK1wgFT4apYIsAexXNOGJ6m+rni+V/5 gJeGggTseUf7sc7cT/u2hkDWAR9H+1h9YIo+ukNAlhsJlgSK16oeyi2yIaaORdJv49B0= Cc: Xiubo Li , Arnd Bergmann , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The fsl-dcu driver copies a drm_mode_config object to its stack but then only accesses a single member (dpms_property) once. The data structure is large enough to trigger a warning about the amount of kernel stack being used: drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function 'fsl_dcu_drm_connector_create': drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:182:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] This changes the fsl_dcu_drm_connector_create() function to only access the drm_mode_config by reference, which is also more efficient. Signed-off-by: Arnd Bergmann Fixes: 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM driver") --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c index 8780deba5e8a..92149152db44 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -131,7 +131,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, struct drm_encoder *encoder) { struct drm_connector *connector = &fsl_dev->connector.base; - struct drm_mode_config mode_config = fsl_dev->drm->mode_config; + struct drm_mode_config *mode_config = &fsl_dev->drm->mode_config; struct device_node *panel_node; int ret; @@ -153,7 +153,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev, goto err_sysfs; drm_object_property_set_value(&connector->base, - mode_config.dpms_property, + mode_config->dpms_property, DRM_MODE_DPMS_OFF); panel_node = of_parse_phandle(fsl_dev->np, "fsl,panel", 0);