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 CC4C0E77184 for ; Mon, 16 Dec 2024 16:31:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 999FE10E703; Mon, 16 Dec 2024 16:31:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="lpqOajY9"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80FF410E703 for ; Mon, 16 Dec 2024 16:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734366674; x=1765902674; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qoH2Adv21No+s+Iv3N4GpJH/3gO7TZUygfUeylM59XY=; b=lpqOajY9ffe91NN1ktKmHe3HDV6VM/NMi7YtlccExRIyx4FZ4NP9iCBN jgZMNnS7aS2qzWAY3QWjhwAT2WSkQ3uASA7bN9mgoMlH8D375ON0QTwuT 7VPvUlRbDVx6yjDdAmtLlNBnMthqe8jDeMr5CMDRoE0mOlP09fpk0r00x Y8PYKpfjCtDsOP5aFnRNlQ3aUcB3q78ZsvvpNEOBxAdK+SmGsEGZjckZa Uj525VCnplaBEYFfv+oplkyb3U7d5DeDwMVa5LPZywdp50GJkqrz7Ooqe aYQtg6fZ+mb+Dvv8AuAL8Mc3DUIWla9fqJBUudI67Lotoxc5cVYlmebIz g==; X-CSE-ConnectionGUID: 8hRc+Na5QcO+FmEIdT70TQ== X-CSE-MsgGUID: 3TXdB88mQ9OkkirNqKhDuw== X-IronPort-AV: E=McAfee;i="6700,10204,11288"; a="34636175" X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="34636175" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:31:14 -0800 X-CSE-ConnectionGUID: SRLMEfN7R9SxLSg6oQ1niA== X-CSE-MsgGUID: /1uekku4RdebqfJ1lhhATA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="97125831" Received: from dhhellew-desk2.ger.corp.intel.com.ger.corp.intel.com (HELO mwauld-desk.intel.com) ([10.245.244.246]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:31:13 -0800 From: Matthew Auld To: intel-xe@lists.freedesktop.org Cc: Satyanarayana K V P , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost Subject: [PATCH 7/7] drm/xe/sriov: support non-contig VRAM provisioning Date: Mon, 16 Dec 2024 16:29:48 +0000 Message-ID: <20241216162941.86070-14-matthew.auld@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241216162941.86070-8-matthew.auld@intel.com> References: <20241216162941.86070-8-matthew.auld@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" Currently we can run into issues with provisioning VRAM region, due to requiring contig VRAM BO underneath. We sometimes see that allocation (multiple GB) can fail even when there is enough free space. We don't need CPU access to the buffer in the first place, so can forgo pin_map and therefore also the contig requirement. Keep the same behavior with save and restore during suspend/resume (which can now be done with blitter). We also need the VRAM to occupy the same pages so we don't need to re-program the LMTT, so should still remain pinned (also we don't want something to try evict it). With that covert over to plain pinned kernel object. Signed-off-by: Matthew Auld Cc: Satyanarayana K V P Cc: Thomas Hellström Cc: Matthew Brost --- drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c index 65082f12f1a8..56a178aca0d4 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c @@ -1409,15 +1409,22 @@ static int pf_provision_vf_lmem(struct xe_gt *gt, unsigned int vfid, u64 size) return 0; xe_gt_assert(gt, pf_get_lmem_alignment(gt) == SZ_2M); - bo = xe_bo_create_pin_map(xe, tile, NULL, - ALIGN(size, PAGE_SIZE), - ttm_bo_type_kernel, - XE_BO_FLAG_VRAM_IF_DGFX(tile) | - XE_BO_FLAG_NEEDS_2M | - XE_BO_FLAG_PINNED); + bo = xe_bo_create_locked(xe, tile, NULL, + ALIGN(size, PAGE_SIZE), + ttm_bo_type_kernel, + XE_BO_FLAG_VRAM_IF_DGFX(tile) | + XE_BO_FLAG_NEEDS_2M | + XE_BO_FLAG_PINNED); if (IS_ERR(bo)) return PTR_ERR(bo); + err = xe_bo_pin(bo); + xe_bo_unlock(bo); + if (unlikely(err)) { + xe_bo_put(bo); + return err; + } + config->lmem_obj = bo; err = pf_update_vf_lmtt(xe, vfid); -- 2.47.1