From patchwork Wed Jul 19 02:22:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 9850353 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 5DEAF602A7 for ; Wed, 19 Jul 2017 02:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4766C27F2B for ; Wed, 19 Jul 2017 02:22:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C42028628; Wed, 19 Jul 2017 02:22:37 +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=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 9C1B727F2B for ; Wed, 19 Jul 2017 02:22:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E94176E406; Wed, 19 Jul 2017 02:22:20 +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-cys01nam02on0076.outbound.protection.outlook.com [104.47.37.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3C8E6E3FC; Wed, 19 Jul 2017 02:22:15 +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=kXb8wKK06Vg88aD8ASb61umCxdPYdJMkfZH6syAqd+g=; b=0qZkntILveq2wAZRE3BQlYtpliKfr+9jhdf+AWLmq1TT1tLKxjMLTMLvOeeZU7R6ZlCOY04CxeaxM/ZyU/iGpX60/UQQ4zDQymLxurtg/Nq1/AmJpffbjCTb/CULtYwIf040XlLT9oy2pnxhrLkVOYXswLF7F/wCInrxqcJ0bgo= 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:13 +0000 From: Felix Kuehling To: amd-gfx@lists.freedesktop.org Subject: [PATCH 6/6] drm/amdgpu: enable foreign DMA-buf objects v2 Date: Tue, 18 Jul 2017 22:22:13 -0400 Message-Id: <1500430934-27098-7-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: 77f3009f-d342-4078-8d9b-08d4ce4cf846 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:VK3Ye7JRVxYDW4KmmPLxl6BMrjxXRJlTH9kMvpyBUF1JRbj1tvgIDrcTJj0XDLo73Gd7krvBRjJLWqE/UopbRYjV4nyF5U+H96XQk7jcJXyASvtrxwpCnMguB0gsBJ3LuB+NwNgWFjlQMYA0Q7aQleeZ5w9B6O6Cn+L0b3NTVkEJvgHjtQkCJ9SeRPoTjDHe2hp69hMbMClwqXRlCeI5aNzhje+nDW1Yjguek5pWu09e98F6hF1eVgCDBfL9NB88qYq6IQOnBSDH/tV4ODT8Pw/8VMLlYYON/HEMqk7rhpx8Xx3El4ixyUgd7T7+UGgp8wjRt3CG0hU53IKK7MS0kGLK5IhNn51bL1WWZGsyu9wX5a3IfU/4GpnGemHDKskiXN5ocudu5Rn4/yij5uqGpIeSRkYxpVMmg2cWT/UUvp8O+ybyMn1d5nlaNLDts8tDbZeMjHqcii2UQJAg24azyA1LXXi8QdQOQi5QAIxwiOCFug7PQVhZVzYGr1lZdcg56pqO8c8e7NJEWzfPgnp/mXyHa6iPaxlygbjo2XLFubZF/5Ir5qk5ycAEKWA+8jRDqzb19fWTbZoIJkqV84BXvXSJhpwLZgtEFqvkdR6oHNgO+N0k20TYqy43IUMml2n/oBltWo3DOCnBjdPTfCCmc6KwxlZnSh4tIBZBM267kD17b8jHalYtGFVkMZKXhtojahCdvFeBs+XMR7DAC273EbvJw0/uwPlXgQneJHhycT7XdnKquoH1w8rXxv/eMFdptCAuQJYW37Voc2KxMaSG8A== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0235: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 25:nLilXe/4Hn8evl27g6X8jWfF4+J77qUvhj0tPjI8s2HfmeAS5tVM1z2mRkh7g8D03mA4u2NVcWRAR/GxMQBPIl14bR5S0TacQWzjIeAZ7i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79bmX46I+JYfLd+z3ao3CIGgNPM1PPeMLBOuF9N2/tR31+97X3L3HsILMAdXG/MneUqxMVKo3GI1nHY8FUWdrNaaLeGfxbHWMudUKorZeA0L9Ue7nlCGqV/LVRSBVMQJotiXqsICYfR09IZMp35LZk4E4RrZfOayWilFz3oLxgshfW5Jss5dDNQvgT/EwBNQ7iqu+h/K0DGvk77nAlT9r/llT6oTETUKKt3ruxZZ9DCbYs1JT7gA5WAQwWLSPRtgDlm2tix3+CcQ445NrxjgzRrvKLP5HiGbXtgJuNug1jyozvBQA5LXCP7vZhKPEytcG0lEu53LLgxpUIvZ1cyJovUaxNiMBalNGRetM+QwzPDRnIh7qGhqDvjOqF2fVs/HOUbkWB1boerwGCgu70H6KmYTFraw1bX+vlHV+XXFNEY78a0fNyrpmXv9Rdr3PuYt4gMUaTEAEdVCvxvcbCZFsmQztk93a4jjCkJk= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 20:Y7N3SxzR0OBreGyzybVPWMJ+i9MqWWskb4CG7IvTK0RIsULQHBhbP/VD0yumE0+qcf9yqDXnVQcFyDO9+u3OE6Q9OQd4JZu2nt8MjBBG3vUoHfraYnzRaoDe9xZ7JGvcj1KWW30PzGBdyg6vk4vNIgH4xQou0UYzCwh4L3pgGCmc40ONo710fpCM0OySTOvqvri3iBwpR5prg0Nkn6A3WW1dvUjMyqTOXjt+id4p66JE2Srxxu02OyP9Gbp1vXqVBLs8VNlzFFpbn3ToSkB0cr1/5466JnbscpJMTwCzTvqwWYkkwPkCAnu3Iw/rod2r8A3euozf7CCc/dMEjWFDXciN+6G8IK0l/KzVZeXNvgJILWeAt1FyGIUNkVyg7GKLEt4qOxEbwxn6U7QkpKjG2BdJBJAm7hcG/cO5gug+KhvNt7qeojm5VaWdDmDOUqkjMJSKPwhExw7VPvivdnFhicBoVpnuxoJE0FjltCIo2+JDzfDt2pGWJ/ArASMUavrE X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(148574349560750); 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: =?utf-8?B?MTtETTVQUjEyMDFNQjAyMzU7NDp4RTBWTEJQVXBOTnpTbjJYTm43RTg0ZFI2?= =?utf-8?B?aWZoTk5DR21Rd2J0elFKTUVaWVE4MDFMcDZVTzV0UTFGNHVORDI2TUJ5bjRz?= =?utf-8?B?cFJTbVZSUTJGbWN5ZVJlL0FGSVA1cFpIT2tqV0c5OHVWZmMzYlBkajh0eDY2?= =?utf-8?B?dXdHL0NwL3pwK2paVjE1NG00RVB1K0RlcVpwUyszdkY1OUJ0ZVlaMjNyT0I3?= =?utf-8?B?clpVVVdrZXhhNmhaQnhjbStJOFkwTmFqb1pjcGhoREdYZmttSmVLcjZadkx1?= =?utf-8?B?NXJuakhoTkdNNWo3YXBuMk93eXBVN3RDY2YrMkZZZnZ0U2JnZGY3dGVvdUlB?= =?utf-8?B?N295NTAvd285VjJvK2RsblJNU0tsRjd1NElMSmFSYVBaREtGM1Q4YVFaTkgv?= =?utf-8?B?WlNoRlhZQmpjUkY5WU5UUlNIMGZYVllvdGtVN29iWDZQZGlQSUhpc29aL0tD?= =?utf-8?B?OGQxSHFTR0p1bENKbEhUVjZBZURtUkM3dXd2dTg2enpOTElKV0F4L1h4UFhO?= =?utf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lnbXJ1SVVr?= =?utf-8?B?MjZ1NndKSzdqTCs2anlFeVloUUhZL3FXTGs0MDA2WENFb3VFV2x1RElLR2Yv?= =?utf-8?B?SXR3MDEzdzQwYzJpc0ZvN3M4VjZsa0Y2MnVvUlVIT2JpZWxZU1d2Q3F1Uytp?= =?utf-8?B?MWFldFViVkRLc29iRkpXSE0zOWoyVW9keU9OQ0xMdU1yNGl2ckpjbmp3Q3Zt?= =?utf-8?B?blZlSTRzWEo2QTFBTitPQllVNFViMFVtRENvQTV6cm5JTE5VbUgyQlp6NXpo?= =?utf-8?B?V3FuYU1kTmRyUHN1bWJvWmpjMmkvV2M3OC9veHBEcGpKWm8vWmR4Y0JlUEdz?= =?utf-8?Q?GOabPt69aMecMUsuIJq64Lmd5OfFutQXwCIO6c=3D?= X-Forefront-PRVS: 0373D94D15 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39860400002)(39840400002)(39400400002)(39850400002)(39450400003)(25786009)(50226002)(47776003)(66066001)(2361001)(42186005)(8676002)(2870700001)(81166006)(23676002)(2906002)(54906002)(4326008)(53936002)(50466002)(7350300001)(5660300001)(76176999)(50986999)(450100002)(53416004)(36756003)(2351001)(86362001)(38730400002)(305945005)(189998001)(72206003)(478600001)(6916009)(6486002)(6116002)(3846002)(2950100002)(7736002)(110136004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0235; H:Harpoon.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyMDFNQjAyMzU7MjM6UVVsa1IrWkUyeXFqZVNvRTdTWTNTQjda?= =?utf-8?B?OUE2a0djWDVncVUzVGM3dnE3R2dKSHhWSVNqVnVGVHF0UzVNZ0hSdmtuS3Q3?= =?utf-8?B?UXhYRlZ0a21LcEFGY2o3eW9Ub0lDSnNNcFlVcHhKSjJZekJIN3AwZCtOWE5r?= =?utf-8?B?cENiYTF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0czNXZuWFlhbTZzYXU1YnV0OWxiamI5TlQzWUdRRG95TVVj?= =?utf-8?B?RkkrSnhvb2dtdFhHaFJsaHMrQjFFamh2Ym1SZUpLeHNGUkphRmhBczdLcEwx?= =?utf-8?Q?vGhclTWrN?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 5:SNwPrEFQOIfiuIsSYz9pbhocumAT6IacH3r7zbjfIEO842VVDEenh3Zq6D0ZSwhG3W3qOvrKGfSzyFmEqN36adygpEXiPR8ChxtnIulrwrKCp/IVmhwk+RWHzPTPWIdSWok19yS43Illup1NwAM3azijcalHIdpKxIZSmFIK2EQ3vmEF83JzwMZ+dt41oeUSWtD6CXTImNw6mRW2Z0M7PhDlkHXWw7M0myi1H4D+xR9d+atjzPvm+EEim5vM5P/7jK5VgP1ZlCzGduGjRR1kk3S89xUXrh7e22AMdz8ZAZalYNtXPvaXEyA34CdqYosFI8Ge4RE7s38sy0wf09ePE8s/LV3+cQ2l5xXfcrkR6FYe8jwIFJwqBuBTkINqltDlzgAuozWq+yaVms2e39aRbUYHVOXHIgTMwR83ShfN7YW7x+31RdqBReZUCHZRMT63fIDQ9Q0praQhs4Q12HJxM9CGtiJ5VBr7EYib6R2Yyrk4ooWgBeL25I8toyYT5fKh; 24:1hxiR6EO6e+qddTZ/47YXKYJp6feC2q/fan/DXn+tF2/V/gY7MF/qKVTNwi5Cnvk2qS97wPN5jhXx1+gy/XFZ+jbb66pN3LKsXeL76CEKCA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 7:jxPyL2hLitmIXcOE8DzpjfdrhyTKASWP5xDkRD8BM74ESRn0iDSwNeozE08HcokPcPNLrw4s/cc/VgZtjhl9MPGPqxEeBkMCX2yI5i/qKTgg3h0XgBVD0EwXewXCngH4od0LauYIrNKQT9nodnHyy9giMSuACOzxl+Rp6R5ROP7NyFCrekU0N8UC76oj/68cJDjKvkcQApT0NTvcviyNaLv+zIU+KfUvS/Xg0uqA4XD2jExrxsFTZJ1Z4pMGtyc+dsLxIe790VLP5bP1sjcuTBmKJm+BCSeaxfGki10P/7YFN/M7YDSdvZLINIPCNXYaEbZKChP8dc0smchXy+RMP+15jBbwacE4F1E5g/Qg2mX4tVmRy43Zh8YXpID/CEEUtUvBvOiPOQ8Xn8BhaNNQxzlMrDfnZMMQ9lrBCALEhiezbsxHc0fm9EnGx5alHEJaqEQg9vqh37WUZ/Vxt46Lmx+F4TQyNKbV5WlfK8NnJjpV/uuwmRaBFeaahI+xzDEMZY0Jj1YPTCxHslYuprwmePBuvl5ennolPdhwl0B3bnT+MEP7vczcavWGg16k2YG+RRWcytSU2QjLE5fbXi+3DoysxvHKJAyAAXv4tjYs+9AbtXy5FRT1Tj7mnZbj57rkWs21gXibdR5BrCgkNuhXBG19Th0OFHdq1PCIaYmpxL1SIqPsBbe3ILP3WRjbREZf5fdNZJO/CzHDL/o9uCrRba1i24UDHuo3alkuz7To7hOJT7mafvDT02IhSwlelFhozSxFogl4U6azBNlXGA75EKiOQINa38HZ8rtyTcdjpsA= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 20:/EnE+84n5chxQijmu8A/6L4OYrMi1PN3QXuLAGprkL4Rs2atgX3Cxexl+wN9R8uwmGLOTMIru/990GJiUCLuO3lN7pYjTTgL8BmiOtTx6U5v1FBA2F+MOUQj4NSSY7NkWa3iDbosSZm4Vp0eaSQ2LfCk43qaMkMJ0d4bZ+6YO7KyAVuWq39Ue2+ttpQsi8ldNHme1y6nmP755QdPY/Nfa6E0wrN1BCFpS3c6umCHGM5LONJNCecXcyK4k1+wfG+/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2017 02:22:13.9760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0235 Cc: Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , 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: Christian König We should be able to handle BOs from other instances as well. v2: * Add a module option that is off-by-default * Use new DRM helper function to check the exporting driver Signed-off-by: Christian König Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 60 +++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 9fa3cee..46d9aeb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -129,6 +129,8 @@ extern int amdgpu_cik_support; #endif +extern int amdgpu_p2p_sharing; + #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 #define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */ @@ -471,6 +473,8 @@ struct drm_gem_object * struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev, struct drm_gem_object *gobj, int flags); +struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, + struct dma_buf *dma_buf); int amdgpu_gem_prime_pin(struct drm_gem_object *obj); void amdgpu_gem_prime_unpin(struct drm_gem_object *obj); struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 2cdf844..ab00864 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -120,6 +120,7 @@ int amdgpu_param_buf_per_se = 0; int amdgpu_job_hang_limit = 0; int amdgpu_lbpw = -1; +int amdgpu_p2p_sharing = 0; MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); @@ -289,6 +290,9 @@ module_param_named(cik_support, amdgpu_cik_support, int, 0444); #endif +MODULE_PARM_DESC(p2p_sharing, "Enable P2P buffer sharing (1 = enabled, 0 = disabled (default))"); +module_param_named(p2p_sharing, amdgpu_p2p_sharing, int, 0444); + static const struct pci_device_id pciidlist[] = { #ifdef CONFIG_DRM_AMDGPU_SI @@ -835,7 +839,7 @@ long amdgpu_drm_ioctl(struct file *filp, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = amdgpu_gem_prime_export, - .gem_prime_import = drm_gem_prime_import, + .gem_prime_import = amdgpu_gem_prime_import, .gem_prime_pin = amdgpu_gem_prime_pin, .gem_prime_unpin = amdgpu_gem_prime_unpin, .gem_prime_res_obj = amdgpu_gem_prime_res_obj, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c index b9425ed..21a34ba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c @@ -159,3 +159,63 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev, return drm_gem_prime_export(dev, gobj, flags); } + +static struct drm_gem_object * +amdgpu_gem_prime_foreign_bo(struct amdgpu_device *adev, struct amdgpu_bo *bo) +{ + struct amdgpu_gem_object *gobj; + int r; + + ww_mutex_lock(&bo->tbo.resv->lock, NULL); + + list_for_each_entry(gobj, &bo->gem_objects, list) { + if (gobj->base.dev != adev->ddev) + continue; + + ww_mutex_unlock(&bo->tbo.resv->lock); + drm_gem_object_reference(&gobj->base); + return &gobj->base; + } + + + gobj = kzalloc(sizeof(struct amdgpu_gem_object), GFP_KERNEL); + if (unlikely(!gobj)) { + ww_mutex_unlock(&bo->tbo.resv->lock); + return ERR_PTR(-ENOMEM); + } + + r = drm_gem_object_init(adev->ddev, &gobj->base, amdgpu_bo_size(bo)); + if (unlikely(r)) { + kfree(gobj); + ww_mutex_unlock(&bo->tbo.resv->lock); + return ERR_PTR(r); + } + + list_add(&gobj->list, &bo->gem_objects); + gobj->bo = amdgpu_bo_ref(bo); + bo->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; + + ww_mutex_unlock(&bo->tbo.resv->lock); + + return &gobj->base; +} + +struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, + struct dma_buf *dma_buf) +{ + struct amdgpu_device *adev = dev->dev_private; + + if (amdgpu_p2p_sharing) { + struct drm_gem_object *obj = + drm_gem_prime_dmabuf_to_object(dma_buf, dev->driver); + + if (obj && obj->dev != dev) { + /* It's a amdgpu_bo from a different driver instance */ + struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj); + + return amdgpu_gem_prime_foreign_bo(adev, bo); + } + } + + return drm_gem_prime_import(dev, dma_buf); +}