From patchwork Wed Jul 19 02:22:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 9850351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A46C0602A7 for ; Wed, 19 Jul 2017 02:22:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DF1F27F2B for ; Wed, 19 Jul 2017 02:22:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82A3928628; Wed, 19 Jul 2017 02:22:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 347EC27F2B for ; Wed, 19 Jul 2017 02:22:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C4166E3F9; Wed, 19 Jul 2017 02:22:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0040.outbound.protection.outlook.com [104.47.37.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id E72906E3F7; Wed, 19 Jul 2017 02:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=emzPoQ0VtL4VKXvMWsS1ONDigFmiTniKnAI5Dxt8d7k=; b=fERWthgTVT3IxIwCnz2qLrsYKmSG7fTO219c6Z+QXpS6IR4dHW/sYekVDuTugEO49L4PbxLvWHcrJW0pupZ3xYIM44VTRDpHn/XpagRhXftM7kDsiFEE+nBfThTk2yHWs4vs5x48HtzGoRvzF8oeYRRK/633aMfNnu06IOTt7ss= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from Harpoon.amd.com (165.204.55.251) by DM5PR1201MB0235.namprd12.prod.outlook.com (10.174.107.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Wed, 19 Jul 2017 02:22:12 +0000 From: Felix Kuehling To: amd-gfx@lists.freedesktop.org Subject: [PATCH 5/6] drm/amdgpu: handle foreign BOs in the VM mapping Date: Tue, 18 Jul 2017 22:22:12 -0400 Message-Id: <1500430934-27098-6-git-send-email-Felix.Kuehling@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500430934-27098-1-git-send-email-Felix.Kuehling@amd.com> References: <1500430934-27098-1-git-send-email-Felix.Kuehling@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR03CA0008.namprd03.prod.outlook.com (10.168.162.18) To DM5PR1201MB0235.namprd12.prod.outlook.com (10.174.107.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8641a53-fc56-42d6-5d4b-08d4ce4cf753 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR1201MB0235; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 3:XZhC2h4dwujIaCcKHlI5VvcrTndHm8s7k6W7Xsl7w3ovTASj3vEM9vI6E2rTiuxGFziAn+szE0HeZSTyzsS2FnwaNPUUIp7Ti1SCJKNjj4ELUOVltvcEjbnSRsCj7HIzS1COwZuryDaq7m4wqLCGQxsq0T06kqJwmY7JGJ/LsgvhhxZ3nf6wdkrFh0Cgkl9u5ZXzy+eZdNFe0sZkW8VK5DJ+dYCkKKj9ckn5n0UINUclJv8ucDfNk7kF+WndQxsGGSCmpg03APGPfNDNTKr258Yh1xxS4h7Hqv6HCmyKUbpSXa38wcHTVpp04zRfEuPRQjIunSzsG0jjV6ov/AM+hby/VP/ZU1Vr7Z7zaTXw4pDy564SABUvnTZN9xYPSRTRjnlYZScngYlwbcuV/PRy3vPMbiUMCTNBT5YCvKp8Ta7AXQyOTmc0oD4vnwVxEc7C5qtTKoAaTVxT54GwS4JHfyuFozhtWEzAgX4OATAMCR2CppeWT6G8zCTZx4ep/cHg2tb91TlSajpntajwsbCZQ0fZka0RFZqbahptAVMgSN2/0j+k7HH+sadVaEEDep0rDWpwIy5WLXNSAYOtUzwmzd7UT5NnZkExLnkmD9T4NEDa7z4aOg+5upHdpbG3PveiCy6IeTOtu8Jg8tkkuVcDJLNjCIam3iwGQELEZN93i1Q1+X0P2wlcz0UJDNJ16p47w+Ln5rm7yo6XU2df6ls6YpCMSNCclo75xZhA/O97LtjdecYq640TtJvALtmFuAUkapmG1x145EHt8lJy7JBrQQ== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0235: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 25:C+DxeTFPeJjCyraLzq/LmwofchDjzoSUHKDDlzp1sEOBDMqEs9/qcALLd0hZS4pE/HONenqeTUVfGJYPPH5pEFrQ5uLWlDy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PGoze+GXJ48eTIOOen0RObL2a3XepxSlPDxc/za99K+F8p+RvJU6PC9q3gmuXA7y7pY41z4l9flxztBW8t2UFFyC+sgWwH381D1bD8E63Gu0vZL8FbkLShy/TGxPbJuNjw3bijzLdL5Z5pOly0qHL6GNWlWmPXreZvPK12VKCkZYegFtG9EEZ8YBC/HRu21DX/zDEZpuKR8bqsjjt3+DFO8Ud6N338IlqCtB4UBU1l/NGH9ssSGeSEyfA/Vs0HN9NUtzmCCXwqyR4FhmtiUCY7ui0rznn4o3YO2DAW1Iq8A9HlpU07EfEhtfm+HllgyzGDZ4csEGAOUzzJKUjbqlnoe5NByPg+IUXq2Fh8B0j+nHVQo/J1SZjEhFTfIgm87oeX+klbUe0EsN7OcXUAIZRTMKFbGrFUlSlRSmYYjl7FhQ997rS4MGegTudzXukAGGi1XS0VValPpGZxgd24SVGxfmJmLxc= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 20:QEhGCbhqka1/XJg+sPDBFRCclAPAm1CYHsP0iSvLMn6th6hF/hg/fHVE2ls/tgc8WKOPXME9toWCENV3dCjKXO5qgFFLpo60oNnI1VttX/TAcoZkCZ2K+3LwZODExLT5hO/Hur9DX0jqSMbT2VXPM8qqzUQZx9wNzyY2dI61t7rv/X1c6LFkvBOwouFCYDQ82B5gqZtDLpi2938aIJflxtsad1n7fWPzol/FPXNxLochxvPOA/2+JuWFU7DU/VxJaZRwPk5iBAFqOPBNMBqS6LiTAdHmFSGk6Gm+5CBV3MK8PdrCylNAAKLMZMbsHImWfe2GazmeGiNPGINh3ul1SJuUpsD8Enpm//HBuMYkBS/AshBSJt4GbOOQNei+A/rBjczO53zJoIlmTouxJYvY5911kG4Ac3gx4bjVtyN1quDNaLELzG24pEUTHUlI8zf6owzjtloGDU18AtckyNrAzB0F8UdrQV8JnRc22nP8nTF3ZIVLKEG2j17P0qnRCbmt X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR1201MB0235; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR1201MB0235; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0235; 4:+bRgahHlvIzzl2i6M0o7RAs9rnXDo3Sm95haBv5R?= =?us-ascii?Q?VFeRADIiCEHdZHwCL8neDQpBtGEIsnMd1X8O/uq2t1CkpHIyfnBfmE0uLOPH?= =?us-ascii?Q?oPwGE9oiz6xP7nOcaOKKMdF0X0NTQV8R97yy4jrnEmMqVqtyujOHNz+SAu/b?= =?us-ascii?Q?lcrZwxmTf22yJQNajqq6GH/h1UDYTKwPa2res0UAfiN0Gx3OsmC8IxD1Fskz?= =?us-ascii?Q?+VOrkoFCrYUPI2iEYMQI8WVWDkre0W/jAs0uAy64/9DlXpGj/kynBqj0ZOfO?= =?us-ascii?Q?7ZjBdJMIuoDM4Kzjxv1w1Uksid5s4MGwj7+CJW37uKmCVjoOegksDpP2cm36?= =?us-ascii?Q?rpj98B+jtDXPg6P0V2pXqo5mM8f8LMCB/h0C7A3PTj4dZCdWewtHlHGwVLgR?= =?us-ascii?Q?Fxk2ORAUdDzO2kdsL8/wd+fTvKQkPocmnzuJ6uh79Bf5Rcf8cVhakoOspl0X?= =?us-ascii?Q?JFHO7Z7xQoBNBmhpJJVwZtUAmJxc42KikHRL7rKeCGWkISYdpGqbhRZHP3D1?= =?us-ascii?Q?LKYlLaU05FVpKnovlMFh56TWXd7+KfeF5jlxWY1h2BXTRS9mGkbGd5H/tiM5?= =?us-ascii?Q?gipLzx8vFNq9KulhYr9G8EvIQSQY7UyUI6LA9KjVA+gthFEC4Nq7DwIkT7nl?= =?us-ascii?Q?NKiMZ8YASI4r7p8kkMP1zgjKiyo6r61i62tYcEe7GWFZMoRum+QwYTWueAzp?= =?us-ascii?Q?iievZNIZ5erQqm1GRCxwGrcIR2az8qnnbYKPNMWFcHkR2rZgZO+af6NkGOwZ?= =?us-ascii?Q?CX6wmcPtrN1/fVFHKRtvNuF0pOKjX4wyMBsRP4wXUzBj//v+k37VLN0rizYB?= =?us-ascii?Q?heuHtTxfmCz9P+z1l1f2jU73MGj9f60j4CpmVDJE5mxKwpTUGbBBClLNvduE?= =?us-ascii?Q?8jVdBDfBLBBSFx+FnM1cXsmqBNnHTk7XAlrtOou/Xj32thg2rKawY+qiNCC2?= =?us-ascii?Q?YyambwL1Oa0wtA7INJbuWTKV8QG2jCbq0aMgTDqcUXGWiTnKa00CW1canF+7?= =?us-ascii?Q?koyUnExh+K8eKGyvCNiN7iAr5UW6D7d+NTRdIwTxnemwKQ1mXAYY0V1R0jbl?= =?us-ascii?Q?H2EMPEL3YITL+WAshEc347FllEMLarSljTaKHNogjDFt795pcfdEHTWjK8AE?= =?us-ascii?Q?bxJxRY6QCEaeHZ/gI9nHMfvwYEhSdxOur+1+N77kiqG2w9OS0E6xy20Lqoan?= =?us-ascii?Q?yxuSqixJO3AJT7/yuXO7iJ82x0QOQgS46xVG7NRKSKmIFxnlIM7IDgT7BGPo?= =?us-ascii?Q?FAjR6996ghtv6gvjlZGlHhJTxs02LX4sqNweOhPs?= X-Forefront-PRVS: 0373D94D15 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39860400002)(39840400002)(39400400002)(39850400002)(39450400003)(25786009)(50226002)(48376002)(47776003)(66066001)(2361001)(42186005)(8676002)(81166006)(2906002)(4326008)(53936002)(50466002)(7350300001)(5660300001)(76176999)(50986999)(450100002)(53416004)(36756003)(2351001)(86362001)(38730400002)(305945005)(189998001)(72206003)(478600001)(6916009)(6486002)(6116002)(3846002)(2950100002)(7736002)(5003940100001)(110136004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0235; H:Harpoon.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0235; 23:bTCHXkzbo+tXBbmTwIJncQs+QjT2/R2J0owCnZl?= =?us-ascii?Q?YJJyX6dTdU/gXeGV8lFNsKyd+D4Yy2g1ob4aEHj+7wFro49CF9VqpasZ5esn?= =?us-ascii?Q?s01EmIPW+y9cUkjgOYJ2CK0ba7bRR9SR3GWfqV0If9hiXWknd8ij8aFj9fSn?= =?us-ascii?Q?WidbGQ/QD7VJ/70lboig5u4MXhDue3eqtxPy8Anyk1f+b0hsRZQoCmTwDd+Z?= =?us-ascii?Q?0PK7H2aDNf0zhN4o1xZpHvQSopU/kPRpumF9gnj0Ueh09q5xD7q8FhRIyWTk?= =?us-ascii?Q?aEmkCNtT6COOcLaUUhPZVDLfDKRurxUfTo7R/Vqxo1NMj9R/GHEbPjM646lZ?= =?us-ascii?Q?pXPhg1PL45gF3F1YWenw4oG/TyOQgxTLaWVbFtURC9oTCsEoddOUdlAimW5/?= =?us-ascii?Q?iocYKucGSs8IU3EO8yHfI0AXcNXet69qhtHnJzgYAlQwqoIonLqpA0xh1Ub/?= =?us-ascii?Q?ngL6cL9RfhEBw9HIr3JB7If9reRFkThKh6t8oSDmofMHI0/Ws44BAwqyd5v6?= =?us-ascii?Q?evxlUHaiv1fk8C0lq3YQgKuhrmSc20wGWLHyMS9Bj8rBJSiNw6fEPYzdcECe?= =?us-ascii?Q?ALdWx1n/tUdAPy7oqRtRils4dsazgO+qqDoHOCfvihWyKxx0g9Rr5WRUmyQm?= =?us-ascii?Q?+EDm7b6yK/9DemG1Yfc7mT41shFVDRnS1mlZYhCNc/pvBlWsRzUOMV9cFIp7?= =?us-ascii?Q?waFHdTzE5ZJ4B0cwtNlRVk2sqv78ldaUR2Fuco3xnshH/PacRGjl7UXOnp46?= =?us-ascii?Q?bAMLvh5AX6MVrG0JlMqGnRMuBeUL5bpMdiZrCSiQEWSqPbbXAUpsYGBiKypL?= =?us-ascii?Q?TjCHTZ3yJSlXfuWajtG6thNMfcz2S4199Mg0VfbwWsdJyBsBtPG7JLc3JT2S?= =?us-ascii?Q?l5O4mjCEE0YzwYyjIRgl1EuwhaV3IX69FvTkl2vXPlwFXhx/LnQVgGjCSa8R?= =?us-ascii?Q?5YWtVLRETesD/PVA5b5V9TiaRF8c09B4r578wO+dFFF7JwbcuC1tr/qcxM8U?= =?us-ascii?Q?GTPPDpS8KeO4oC8cd9RZhP3IZvRlMyWtwJGVDtV5UmqjK6/1dEwNCxISYgWw?= =?us-ascii?Q?U10QMvPLyT+z2jWE+73FujTypXljQqCcQa5mketxV9vCbSXVV+DawMost+un?= =?us-ascii?Q?g9TNrgy7783/2q2xT4XNe/aX2X1KSgEX1?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0235; 6:gviVG9vREdu13cfKLI9zBmjpja8dPFK1jl9eF6eB?= =?us-ascii?Q?0aW30/WLbktIR4bOruK8ynPfoE50l8oWl/+ejh6gAXiuUEUXWU1VcM1LjWJe?= =?us-ascii?Q?sLSx0u1xHb7lIxkXntI3uh4RHuMUuMlx/Jwv8Coi7TVQpVEfH/HTJtFXMK3B?= =?us-ascii?Q?3Qw08u+HRnN8LILGaVTcqD68HEQ1RTw+w6IyBo+PrMoZStQDydmS2LE4LsVZ?= =?us-ascii?Q?wFQzZN+PBqoL4X7c13E8ex1rIktefhHAtplmmZ2euOTaDXD6IV8TFyYsvOLS?= =?us-ascii?Q?7fkrp7cLUdQwwY2wcMJQsXGzlNT9pQxetDCh41aR/8PYEko0gM6PTot1sxDn?= =?us-ascii?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6gWFqhHTbuaG1C96Ydis01vLlFhq9t0Er6fRHN90fvPez8u7PWj8+EQmCOMXMpSlm2jc/7hjzOD4wcDsSnHYmkcphRT33fpq3xaBMC9aGLsW6Fy9JjzL4qhuNdxehRR/ncmrXoMib02xLUceiug2Rgr8pCyE1xQ3Dk3LWqTcZgHYwiOlK33xG93gHN6huiYVNkOUlwXXTHT3qUzCY6nBawKY09uTpivXzx+REg/qso2lo7E+1KYU= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 20:JEZJ5rW5KEOW3opT22vb0ni0PzhtxTua9FhRCL72mPcSg9D+ywCheLI2Wet5iauptEwZ1aUeDkDpENgzB38bPD+wCQLtL2Sm6lrRl7yKDib/Fl/LARDWGSWXFqjA9Xm+zsIDO2PcpTUes7BNDBXak3MxCNWtLbtoTl+IqVqkIvCiRO4692kjahdoY6mWUsOo3EVaNpptGOBHoKsQ76hn8Cd6Xtt95vdPzK+HuPRJEpCddXbWa8My5NuOUCiRYgmB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2017 02:22:12.4448 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0235 Cc: Amber Lin , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Amber Lin Set the system bit for foreign BO mappings and use the remote VRAM BAR address as the VRAM base offset. Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 55d1c7f..3ee8bac 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1594,6 +1594,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, dma_addr_t *pages_addr, struct amdgpu_vm *vm, struct amdgpu_bo_va_mapping *mapping, + uint64_t vram_base_offset, uint64_t flags, struct drm_mm_node *nodes, struct dma_fence **fence) @@ -1652,7 +1653,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, max_entries = min(max_entries, 16ull * 1024ull); addr = 0; } else if (flags & AMDGPU_PTE_VALID) { - addr += adev->vm_manager.vram_base_offset; + addr += vram_base_offset; } addr += pfn << PAGE_SHIFT; @@ -1697,6 +1698,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct ttm_mem_reg *mem; struct drm_mm_node *nodes; struct dma_fence *exclusive; + uint64_t vram_base_offset = adev->vm_manager.vram_base_offset; + struct amdgpu_device *bo_adev; int r; if (clear || !bo_va->bo) { @@ -1718,9 +1721,15 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, if (bo_va->bo) { flags = amdgpu_ttm_tt_pte_flags(adev, bo_va->bo->tbo.ttm, mem); + bo_adev = amdgpu_ttm_adev(bo_va->bo->tbo.bdev); gtt_flags = (amdgpu_ttm_is_bound(bo_va->bo->tbo.ttm) && - adev == amdgpu_ttm_adev(bo_va->bo->tbo.bdev)) ? + adev == bo_adev) ? flags : 0; + if (mem && mem->mem_type == TTM_PL_VRAM && + adev != bo_adev) { + flags |= AMDGPU_PTE_SYSTEM; + vram_base_offset = bo_adev->mc.aper_base; + } } else { flags = 0x0; gtt_flags = ~0x0; @@ -1734,8 +1743,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, list_for_each_entry(mapping, &bo_va->invalids, list) { r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, - mapping, flags, nodes, - &bo_va->last_pt_update); + mapping, vram_base_offset, flags, + nodes, &bo_va->last_pt_update); if (r) return r; }