From patchwork Mon Oct 15 08:55:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10641339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 877E215E2 for ; Mon, 15 Oct 2018 08:56:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7479629615 for ; Mon, 15 Oct 2018 08:56:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68D5B29618; Mon, 15 Oct 2018 08:56:09 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 F112B29615 for ; Mon, 15 Oct 2018 08:56:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AC4C89D02; Mon, 15 Oct 2018 08:56:04 +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-dm3nam03on0089.outbound.protection.outlook.com [104.47.41.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 573A389A1A; Mon, 15 Oct 2018 08:56:02 +0000 (UTC) Received: from MWHPR1201CA0021.namprd12.prod.outlook.com (2603:10b6:301:4a::31) by CY1PR12MB0426.namprd12.prod.outlook.com (2a01:111:e400:5191::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Mon, 15 Oct 2018 08:56:00 +0000 Received: from CO1NAM03FT039.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by MWHPR1201CA0021.outlook.office365.com (2603:10b6:301:4a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.21 via Frontend Transport; Mon, 15 Oct 2018 08:56:00 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT039.mail.protection.outlook.com (10.152.81.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.12 via Frontend Transport; Mon, 15 Oct 2018 08:55:59 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Mon, 15 Oct 2018 03:55:58 -0500 From: Chunming Zhou To: Subject: [PATCH 1/7] drm: add flags to drm_syncobj_find_fence Date: Mon, 15 Oct 2018 16:55:47 +0800 Message-ID: <20181015085553.30656-1-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 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)(346002)(376002)(39860400002)(136003)(396003)(2980300002)(428003)(199004)(189003)(77096007)(26005)(104016004)(336012)(316002)(53416004)(16586007)(97736004)(426003)(8676002)(476003)(81156014)(81166006)(486006)(126002)(186003)(2616005)(8936002)(4326008)(305945005)(450100002)(478600001)(47776003)(6916009)(2906002)(54906003)(53936002)(7696005)(51416003)(36756003)(106466001)(48376002)(50466002)(5660300001)(50226002)(1076002)(356004)(6666004)(2351001)(86362001)(68736007)(105586002)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0426; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT039; 1:pgqn3AnDZJkaG0oJILpqEa8kOlCHF1jkhZotpwgdK+G0SVaW3QvEREzQTZ8TQP1HjqMEiEUqz4SoT7DiXzeV+KoIFm4N1GBeL7UYXmut27T0gziApnTYXycKjx0d5ByD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38793464-2be6-4203-9cf3-08d6327c0757 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0426; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0426; 3:yAay7z2Juo+fZPD5idpLjj3vW5WkIdxtwec8+YpdATYbihmJKXmJD0ZvUp3MfynDGnSecL2aJnEekkSmcyNph9uILXcVL4kz3TfAxHXvvtE1Zd0Zg/gOLe0zNEWnzziqdEBwHTT03SFnshebFwP36JHRmhXrw5LMoIbAcY6wCsw9oB4GYW60leKPN1rUR49ffV6P3Illkw0Owe5GBCqTQggYOFFiWAdc+sdsuaAo1Vz5wQm+KNkXmGZDNCX+/7J61FDQJqef4Fr8nhkDBAf/ufqepcUhMCZLgTutRJyVarz6QmpeM54ZiIDjvA6FKVOsBe8F4QPPL7CrLEjBeHn9dkbriPkqAVUenBCC0JJnGQE=; 25:lkqDSBE8a5MdTvglU3WOwk+GGOMGLyCMrwvHlBOxkQs3TqEA/oDzsD+jMQm3eElUoFtwP8zOU/qGevh/1ZB54AMGRjYNN4hi0+maiquc1bsQ4tsrTYOJhADpJflxIb4QUH7wUuAkf6SMwG30o4eAehmOwiCFkknrBBWOgCNvJKAfTk6Vut28sh672lEre/9yAXZ8NQAh3EenN2wgHqeR+TwsohQG1qrEoIXlfTt0gfyLPQl3GH0wqgkzsQF4a+O+R+kxjtoa2GaLpZBjmtjL2xPE5EBOOMrdSCSbr09CsFBezKBSR9T0zfUsiDslGIGVcDT98OEVFOYNst7XqlCFCA== X-MS-TrafficTypeDiagnostic: CY1PR12MB0426: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0426; 31:+hp/OHnCmjtr/eOPQ49CbHU74MFB+0HcU5wHIiry8khyjgg1oFirAVcMD0bl4vhfSEOrXNMCeemdn2K0V5BqrREEqEIVIt7QQ2QPj+sJ/zXCmuqfSwqZJ1N8pH5T/yr4/SQW8RY3wDc9G/bQVCSHgnS2/NbwGDauFW3GCbV6XtQuLezkcxSuUJxpGRuSpQ/r/1ORNhQKOAZ76NflhxJWIy7wnW/Wunk7L3dE6zoiUbM=; 20:ZaVeeIBuQsQdxezlvVeHS1iJZiDFYAGcYzL8VArkIR3pg12NYHxC8dXSy4Sg5IJ1xitLQ417K+RbTWH0W3ypfubOSPVtyNPQfgY1oqotVsv4M3rjJYe6tjcmJmJHWpEU5xONQFsM52aDxYcYt5ZzLditjDKQ7mCVNgSrGtNnDZet7VYHwxsoqgDs3xqzQO3zNzKIw42EpMhpkC/WJMUM6aBuy4wZey+UGHMFSiLS9fUg2m9NoYhsWAvG5ETNxytJT1gGbTuRp5kknzi+mgqsgfzc3Kxh4mPbV61T8P2eduUGPXlBbtx7GPi51Bablqne4kKE1wkOvgLgV4RPzAHESOsoLTS2vrAu8QUv+0CTTJWDRChE1reQBC8m5sP8ecoaaKH6yjg0o2nRRMk6mv9lAjvany79MAFSST961yXrfcYvt6BzWGULqTnb+d0udN2NSHmHlcTZYU2SR7657x5KWo3W8mWVtSGGVfPnj6S+8ZwJI7BlDOiLqxOcesu3Cc8V X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93003095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991067); SRVR:CY1PR12MB0426; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0426; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0426; 4:7aKvju+/a24VvASdoKe2s8M84CoDzkUAsnnWZenXCu9YieIFw75Rqy4/2FUyWxfpy4BCwpaL1O8fFBXho8oKdawFMIGHARu3wdX2B5HGiyUlks/vzssmVPlhELQb6/RgQWux6yzPO7H0ZDAk7abEbxKhVvyWpEBtx1bL/sWDvK0Rf+dEg14Pa5rLF8zDvaUkNORl8k9PtpCQkAnBHcSbJYWwtiHi/pWbgWL6Sq9OXsEskqm4RQk4nNBEsx0eS7wblK+altSgCqwnFopqH3JpMCDJ/exCxjFo9UVFHIbiIlLMO30qTrkqDn6JSGITbp5L X-Forefront-PRVS: 0826B2F01B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0426; 23:cTLrbZYYNzZHz0uuTt3TESbQkzSBEf4iHLhZp8jiH?= teFKG07o1yg26IHDuN99QSoAjxuI9/eDDYmrAhMLuOf3MFnO1MfGrRk5zfSuff8wcEppD01CpNbfy+6ZOr7/S/tK5MAydkqnnRgV8Q1Pewz3/A/l5aNxjx8cd84GpKWBS/zZO8yy54ZP4/XMW/E9x+xzNc3MuA+G17Shu3ZiVl/0hlPm2HmK0AwwWcz9o6jXSRiGfsrjwEkOsv1bhBLtYPB4xE9pwIwIrr66eO+N1r2aQdpubW3Ofbt8BHW7Bki2V11ukcGsYXnoV7DxIzb8JTA2Neo6fodbGRWIrM+i4FAB76leZPMQR2Q+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EMLUgL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0426; 20:GuBaeKpUxDMiufMUSNXfSJSnPCSUdTWRatlTZa+RNwcjvYYwllwErVRjyjrIv7ajVN54FPMo1ID/n3g+fMZ/u88krVBHcQB7AzZ1/oCln78WOLoiil1+XB+ddVkSvsUzRQ2OIhJjLVrAZEVxHTw4AZS+TBg3iSX06X1ufgb2TziPuYYANA8Yc1v8jrZhGYhq+zmR53o7Jk5pZdvvLJ+EGGLe0JfaYC1mOHfdKAELQUOXTHrQUg2EN+LmfWsFvlT9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2018 08:55:59.7832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38793464-2be6-4203-9cf3-08d6327c0757 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: CY1PR12MB0426 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP flags can be used by driver to decide whether need to block wait submission. Signed-off-by: Chunming Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/drm_syncobj.c | 4 ++-- drivers/gpu/drm/v3d/v3d_gem.c | 4 ++-- drivers/gpu/drm/vc4/vc4_gem.c | 2 +- include/drm/drm_syncobj.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index d9d2ede96490..412fac238575 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1102,7 +1102,7 @@ static int amdgpu_syncobj_lookup_and_add_to_sync(struct amdgpu_cs_parser *p, { int r; struct dma_fence *fence; - r = drm_syncobj_find_fence(p->filp, handle, 0, &fence); + r = drm_syncobj_find_fence(p->filp, handle, 0, 0, &fence); if (r) return r; diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index e9ce623d049e..f796c9fc3858 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -235,7 +235,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) * dma_fence_put(). */ int drm_syncobj_find_fence(struct drm_file *file_private, - u32 handle, u64 point, + u32 handle, u64 point, u64 flags, struct dma_fence **fence) { struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); @@ -506,7 +506,7 @@ static int drm_syncobj_export_sync_file(struct drm_file *file_private, if (fd < 0) return fd; - ret = drm_syncobj_find_fence(file_private, handle, 0, &fence); + ret = drm_syncobj_find_fence(file_private, handle, 0, 0, &fence); if (ret) goto err_put_fd; diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 70c54774400b..97477879d3d4 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -521,12 +521,12 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, kref_init(&exec->refcount); ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl, - 0, &exec->bin.in_fence); + 0, 0, &exec->bin.in_fence); if (ret == -EINVAL) goto fail; ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl, - 0, &exec->render.in_fence); + 0, 0, &exec->render.in_fence); if (ret == -EINVAL) goto fail; diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 5b22e996af6c..251198194c38 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -1173,7 +1173,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, if (args->in_sync) { ret = drm_syncobj_find_fence(file_priv, args->in_sync, - 0, &in_fence); + 0, 0, &in_fence); if (ret) goto fail; diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 425432b85a87..2eda44def639 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -134,7 +134,7 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point, struct dma_fence *fence); int drm_syncobj_find_fence(struct drm_file *file_private, - u32 handle, u64 point, + u32 handle, u64 point, u64 flags, struct dma_fence **fence); void drm_syncobj_free(struct kref *kref); int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,