From patchwork Sat Sep 30 01:55:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 9979045 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 2CA6E6034B for ; Sat, 30 Sep 2017 02:28:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144592950A for ; Sat, 30 Sep 2017 02:28:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08FF229541; Sat, 30 Sep 2017 02:28:47 +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 317E42950A for ; Sat, 30 Sep 2017 02:28:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 638506E0C3; Sat, 30 Sep 2017 02:28:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1057 seconds by postgrey-1.35 at gabe; Sat, 30 Sep 2017 02:28:42 UTC Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0064.outbound.protection.outlook.com [104.47.37.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 083786E0C3 for ; Sat, 30 Sep 2017 02:28: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=ty4QktXEHNrIqm0fqjzWq/usVlRq2EXfOnGycDdLaSQ=; b=tYo+wLc8vIUOOc/7FfoKWZZltuKy21FBfEbeBR5lu5zm2ArrUHJykOx2+EaPKCzuvTbBnrz7zOlQZVsfBthbdugFCQwKW8lnOhQFM/ufKWEix7ltp5/Zp41CHNEVla0gzEE6dt6OBm8DQt7N32JUGeVanan8FbcJz/Xmkjl8Q5k= Received: from CY1PR1201CA0004.namprd12.prod.outlook.com (10.169.17.142) by DM5PR1201MB0058.namprd12.prod.outlook.com (10.174.106.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 30 Sep 2017 01:55:28 +0000 Received: from BY2NAM03FT045.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::209) by CY1PR1201CA0004.outlook.office365.com (2a01:111:e400:5b9a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 30 Sep 2017 01:55:28 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by BY2NAM03FT045.mail.protection.outlook.com (10.152.85.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.77.10 via Frontend Transport; Sat, 30 Sep 2017 01:55:28 +0000 Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 29 Sep 2017 20:55:26 -0500 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 29 Sep 2017 21:55:25 -0400 Received: from [10.237.74.158] (10.237.74.158) by SCYBEXDAG01.amd.com (10.34.11.11) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sat, 30 Sep 2017 09:55:22 +0800 Subject: Re: [PATCH 1/3] drm/syncobj: extract two helpers from drm_syncobj_create To: =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= References: <1505248934-1819-1-git-send-email-maraeo@gmail.com> <4ae21aee-0b51-8338-b205-25d8910e2b86@amd.com> From: Chunming Zhou Message-ID: <53eb9f85-e57f-fe8b-8bfb-967db2370c28@amd.com> Date: Sat, 30 Sep 2017 09:55:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.237.74.158] 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)(189002)(377454003)(199003)(24454002)(7736002)(305945005)(4326008)(356003)(16526017)(65806001)(54906003)(3846002)(512874002)(1411001)(270700001)(65956001)(37036004)(6116002)(568964002)(65826007)(84326002)(2476003)(8676002)(81166006)(39060400002)(97736004)(83506001)(16576012)(6916009)(68736007)(64126003)(189998001)(31686004)(2950100002)(81156014)(58126008)(316002)(16586007)(93886005)(4610100001)(53546010)(229853002)(31696002)(8936002)(53936002)(33646002)(36756003)(478600001)(101416001)(6246003)(5890100001)(76176999)(2906002)(50986999)(54356999)(106466001)(5660300001)(77096006)(105586002)(72206003)(3940600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0058; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT045; 1:gK8uQV78/lzA92llUejo5zojJxptsxDVgQARjzTlcE/LICf31YGtmL1kQWG9aISCLa0Wc/c8W7M2jLc+s522SzOuAMVk7zfYlQz/Ukih6TIih2+Aw4WVU2aczYuedxBo X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb3c2d68-fce5-4008-dbec-08d507a65321 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR1201MB0058; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0058; 3:qEQnbm90v648KsS0tQTSFxfiB3/wPUK891UIVyksQmBqSI9KrQpEeKGy/LriSzs1F1emaTAn7/Yp6RD1PFvIICoDojZ7jMoC4t+qRK0pD8FAlXHvVWtgq6DgJL5eRpjiC684Oo40YLOXEf25d4B7nyVbLbpt/31VDqmNw3lQ6s5wzpS9ZGvLVyhYaix5e7Irfi2RhGH4YGCN8hxUhD+i4f9BgfQsEiYM3d0m4g5Hb9mAFnEnEAzpU9xjY4bfNauvjMehR3A3y92s0CI75fPFNNnWsgZCx4OcsulXCxKiD8pVrXYiMnP7UkQ/A1Ykka0VS6qwgdlWeGeYzAkrssBhyud71oTY26aaOwZ4avHQTGM=; 25:eLfy7sVG5YZXZvf36GYadCbiy2Y4eQ6lz/7WCgeepYPqFK8RLrMm0EuB1AfPkbZJEhxwc+nwWACGc0KocXYzgRuGa5qFSC4JPaGGvjlcgNMt+/C4sDdrNAOwtsW7FEMVBmk3HTajHvMQyWkies7gLOZgcdlikbkH0AZuFPrnU9F7TVRvu9aq3GzZ8G5CZ/tf7LEVc+WJLqA0N9ynqbDYTUd2jMOWj0NOxKFSqeAWm+5YiiY9IlTD5LEOZi5b+l7+9rYsT2eN/eIMt9gv/EA3uydwmpFF4+78b3LXvmcHZR7/kxrBwMovRMuNzKrxHKeZ3rkFXLM0aP3OOQpVRS5nRQ== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0058: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0058; 31:Buejj6+DohSj1EBqz/+oEr6ePjkFVWvPqc+LmM3n0BW3H8r8TB0zqqJ/VlGe9TXT2RWQJmKIOCZ7YgHF0rIc12TarqE+Q9Ph2eM4L6ucGZCKWM8z88+ClBCyDGkzfEz4mDYB82IVLkDZuq+uFJRyYxc1XGYbctAmrwNKtGyKTgiSJmAJxXyM2GT0JSzhGaB2ozpfqwmi2knsmFny5Qkzz1fTBV2ToGBvSaSfB+nirwE=; 20:oK8OAt0Tl//JetmnPDXyuoUbAQU/B2rwaL6MZLec3k1uJcATmPwyRHiBG3lOZVWi2Mk6Onuu4Cp+spLvNe3Cg4OiMo4RQgm9z/6BBUgUVB1MWGcRN4TsOQ9k9dIyu7tFRbkOqRDTlgz4BHxSdpymGJ3k+m1B3kp29smUyJb3LX75lLAx7vpK3xAk0VUMfi0GhxdWtDZODsVqEHpVnjfu0tq+DrY2UlN8VMI/x2TIuSPkJEOupj9IVeQ3FbP6MfvNNrqy/c/SrUvISU3gyQ/qnF+pUwDXCsw2yLUbvaI2ixKZ0dhvbrD5hwk5DWbr2TA4bWM2eapCL5A+bErZF2LuuzW1KcwFac6Jq0IpcbMOViVO5SVT6jPn5ikaMbOToj9KWBXm0GLccUjvgdBb0QKyhVE70xmDC/mw6CraXzD6itF68TTQ7B5Qk/yF9FQ5vWN8H30qNR4H25OT8xqa44fbuub55EzmfIxHaygQMck4Kpc6t1U54dQ8uwGNc/FrhX+j 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)(102415395)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93003095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR1201MB0058; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR1201MB0058; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0058; 4:qY697OvyxKBfNL/D+Z47FoGR+ZgTnWnz8go1p8ExST1+xsyWsOAEVPXaZoeDN5iQdadFbROV61wlXMDWYPAuNIqHA+7vYHwiDH5smKHDLk87/8fn49woxiBU84/jq3n0eprU0p1z5vfebdbLX7PUVfyXR+gqP0oykwVZ3kyiJ8IlOjk5dZ1SL1TK8iKkF5TA2vCSNnX5ZdJyUhkXIFv8/US84+HGm+8wrS5j06KWWqueKUHo3beFbCrXVgmXo9H4ijbHFdGg7/maTeRkSTMam6/d9wCh++dJIAicuWw+/KA= X-Forefront-PRVS: 0446F0FCE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0058; 23:hhrPaqCmXX5tb+ebKp6s2cum5B1Gi9z3ugZLxdU?= =?us-ascii?Q?IarVdfvZxaQgVTCbKnLoMbp3ZKGIFFqUv31K7NFR7QWlArORsQAaR5tf9iqU?= =?us-ascii?Q?6BQfYcjkLs01E6znq63jiYuiWljLhIw/JVjd2bwl58r3B552kfA5Q2dFaSV9?= =?us-ascii?Q?TeaFk2fjehWhRMchOuiXkWV6qZKJ0vGiTVQMExQm1w7BxZfoWTH3QSOlXXx5?= =?us-ascii?Q?JXfLM3pakic5Nr4fernHMaVubZtY0PfRE2Qe/LvWoZgHHjmH+6S4Bb0XmaW1?= =?us-ascii?Q?DVUVtG6T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qOlfl7M/Nk3FOrGD1SB0DFkGjZ3qivWLgtyLQ8zuLhjJUtdCJ4nKooXjyg=; 7:6mruuz7jRbX3CSazZNC+X/FIpxUDVWHwL7rRqn+713lHPRjp8Dxrp3gxuJvCZOCL1ohCfMm/vZB7sXhCPe3llY535UZfNyk4hRxZWuBFc0vKN52sdhpCxWcys6JkhhurV2Ujkl4Ai/HE/qSVORMtFay3w7bo+tR6Y2PhKU2s/JgqqMx59HWE5fW4WsgvK1X1pbDTFs+dWfr1XZ93phxHqiFTw42g9pfprI0JOyLNBqo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0058; 20:fXYnR20DSUTXlbDU8/joPkfx4+VCeCqVEDX+uBzjumxB/feOaplF3ol2jM/DbO7DOemjwn3JDy9fi+u9U8QYscsOP0+qvNa8ycQNdLPDbVloUku66aeqRNzG6coM5CMlJlO2z6cH12tehw4D+DPm+QPd14aO84YbhKTi2+qHT+CLuvhYiTwv+OJvs7rZGQZml8hAThfFBavDvBXjj7LjXEkr76w1ksBUxYZa0lB4eHA6WcYB7pccEbvJhaaR3BjA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2017 01:55:28.1767 (UTC) 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0058 Cc: amd-gfx mailing list , dri-devel 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 My mean is like the attached, I revert part of yours. Regards, David zhou On 2017年09月29日 22:15, Marek Olšák wrote: > On Fri, Sep 29, 2017 at 4:13 PM, Marek Olšák wrote: >> On Fri, Sep 29, 2017 at 4:44 AM, Chunming Zhou wrote: >>> >>> On 2017年09月13日 04:42, Marek Olšák wrote: >>>> From: Marek Olšák >>>> >>>> For amdgpu. >>>> >>>> drm_syncobj_create is renamed to drm_syncobj_create_as_handle, and new >>>> helpers drm_syncobj_create and drm_syncobj_get_handle are added. >>>> >>>> Signed-off-by: Marek Olšák >>>> --- >>>> drivers/gpu/drm/drm_syncobj.c | 49 >>>> +++++++++++++++++++++++++++++++++++++++---- >>>> include/drm/drm_syncobj.h | 4 ++++ >>>> 2 files changed, 49 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c >>>> index 0422b8c..0bb1741 100644 >>>> --- a/drivers/gpu/drm/drm_syncobj.c >>>> +++ b/drivers/gpu/drm/drm_syncobj.c >>>> @@ -262,8 +262,14 @@ void drm_syncobj_free(struct kref *kref) >>>> } >>>> EXPORT_SYMBOL(drm_syncobj_free); >>>> -static int drm_syncobj_create(struct drm_file *file_private, >>>> - u32 *handle, uint32_t flags) >>> You can add a new parameter for passing dma fence, then in patch3, you can >>> directly use it for AMDGPU_FENCE_TO HANDLE_GET_SYNCOBJ. >>> >>> otherwise the set looks good to me. >> Sorry I just pushed this. > Actually, you commented on a deleted line. The function already has > dma_fence among the parameters. > > Marek From a34c466f4a8617c18bf191d83bff3a3382166b00 Mon Sep 17 00:00:00 2001 From: Chunming Zhou Date: Sat, 30 Sep 2017 09:53:53 +0800 Subject: [PATCH] drm: Don't split drm_syncobj_create Change-Id: Icc6e4d8e94236675d6267d211e53698834d29869 Signed-off-by: Chunming Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +---- drivers/gpu/drm/drm_syncobj.c | 42 +++++----------------------------- include/drm/drm_syncobj.h | 7 +++--- 3 files changed, 10 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index ab83dfc..882becc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1351,14 +1351,10 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data, switch (info->in.what) { case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ: - r = drm_syncobj_create(&syncobj, 0, fence); + r = drm_syncobj_create(filp, fence, &info->out.handle, 0); dma_fence_put(fence); if (r) return r; - r = drm_syncobj_get_handle(filp, syncobj, &info->out.handle); - drm_syncobj_put(syncobj); - return r; - case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD: r = drm_syncobj_create(&syncobj, 0, fence); dma_fence_put(fence); diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 62adc7a..28e1463 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -268,8 +268,9 @@ EXPORT_SYMBOL(drm_syncobj_free); * @flags: DRM_SYNCOBJ_* flags * @fence: if non-NULL, the syncobj will represent this fence */ -int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, - struct dma_fence *fence) +int drm_syncobj_create(struct drm_file *file_private, + struct dma_fence *fence, + u32 *handle, uint32_t flags) { int ret; struct drm_syncobj *syncobj; @@ -293,22 +294,6 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, if (fence) drm_syncobj_replace_fence(syncobj, fence); - *out_syncobj = syncobj; - return 0; -} -EXPORT_SYMBOL(drm_syncobj_create); - -/** - * drm_syncobj_get_handle - get a handle from a syncobj - */ -int drm_syncobj_get_handle(struct drm_file *file_private, - struct drm_syncobj *syncobj, u32 *handle) -{ - int ret; - - /* take a reference to put in the idr */ - drm_syncobj_get(syncobj); - idr_preload(GFP_KERNEL); spin_lock(&file_private->syncobj_table_lock); ret = idr_alloc(&file_private->syncobj_idr, syncobj, 1, 0, GFP_NOWAIT); @@ -324,22 +309,7 @@ int drm_syncobj_get_handle(struct drm_file *file_private, *handle = ret; return 0; } -EXPORT_SYMBOL(drm_syncobj_get_handle); - -static int drm_syncobj_create_as_handle(struct drm_file *file_private, - u32 *handle, uint32_t flags) -{ - int ret; - struct drm_syncobj *syncobj; - - ret = drm_syncobj_create(&syncobj, flags, NULL); - if (ret) - return ret; - - ret = drm_syncobj_get_handle(file_private, syncobj, handle); - drm_syncobj_put(syncobj); - return ret; -} +EXPORT_SYMBOL(drm_syncobj_create); static int drm_syncobj_destroy(struct drm_file *file_private, u32 handle) @@ -568,8 +538,8 @@ drm_syncobj_create_ioctl(struct drm_device *dev, void *data, if (args->flags & ~DRM_SYNCOBJ_CREATE_SIGNALED) return -EINVAL; - return drm_syncobj_create_as_handle(file_private, - &args->handle, args->flags); + return drm_syncobj_create(file_private, NULL, + &args->handle, args->flags); } int diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 43e2f38..4e3025e 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -136,10 +136,9 @@ int drm_syncobj_find_fence(struct drm_file *file_private, u32 handle, struct dma_fence **fence); void drm_syncobj_free(struct kref *kref); -int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, - struct dma_fence *fence); -int drm_syncobj_get_handle(struct drm_file *file_private, - struct drm_syncobj *syncobj, u32 *handle); +int drm_syncobj_create(struct drm_file *file_private, + struct dma_fence *fence, + u32 *handle, uint32_t flags); int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd); #endif -- 2.7.4