From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=192.198.163.8 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796070686; b=KSfj2o9+9hLLS2MJTl/5TK57mFCdQlcaZFQaiwZ+WfYicpi1QAaMk26dYzQdtq6uJDtJ 5IwavOFVsOexV+McjZiK50htr6ofBdWhZTW44jWqIMwZGlUe0Vd7rSEs1zWlpojoAYA2h 1wGLsZem90p5LB8eOxnp6Fxb5iHLWXMdJHIC+LF9lS8ie2geIyoxFO3H/rXlqfyaQd4sK dDLVyMYBXymT7FlElqDngjE/t4Zj1dsBv5FMCGAwnh4uO0lz/CVUG2S+UER6zK9VWmCkE 3z998ZVOnz/kpAtT7CemeTZYfwoG6nqkfv6RGLswC/I7Vx+2tjUJ630rBZjs0nCScjA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796070686; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:Date:From:To:CC:Subject:Message-ID: References:Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-LD-Processed:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; bh=zIqqR+Rfd9gMmmkMkuaTrT5zculxgEA+SnMeo3jKr9k=; b=xpvxXkpWlJOIwyb9vS+DuvfczKTMx3a/T0dfINpV2hNYLM4rjuMzZYiQ+8PczTIj5GwJ xp3Enztoa1jTLt/ZiiY7ZZKGJpVmVLr25gBo2dpOavpD9VdWnH/uLDL6r+Ru2KvYswLGV IJZTGLpc8mCTE7MazkGR8fWt+A5S9W+1eUZ8y1959CwGUHzdlVyONi4+M0sg1sEhO7v6y 2tnoOWlbbgBvewFOBHmLxpyl8Py8ow+0/NdYumcEu7sRF55A1NKEZbCk3L5Un4EZH1CUT OKu92HC17Ft86xuhIXITexbmlxpvlVSVXKfMSvFBw+hkR1H1PdNinIfU/vAEVW5JOGA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NJ0p8ndF; arc=fail smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EA8F606A31A for ; Mon, 30 Nov 2026 20:31:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6EA8F606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NJ0p8ndF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796070686; x=1827606686; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=zIqqR+Rfd9gMmmkMkuaTrT5zculxgEA+SnMeo3jKr9k=; b=NJ0p8ndFik0WPcJbJZ0y2+A8BbvVwsZKsFmrW+P1/6U5V/VNqZE47WXE pxjeOeSNpNZ2/2k6mM+rmS/u/zddL6ocNAs5tQYOQatuOyj77ym6NVag2 IJfjGebhXnEuE60Qpzh1ZAquvYqR62o1FSvisxParOSg4emWofgRT51+o MT5E0ja2E14FtFHpQBxa/E8lRS+mAICCqgrhODspaIQJSs7hPkbwZXERo mn9/oVTbstZcFVT1FPlwmhWya5r9fuZoTETVpmf2/3dqUU90by/5WdUDB dK23viiSZYwgebdVvxOzWBKBBdM0dRs2f9Sbk1xhHY9Ru7ndRwZ8Ym8p5 A==; X-CSE-ConnectionGUID: FFmKaybhSc2fOK8qNO4wCw== X-CSE-MsgGUID: l4LlKkKgSha0xVjikBy2Yw== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4805392" X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="4805392" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 12:31:25 -0800 X-CSE-ConnectionGUID: 9sUpT9VZT/qnfK5aJoU27A== X-CSE-MsgGUID: x+lPt5FxR1y7HOUUMj9yqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="13449430" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by fmviesa009.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 12:31:24 -0800 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 12:31:23 -0800 Received: from ORSEDG903.ED.cps.intel.com (10.7.248.13) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Mon, 30 Nov 2026 12:31:23 -0800 Received: from PH0PR06CU001.outbound.protection.outlook.com (40.107.208.24) by edgegateway.intel.com (134.134.137.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 12:31:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F8l16soxpV0SdJHq4RGEjektJUf1FvNP1nFyFm75AxQfTV4nKs7yjUQhJRbTxQnqhPfMmr2tgEMYDQHn8OPhE7NrU+evHNSuKTk+LtR41rpwkEU19cyl34QuvrA4O6Aa+9vGyuGT2HfX/7Js8Fmo0hH9PPjRmI6/sMAE5Vh6+zMwGgkINGJTSFcv7/J93bBKg5h7RXr8gFd6qfRouL8jJGt71QHFksJJeOwJLPZxapefM46qsIYu77DBVeIAVxto/vc0EGcotihJPHfbGU/0WtJpkPnG8WpEbsKBsDHuxQLpudz0S/AkB0ltvELdn40jO+5QROLk6HfS2UAkoTCZmg== 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=0jjgeIeYGePXIVIiwpmTfurMsZl7AKdERpu+7m7L82I=; b=DCtADvfrbsKMgvEv4s1zyN67VR0vpHDTJNrDF+sMSxoR+pf+jQ9RRGU/a1DpMP0nzYlA1FeITtVPoxnqdBrBYzOsk0bjOKYjqTSKRXf3lnSp2SuEAgX+8gHTX6f+EE62ItKqUUX052YL9bLPBdKDGJAPnTqWaY1cIKedgKIb/RLXqq5h10W8nMOPesaW6l7rRw4LIbJ61xJv5WjJ8l5j3SKnCq8pYFKLx1ndj3WGZXUP+LBlxbAZW2ckwyub7hTPoJYr7IwOoV1J9Lx+GIA/HSTU9SA+gR2Mj7w9cI2XaaiYfs5+HMzrrVbf0uHZDxh/k8LOaClfQP9NtWLkhCKAAg== 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: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MW3PR11MB4684.namprd11.prod.outlook.com (2603:10b6:303:5d::14) by CH3PR11MB8436.namprd11.prod.outlook.com (2603:10b6:610:173::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 20:31:11 +0000 Received: from MW3PR11MB4684.namprd11.prod.outlook.com ([fe80::2f5a:96ce:f7e4:c315]) by MW3PR11MB4684.namprd11.prod.outlook.com ([fe80::2f5a:96ce:f7e4:c315%7]) with mapi id 15.21.0662.012; Mon, 30 Nov 2026 20:31:11 +0000 Date: Mon, 30 Nov 2026 12:31:08 -0800 From: Niranjana Vishwanathapura To: Matthew Brost CC: , , Carlos Santa , Ryan Neph , Christian Koenig , Huang Rui , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , , Thomas =?iso-8859-1?Q?Hellstr=F6m?= Subject: Re: [PATCH v3 31/33] drm/xe: Blit src-natural to dst-packed for defrag-IOVA copies Message-ID: References: <20260711025619.2540575-1-matthew.brost@intel.com> <20260711025619.2540575-32-matthew.brost@intel.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: SJ0PR03CA0262.namprd03.prod.outlook.com (2603:10b6:a03:3a0::27) To MW3PR11MB4684.namprd11.prod.outlook.com (2603:10b6:303:5d::14) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR11MB4684:EE_|CH3PR11MB8436:EE_ X-MS-Office365-Filtering-Correlation-Id: d4a18920-fd7b-4d2f-d140-08df4f20df03 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|366016|7416014|376014|4143699003|6133799003|18002099003|22082099003|3023799007|10067099003|5023799004|11063799006|56012099006|261102123227099003|261028144727099003|261021123027099003|261026140227099003|261026121527099003|261022105027099003|261021121427099003|261009223027099003; X-Microsoft-Antispam-Message-Info: BGhVykE7BqqxzSysnPjKjyrN5LQUU3oxyjFiDvbsQ7QA/1dMK7FdzFCBA8xXQ/y+zIHnjq+0zPTKNmoVz/Y0274vd1jOREtbZ+/+lUYTITR1nj6prmiIlwhdNlsJF56RTkSx8ws6PpMm9h/4ZIoXgw4VIZ3Kp6wvAkayuyGZDtGjpGf59ozCUgwa22PilK2DDRtXAipHgDgndVSCBh0kWf5q8oo7OC4xxayZm/EGJngLh0PcT9Uj6tVcZX7RzfR0URYtiqNb/KcIlg0Wjg6GKaYCe9hvBKUXENP45AGMzeL6ZBEJqC9Hh2btfv1fj5oiK3uPRcRaH1qd741P7LOdVU6AbLmfeKC6Sm9GofLZQ8p0QAIIw34G6SuGrSUkOgMwZ13Zbz+qqQkloTYPzUmjJtWfvLYgpKxc05PCK9Uth0v3qeRqGqg8gSiopRDwUpflKnVrVR9053vn//9iUq464KS1ifLXbTdtHK+zksia+3GPGOwGhV8cG0xINBu7TJuYLFGaj91W6r8bYGOEsGds1kN4VKefEzPK+3y7GmvLTVa4V80k4R8R6Vztf3x7sD03UqG700/waPE0cHDqzo6DLZhSOnhvhD1wfa0nGM4uPZ0p4fd0ucBvkmEF7QGmfimJew6qSYiGUyivo2bTpSXY7gzagecscna3kRDN7h/xrgI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4684.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(7416014)(376014)(4143699003)(6133799003)(18002099003)(22082099003)(3023799007)(10067099003)(5023799004)(11063799006)(56012099006)(261102123227099003)(261028144727099003)(261021123027099003)(261026140227099003)(261026121527099003)(261022105027099003)(261021121427099003)(261009223027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?cWxCCBZIjOd6aAY5rYYSW7xlKtg/2JBoLnGmuxj8z/FPmbEwmheGFWfZ6Y?= =?iso-8859-1?Q?dCu/QvzRe0YgAJhi0fNvsPdiz1rByuFfX37/G58uIkZ5W3+a0Nc4gGf8N1?= =?iso-8859-1?Q?iayRpIspMvXJ7IaVDM2N5yoBlIOU9EtORkM2p4of25S28rF7Ns7hil6Ar0?= =?iso-8859-1?Q?IcXgP61HYd+rswDnFXSvKTaXp2QomZhkYbslju3V8hrayDwub1Qail2961?= =?iso-8859-1?Q?ycLw3V+SmrPbFq9G3PQV++0JuTOvC0Qmvax4XH7u9cwVRhcXc0O7egso8R?= =?iso-8859-1?Q?o25O4YWkeP/tKSggQh2rBacrHQQg4Z2Nhv8+8IV9xy2CZdz0y9qrJoyfRj?= =?iso-8859-1?Q?M8Wrtfw3QhgwYrLKqKhbgS8sznvf+RXpE/UeWns7wsA3f4sOC6Ew26OGw1?= =?iso-8859-1?Q?ixiMuYGoy0wakJtLGpC3W004faieqBjpkSFF+LcPH+FKObJAqId5c6LpTe?= =?iso-8859-1?Q?fsPnxXINa/z1J2tvwwJgK14nDi0+QtkAbsHBFfXiesAAJAdHfA2lilCsje?= =?iso-8859-1?Q?w8nroDhX5LlkbdjwvYQObVnHoni0FBgzpUkMwidlowcuOarJVId9jdKmB2?= =?iso-8859-1?Q?+4JBcVSfVVN+B9RenOZLXYGZ/B0jNGkAwhHAeFksK/RzxUFiYrNaGHrxlF?= =?iso-8859-1?Q?vHDx+kVntGK0aLg8xiVVjkfQTOyA43mF5PABtgv9zXRQxT60HKzKRu1w6G?= =?iso-8859-1?Q?d5ZO5vYJLc7VTdhua0nx+7bZNSrICcBEvXNv5aEOFICpvrz9yJqlssQ740?= =?iso-8859-1?Q?i7wgEGZpdrhuk8mNXr+gyV4IVYadp2UAMtgqigmFrTGDMynnklbtHbfVMB?= =?iso-8859-1?Q?tEkwbiwUI/vnBhU60A4zqD36pCdZNA8g/fOy5KiQoDAwR9Y+Zla0QnSlB7?= =?iso-8859-1?Q?XltIVCLnkp83djMC4oa9wTUU2HJ2cSM0/JVgBY1Oaf+yCtrG2U6PO1l3j9?= =?iso-8859-1?Q?f+EITcs1/saSabN4vHMWZOHhT3ZFIyijMYjmsnymNRq5emwjt/WzMXq9vz?= =?iso-8859-1?Q?6nMPxN3bIGlEr8+4er2qs3fHxZHJly8JGOZ0Wymjqp5LTnMNoa9sA5mu5+?= =?iso-8859-1?Q?97wFmNKNYNpGRhRK4EehGnRfONAn7/CgdnKyxz6ELJPDo6CkEa6CLvva2P?= =?iso-8859-1?Q?eCLnSAegyVtqOyQGbFd/MWDlsyJyjr8SiYSx+mj3oHOj7Q6YDQbQH3GgeQ?= =?iso-8859-1?Q?kRWuVkRig5oGM1R3h0u9EPUJQoCL8ucz+mEFv0wQ2FojdW4+3C0huK6in0?= =?iso-8859-1?Q?Rt70XZ7fg7kcJQAVfSnud0pElDri32IgwXVAIGH8Rk/L3dp+klOh4/gIHZ?= =?iso-8859-1?Q?M0AelvlAQlTcjxparLZkoAbnWEPKOCSCrdR1AiEjSCECI0R073oc59ohVe?= =?iso-8859-1?Q?5U2hMyg/QNc21Wd29jXylBGhI84IZwgFqrWhrt6SEKrnglNPW4i9N3ioud?= =?iso-8859-1?Q?+DY5Hr5IBa8iF5RmlGfff5wHyZKYIoKlTH0y12a4KfBIt4OX2cLZ2VE/xq?= =?iso-8859-1?Q?3MUolLx9OzXnK8tpmLHEeKxKghGt48YTkE3d9dZZBpgi22FnWfz5GX7rDE?= =?iso-8859-1?Q?y4un6a7o51hwzJW9L7ZeYP60StpIfCHn1X1HAsP0KgcmMwVkpSraLHMrsI?= =?iso-8859-1?Q?MAfqXS1t9tlc97MWahooifQfS67WlZntTEy7Bbv5PZOZNfBLsNslMHxmD3?= =?iso-8859-1?Q?faKoQ26FQzIxcxlMfkoAD6qR8EYMg97X7g0YPITjBakK0an8lJ3HmXVRwN?= =?iso-8859-1?Q?5iEZuKsARSMwJCwfZkNYgRng6BhXeHtnROyPuiGLyummDUXpN2wRbFfifL?= =?iso-8859-1?Q?6NFom4bGIxXaNIDTjYRy+XbzVdXRb6nJ2/E1egrz1Pm1UveJFb+2?= X-Exchange-RoutingPolicyChecked: VmOxERQA13RpPs3e29UyVWxH7E8TggaT8p8qxQ97JqAmlu7IzgpwgkGIPVxtd1S1KdCAnyuCECu8HU+Dg6eyeKBPU7eIKp1hLfEeszEdqEnGY8cY/BnJ3Uh6bDrnhT0j74PD0P64elwqEcnIqfyyaKAp0A1r4tbeu1mwloxmbpV/UOEWXC2y+iCEL7u/fCVczc90RoWkLTKvgCCisDaTzr3/mlLFaOf5bFo0pQwYpze/wbKg72n/58/tDsXjtJ61GHAeSbcVULy7m5VDr84v+F+XppLs1Tyw8CPf7+vHJaZflSrsH+gR4epfvLzVHg/JjHZ+FGTT2Hzjj//lDSpphw== X-MS-Exchange-CrossTenant-Network-Message-Id: d4a18920-fd7b-4d2f-d140-08df4f20df03 X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4684.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 20:31:11.0781 (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: B4+Vez0WgNs5Yg44iWZiht6tzTJC9T2VdJOQA2KiqJ4bKdJwVkcDeQ5RbiKVpbZOCbjzhx7BLUf2ACBWCyS9rljD3BuapzWE+Mx5pIQu/MDbA2Ja9HUE3cRM+j0M+B1L X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8436 X-OriginatorOrg: intel.com On Tue, Nov 24, 2026 at 01:12:09PM -0800, Matthew Brost wrote: >On Sun, Nov 15, 2026 at 04:41:47PM -0800, Niranjana Vishwanathapura wrote: >> On Fri, Jul 10, 2026 at 07:56:17PM -0700, Matthew Brost wrote: >> > A defrag move with IOVA enabled only DMA-maps the changed (non-borrowed) >> > pages of the new tt, packed contiguously into the front of its IOVA >> > reservation (xe_tt_map_iova_copy()). The GPU copy therefore has an >> > asymmetric geometry: the source is read from the old tt at its natural >> > page offsets (via the old tt's full IOVA), while the destination only >> > exposes the changed pages, packed. >> > >> > Teach __xe_migrate_copy() about this packed-destination mode: >> > >> > - Add a @dst_packed_pages argument. When non-zero the destination tt >> > cursor walks just that many packed pages and the source (not the >> > destination) drives the chunk size, so the smaller packed prefix never >> > clamps the source walk. >> > >> > - Size the destination PTE update for each chunk from the changed-page >> > count (xe_migrate_count_changed_pages()) rather than the full chunk, >> > and skip the destination PTEs entirely for an all-borrowed chunk. >> > >> > - Extend emit_copy_chunks() with a @pack_dst flag so each emitted run is >> > blitted from its natural source offset into a running packed >> > destination offset that only advances for changed runs. The >> > all-borrowed skip leaves the packed destination cursor untouched. >> > >> > Expose this via xe_migrate_copy_defrag_iova(). It is only valid when the >> > BO needs no CCS pass, since the separate CCS pass migrates aux state for >> > all pages and would require the full destination mapping. The existing >> > xe_migrate_copy_defrag() (full destination mapping) remains the path for >> > CCS BOs and the non-IOVA fallback. >> > >> > No users yet; xe_bo_move() is wired to this path in a later patch. >> > >> > Cc: Carlos Santa >> > Cc: Ryan Neph >> > Cc: Christian Koenig >> > Cc: Huang Rui >> > Cc: Matthew Auld >> > Cc: Maarten Lankhorst >> > Cc: Maxime Ripard >> > Cc: Thomas Zimmermann >> > Cc: David Airlie >> > Cc: Simona Vetter >> > Cc: dri-devel@lists.freedesktop.org >> > Cc: linux-kernel@vger.kernel.org >> > Cc: Thomas Hellström >> > Assisted-by: GitHub_Copilot:claude-opus-4.8 >> > Signed-off-by: Matthew Brost >> > --- >> > drivers/gpu/drm/xe/xe_migrate.c | 307 ++++++++++++++++++++++++++++++-- >> > drivers/gpu/drm/xe/xe_migrate.h | 8 + >> > 2 files changed, 296 insertions(+), 19 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c >> > index 666c715a9067..e1dc2fb5c5cb 100644 >> > --- a/drivers/gpu/drm/xe/xe_migrate.c >> > +++ b/drivers/gpu/drm/xe/xe_migrate.c >> > @@ -811,6 +811,64 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, >> > emit_xy_fast_copy(gt, bb, src_ofs, dst_ofs, size, pitch); >> > } >> > >> > +/* >> > + * xe_migrate_count_changed_pages() - Count non-borrowed pages in a defrag chunk. >> > + * @src_tt: Source (old) tt providing the page pointers. >> > + * @dst_tt: Destination (new) tt providing the page pointers. >> > + * @start_page: Page offset of this L0 chunk within the tt page arrays. >> > + * @npages: Number of pages in the L0 chunk. >> > + * >> > + * A defragmentation move may harvest already beneficial-order chunks from the >> > + * old tt, so the new tt references (borrows) some of the same physical pages. >> > + * Count the pages that actually differ (src page != dst page) within the chunk. >> > + * >> > + * Return: The number of non-borrowed (changed) pages. >> > + */ >> > +static u32 xe_migrate_count_changed_pages(struct ttm_tt *src_tt, >> > + struct ttm_tt *dst_tt, >> > + pgoff_t start_page, u32 npages) >> > +{ >> > + u32 i, nchg = 0; >> > + >> > + for (i = 0; i < npages; i++) >> > + if (src_tt->pages[start_page + i] != >> > + dst_tt->pages[start_page + i]) >> > + nchg++; >> > + >> > + return nchg; >> > +} >> > + >> > +/* >> > + * xe_migrate_leading_borrowed_pages() - Count the run of borrowed pages at the >> > + * head of the remaining copy. >> > + * @src_tt: Source (old) tt providing the page pointers. >> > + * @dst_tt: Destination (new) tt providing the page pointers. >> > + * @start_page: Page offset of the next page to copy within the tt page arrays. >> > + * @max_pages: Pages left to copy. >> > + * >> > + * A defragmentation move borrows the already beneficial-order chunks from the >> > + * old tt, so the new tt references (borrows) the same physical pages for the >> > + * unchanged majority of a large object. Those pages alias on both the source >> > + * and destination GPU mappings and need no copy. Count how many consecutive >> > + * pages starting at @start_page are borrowed so the caller can advance past the >> > + * whole run at once instead of rediscovering it one L0 chunk at a time. >> > + * >> > + * Return: The number of leading borrowed (src page == dst page) pages, capped >> > + * at @max_pages. >> > + */ >> > +static u32 xe_migrate_leading_borrowed_pages(struct ttm_tt *src_tt, >> > + struct ttm_tt *dst_tt, >> > + pgoff_t start_page, u32 max_pages) >> > +{ >> > + u32 n = 0; >> > + >> > + while (n < max_pages && >> > + src_tt->pages[start_page + n] == dst_tt->pages[start_page + n]) >> > + n++; >> > + >> > + return n; >> > +} >> > + >> > /* >> > * emit_copy_chunks() - Emit the data blits for one defrag L0 chunk, skipping >> > * borrowed pages. >> > @@ -822,6 +880,9 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, >> > * @src_tt: Source (old) tt providing the page pointers. >> > * @dst_tt: Destination (new) tt providing the page pointers. >> > * @start_page: Page offset of this L0 chunk within the tt page arrays. >> > + * @pack_dst: If true the destination only maps the changed pages packed >> > + * contiguously, so the destination offset advances by changed-page >> > + * runs instead of tracking the source page index. >> > * >> > * A defragmentation move may harvest already beneficial-order chunks from the >> > * old tt, so the new tt references (borrows) some of the same physical pages. >> > @@ -830,16 +891,21 @@ static void emit_copy(struct xe_gt *gt, struct xe_bb *bb, >> > * only blit runs of pages that actually differ (src page != dst page), >> > * coalescing contiguous to-copy pages into a single blit. >> > * >> > + * When @pack_dst is set the source pages are read from their natural offsets >> > + * (@src_L0_ofs + page index) while the destination pages were packed into a >> > + * contiguous prefix, so the destination offset is a running counter that only >> > + * advances for emitted (changed) runs. >> > + * >> > * Return: The number of blits emitted (or that would be emitted when @bb is >> > * NULL). >> > */ >> > static u32 emit_copy_chunks(struct xe_gt *gt, struct xe_bb *bb, >> > u64 src_L0_ofs, u64 dst_L0_ofs, u32 src_L0, >> > struct ttm_tt *src_tt, struct ttm_tt *dst_tt, >> > - pgoff_t start_page) >> > + pgoff_t start_page, bool pack_dst) >> > { >> > u32 npages = src_L0 >> PAGE_SHIFT; >> > - u32 i = 0, nblits = 0; >> > + u32 i = 0, pack = 0, nblits = 0; >> > >> > while (i < npages) { >> > u32 run = 0; >> > @@ -859,9 +925,71 @@ static u32 emit_copy_chunks(struct xe_gt *gt, struct xe_bb *bb, >> > >> > if (bb) >> > emit_copy(gt, bb, src_L0_ofs + (u64)i * PAGE_SIZE, >> > - dst_L0_ofs + (u64)i * PAGE_SIZE, >> > + dst_L0_ofs + >> > + (u64)(pack_dst ? pack : i) * PAGE_SIZE, >> > run * PAGE_SIZE, XE_PAGE_SIZE); >> > nblits++; >> > + pack += run; >> > + i += run; >> > + } >> > + >> > + return nblits; >> > +} >> > + >> > +/* >> > + * emit_ccs_copy_chunks() - Emit the indirect CCS aux copies for one packed >> > + * defrag L0 chunk, skipping borrowed pages. >> > + * @gt: The GT. >> > + * @bb: The batch buffer to emit into, or NULL to only count the copies needed. >> > + * @src_L0_ofs: GPU offset of the source pages mapped (comp PAT) for this chunk. >> > + * @dst_L0_ofs: GPU offset of the destination pages mapped (comp PAT) for this >> > + * chunk (the packed changed-page prefix). >> > + * @src_L0: Byte size of the L0 chunk (page aligned). >> > + * @src_tt: Source (old) tt providing the page pointers. >> > + * @dst_tt: Destination (new) tt providing the page pointers. >> > + * @start_page: Page offset of this L0 chunk within the tt page arrays. >> > + * >> > + * Companion to emit_copy_chunks() for the packed defrag CCS pass. The flat-CCS >> > + * aux state is migrated indirectly through the data-page mappings, so it >> > + * follows the physical page regardless of the (packed) GPU VA layout. Borrowed >> > + * pages alias the same physical page on both sides, so their aux is already >> > + * identical and is skipped; only the changed runs are copied, from the source >> > + * at its natural offset to the destination at its packed offset. >> > + * >> > + * Return: The number of CCS copies emitted (or that would be emitted when @bb >> > + * is NULL). >> > + */ >> > +static u32 emit_ccs_copy_chunks(struct xe_gt *gt, struct xe_bb *bb, >> > + u64 src_L0_ofs, u64 dst_L0_ofs, u32 src_L0, >> > + struct ttm_tt *src_tt, struct ttm_tt *dst_tt, >> > + pgoff_t start_page) >> > +{ >> > + u32 npages = src_L0 >> PAGE_SHIFT; >> > + u32 i = 0, pack = 0, nblits = 0; >> > + >> > + while (i < npages) { >> > + u32 run = 0; >> > + >> > + /* Skip a run of borrowed pages (src and dst alias). */ >> > + if (src_tt->pages[start_page + i] == >> > + dst_tt->pages[start_page + i]) { >> > + i++; >> > + continue; >> > + } >> > + >> > + /* Coalesce a run of pages whose aux must be migrated. */ >> > + while (i + run < npages && >> > + src_tt->pages[start_page + i + run] != >> > + dst_tt->pages[start_page + i + run]) >> > + run++; >> > + >> > + if (bb) >> > + emit_copy_ccs(gt, bb, >> > + dst_L0_ofs + (u64)pack * PAGE_SIZE, true, >> > + src_L0_ofs + (u64)i * PAGE_SIZE, true, >> > + run * PAGE_SIZE); >> > + nblits++; >> > + pack += run; >> > i += run; >> > } >> > >> > @@ -949,6 +1077,7 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > struct ttm_resource *src, >> > struct ttm_resource *dst, >> > struct ttm_tt *src_tt, >> > + pgoff_t dst_packed_pages, >> > struct xe_migrate_copy_flags flags) >> > { >> > struct xe_gt *gt = m->tile->primary_gt; >> > @@ -981,6 +1110,23 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > */ >> > struct ttm_tt *dst_tt = dst_bo->ttm.ttm; >> > bool skip_borrowed = flags.defrag_copy && src_tt && dst_tt; >> > + /* >> > + * Defrag-IOVA copy: the destination tt only maps the changed >> > + * (non-borrowed) pages, packed contiguously into the first >> > + * @dst_packed_pages pages of its IOVA. The source is read from the old >> > + * tt at natural offsets and each changed run is blitted into the packed >> > + * destination prefix. >> > + */ >> > + bool pack_dst = dst_packed_pages != 0; >> > + /* >> > + * Packed defrag CCS pass: migrate the flat-CCS aux state of the changed >> > + * pages only, from the source at its natural offset to the destination >> > + * packed prefix. Borrowed pages share the physical page (and thus its >> > + * aux) on both sides, so they are skipped exactly like the data pass. >> > + */ >> > + bool ccs_pack = flags.defrag_ccs && pack_dst && src_tt && dst_tt; >> > + /* Per-run, borrowed-skipping defrag emission (data or packed CCS). */ >> > + bool defrag_runs = skip_borrowed || ccs_pack; >> > >> > /* >> > * For decompression operation, always use the compression PAT index. >> > @@ -1009,7 +1155,9 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > else >> > xe_res_first(src, 0, size, &src_it); >> > if (!dst_is_vram) >> > - xe_res_first_tt(dst_bo->ttm.ttm, 0, size, &dst_it); >> > + xe_res_first_tt(dst_bo->ttm.ttm, 0, >> > + pack_dst ? (u64)dst_packed_pages << PAGE_SHIFT : >> > + size, &dst_it); >> > else >> > xe_res_first(dst, 0, size, &dst_it); >> > >> > @@ -1030,29 +1178,86 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > u32 pte_flags; >> > pgoff_t start_page = (xe_bo_size(src_bo) - size) >> PAGE_SHIFT; >> > u32 ndata_blits = 1; >> > + u32 nchg = 0; >> > + u64 dst_size; >> > >> > bool usm = xe->info.has_usm; >> > u32 avail_pts = max_mem_transfer_per_pass(xe) / LEVEL0_PAGE_TABLE_ENCODE_SIZE; >> > >> > + /* >> > + * Defrag fast-forward: the new (destination) tt borrows the >> > + * unchanged beneficial-order chunks from the old tt, so for a >> > + * large object the bulk of the copy is borrowed pages that alias >> > + * the same memory on both sides. Skip the entire leading >> > + * borrowed run in a single cursor stride rather than discovering >> > + * it one (8 MB) L0 chunk at a time - each such pass would >> > + * otherwise pay xe_migrate_res_sizes() + pte_update_size() + a >> > + * full chunk walk only to copy nothing. The non-vram tt cursors >> > + * are normally advanced by emit_pte(); replicate that with >> > + * xe_res_next(). In pack_dst mode the destination only maps the >> > + * changed pages, so its cursor must not advance for borrowed >> > + * pages. >> > + */ >> > + if (defrag_runs) { >> > + u32 brun = xe_migrate_leading_borrowed_pages(src_tt, >> > + dst_tt, >> > + start_page, >> > + size >> PAGE_SHIFT); >> > + >> > + if (brun) { >> > + u64 brun_bytes = (u64)brun << PAGE_SHIFT; >> > + >> > + xe_res_next(&src_it, brun_bytes); >> > + if (!pack_dst) >> > + xe_res_next(&dst_it, brun_bytes); >> > + size -= brun_bytes; >> > + continue; >> > + } >> > + } >> > + >> > src_L0 = xe_migrate_res_sizes(m, &src_it); >> > dst_L0 = xe_migrate_res_sizes(m, &dst_it); >> > >> > drm_dbg(&xe->drm, "Pass %u, sizes: %llu & %llu\n", >> > pass++, src_L0, dst_L0); >> > >> > - src_L0 = min(src_L0, dst_L0); >> > + /* >> > + * In pack_dst mode the destination is the (smaller) packed >> > + * prefix, so it must not clamp the source chunk size; the >> > + * source drives the walk and the destination is sized >> > + * independently from the changed-page count below. >> > + */ >> > + if (!pack_dst) >> > + src_L0 = min(src_L0, dst_L0); >> > >> > pte_flags = src_is_vram ? PTE_UPDATE_FLAG_IS_VRAM : 0; >> > pte_flags |= use_comp_pat ? PTE_UPDATE_FLAG_IS_COMP_PTE : 0; >> > batch_size += pte_update_size(m, pte_flags, src, &src_it, &src_L0, >> > &src_L0_ofs, &src_L0_pt, 0, 0, >> > avail_pts); >> > + /* >> > + * The source chunk size may have been clamped above, so derive >> > + * the packed destination size from the changed-page count of >> > + * the final chunk. >> > + */ >> > + if (pack_dst) { >> > + nchg = xe_migrate_count_changed_pages(src_tt, dst_tt, >> > + start_page, >> > + src_L0 >> PAGE_SHIFT); >> > + dst_size = (u64)nchg << PAGE_SHIFT; >> > + } else { >> > + dst_size = src_L0; >> > + } >> > if (flags.copy_only_ccs) { >> > dst_L0_ofs = src_L0_ofs; >> > + } else if (pack_dst && !nchg) { >> > + /* All borrowed: no destination PTEs for this chunk. */ >> > + dst_L0_ofs = 0; >> > + dst_L0_pt = 0; >> > } else { >> > pte_flags = dst_is_vram ? PTE_UPDATE_FLAG_IS_VRAM : 0; >> > batch_size += pte_update_size(m, pte_flags, dst, >> > - &dst_it, &src_L0, >> > + &dst_it, &dst_size, >> > &dst_L0_ofs, &dst_L0_pt, >> > 0, avail_pts, avail_pts); >> > } >> > @@ -1072,26 +1277,31 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > * is split into one command per run of non-borrowed pages, so >> > * size for the number of runs actually needed. >> > */ >> > - if (skip_borrowed) >> > + if (defrag_runs) >> > ndata_blits = emit_copy_chunks(gt, NULL, 0, 0, src_L0, >> > - src_tt, dst_tt, start_page); >> > + src_tt, dst_tt, start_page, >> > + pack_dst); >> > >> > /* >> > * If every page in this chunk was borrowed there is nothing to >> > * copy: don't build a batch or issue any GPU commands, just >> > * advance the cursors past the chunk. The non-vram tt cursors >> > - * would otherwise be advanced by emit_pte(). >> > + * would otherwise be advanced by emit_pte(). In pack_dst mode >> > + * the destination consumed no packed pages, so leave its cursor >> > + * untouched. >> > */ >> > - if (skip_borrowed && !ndata_blits) { >> > + if (defrag_runs && !ndata_blits) { >> > xe_res_next(&src_it, src_L0); >> > - xe_res_next(&dst_it, src_L0); >> > + if (!pack_dst) >> > + xe_res_next(&dst_it, src_L0); >> > size -= src_L0; >> > continue; >> > } >> > >> > batch_size += ((flags.copy_only_ccs || flags.defrag_ccs) ? 0 : >> > ndata_blits * emit_copy_cmd_len(xe)) + >> > - ((needs_ccs_emit ? EMIT_COPY_CCS_DW : 0)); >> > + (ccs_pack ? ndata_blits * EMIT_COPY_CCS_DW : >> > + (needs_ccs_emit ? EMIT_COPY_CCS_DW : 0)); >> > >> > bb = xe_bb_new(gt, batch_size, usm); >> > if (IS_ERR(bb)) { >> > @@ -1111,7 +1321,7 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > else if (!flags.copy_only_ccs) >> > emit_pte(m, bb, dst_L0_pt, dst_is_vram, >> > copy_system_ccs || flags.defrag_ccs, >> > - &dst_it, src_L0, dst); >> > + &dst_it, dst_size, dst); >> > >> > if (copy_system_ccs) >> > emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src); >> > @@ -1121,16 +1331,22 @@ static struct dma_fence *__xe_migrate_copy(struct xe_migrate *m, >> > >> > if (skip_borrowed) >> > emit_copy_chunks(gt, bb, src_L0_ofs, dst_L0_ofs, src_L0, >> > - src_tt, dst_tt, start_page); >> > + src_tt, dst_tt, start_page, pack_dst); >> > else if (!flags.copy_only_ccs && !flags.defrag_ccs) >> > emit_copy(gt, bb, src_L0_ofs, dst_L0_ofs, src_L0, XE_PAGE_SIZE); >> > >> > - if (needs_ccs_emit) >> > + if (ccs_pack) { >> > + if (emit_ccs_copy_chunks(gt, bb, src_L0_ofs, dst_L0_ofs, >> > + src_L0, src_tt, dst_tt, >> > + start_page)) >> > + flush_flags = MI_FLUSH_DW_CCS; >> > + } else if (needs_ccs_emit) { >> > flush_flags = xe_migrate_ccs_copy(m, bb, src_L0_ofs, >> > IS_DGFX(xe) ? src_is_vram : src_is_pltt, >> > dst_L0_ofs, >> > IS_DGFX(xe) ? dst_is_vram : dst_is_pltt, >> > src_L0, ccs_ofs, copy_ccs); >> >> Assisted-by: LLM >> >> There is a sashiko reported issue here about ccs_ofs being used uninitialized. >> Though probably we never run into that case, probably add an assert here which ensures that >> ccs_ofs never used uninitialized. >> > >How would we assert that? LLM suggests initializing ccs_ofs to poison value (say U64_MAX) and in xe_migrate_ccs_copy(), assert as below (in copy_ccs is true case). if (!src_is_indirect) { xe_gt_assert(gt, ccs_ofs != U64_MAX); src_ofs = ccs_ofs; } else if (!dst_is_indirect) { xe_gt_assert(gt, ccs_ofs != U64_MAX); dst_ofs = ccs_ofs; } I am not sure if it makes the sashiko happy though. As we shouldn't be running into this case, I am fine whether or not we add this assert. Niranjana > >> > + } >> > >> > job = xe_bb_create_migration_job(m->q, bb, >> > xe_migrate_batch_base(m, usm), >> > @@ -1218,7 +1434,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m, >> > struct ttm_resource *dst, >> > bool copy_only_ccs) >> > { >> > - return __xe_migrate_copy(m, src_bo, dst_bo, src, dst, NULL, >> > + return __xe_migrate_copy(m, src_bo, dst_bo, src, dst, NULL, 0, >> > (struct xe_migrate_copy_flags) { >> > .copy_only_ccs = copy_only_ccs, >> > }); >> > @@ -1267,7 +1483,7 @@ struct dma_fence *xe_migrate_copy_defrag(struct xe_migrate *m, >> > bool need_ccs) >> > { >> > struct dma_fence *fence2, *fence = >> > - __xe_migrate_copy(m, bo, bo, src, dst, src_tt, >> > + __xe_migrate_copy(m, bo, bo, src, dst, src_tt, 0, >> > (struct xe_migrate_copy_flags) { >> > .defrag_copy = true, >> > }); >> > @@ -1275,7 +1491,7 @@ struct dma_fence *xe_migrate_copy_defrag(struct xe_migrate *m, >> > if (IS_ERR(fence) || !need_ccs) >> > return fence; >> > >> > - fence2 = __xe_migrate_copy(m, bo, bo, src, dst, src_tt, >> > + fence2 = __xe_migrate_copy(m, bo, bo, src, dst, src_tt, 0, >> > (struct xe_migrate_copy_flags) { >> > .defrag_ccs = true, >> > }); >> > @@ -1286,6 +1502,59 @@ struct dma_fence *xe_migrate_copy_defrag(struct xe_migrate *m, >> > return fence2; >> > } >> > >> > +/** >> > + * xe_migrate_copy_defrag_iova() - Copy a defrag move into a packed IOVA dst. >> > + * @m: The migration context. >> > + * @bo: The buffer object being defragmented. >> > + * @src: The source (old) TTM resource. >> > + * @dst: The destination (new) TTM resource. >> > + * @src_tt: The stashed source (old) tt providing the page pointers, fully >> > + * IOVA-mapped at natural offsets. >> > + * @dst_packed_pages: Number of changed pages packed into the destination tt's >> > + * IOVA prefix by xe_tt_map_iova_copy(). >> > + * @need_ccs: Whether the BO has flat-CCS aux state that must be migrated too. >> > + * >> > + * Defrag copy variant for IOVA-mapped BOs where the destination only maps the >> > + * changed (non-borrowed) pages, packed contiguously into the first >> > + * @dst_packed_pages of its IOVA. The source is read from the old tt at its >> > + * natural offsets and each changed run is blitted into the packed destination >> > + * prefix. When @need_ccs is set a second pass migrates the flat-CCS aux state >> > + * of the same changed pages indirectly through their (packed) data mappings; >> > + * borrowed pages share the physical page and its aux, so only the changed runs >> > + * are touched. >> > + * >> > + * Return: Pointer to a dma_fence representing the last copy batch, or an error >> > + * pointer on failure. >> > + */ >> > +struct dma_fence *xe_migrate_copy_defrag_iova(struct xe_migrate *m, >> > + struct xe_bo *bo, >> > + struct ttm_resource *src, >> > + struct ttm_resource *dst, >> > + struct ttm_tt *src_tt, >> > + pgoff_t dst_packed_pages, >> > + bool need_ccs) >> > +{ >> >> There is a sashiko reported issue which though is not a bug, it would >> be good to assert here that dst_packed_pages is non-zero here. >> > >Sure. > >Matt > >> Niranjana >> >> > + struct dma_fence *fence2, *fence = >> > + __xe_migrate_copy(m, bo, bo, src, dst, src_tt, dst_packed_pages, >> > + (struct xe_migrate_copy_flags) { >> > + .defrag_copy = true, >> > + }); >> > + >> > + if (IS_ERR(fence) || !need_ccs) >> > + return fence; >> > + >> > + fence2 = __xe_migrate_copy(m, bo, bo, src, dst, src_tt, >> > + dst_packed_pages, >> > + (struct xe_migrate_copy_flags) { >> > + .defrag_ccs = true, >> > + }); >> > + if (IS_ERR(fence2)) >> > + dma_fence_wait(fence, false); >> > + dma_fence_put(fence); >> > + >> > + return fence2; >> > +} >> > + >> > /** >> > * xe_migrate_resolve() - Resolve and decompress a buffer object if required. >> > * @m: The migrate context >> > @@ -1301,7 +1570,7 @@ struct dma_fence *xe_migrate_resolve(struct xe_migrate *m, >> > struct xe_bo *bo, >> > struct ttm_resource *res) >> > { >> > - return __xe_migrate_copy(m, bo, bo, res, res, NULL, >> > + return __xe_migrate_copy(m, bo, bo, res, res, NULL, 0, >> > (struct xe_migrate_copy_flags) { >> > .is_vram_resolve = true, >> > }); >> > diff --git a/drivers/gpu/drm/xe/xe_migrate.h b/drivers/gpu/drm/xe/xe_migrate.h >> > index 4094ea1c19c1..da066cdf01bf 100644 >> > --- a/drivers/gpu/drm/xe/xe_migrate.h >> > +++ b/drivers/gpu/drm/xe/xe_migrate.h >> > @@ -141,6 +141,14 @@ struct dma_fence *xe_migrate_copy_defrag(struct xe_migrate *m, >> > struct ttm_tt *src_tt, >> > bool need_ccs); >> > >> > +struct dma_fence *xe_migrate_copy_defrag_iova(struct xe_migrate *m, >> > + struct xe_bo *bo, >> > + struct ttm_resource *src, >> > + struct ttm_resource *dst, >> > + struct ttm_tt *src_tt, >> > + pgoff_t dst_packed_pages, >> > + bool need_ccs); >> > + >> > struct dma_fence *xe_migrate_resolve(struct xe_migrate *m, >> > struct xe_bo *bo, >> > struct ttm_resource *res); >> > -- >> > 2.34.1 >> >