From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DA2DFC47258 for ; Wed, 17 Jan 2024 10:52:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A172A10E669; Wed, 17 Jan 2024 10:52:56 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 924B510E66F for ; Wed, 17 Jan 2024 10:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705488774; x=1737024774; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=SkSkR3EAFYK44Hcx61OtwTwMdpprVhyjAImdu/jUfnE=; b=bZp68KtV8YEofKrdujjtpCWKZAGKuznCua4M3Liqcg7H9YGvCt7tOlIT 6909mX4yIBXQ96fVWCW3Fa1fK7ANxOgFL/xQ8sPdGvBcW/pB1c8I/Q665 yZDkMN1sSJIXtGVkdq7zWOQB2NIaP7JkG2FsCSpaf7tDxzhQCUnBkVMMs Sj4eb1JKhp0gWVuJKSL1hMfibXCVIZO7vMBaoq2Onn9THNNQ+kZF/okAP yC/h/YB3ujdC3DmEOGNWCN3EyUDQWOgc7UKITLZP/Q0wlhX0b/FbcqsmL 3J5g+EhpL1SNZ4l2P9NEXjpVZdveRQRVwGgEZyc0llCc6SorZVh804aQc g==; X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="486292288" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="486292288" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 02:52:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="1851" Received: from clanggaa-mobl.ger.corp.intel.com (HELO fedora..) ([10.249.254.57]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 02:52:54 -0800 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Subject: [CI 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT Date: Wed, 17 Jan 2024 11:52:36 +0100 Message-ID: <20240117105236.121836-6-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117105236.121836-1-thomas.hellstrom@linux.intel.com> References: <20240117105236.121836-1-thomas.hellstrom@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Christian König Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 06fb3fc47eaa..2752f2a67a44 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ? AMDGPU_PL_PREEMPT : TTM_PL_TT; places[c].flags = 0; + /* + * When GTT is just an alternative to VRAM make sure that we + * only use it as fallback and still try to fill up VRAM first. + */ + if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) + places[c].flags |= TTM_PL_FLAG_FALLBACK; c++; } -- 2.43.0