From patchwork Thu Nov 2 14:29:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10038833 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 442F4603B5 for ; Thu, 2 Nov 2017 14:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34D83290C1 for ; Thu, 2 Nov 2017 14:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 293A5290CB; Thu, 2 Nov 2017 14:44:46 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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 1F60B290C6 for ; Thu, 2 Nov 2017 14:44:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6F596E92F; Thu, 2 Nov 2017 14:44:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E1466E92F for ; Thu, 2 Nov 2017 14:44:42 +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=QxCij3KzYI1sDTvoVk2LRI/wfazzgvgtWeGeapgBAn0=; b=hztD7ys6bw+xYzaTMuyqBbmkjDweJ9hyMwKeQUrgeADjNepYWEe0oZOXiH0SlrUQ+TvIIvadXReauRMQcuC7fe0AzZFkP6NEJXP3ilZ5HTRIiaTuoBGxBlY28xGFVOFnpT5wYBTI+JXFQRQIQ1jLz+cEpHahT9oo4HdL7cbJW8E= Received: from DM3PR12CA0046.namprd12.prod.outlook.com (10.161.151.14) by BN6PR12MB1442.namprd12.prod.outlook.com (10.172.24.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Thu, 2 Nov 2017 14:30:18 +0000 Received: from BY2NAM03FT013.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::201) by DM3PR12CA0046.outlook.office365.com (2603:10b6:0:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6 via Frontend Transport; Thu, 2 Nov 2017 14:30:18 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT013.mail.protection.outlook.com (10.152.84.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.197.9 via Frontend Transport; Thu, 2 Nov 2017 14:30:17 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 2 Nov 2017 09:30:17 -0500 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 2 Nov 2017 10:30:16 -0400 Received: from ubuntu-1604-test.amd.com (172.27.225.147) by SCYBEXDAG01.amd.com (10.34.11.11) with Microsoft SMTP Server id 14.3.361.1; Thu, 2 Nov 2017 22:30:03 +0800 From: Andrey Grodzovsky To: Subject: [PATCH libdrm] amdgpu: Fix wrappers for AMDGPU_VM IOCTL. Date: Thu, 2 Nov 2017 10:29:55 -0400 Message-ID: <1509632995-9775-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(428002)(199003)(189002)(54906003)(50466002)(97736004)(316002)(189998001)(450100002)(4326008)(36756003)(86362001)(48376002)(105586002)(50226002)(16586007)(5003940100001)(53936002)(81156014)(5660300001)(6916009)(6666003)(106466001)(8936002)(77096006)(101416001)(8676002)(305945005)(33646002)(81166006)(2906002)(47776003)(2351001)(53416004)(356003)(68736007)(72206003)(50986999)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1442; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT013; 1:5J4wRPsPplQ79SRjGkygX+2LDyOX4uQFi4WoKIV6tIuZlWxvjH/UFUdI0nUcXz90dKO7qAslAE1AMWrbb4RTDQWV3cnfbH3FrqZ1t0vNEZxkw7lgmwuGMFYyDJGetoBe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3da71744-debf-456c-7f57-08d521fe3d7f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR12MB1442; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 3:cVzDVsPiv7DIDuyRj4Nu1Iv5QEQctwzIPY1n2F6ohZfkbjQL84NrTgfVayDuqoNgdICreY3lmEG838RuE5L08Tr8XTviyhlbAnkMDWMQ+GpOuFC1qSPTNWbF6QtFWWZf6Kp8J/NAx9qILmsMvba8C+ML0Gq9rXLALi2lOBThBGVVkxpCAFhBfDK5Re0R33crEgtf5u7XYh6cLp7LuuI9/oQZre5GMw/h1dcm/L22SrQ7JDj8EVbUDqoHD310FBHtHtvVHd0Q2qTMJTZK4YyUdiYI4TIXEFULyxMFu8bXHrqdddWepCbDf4Akvib4pgP/2WkXHMa4b2CiJ0taEaIdoh3FnrYQsbutGJdZfbNsDOc=; 25:7hvoa7hKT5KpaKooSf3ceCvGbPU1N9dLwMU8Kvls2cek2+oy5VBdXTJn6SPVHCTa4kUHCOSudvtWLfG0IYDMy6dPki0bxokOfMmBAKQt2I9irCEhLfM5i7DSK6NrAz0oqMaN+3gfcNScln7kqW88hB0c8AHEh5h5yshQlNL5DB+vyJCV7VaiVOP8NNgd/0Gtm2F4AFcIHd2Zg/sjpiwYUu1y2oDhp3/sP7MnoIUVbBTWYowM35wti1iKTW7IkOB/Q01WMougwqXWh6BorDZnQzi+T4pTSjrF7kmV1Pyz9gOfRt3is8YXwfvX/BIipKzCF5wU5nC/FK6mG5X3he9qBg== X-MS-TrafficTypeDiagnostic: BN6PR12MB1442: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 31:aUFAR7SaE0uwOAr+6elkOMaS5y4v/h8R55Be/9y+5ubA1N7oO+qWTrSaJKFAUFP0JK8gWq44sDq6ITnFwMc5oJTmI6We8ycbpCo9mOTFIAl7t6r1hYw55nZFZcY5X7ji/HEBtWdtsN2lLlWr/v7jtgul8w5o/JWe5cVvFBi/pLDNoHOpAHS/dtvVeqXZ8fB9LeIT8gzfYRL/OrjT+Hk4lt8/pAGUVAVQmAChW9CS+IQ=; 20:PS29IWpDBBr+E+33XESkoZYoVkSY60Axzu/eEiRWKos1WDUKTER5SBBBQ25VAoC2s7xndoW+xsN/uCEU/6FtpZ783cud+Xv5yFEBFuTqj6hqBNNF2ZEX2Vyf90VNiEZ6xaTCtJDgtxdRsefXc2mF3HLDzUmAkl+27Y5BumcjxazlRMJJQr+p5Vi0W01EuFq14HyiIwmiS/bwiGVPI5pUynkEowCFPTytwOaaCToaUUqT/IxJn0LFYXSyfLvupBg8hL/XUu4obeuwLcolAQM73Xb1ZujR3z1uHmft1ALsR7iKaRve1OpjuTqfvYqX0CCdsPMoO6k2phjZwft6lFIdgYbq5IhuCRuAA1uNL4muZ1UDNvNXcHnj7Fg8PXWTSjMEeNeGIaVyoBAcOXaB3aVxr37YqKwFwJue7/aIYciy+YvW8h95R0169as8GDlZAg83DPz3piL9YO4SP3KVr/wq/cHxLvTT9VoMkdR3rAchjNbrxU3zdqlYTGSZrbPlY03E X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93003095)(3231020)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1442; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1442; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 4:2fjMRqPteMph/c5ck5mvpkaQoTfRx27QSKpbcjSA0Jx0wwyF4wmtyVt0bdgL2Ov4jYdNI7fMN7eOxjw7Fr+M6ABA8+Q6lE193IPTohzc9MRTOXIoqLsuUmgULRYAdb5A1esaPNHatyvx6I208+gmY2qPbOyJ/o0n+60FCufufom2qCb564yQZtDL5W0zTWzPmADHKSec+HyNn/Kw73GrqkqgOhqfi97MkxVX5+KDOi9FeVz5FvsUjhAFd57V2GOo2Dqcf/bckOsSp5uxL+vA8IQPWJd6X09XEViHSoSUk98bj7Xv/rfCb/2VYCuLlI3o X-Forefront-PRVS: 047999FF16 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1442; 23:txTfpA3CPgJmCTsH1WlKlAQEucldU/m3m0o0TIXUB?= =?us-ascii?Q?68zgL25KleTQlRyh72jzp6yEOjFPRM26MAghqB3g+Aafh93P7u8MQn5kUNqC?= =?us-ascii?Q?Nm6ZeGbZFnuORe8ETA3gZd7Inv0pdGTXyd+rqLBL/WTBm0vIRCRBpwNgOfwN?= =?us-ascii?Q?6DP9GIoGca08kRljbYKsRcN6ZJcvAVbO5He8kANSChMiR6m/Z2FaLge8djUv?= =?us-ascii?Q?3lqLxnJ1Hbn0ip2pqabOu18ReCQGJoDoG7rZkbLDCy52JDbgIlNJo16Y1l0b?= =?us-ascii?Q?hWVospvGwZiGyyVsp+IS2TaOjVemw81LsNe7mWKpKZvOEMYwXpZEbWvRGdoJ?= =?us-ascii?Q?Z/U6M9TqO41IZD3guw/3c9F7Hz0Qge3ROtYKqOsckXcPlSN9+pTEEynOCvZP?= =?us-ascii?Q?Tsc6qTzUT1wqyXLlZErib1hsiLuTu7WCACopGn3hXqoTjIl/i6LhXGeA907s?= =?us-ascii?Q?vlOp2HhyV/Vzal8cbe/RttN3G8fJyDoO4ZicgOq8WgicfW0m7p0gAVZZyBAh?= =?us-ascii?Q?nLKEBO7fWa7qUSW+yqVQrnoQyrBEWd02Dots37yErmkBO1IDCMB5c34IBgF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Lv2sIu4kXlStg+MdzHrgMhf9wjZIXJRUzkDf6hgyboTVpUPN3939aNiISc527jCxio7XcV0u0dkiY9cQZy0x8fvCwUwm0IOIRZADHFKWaKCsN3ivBLNnfgXKkPlDNU=; 24:FcfE9ed7NTECa5fTJvRCrg+FgK6vjzIJU20m6Ya0TEIzlV6RdxDiMOT9+L/Fg2vP7U3DMMJ/IuRhkJK8hBlOnsk+f+CJl2jnkxFVQpzKrgA=; 7:SmkheqjPCGV9ZvMvZgdoFMrt81drn54oejwfHkRr+YfEZXnwWeOOieEGkqP3I/HTPqFwKX7npZ0GbS5UHwp0fy6ECXZRFBBaqvnOjQBcabqqyI/gNd3sFSGuw638Moh+KdSKuLYElacWD6mEtzOPujngp/agdCkYc1yy+Ly1MEqdDw+iP1noyB3Z88G4LHdEhsGtozyYRniYemL3i8n/SSVMVQ+DhQWJNuFzENBcuvKsPH2RwwSbQhRX0Mdi4P5i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1442; 20:kIB5liv0xxjN6sL5ChGN73VT/fR0ijY8tav6WT4CwOujnYzTFjU+53V4qYQ0MSvpXYGu/mAHVY4LwZm2xoMMk2ebE8sZY3SzdE6bJuTk03bIX3wTglP9LiQHrbIlEyTyHa5R2ecL8tfmEcGRK078qYKpR9QALkPX+chRTyjBvoA088n6jEK+az5M5ebgU/czimGFvPdig/7S5JOFVZS312JA51BM2OSDZ00VeWqmzAbaOjDKdH4Ev7M/axhWCEh8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2017 14:30:17.8250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3da71744-debf-456c-7f57-08d521fe3d7f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1442 Cc: Marek.Olsak@amd.com, Christian.Koenig@amd.com, amd-gfx@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 Rmove amdgpu_context_handle from the interface and use amdgpu_device_handle instead. Uupdate VMID reservation test accordingly. Signed-off-by: Andrey Grodzovsky --- amdgpu/amdgpu.h | 4 ++-- amdgpu/amdgpu_vm.c | 8 ++++---- tests/amdgpu/vm_tests.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 597fc2b..df85a24 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1496,7 +1496,7 @@ void amdgpu_cs_chunk_fence_info_to_data(struct amdgpu_cs_fence_info *fence_info, * * \return 0 on success otherwise POSIX Error code */ -int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags); +int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags); /** * Free reserved VMID @@ -1505,7 +1505,7 @@ int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags); * * \return 0 on success otherwise POSIX Error code */ -int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags); +int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags); #ifdef __cplusplus } diff --git a/amdgpu/amdgpu_vm.c b/amdgpu/amdgpu_vm.c index 304b423..5ba7c08 100644 --- a/amdgpu/amdgpu_vm.c +++ b/amdgpu/amdgpu_vm.c @@ -30,24 +30,24 @@ #include "xf86drm.h" #include "amdgpu_internal.h" -int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags) +int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags) { union drm_amdgpu_vm vm; vm.in.op = AMDGPU_VM_OP_RESERVE_VMID; vm.in.flags = flags; - return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM, + return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &vm, sizeof(vm)); } -int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags) +int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags) { union drm_amdgpu_vm vm; vm.in.op = AMDGPU_VM_OP_UNRESERVE_VMID; vm.in.flags = flags; - return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM, + return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &vm, sizeof(vm)); } diff --git a/tests/amdgpu/vm_tests.c b/tests/amdgpu/vm_tests.c index cbfafe9..5f18310 100644 --- a/tests/amdgpu/vm_tests.c +++ b/tests/amdgpu/vm_tests.c @@ -88,7 +88,7 @@ static void amdgpu_vmid_reserve_test(void) CU_ASSERT_EQUAL(r, 0); flags = 0; - r = amdgpu_vm_reserve_vmid(context_handle, flags); + r = amdgpu_vm_reserve_vmid(device_handle, flags); CU_ASSERT_EQUAL(r, 0); @@ -142,7 +142,7 @@ static void amdgpu_vmid_reserve_test(void) CU_ASSERT_EQUAL(r, 0); flags = 0; - r = amdgpu_vm_unreserve_vmid(context_handle, flags); + r = amdgpu_vm_unreserve_vmid(device_handle, flags); CU_ASSERT_EQUAL(r, 0);