From patchwork Thu Jun 28 18:29:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10494721 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC8ED60325 for ; Thu, 28 Jun 2018 18:29:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2D322A762 for ; Thu, 28 Jun 2018 18:29:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B72E72A780; Thu, 28 Jun 2018 18:29:28 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C1322A77C for ; Thu, 28 Jun 2018 18:29:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030490AbeF1S3Y (ORCPT ); Thu, 28 Jun 2018 14:29:24 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:33256 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030475AbeF1S3U (ORCPT ); Thu, 28 Jun 2018 14:29:20 -0400 Received: by mail-yb0-f193.google.com with SMTP id e84-v6so2387237ybb.0 for ; Thu, 28 Jun 2018 11:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tzRO4RUEs0M6h3uf9QTAfgZd8+tWN+xizBl60M2BmBI=; b=dgMUiJ6F5fUHZFNhwzZwicQ9m4wqZNmIXhTgzqOZR/FPRadDjIfK8HBWRGGR6CzLcU 4G+f0RMeGHH/WhlAZ99skmHatVmCulu4OTi22znwy8BMEXbvqA7OoCs27nrtnlNU2qH7 jrEoNTNZK03+aPXrm12h88e73vyTmryrk35Cc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tzRO4RUEs0M6h3uf9QTAfgZd8+tWN+xizBl60M2BmBI=; b=VsLLkpOkfhClMf+bL3e9CJ+61qMYfSTIQjhAZrkybuGGxEI12rJbiEfv+yWmLnr8Xb nfYBGJsMSm3z+tXlh8cZcwZrPgFne0i2oSQ7QYxAgJS13Kcm+aCBSYknCGrf+Js1e7iU /cT8nhO8T9F0ebOcvh4l0KK5M1AN1qiCvEcfJY+1isGsMUD7R6cxW/3dkDOjxtWVoWeO Z1hiG7muxo3yzFA3CF4xZA64dEz/6zYsnqSdPPJEq/Q95eSL958NB40N5wveY5VkAWIY xAnCFywbh3LT5hzd+JbArweWuQmlrqd18Ekg3mOmlAtrC9j0DH2RxA59nEmXVAHgs1RI GzSA== X-Gm-Message-State: APt69E1p5UCdfZfZcwT1RNPrLBYq7efzDBEaIWgC6L9b6PM1LdP531cT dR2URtw5kKP4Q+2EJPFDthlehQ== X-Google-Smtp-Source: ADUXVKJ7jByQ5djI4bOVVWPaVlkICswlr4oW/eOx9o/avi4ZLoM858HY9lk05gt5sf3HZjCuMHJwqA== X-Received: by 2002:a25:1a04:: with SMTP id a4-v6mr5749393yba.53.1530210559824; Thu, 28 Jun 2018 11:29:19 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id g145-v6sm2732140ywe.17.2018.06.28.11.29.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:29:19 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, hoegsberg@chromium.org, jsanka@codeaurora.org, abhinavk@codeaurora.org, Sean Paul Subject: [DPU PATCH 13/15] drm/msm: Reduce dpu_crtc_atomic_check frame size Date: Thu, 28 Jun 2018 14:29:04 -0400 Message-Id: <20180628182906.84926-14-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180628182906.84926-1-seanpaul@chromium.org> References: <20180628182906.84926-1-seanpaul@chromium.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allocate pstates from the heap to avoid the following warning when building with an arm target. warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=] Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index c70b609aa7f2..d17128222f45 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1737,7 +1737,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) { struct dpu_crtc *dpu_crtc; - struct plane_state pstates[DPU_STAGE_MAX * 4]; + struct plane_state *pstates; struct dpu_crtc_state *cstate; const struct drm_plane_state *pstate; @@ -1757,6 +1757,8 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, return -EINVAL; } + pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL); + dpu_crtc = to_dpu_crtc(crtc); cstate = to_dpu_crtc_state(state); @@ -1792,7 +1794,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, dpu_crtc->name, plane->base.id, rc); goto end; } - if (cnt >= ARRAY_SIZE(pstates)) + if (cnt >= DPU_STAGE_MAX * 4) continue; pstates[cnt].dpu_pstate = to_dpu_plane_state(pstate); @@ -1959,6 +1961,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, end: _dpu_crtc_rp_free_unused(&cstate->rp); + kfree(pstates); return rc; }