From patchwork Thu Oct 10 10:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13829915 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 03404CF11CA for ; Thu, 10 Oct 2024 10:32:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 896A310E8C3; Thu, 10 Oct 2024 10:32:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="P8TBiJML"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC6F410E8C3; Thu, 10 Oct 2024 10:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728556357; x=1760092357; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=doqr1dty0vN+uf31XtEqRtxzdxeUgEoyO4Rr7m7TfV0=; b=P8TBiJMLoFA4bTKK48jzhslY+BdCgXswx3kl8fuuYYKJohArE8Q2FXTo JT7nn/UJJT8ecfsId8kAyKkjAGUJSUyh1L457Hjldq6dknqguzvM+ceST 5Td8AyKJsHDzIG2t21AhTiJS0omgzt1y/w/LuiixC4agIxdMcNeVX5Fs6 RjmvjL002bI68U4qf/R0263+BLZB0N5FBsEQTp6r4AZ4sBY2uPDU5vgzd i88aFKAkXGK3jHXEuo/efhYpbkpTODy4lomeJSajpFs4h5EFAic49IvZn AvLyFfIqFVGiTuKGOxGdOR8vhmmiPZkpejwTqtN482sSdWgMSvVbzvYl0 A==; X-CSE-ConnectionGUID: rKNjOOPgQ0+84kHtzWtjqw== X-CSE-MsgGUID: qBTECrwiSsq3RLVyhBBCbw== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="27351305" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="27351305" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 03:32:36 -0700 X-CSE-ConnectionGUID: +4zwoDOwScSCV3JD/xSNrg== X-CSE-MsgGUID: T7i+5Ds5ThKAZZF9OaBviA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="80559343" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Oct 2024 03:32:34 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 10 Oct 2024 03:32:33 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 10 Oct 2024 03:32:33 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.46) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 10 Oct 2024 03:32:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=exTCYN/P+Bog60IrLiv0hAfZkj1EMBHMjpSZD4+s0d4fmXnyIRAu9wJPWtlw8RB9Nt17B6KyF94uNL8Mm1PMIA6/0o+HB5s9CNWvkaXk9TK+Bh0CtA+/MbOY07Bc1aECBb5oEB56qYXx+HirbliEmwS86AOfoMlGJwCuuvrvTmGi9Mvn1Fe/EKhtND3rFo6Wpdw7AFpocIm7roK0bHur3c+5Q6KgbtbnfguBa26/yyuwhVkm/XWYEgPxi1PYrF+AaYb6eDqM3QQ+zbF1wg45StDUc5D/XW8/w7BRrlWYeBYhlE4uQLISQW/0B2kSq9dJ0fW03LQt8Zl0IMiQJkruXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KdVn5Ub7EPPEMa3i3e7evc/RY/yZ3Kbngz9R7/bMOT4=; b=gZxGGWUeDGP6LN0/73Vvq4kdDctg0e3OtWV/wuUmiRHJ/esxaSMWW66TnjoFm303YaXL8xUZ6RifyVliz8AxpAIfyfn/kZqlI1Vo0ViOBCq8kSO3opD7uL1ifZCIGhYySwulyGZxjGjLyEG7jBg9L2hCDR9nVRHZFKK/yxvq6WujOqlqIp2eW7yUM8avGJvO/svvdGTEBk/8Ve4o/8Bnk5XcbdmSxA2W15O9YLBldb7fFNpbt3wgP6QJQOactwbMQP07g5EF4hybmPMD1hdHhyTD6wzFOdUdJQDXq1FRdrv0QQHv/zuO38q5d8vwkjFaIzkuDbN8PkJcBxxcUl2K6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by MN6PR11MB8103.namprd11.prod.outlook.com (2603:10b6:208:473::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Thu, 10 Oct 2024 10:32:31 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39%5]) with mapi id 15.20.8048.013; Thu, 10 Oct 2024 10:32:30 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , , , "Bjorn Helgaas" , =?utf-8?q?Christian_K=C3=B6nig?= , =?utf-8?q?Krzy?= =?utf-8?q?sztof_Wilczy=C5=84ski?= , =?utf-8?q?Ilpo_J=C3=A4rvi?= =?utf-8?q?nen?= CC: Rodrigo Vivi , Michal Wajdeczko , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matt Roper , =?utf-8?q?Micha=C5=82_Winiarski?= Subject: [PATCH v3 5/5] drm/xe/pf: Extend the VF LMEM BAR Date: Thu, 10 Oct 2024 12:32:03 +0200 Message-ID: <20241010103203.382898-6-michal.winiarski@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241010103203.382898-1-michal.winiarski@intel.com> References: <20241010103203.382898-1-michal.winiarski@intel.com> X-ClientProxiedBy: WA0P291CA0006.POLP291.PROD.OUTLOOK.COM (2603:10a6:1d0:1::18) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|MN6PR11MB8103:EE_ X-MS-Office365-Filtering-Correlation-Id: 312d2e32-a51e-4d8b-c513-08dce916d857 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?HF1fDWyhYk5m/9NIzum3HwQgsAxeOfK?= =?utf-8?q?1P8u+wKuWolAqGCap3N0b4bbA9CY+I5s+s0RgySfizymr+p1w0d6K9T48bn8KMZbo?= =?utf-8?q?Y+um3ZHOZTcIhblyCkdwgrXZUMR2abB0ANUzKjAIhXt59Yy0YJwaZysrc7hg1eAwZ?= =?utf-8?q?2St7Hvqarpr5UooCqS1K5ElNimfTCXSGng2/7/NRzwiByCT1NRz9pnaRxbjzRLWqq?= =?utf-8?q?JDeWN6xtkEYtF4lfEl4ZZtYoZoDkGls8uT/6CvEacxZ9o0068gyF/DWCGimQQBh95?= =?utf-8?q?ZAG9ZmR3cH78FPgmLWwvnI4Um+se7Jpcb/d7b2dAD8HvfmuJKmXn0Y+70iglw8lM2?= =?utf-8?q?u0Y+CXlwYoDUwRxikOP1BPCo/Y4xLupx3MRiXNBY+QSI8hOGhE6zN1SwVE/EMqQRN?= =?utf-8?q?7HHyhNFjoDQIYcOyJL7PpHumMDTQvWF7Ucax2Yynv9LYhUHGDsWR6Sn+Whe5eXHVi?= =?utf-8?q?VpFUexKlKTaSfeA4FjG4Gx064gwKg/75Pfc2J+ZpAZUDEs0v1uB9j+offc+SVbgvu?= =?utf-8?q?Z4nZR47Ce/kBLgOzENvXWyew04XoH3S3mYV3E1lj772ccwrLZhybOnfIaN0toF3E2?= =?utf-8?q?RfJZRoWWPx0d2qnKJ3OHQF5QD+KazOxBtk1RXEKI8JbXSSVVtgqSn+/5UfOazSaU6?= =?utf-8?q?/9lblvzc3l3juMyPr4I0jn3MxpLBBBxpCU7y4v4JPZk20yt8lecAPBS/uiPAdjXen?= =?utf-8?q?uCXdX+WgQ864XHrH9/zd/3AZr42SJL4wbcg8ksCf3DRzkKRTBH+wSDYXhREND0ogd?= =?utf-8?q?K9engNuZK4xC6b8JczPgUiNoiKb90aAHidMgCUoLTFB+g8r9H6TOf7liN62H9Jr4o?= =?utf-8?q?0AZJemh/+jS46adM0S77nWpEt5eQwWOHI4sXy5BAGrwnHlSZqH0B/eqrYSabV/PVx?= =?utf-8?q?jX8QS4ER9fW4wG4g1jy2VKvrJKwDcQw3tou5w2kku9yed15WTyAQoIWs4dL8icHZR?= =?utf-8?q?SExJSzPJMHeD6BCkCaNPMmqT2zF9pL+9lSrQf40Pc8uytVh+22aRzaEeFlWxOXYFA?= =?utf-8?q?EWb9Jj0hMGwEa4T341KDFx+zbs4dc+t5S1Tnv/6dtupoiWiNCu5yOplTBpv93UXhE?= =?utf-8?q?SKUOxq9n0b086ucb2dHT7MOe113hcVoT61azGyBy2U9ywu7GKrW93a2T3s4rmonXH?= =?utf-8?q?i35IbNYRfL3YTAu3SLzSrjfqdXCaXY3nZjZ5AlYuDMnELPS5L1L6mGeWJUsxzNjzi?= =?utf-8?q?J8uR2L4w1cpQb9nAE6ELoEpaspVTKXdv3qZw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(7416014)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lC2yiSIKKCunbzuv9MQcB5BgbFuV?= =?utf-8?q?gofeirmxw0+vMX2y3AeNlMd532DPW2Apz10t9aWuJlWuB129vh2vBfUN71QUEINP8?= =?utf-8?q?HmQW7gRCXr+pJ1phaSqxbHCzfEacd/ehAxKTFOh6wYD7zh4cB5vEFYaoD9M1AgjT/?= =?utf-8?q?BLoh16FHznYLlRXWIdhI+SquZTauV25eWha2bD0G32rnPGzMHtKZ76npWNkdvDhzU?= =?utf-8?q?Lbvp7EVzz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nUnZSoFzk/6XXqyiO2wWPswePZoqcYaUulBl1bJq3jy/Zj/kiW?= =?utf-8?q?7GNpoiNZILrhcc7wD3ZHAZnB06jibmr+qgPXGSBl+P4Kf7Jtp0FtI0yIk0coVWZEv?= =?utf-8?q?m3q6Kdk/5TDD2j/S9EeTQbXEUUfEPu+Qz1yqyOVtqkCzLGF3Svysp2OCZ8T0+cXZP?= =?utf-8?q?uJXUep+yimhyDsRf9cHsrRUB6VBaD+1yOAL/afpEVguCmIVAHi1duYQbUNZO3M5NB?= =?utf-8?q?aBDEZNqSeuHrWF77xx1DnOIxu/iwC9gKB+KcAUwb30L6b90EFNpIuj7xbquzZWDtD?= =?utf-8?q?VjFaLEqkiZvXpNrPs62QeN38L/Qj4DZA2isc3jcrrCnZoT49fJR4vE1+7DgDIFHvg?= =?utf-8?q?Ko3+8gpGoWKw0IuGCAiliexqPw1IHDIpdfNUBOHZrntXJp4ExFxuZkRkoF9aV/nyb?= =?utf-8?q?dLXnsMmMW+P2yHdhM3ba7hQGtHcdpS+T4w=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 312d2e32-a51e-4d8b-c513-08dce916d857 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 10:32:30.8990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cjHW+P7YzbGrckK7LL2/dLmZP5Ktfnv1m7sdrh4Q1edn/vkpvtfgqBRe/yAnxhLcpJdxlmfNg1xxe7gk0gYfE6cbTYwJKC/FtTnSU2/TA54= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR11MB8103 X-OriginatorOrg: intel.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Opt into extending the VF BAR. LMEM is partitioned between multiple VFs, and we expect that the more VFs we have, the less LMEM is assigned to each VF. This means that we can achieve full LMEM BAR access without the need to attempt full VF LMEM BAR resize via pci_resize_resource(). Signed-off-by: MichaƂ Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe/regs/xe_bars.h +++ b/drivers/gpu/drm/xe/regs/xe_bars.h @@ -7,5 +7,6 @@ #define GTTMMADR_BAR 0 /* MMIO + GTT */ #define LMEM_BAR 2 /* VRAM */ +#define VF_LMEM_BAR 9 /* VF VRAM */ #endif diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c index 0f721ae17b266..a26719b87ac1e 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c @@ -4,7 +4,9 @@ */ #include +#include +#include "regs/xe_bars.h" #include "xe_assert.h" #include "xe_device.h" #include "xe_module.h" @@ -80,8 +82,14 @@ bool xe_sriov_pf_readiness(struct xe_device *xe) */ int xe_sriov_pf_init_early(struct xe_device *xe) { + int err; + xe_assert(xe, IS_SRIOV_PF(xe)); + err = pci_iov_resource_extend(to_pci_dev(xe->drm.dev), VF_LMEM_BAR, true); + if (err) + xe_sriov_info(xe, "Failed to extend VF LMEM BAR: %d", err); + return drmm_mutex_init(&xe->drm, &xe->sriov.pf.master_lock); }