Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9108129pxu; Mon, 28 Dec 2020 06:51:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZALR3V+vM5/YcOb8TNjdYg5gGTpyCTtZZtHKmu6BmPT4MOvaqkm3eZwU0QOHryUjT3yzU X-Received: by 2002:a05:6402:541:: with SMTP id i1mr43244324edx.289.1609167071073; Mon, 28 Dec 2020 06:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167071; cv=none; d=google.com; s=arc-20160816; b=YAF0SGVAddi8okcld1CzB5396d9S3/BndrWKLGRDSviuxig884Xtf6EVmvb8SKrFHW MG+0GUeNrNMiMdd7dr/BYIxqxwG8zsxQSOOTU4AcAxZ+z1OD17H0l+v9JFN+D/LAQJF6 SmFw/JunTilxSjOd3lAolsVRwZ6+ivMPFfHF2NmKPq+lmYfogWUwo8/Joy4nLA8eQVaQ UyB0MCL2BDp1P6u0/KaXu9pFOOISZ9L3qWy7PGu0rayMcXkg1EbQLDeIu9AlxlK39Ik1 LT6rmEEZ/z8nHO2/uEodtjmUN5NjmvDtD8TRd52t/M8igSbw2KWXlaeSqAlbbnra5iqA wyYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gE6zk2NYnI0ouqYp+u1b/imu2OlAfT6xECceYVjB0PE=; b=tI558az9z8FiLkXyLRcudttWh2S4D/4oEqIJlTLt/DwXB8jNO/y0T5mgxEUSO4OFaa wwYjm6FIq4OpyBKf0aK5F5O4cbBN3ZwPMZeoo4I+Ujs7tOnR6Pbbvp64H+OZjw0NN8zK a9qWMdKfvjN3PMCHHkuDj/AXclTuE1y4SUfYmzrwFBRDFgH+83t2KPVzqHyT9MNI6V87 qbMkV9tnXnWwEpQ0++2teldDgJsCs5pG5Iao3/XDQXmw5jJ0mOZppXVGfzGRxUC8p2wG erVlTo2ZuyD7cK3WzeZ4vJ2hqo7DtkqvEF7JPE8C1VNOoe2Jfo5g637Q4lQe3Lo8YcCM tTAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZvaIcYdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si21200140edr.4.2020.12.28.06.50.48; Mon, 28 Dec 2020 06:51:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZvaIcYdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438129AbgL1OWH (ORCPT + 99 others); Mon, 28 Dec 2020 09:22:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:57490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441433AbgL1OV6 (ORCPT ); Mon, 28 Dec 2020 09:21:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7392E221F0; Mon, 28 Dec 2020 14:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165278; bh=dZn5O+DNoIlyQ7eVyRid+SmugfrjUNdAQX8cUqeS0gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvaIcYdKAfDZg5kwpSO0EX+aT21lZrRct5UA0ByQeYb23plsJ7/tfSUhOxtjHbxAf c5oF9sYsf1J+1Rfnsc8WbTwsp7m96eqrEfiCoPnCL65wnlQQhWWSGb4S57X7nrJW1Q +nn9xovkf6/JdsyrIHqDBzrpS1pYy7GUeX4kyPh4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guchun Chen , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 445/717] drm/amdgpu: fix regression in vbios reservation handling on headless Date: Mon, 28 Dec 2020 13:47:23 +0100 Message-Id: <20201228125042.291855184@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher [ Upstream commit 7eded018bfeccb365963bb51be731a9f99aeea59 ] We need to move the check under the non-headless case, otherwise we always reserve the VGA save size. Fixes: 157fe68d74c2ad ("drm/amdgpu: fix size calculation with stolen vga memory") Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index 3e4892b7b7d3c..ff4e226739308 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -494,13 +494,14 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) break; } - if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) + if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) { size = 0; - else + } else { size = amdgpu_gmc_get_vbios_fb_size(adev); - if (adev->mman.keep_stolen_vga_memory) - size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION); + if (adev->mman.keep_stolen_vga_memory) + size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION); + } /* set to 0 if the pre-OS buffer uses up most of vram */ if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024)) -- 2.27.0