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: 392069 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp5132879jap; Wed, 3 Mar 2021 05:43:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhR6gWpfHOnwENpNphqOlTDpxXavExOE7BOZEC67NyFJuXMMn5oadw25mDyx+cCZbWqg2q X-Received: by 2002:a17:90a:f2ce:: with SMTP id gt14mr9394441pjb.221.1614779036219; Wed, 03 Mar 2021 05:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614779036; cv=none; d=google.com; s=arc-20160816; b=aUSQkAwfr/1BxpXlNHWb3oDuYeG+Rf1L+TnPrimB1zh5TAOSGPO9cX3GWgB7iESZgy eLfJ0wrQc3cNpGgg6rqrJtulkx+ZtbNH34PHY76osI1TsU5anTqm0s42dJCagBWPGcZq hWoioKEgtSTZsLV5IuSRFKat96GAVSa5wUV25StQwr0okR4+hVs6JPaDNge608FzHejG NB1csn0vgp4kcgldGaEsXdEWY5sxgLYeza2a0kCtAokelD6zoP3EFTOXL9/syUCgzvpQ dtHajjJ/s71NoxZkhgXVHhFKBEOAGxMpSuobGZzlD1JxubgsbSxnbwd8YFdQO8BJc0wC OLHQ== 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=is/vxxjXGchAOSrx+TVkMFAFZOt7NYf6CsmervxTQlI=; b=XxYU4HGHaGajunZB1OQ7l63UVJwFJB3LyTI/QWNEQpevLkZuieNxVXruB1ioK099Cj wEtU1qc2ijYPkIMJRA8byZcX6YOj5DUR5mZhpT1MIDtAjnUQK6jufQjY8YMosSweZOKA kWJTBFMxJkQuTbQOFTUjPk0uVXpWTonaJmYVdd6dAohK4BtCpStWEQkGzT1sk7vBkgRU 9SZJKp7qpH2RAbbIhGIdKk1fopfju7jZiUHf6qlb6ZavnfTFhXQdpsmijc2xOCfKghnq aWSoommb1XQM5klNf+plqS8FVvd0dCr4fWW1ZnMqAM4aUWmTcLWy/D4Era1dtA9UoPtx +r5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZsyMPRW9; 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 k11si24415448pgi.63.2021.03.03.05.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 05:43:56 -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=ZsyMPRW9; 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 499D56E8E7; Wed, 3 Mar 2021 13:43:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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-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?= =?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 | 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); } /*******************************************************************************