From patchwork Wed Mar 3 13:42:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 12113495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66202C433DB for ; Wed, 3 Mar 2021 13:43:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B8EB64E6C for ; Wed, 3 Mar 2021 13:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B8EB64E6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 499D56E8E7; Wed, 3 Mar 2021 13:43:41 +0000 (UTC) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CAB26E8E2 for ; Wed, 3 Mar 2021 13:43:39 +0000 (UTC) Received: by mail-wr1-x42e.google.com with SMTP id j2so10883546wrx.9 for ; Wed, 03 Mar 2021 05:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Quc2kUn4zxyJwPjFnwIzGGrQHrzECWlhqtsSXbJueZc=; b=ZsyMPRW9QBkC/Ih85kKhmz4YGoEObQ/YxdodsqQrvvAe4BorhfF8b0CVqsxplW4lZJ G6nXul6/Poxd7MlR+c60M/IowDeDVmsoSNAO7/XZofVeoq0Wx+U73wYVvL9gD+ecPCTa SdkbYZTluzU7XVX6LBWI1Z2WYNNfuTvs9rn7OWz/Ud1K5KnZJG5i5a7fj0LIB2MJE+bT hsjumX83elTXdLYYw/z3vZ9IxGOtgTVucQn18omtvAXrzksJoibAz0enmNfcdvJYIrib YrnNGjo+6n1FULBR+nT8xa26l3ctUCgLASQSzuE9nyZNcfID+1sRyXk+z/2C9uPVOH7n gD5w== 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:mime-version:content-transfer-encoding; bh=Quc2kUn4zxyJwPjFnwIzGGrQHrzECWlhqtsSXbJueZc=; b=Kwc1q2EotYhHQKcoWpuLVwl3HuAi+twdftKoeqChVFoq4ApSJOjjDlYuOkEpwluqsT 65E5NTJeLn5VpcHWYl5Yqiko2JFD5jDhTqsFwo/sea/RxUbol/TnZ/vDOQdA+mLDti37 jZpr/By5tpZt7SElKnS/ZTTEZpiWpbEVidfjkexAZlyiamQ4GtFP+uKWx7Pm1VLCfeiE idlBl3YwPuf8RepTwsOHFk4SlL0QzejK++pJGj4sJbnGdx2FEzZ8vvouiphTkNUdpUOd sgxOLx0ZoAgRBgAsvW8+IAevGs8+QWrX5ep+4G7igiJ92ZZ9cU8HsSX5Gu4aLrVS31k7 wyig== X-Gm-Message-State: AOAM533PmoukJCpKGH+HSKcVOhLBlL9UgiIwkVh9wXs/I5sQWyO5f1jQ vdqguv75drn+hEiObSX5FDm6wA== X-Google-Smtp-Source: ABdhPJwoS+oCFNTWZ5t67qRoR7YW69ytGqSXrSMYfn60dFtl/bMIFBBKbbS7ueU75+L9BeANFKW4gg== X-Received: by 2002:a5d:64ac:: with SMTP id m12mr27033016wrp.138.1614779018312; Wed, 03 Mar 2021 05:43:38 -0800 (PST) Received: from dell.default ([91.110.221.155]) by smtp.gmail.com with ESMTPSA id w18sm6109524wrr.7.2021.03.03.05.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 05:43:37 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 08/53] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap Date: Wed, 3 Mar 2021 13:42:34 +0000 Message-Id: <20210303134319.3160762-9-lee.jones@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210303134319.3160762-1-lee.jones@linaro.org> References: <20210303134319.3160762-1-lee.jones@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, David Airlie , dri-devel@lists.freedesktop.org, Alex Deucher , Colin Ian King , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Colin Ian King Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index e633f8a51edb6..4f0474a3bbcad 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -98,16 +98,16 @@ static void calculate_bandwidth( int32_t num_cursor_lines; int32_t i, j, k; - struct bw_fixed yclk[3]; - struct bw_fixed sclk[8]; + struct bw_fixed *yclk; + struct bw_fixed *sclk; bool d0_underlay_enable; bool d1_underlay_enable; bool fbc_enabled; bool lpt_enabled; enum bw_defines sclk_message; enum bw_defines yclk_message; - enum bw_defines tiling_mode[maximum_number_of_surfaces]; - enum bw_defines surface_type[maximum_number_of_surfaces]; + enum bw_defines *tiling_mode; + enum bw_defines *surface_type; enum bw_defines voltage; enum bw_defines pipe_check; enum bw_defines hsr_check; @@ -122,6 +122,22 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); + if (!yclk) + return; + + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); + if (!sclk) + return; + + tiling_mode = kcalloc(maximum_number_of_surfaces, sizeof(*tiling_mode), GFP_KERNEL); + if (!tiling_mode) + return; + + surface_type = kcalloc(maximum_number_of_surfaces, sizeof(*surface_type), GFP_KERNEL); + if (!surface_type) + return; + yclk[low] = vbios->low_yclk; yclk[mid] = vbios->mid_yclk; yclk[high] = vbios->high_yclk; @@ -2013,6 +2029,11 @@ static void calculate_bandwidth( } } } + + kfree(tiling_mode); + kfree(surface_type); + kfree(yclk); + kfree(sclk); } /*******************************************************************************