From patchwork Mon Jan 11 19:18:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 360548 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3139488jai; Mon, 11 Jan 2021 11:20:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCPpE/IiuaZF6EnBB4MdRzc6Eb33sjbi1hqIFvUMt8T36rffDkFxnwQAJWj/EMwNdFGkaF X-Received: by 2002:a17:90a:970b:: with SMTP id x11mr407398pjo.16.1610392804303; Mon, 11 Jan 2021 11:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610392804; cv=none; d=google.com; s=arc-20160816; b=f2keP+JeXSE7GSsYrAbarmmUBbWnbQP42IzqnIrmj0C2cVZIxp7b8vllvRD2yMTz7J DD0qqKHi5dHNaP3IZAPNKAxlynXsw2j0Zz7R6Th/I33j5hVb9Czq+6GHHpzTo6mscvL7 qekhuTvZR6ohdpL/xfYVf0QE1a2l6ME9+QB1bYVB3gmIUhzNc0j+Oa4eAXp7PiFcwu4q 9o2MjAYHVplag7FajZIOyYlfoGPcUloPAKHtPLbX+dnCIa9FvRfIXXgp1vtp2fyGI5hk HvB5JcQGz4l1cCXgwA/jzZFEMoijmavIegKKvhAySQmFIST3a6+O1T5YBhCIz61zqDky 31pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=jBLoAqs6C5/WTAQ0juEIzTthQGC1IYjHACvloFy1MLw=; b=xDum/qqWA5RddiHbLscxYvtugSIn4ZqJEb2o9G0sL8IwEanSKieMMOJeHyTzpMxIon p4sOF/PLDhUK3bo6lJaSRgfGramWk6s7Q0cwLGz4dvcdi/9ULeN0kDkbHYN8YGR31ABW sXtgIx4qdPz5Dek2ltayYvNEJl3GD2HTXIKQrD8aF1BD3DuFRrItiXYNaqYWTfcuJQ3f CQ3LXNOSKakJnUTAs3TSoQ14gv2CgETULPRYmjPmAI8Gpi3A54gEmJyBH+9FuFyD7cAw 7JsaRoiwZvyCVINw+ry0zkhbWmX+XuUsPrbcxF/9Vnka22r6yc8AotIxeieH/byaDjrJ WGMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q9535ah1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id q11si383319pgm.57.2021.01.11.11.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 11:20:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q9535ah1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7000289DFE; Mon, 11 Jan 2021 19:19:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by gabe.freedesktop.org (Postfix) with ESMTPS id B224B89E0E for ; Mon, 11 Jan 2021 19:19:48 +0000 (UTC) Received: by mail-wm1-x32f.google.com with SMTP id k10so243504wmi.3 for ; Mon, 11 Jan 2021 11:19:48 -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=bXFKZa9JjVse7+5giwTOAXSXYikkRKBfRN4TR1AbnV8=; b=Q9535ah1toYRZ7VlqwLDBDjQYfMfUYLA55rRtLkTMCTwmD5CzFWXNAVjehFjlap/TL MXSD01bPe7YrIvBgydU8YLuFUEqZ0AUoo9ikS76apFToPKRioQgaXnbjyXRMB6nmGgKc NPwBpeK8MR1KnLKTEwtKy+UfcL+uJZNqwVSZ4xfIVKlrLD7FPEYfSVjb4lVfdGbNE1wE 1XmsAJ+oNGYUbrm0kZTvO54T9yVqRnP8byP30PPfSuDZAiBewofkUpEO3ALMw4QF5SJa IYHVmBt/aHbAefEsRw7Ge8rYYH+nSYIfdVy3gs+idI7Ae/0qvaiW45i+HoUqcEzaFlKb w+zA== 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=bXFKZa9JjVse7+5giwTOAXSXYikkRKBfRN4TR1AbnV8=; b=ezCjb2hlZqpnUEr/vj56joIMaaEOJ2mqj5MV4WtQj8xF5HFhV20EUWf+oCWJySFk/a +FB5Q/+v8DcXUW5ZdYsPglZsESrrWMh+4jsxkzWCVRMib9S9Ncy4b3MXNkTzyvGqPx3T 7Yfh4naJenPngTNcPlgYq6TY4GvDoJ0HXIlI5w5AOAgvcIfhvGBWmVgqhf6SXMUtLrqS p7JbpcddyHNXJcJrQigUEuzf4vVkAXtn5FcqtukKhqvjzJEUqmShfuwNDctoGINLWUFG PL6aibORnfWSbI+v28H+YqpInR+7fQ283DiB1jbOI6mP+TNB7fsG5ByeiJsE0QWN9kX3 lc5w== X-Gm-Message-State: AOAM531tRo7FB5IjQdseUWcpR7Z7biJTJjdncKTyYxr2UnXqPyEinxsT UFDNBp/BJodHiDDkfAhpzMZFnA== X-Received: by 2002:a1c:a1c1:: with SMTP id k184mr260298wme.101.1610392787408; Mon, 11 Jan 2021 11:19:47 -0800 (PST) Received: from dell.default ([91.110.221.229]) by smtp.gmail.com with ESMTPSA id n3sm778090wrw.61.2021.01.11.11.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 11:19:46 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 13/40] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap Date: Mon, 11 Jan 2021 19:18:59 +0000 Message-Id: <20210111191926.3688443-14-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210111191926.3688443-1-lee.jones@linaro.org> References: <20210111191926.3688443-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?= =?utf-8?b?w7ZuaWc=?= 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 | 21 +++++++++++++++---- 1 file changed, 17 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 158d927c03e55..a0c69fae40ced 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,14 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; + yclk = kzalloc(sizeof(*yclk) * 3, GFP_KERNEL); + sclk = kzalloc(sizeof(*sclk) * 8, GFP_KERNEL); + + tiling_mode = kzalloc(sizeof(*tiling_mode) * + maximum_number_of_surfaces, GFP_KERNEL); + surface_type = kzalloc(sizeof(*surface_type) * + maximum_number_of_surfaces, GFP_KERNEL); + yclk[low] = vbios->low_yclk; yclk[mid] = vbios->mid_yclk; yclk[high] = vbios->high_yclk; @@ -2013,6 +2021,11 @@ static void calculate_bandwidth( } } } + + kfree(tiling_mode); + kfree(surface_type); + kfree(yclk); + kfree(sclk); } /*******************************************************************************