From patchwork Fri Aug 24 12:12:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575275 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 3F67914E1 for ; Fri, 24 Aug 2018 12:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 301A82C39E for ; Fri, 24 Aug 2018 12:12:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23AF02C3B5; Fri, 24 Aug 2018 12:12:25 +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=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 E9D6D2C39E for ; Fri, 24 Aug 2018 12:12:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13AAC6E686; Fri, 24 Aug 2018 12:12:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-dm3nam05on0626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe51::626]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9DB066E684; Fri, 24 Aug 2018 12:12:19 +0000 (UTC) Received: from DM3PR12CA0071.namprd12.prod.outlook.com (2603:10b6:0:57::15) by CY1PR12MB0248.namprd12.prod.outlook.com (2a01:111:e400:50f9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Fri, 24 Aug 2018 12:12:16 +0000 Received: from DM3NAM03FT044.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::208) by DM3PR12CA0071.outlook.office365.com (2603:10b6:0:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:12:16 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT044.mail.protection.outlook.com (10.152.82.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:12:16 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:12:15 -0500 From: Chunming Zhou To: Subject: [PATCH 1/8] drm: fix syncobj null_fence_enable_signaling Date: Fri, 24 Aug 2018 20:12:03 +0800 Message-ID: <20180824121210.19101-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)(39860400002)(136003)(346002)(376002)(396003)(2980300002)(428003)(189003)(199004)(104016004)(68736007)(77096007)(186003)(53936002)(8676002)(81156014)(81166006)(72206003)(26005)(4326008)(356003)(478600001)(305945005)(86362001)(5820100001)(54906003)(8936002)(50226002)(316002)(97736004)(47776003)(50466002)(106466001)(105586002)(2351001)(426003)(336012)(476003)(2616005)(126002)(6666003)(5660300001)(6916009)(2906002)(53416004)(486006)(14444005)(1076002)(2870700001)(23676004)(7696005)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0248; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT044; 1:ABzVJTq/T0wf4lWquqi53lM0O7xd13FGxtJcAznCGavU8LdHebiVKZbNKgEeKWLQvmeuhGUH4KlVfjQKDP32VdT7de9cOZ4hygJfBACwKuf5Xqvm89ylUD3whlvYSheO X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a458bc75-0c06-4ff9-8386-08d609bad553 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0248; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0248; 3:5cwC6n5sHx/geWPA8SXSDWyDCI13AUoNVB2gVaT68VCrVswzqHdKFRssaqdzmqtXSnOTPhcfUZ3S8ifc2Mjmm0P39LThUMsisKgLK+H8B//qKwQ/23mEq8McTan2RRH96VRmoMgElz02JYy3UwD/mI2S7NgYy3EtgSCEURQW/Qv/0035N/jSI9Xiwvi5Gn0mLXdMoOccgTJWWzoSME/lECv4XRyEnXUc+i+U9AB8ead1MAdB581aPQ/0sjVeG6nrkk+GHQdStOLsxBfBKqlpP6GPFB5MbNmVSpB2vcWxlMxSLBfuqPhvjvyGcyAV1gminfw/pN0rRuyF0SVG4iU4omLfNpRhP+TtQI9JuGyu/tw=; 25:TvutDzDRVtazFQDWlBc34wT2kQEIk56weZazp9E6Vmvw2ixyDWn6LJusxYZTk7qaAkGEYpleQHv1ib5amKvM8lIToaJWEzrBlyIszceNPDTOsgW2wciW3uOieBR2Y3TI/ngQTNiTArO/F6qqX2Bzo3nBodW6chZ2mLmGNN2cyVsj3sqFcdf8V43GrnxSHjkIhVNMl2bk6ZlIV1AUnDIpFfB6kRt6NQCr9qANqlyJjZjwsowrANxkNVEmTr8+TW/z5YyyvrPxxOU0SYKamArf2vFVlHDbC6Y+caLe6mQNYW356YyP43BQvq8ZaR7rBd3UZI5EOkYa3MI0uQwSVRkIgBHlJ5y7UK+BgGcxFw9M8Is= X-MS-TrafficTypeDiagnostic: CY1PR12MB0248: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0248; 31:ltJFD3EQ39xhmQqsrYbRxb4sFdphSmVDoraOAOjNXxFWGa42262qXXHiY/nco9L5tqi9+UXPHV5znAMbL/iancBUC1IsT0fNJ+pFB/CPrvAseORKwIAshA3CHzLFvlpCV169dduqOftfMgY15+OGJEQYYtH6U9rAexqiRQWa1OtvowlNq5spuo3YB+eu4Fm7btoFH5SqX9uAQMAak7VaceH56BfeYT3WIeWMKc4JGlw=; 20:6cyCg8bVLaWhPJjOREti0dnqfg8UYocJm7DDOsO0llwMV00uWsbdk9TicKhfVG6TwTssjTq/mbrww4cNVc7G1XfNebEtyXDkYJ3c+EspU7OhmZWlArtpEpDcn2gCyzC895gOcjyd22q4U6nDF5OtfUgmqM8NgHxvIcWEqkKEC5neb4zSmUnKBjLQ2x9zc9NqIykYrXQxNZm+W8eRsgOxwflMvQNR6dvMsECmGeMECR6qceJhxBEyKFRfsqEujtq57mWry5i8D8qUtGF+c3w2t/ZBq59kPx4OufSpsFn7nFrtu8gAoSV85NlORnqMNkWraVuqDbhj9BWGo8/mT9p9et+VEiOPTusJDsuwzVKvYH8Mv5pbbtHQzTEWzPtsuw9AoBv0wWCkAVjyiMY9mHsPzA8NzaF2rOKksoBmXiKEuYavFt8IYoqNfCfo6ztNJgtXzZXAkRra9GvFLv9TEEhkRrYdYlS83zlD6UNre4NeBLud8YbCU/mbSuwSOa9PMhHr 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)(93006095)(93003095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(201708071742011)(7699016); SRVR:CY1PR12MB0248; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0248; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0248; 4:a0OAHaMt0g6RglGMtx10IaB6Fw/geOQzV7sysDhNqq//MkGAFE3AdlLlSpUgAo4SpcDITjQleoQ3A1nImnDmicOzvITV76JrxTol1sLy7swyn3XbzfdVIc0AUhiPaTQzFpS+/ytyeyCDGIbX7PI3Y7h7pz1UwGs6gq2gSEikPlbmoOPmi+ZkfHY+1v/7lmVM6uo0H2GaXgZESmHmBnmZ2uAXz6UKLqotgvahuyzdDSmwjqJE1k2AH+r7dc6cKKs0NjUqMsCbXRWW+0DuNaEqAs+wQwD+3zt6NwBVv3DjDEml+s1Q2KMbhoVpm39uaH8W X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BCY1PR12MB0248=3B23=3Avg1BLBo?= =?utf-8?q?Vc6Fk34IVYINweI5BHtN1jYmDEArwbJGeIy2COI5WuKkfc7G6I+eHaj1qLLNk62Oz?= =?utf-8?q?s4zj+y4/GKdss1vVH3O3i03Veg3gLovWn2sHNKl3KAtga+V1nBA1mhgtnije9gZub?= =?utf-8?q?AV+g6e9AXmxgh45cVsKXKw30apTRCoV6Hr4aW9J9Bfp5bMCOXPWBzlcPn/FC6r7HS?= =?utf-8?q?2XaxURINua+Mp/n2Z7bZmYftXoCFxgmEW/JpPXQmcpLOv/c8yKKjn/6k2RtsLw6z9?= =?utf-8?q?X/U3Pozaq1DD9kvosouy0V5fhOpP2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IwunVQaLgKNw8LkG4a4BdEnxj+0r3ePU96wTobTCjHx/rN1bdX2TxOCnac7jbUAPwzHng0YRWB4r5p4vzY97QqbW+jJRP8E2RxnJ7xs8C6OTlx2ycQExJc0OpaW17KGzC3JU2xon9SJ74fzJ7SgG5EcCrqF8ztt23aXfGY310QMVv1+3GE4eDrmGMm8dn56t3oaGyHRqz+0F5BYYp7zmSP2Ngyil SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0248; 20:+1zYSA5MHU7tmXopQF0MlZTPYjjGyOx+nbBEy5w1PV8AubHQRUU4oSsrM1kwEPzpXaSAcCtoWVgzGSOR8FVa87p+ZBajZXNGdXxmri3jaADc5NTRkT2c8hzJIs2chK5Q9NdNjGSc/50ZqmBluG1uSo/pZ7JMinqwuziiopbm/pzwj472dqNAboypVjKTPQ2Z7OpUJIxT++RqqfEgL1bog755whz8qc7/zSeL3Rbk952ZtFq2w1s33JJv+a3lcg4M X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:12:16.5216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a458bc75-0c06-4ff9-8386-08d609bad553 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: CY1PR12MB0248 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: Jason Ekstrand , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP That is certainly totally nonsense. dma_fence_enable_sw_signaling() is the function who is calling this callback. Signed-off-by: Chunming Zhou Cc: Jason Ekstrand Reviewed-by: Christian König Acked-by: Daniel Vetter --- drivers/gpu/drm/drm_syncobj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 3a8837c49639..d17ed75ac7e2 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -184,7 +184,6 @@ static const char *drm_syncobj_null_fence_get_name(struct dma_fence *fence) static bool drm_syncobj_null_fence_enable_signaling(struct dma_fence *fence) { - dma_fence_enable_sw_signaling(fence); return !dma_fence_is_signaled(fence); } From patchwork Fri Aug 24 12:12:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575277 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 BB56E112E for ; Fri, 24 Aug 2018 12:12:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC3622C39E for ; Fri, 24 Aug 2018 12:12:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F6702C3B5; Fri, 24 Aug 2018 12:12:44 +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 3508E2C39E for ; Fri, 24 Aug 2018 12:12:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55A226E693; Fri, 24 Aug 2018 12:12:42 +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-dm3nam03on0052.outbound.protection.outlook.com [104.47.41.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 741396E68C; Fri, 24 Aug 2018 12:12:40 +0000 (UTC) Received: from BN6PR1201CA0002.namprd12.prod.outlook.com (2603:10b6:405:4c::12) by DM2PR12MB0251.namprd12.prod.outlook.com (2a01:111:e400:50d1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.22; Fri, 24 Aug 2018 12:12:38 +0000 Received: from DM3NAM03FT021.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by BN6PR1201CA0002.outlook.office365.com (2603:10b6:405:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:12:37 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT021.mail.protection.outlook.com (10.152.82.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:12:37 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:12:36 -0500 From: Chunming Zhou To: Subject: [PATCH 2/8] drm: rename null fence to stub fence in syncobj Date: Fri, 24 Aug 2018 20:12:04 +0800 Message-ID: <20180824121210.19101-2-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(39860400002)(396003)(136003)(346002)(376002)(2980300002)(428003)(199004)(189003)(50466002)(48376002)(1076002)(104016004)(316002)(16586007)(336012)(53936002)(54906003)(47776003)(97736004)(4326008)(14444005)(81166006)(478600001)(81156014)(8676002)(53416004)(356003)(2906002)(105586002)(305945005)(106466001)(446003)(486006)(11346002)(72206003)(426003)(476003)(2351001)(2616005)(68736007)(126002)(6666003)(6916009)(76176011)(5660300001)(36756003)(86362001)(8936002)(51416003)(26005)(7696005)(50226002)(186003)(77096007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0251; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT021; 1:5+jjXAe0UZNbimzeKNS3cjaHLzFXy/ENTWb7e4a8Asv4COMWbnvRIOxoO8G/b9EyfNOPZDQIfviZN0SI93Lt2YAD7N7UDLPFuEENdR+o0PpwuUR85j9M6hSaSOK4+PXu X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6695fcf-f36c-4bc5-d7c2-08d609bae1de X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1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Ds9Gh+/kp/XonJiHvIbps0uA8Sh0m3cuwIkt5UIX9yPiBm8Be8Kg19RIzr3rTsU4kgvFvB5qcX36zmqeSKlOX+42fwSJbNbgCqsrR0LVo7uq7+clhERHiXOSRWNmh4I9W/oGWc6KNkbbmtTE555zv4hvTHB4LJpH95IVX30lQTwgPIjkX9FcX5aAIns8Z3DX+qIttzCjexCrGZnmldybBxK7vf5wamY6I/4dRj7dwUBdgt87cZYAOcx2ohA4nhS5zuk7LkX9fSNnM6mBZJWiqXiYAbxqcdHl+U3c9/0hGkSOLHeC2WlrMewMaiyWqTDsJ0JvD7jN9rFshvY9rZDH/sY7Y7uSUdQxaSFrkP34mJQ/+9xmP0KF1VdiVumMSCdHBWnK4xvzJyQ5CK95q1qxgIlt1Y4kaGs20D5TcImob4qfKCCZlcZxqjS2GUkA5UGGx4tFQ5mEygnTKbwLYADKG/AJZ88X3TfjK+94Vtr9Mw 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)(5005006)(8121501046)(93006095)(93003095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DM2PR12MB0251; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 4:X6AwiZKKeq6sKb3VXLgMKazZrz8HW+6m7QeDQZIzcV8/YYceEntDVLyF3qdyzvpObfKicqWEBv9+usAe5SSsh5GGt3+fS+U+ucVvS4fVPE1nSFHyVatwK6toTo0hfk0Aw6LKdU006+ctY+0hKkCg+zJKBxmG9KnPm+XrX8557HYtLCPxIgYVHdmLO4DgAr22Uplj6txxghfmznfzRmezycCSiej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IkEQLb7z/zCPYxQxmkB+9cacmH7skaCFo3UyZQ3HPQQ2jowRUpZ0JM+fE2w3FlXaQrbLlnwfSole2ZTR1y4pdhth4jkaSjVp5c5bxgdVe/CuzVeXL2yXQ/jd5BugohX+wsY7zrEhhTQ==; 5:EBBV+mxvdqMk+CvvDwxTp5qMCRip06f09weVRZzFoXV3FxPl10uC1Y+4Mg0OJw1NaZFE3HrGCxVKkpdHlGFc5UyGHqJ59IVIKxH6rICxT6p2zDbI88agGonpMvNUXVbGbPThZShPKzS7hapx549kN+XSirwkiRKdZuQlDAfvCyE=; 7:5zPlnlDAulVurzBxmGlh2cC+E4wC2CkDo/3jw6NH0x/TVqbVa0w+7x4WBXdKnfQ05qGE3Z5tvR+5MaVdWh2Vss7drZOFt+YYhc9DwSl4EPGevGXAK1vw4NalHq0IoSB0J6/Tdnn9gQhwLmAO1fniAbrjC4T/kxA2kIg8E7/ZHtFwuVQFGbLPvzMoskC3a5kedpAYaSWzIaUOmG9z9y4zorh761gannIocMwLWc3pAEolKWyF41OetVgBg/LZqugu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 20:UJoNpx0SqKEQhwiCWmZWHU8zQXbp936OIK5otttPGJ4hp+28NXrvgv72svrSmcWtnejsk7wl/xgEplHJULkOCK3bdeQ2csNtP66l1dT2E/ESFwzf1T7eHPQ+Isvz4hvtjw0OkvHkAvGkVWXYYV1mP1DpSkicEc8ihbxj9An1kk4zjYzUAVVwK+UumgIKL31V/edMrzsZ7scOgN4ZOY9/gxxnWRyDn1Apnzuau74lp+d3DfiyOcQSWHgHncyqQ8b/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:12:37.5361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6695fcf-f36c-4bc5-d7c2-08d609bae1de 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: DM2PR12MB0251 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: Jason Ekstrand , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP stub fence will be used by timeline syncobj as well. Signed-off-by: Chunming Zhou Cc: Jason Ekstrand --- drivers/gpu/drm/drm_syncobj.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index d17ed75ac7e2..d4b48fb410a1 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -172,37 +172,37 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, } EXPORT_SYMBOL(drm_syncobj_replace_fence); -struct drm_syncobj_null_fence { +struct drm_syncobj_stub_fence { struct dma_fence base; spinlock_t lock; }; -static const char *drm_syncobj_null_fence_get_name(struct dma_fence *fence) +static const char *drm_syncobj_stub_fence_get_name(struct dma_fence *fence) { - return "syncobjnull"; + return "syncobjstub"; } -static bool drm_syncobj_null_fence_enable_signaling(struct dma_fence *fence) +static bool drm_syncobj_stub_fence_enable_signaling(struct dma_fence *fence) { return !dma_fence_is_signaled(fence); } -static const struct dma_fence_ops drm_syncobj_null_fence_ops = { - .get_driver_name = drm_syncobj_null_fence_get_name, - .get_timeline_name = drm_syncobj_null_fence_get_name, - .enable_signaling = drm_syncobj_null_fence_enable_signaling, +static const struct dma_fence_ops drm_syncobj_stub_fence_ops = { + .get_driver_name = drm_syncobj_stub_fence_get_name, + .get_timeline_name = drm_syncobj_stub_fence_get_name, + .enable_signaling = drm_syncobj_stub_fence_enable_signaling, .release = NULL, }; static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) { - struct drm_syncobj_null_fence *fence; + struct drm_syncobj_stub_fence *fence; fence = kzalloc(sizeof(*fence), GFP_KERNEL); if (fence == NULL) return -ENOMEM; spin_lock_init(&fence->lock); - dma_fence_init(&fence->base, &drm_syncobj_null_fence_ops, + dma_fence_init(&fence->base, &drm_syncobj_stub_fence_ops, &fence->lock, 0, 0); dma_fence_signal(&fence->base); From patchwork Fri Aug 24 12:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575279 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 F338D112E for ; Fri, 24 Aug 2018 12:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E31CA2A732 for ; Fri, 24 Aug 2018 12:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6C162B4D9; Fri, 24 Aug 2018 12:12:56 +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 CA71B2A732 for ; Fri, 24 Aug 2018 12:12:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAC876E699; Fri, 24 Aug 2018 12:12:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710060.outbound.protection.outlook.com [40.107.71.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BDE76E68B; Fri, 24 Aug 2018 12:12:53 +0000 (UTC) Received: from MWHPR12CA0030.namprd12.prod.outlook.com (2603:10b6:301:2::16) by CY4PR1201MB2502.namprd12.prod.outlook.com (2603:10b6:903:d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Fri, 24 Aug 2018 12:12:51 +0000 Received: from DM3NAM03FT050.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by MWHPR12CA0030.outlook.office365.com (2603:10b6:301:2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:12:51 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT050.mail.protection.outlook.com (10.152.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:12:51 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:12:49 -0500 From: Chunming Zhou To: Subject: [PATCH 3/8] drm: expand drm_syncobj_find_fence to support timeline point v2 Date: Fri, 24 Aug 2018 20:12:05 +0800 Message-ID: <20180824121210.19101-3-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(396003)(346002)(136003)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(36756003)(476003)(97736004)(2616005)(104016004)(51416003)(86362001)(7696005)(48376002)(486006)(446003)(575784001)(76176011)(336012)(77096007)(356003)(450100002)(4326008)(186003)(11346002)(426003)(305945005)(50466002)(81156014)(81166006)(8676002)(5660300001)(126002)(1076002)(6916009)(105586002)(6666003)(2906002)(106466001)(316002)(53936002)(53416004)(2351001)(54906003)(26005)(16586007)(50226002)(478600001)(72206003)(68736007)(47776003)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB2502; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT050; 1:Do5bYF91feGDBbBqCTtD5WOHrKAi+458pp2a9gN74szpi34IHT7gQR3yLZ5+sm3cVAMt/s6rh3aD+fS2qsX+FEVHvPmZSUpI+yFSnZn4tDiChHMidGY3kdhc+2aOr6wP X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ab8c2c7-aded-4b11-90d0-08d609bae9f7 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:CY4PR1201MB2502; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2502; 3:NEoPINsFd3GEUsjdpgivxEeW9Aqk8V732oQr3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hAiL8hIaSI1oCLPIk0zK7/up9F5IRY4wlaxTE3EWQesJpxSKhbW+Gb6J8YgPXPOfDYdCpAkAg+VRVUwh6CyuHSMWyRxcHUyfy5Cv6Yli2boFj826M1iw4XpkZVg6N/AjPKRaSdR2z4ttNSv04H4phX77ucHWF4/3MlG1S1FY462k2R1AAt2LQE7w/qlDQP1IdYtO7Ub6TPHp/9+vt8kX7yqoZxWGbdVh50Od+eE9vyF96qfk/ZV7qra08DPE4D6kpcORkJGU9Coq8VU29q0FLrTdTnY8c2jn8Lp6yZZYQkjyIVQjmajAvT2KNmUWXEHu+wCVWyZiEdns6JL/GjxGsXAtzRNu4z7SRxFwISV1Gw88bCVvclYcdLEi8puMtOu8CaC02vAMWIFyZLLWtwOpmjWE/Npyv0s41Rz5782O 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)(3002001)(3231311)(944501410)(52105095)(93006095)(93003095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:CY4PR1201MB2502; BCL:0; PCL:0; RULEID:; SRVR:CY4PR1201MB2502; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2502; 4:nErFZVXb36wurmp8TwArlhlKLvqgrHkGBb6E8TSmpZub3wYRepglFqKqYh5jGWGtowp2tiGQqIOjPvLrl31YKdlf04Jl9XpbxMRE9tC+FWxhD6dODWX3ChKivGjqLMLX+PMD/lD8/JaBAd1HijhS79+TPKMX9brrPoMsxJ4/klO4WnObkykHgOyjQ574uf+7qgma+vlPaohXxb9BjkpDjdZ9hf/OGW///FX6K46JGPN6ZdfBlt7ss84i3HQeFRr3EE383sD2+e62xe7R/lQ9wxKQADd1OOPfUn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8h9JoybOXdIlBFTpcDdWkCeUxkarED98jqyBPfJuGrMdt+jZg5uiFx9RQulHG/+giLfdfPQp+t9GBXUmsPu7f3U/2RAbustY/g==; 5:8OLR9Wr2crCiZHa57cElGkEOFm+z3ipRIt7Q91hAHxp/ZorTZlOUQAzMQbrPQMPYwSpcyVjV+PpbfozLovHd5wrKoiwaNxzdWp4TIVZwPW+fkfuE7sn5V6W7wNtuclxkrVn/6qW/xypXlw4nTFPfeXCajB+lwYhBMvLT8VhIABI=; 7:nqKq4z5FxsXfogfXJcZSUwHCIr6G9AWOa/Euq/5k1pMVcJj5p+5LlAcLl/uVVutG8Z9EXd2ZHvydMg1gF9rdWbR1K1BixaF6FnLleVDSDatpVjCE/yQYHtXhJFv21+Fn0GBolUN7TBKV9ubwD6ZzvoJv4LDGvegp3Nygz4YAIhiQuOgTPSrmxjztoas12D1OpQLvCMgSl0OTxokI9IH+Q8IshJAS+WajMuquMvqJKzgvz5jzLPIh477X+ezF70Kw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2502; 20:qngCpqCk1qnJOk/QmSGYA9IHgZNa19LhZKLtV34FhLJxWdyDwHQGSxa2ILpbGmE8iUhuv9rZ803x0jcuA21XzBbAKiZQnYwpV1FAgrCX14taSLP+ZeKUh7h7RlT2D1ZZ4bAfHjL6L7FnQrtPTb1LcGRuu1o8SzIgTHdCeAfo50rxQAs00hYRBiatZnSkhuqLZ1M9ZReiPXsIuRqP3GJD5mxWDXlljx4btfRenVQnv5vjhfucMyOqWq98VNklDm3o X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:12:51.0886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ab8c2c7-aded-4b11-90d0-08d609bae9f7 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: CY4PR1201MB2502 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 we can fetch timeline point fence after expanded. v2: The parameter fence is the result of the function and should come last. Signed-off-by: Chunming Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/drm_syncobj.c | 5 +++-- 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, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 7a625f3989a0..0e8cf088175f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1062,7 +1062,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, &fence); + r = drm_syncobj_find_fence(p->filp, handle, 0, &fence); if (r) return r; diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index d4b48fb410a1..2dcb60f4c0f7 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -217,6 +217,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) * drm_syncobj_find_fence - lookup and reference the fence in a sync object * @file_private: drm file private pointer * @handle: sync object handle to lookup. + * @point: timeline point * @fence: out parameter for the fence * * This is just a convenience function that combines drm_syncobj_find() and @@ -227,7 +228,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, + u32 handle, u64 point, struct dma_fence **fence) { struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); @@ -498,7 +499,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, &fence); + ret = drm_syncobj_find_fence(file_private, handle, 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 e1fcbb4cd0ae..d25c35c45c33 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, - &exec->bin.in_fence); + 0, &exec->bin.in_fence); if (ret == -EINVAL) goto fail; ret = drm_syncobj_find_fence(file_priv, args->in_sync_rcl, - &exec->render.in_fence); + 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 7910b9acedd6..928718b467bd 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, - &in_fence); + 0, &in_fence); if (ret) goto fail; diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index e419c79ba94d..ab9055f943c7 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, struct dma_fence *fence); int drm_syncobj_find_fence(struct drm_file *file_private, - u32 handle, + u32 handle, u64 point, struct dma_fence **fence); void drm_syncobj_free(struct kref *kref); int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, From patchwork Fri Aug 24 12:12:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575281 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 160F714E1 for ; Fri, 24 Aug 2018 12:13:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 062442A732 for ; Fri, 24 Aug 2018 12:13:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEA2A2B3C2; Fri, 24 Aug 2018 12:13:00 +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 7FBBE2A732 for ; Fri, 24 Aug 2018 12:13:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 240036E69D; Fri, 24 Aug 2018 12:12:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0083.outbound.protection.outlook.com [104.47.36.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75ED06E69B; Fri, 24 Aug 2018 12:12:57 +0000 (UTC) Received: from DM3PR12CA0081.namprd12.prod.outlook.com (2603:10b6:0:57::25) by MWHPR1201MB0126.namprd12.prod.outlook.com (2603:10b6:301:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 12:12:55 +0000 Received: from DM3NAM03FT044.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by DM3PR12CA0081.outlook.office365.com (2603:10b6:0:57::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.13 via Frontend Transport; Fri, 24 Aug 2018 12:12:55 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT044.mail.protection.outlook.com (10.152.82.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:12:55 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:12:54 -0500 From: Chunming Zhou To: Subject: [PATCH 4/8] drm: expand replace_fence to support timeline point v2 Date: Fri, 24 Aug 2018 20:12:06 +0800 Message-ID: <20180824121210.19101-4-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(428003)(189003)(199004)(7696005)(51416003)(6666003)(1076002)(68736007)(478600001)(104016004)(50466002)(47776003)(50226002)(5660300001)(8936002)(2616005)(486006)(126002)(446003)(476003)(316002)(54906003)(14444005)(97736004)(16586007)(36756003)(72206003)(2906002)(81156014)(81166006)(8676002)(48376002)(6916009)(11346002)(53936002)(305945005)(77096007)(450100002)(575784001)(4326008)(86362001)(2351001)(356003)(26005)(426003)(186003)(106466001)(105586002)(76176011)(53416004)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0126; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT044; 1:guF6luJAGEh7ILy7wYCXtzkicgPLtNbG+LU584Oo/b4S13OcssvvGDTfDcL+PzA11Tomel5j0zwDP6lf4RlMmbddWjzUPg2wzE23zATWdNO+/cNzb6MvPabAA2UdNCgz X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c74b29e7-ae28-4e44-2efd-08d609baec77 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:MWHPR1201MB0126; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0126; 3:Qxiwel6ZtxJHfqwn2gUTT0NE5PnnlmL41zjSWTpdgantP/jBbrAg3c1k2BE7z/r9MKrlu6BTo00l6sAtMpP99TvrMyKOZ6hFEEl6mdFm4PWnD4BFG/O8p96resUxMlpbMD5daNVvGnaNifzAU5CL8MCQVoCwERE4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BEsEgb4O3UNZlYjXV+9yfRY42dErxt1tKh5WQYwnNHSc7VvoSt68ivw8O1I6iEAI/IzCRjlu0JDRL+4xPu1hxqN6u3DaBLNAZMbbnX3dmdKyn0ksu97uGEltZi92UJw3S8jwoON5y2cqpnVCZmuUeJVQ6S1nb5saJY/qFH5PhEfotdX2s0fsQLo30J2pR1JrH6qnOjHZllK2qopIsTvoRvuCFupLMKo34c1mfV+cfdDTWUAOS0VGmtw/aekCAa9ig2QJKSVNR9qTD+Jmh9zsTM0L18n+zaMW75zjHycrStTkv5Am+pCV4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93003095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:MWHPR1201MB0126; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB0126; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0126; 4:IpdWOJDf8DKaLtiO2TyPjhYEo0p9OJ6AlS7dfMKYj/Q0jrhK4W6/ZB+c2bbxGqCnFXs3tc107RBwYFxlwmWy2Bs4sMlgdsrQU0weoiUVcGlk5pO5UfbsgfJFJN4eE6dFrsIw/FKH/h8FgHE/ml9wlE+T/rE9q05dn+3oszeQF9B/A2/0A2Yf7Dv7Xz+8ayWQSJyxfuNQWB/O4CUB1jGaU8nYTfOMqcz9OfvDzUOcTPx9wR4Zr1vNSpxrma0l72nJLAFCn5MY7BpRnm9l0+eNZgO4K2/FsXd85UsvFm6B3XhLjx1jpI/SsKB0FvwummvOPtNcH/UiyXXHCHU8tlx+/g== X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exch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U0X3vCMoKbIfELkgiZUwP/0Q0Lq3s6NesaruE/hP45dFQFUqfPjjTPPYFiUm9OmKig==; 5:8cRsLSyne8PzKxqkWc8PgIi5UJjrJluyFVbe2hYNdSxkfFaDjPlsMfFWHUrzFfa+shcYkNLFhNnDEHABCDOs8CTSu54TfhcqDpP6KC1Qu2HJ5G7gS5P4Hb4+91+M9tqujh1A7KP54lQgsuvZkxvs7OI2GGVUti07Dbj01Ja/VfY=; 7:ecN4NIyFzN3FFzWQZJ6Gm98KvvCi2l/BWuuH6qKnNP4Xi3G/35CqEWrOmS70tZwqweLg4H0bHLM2kA0N/twU2m2ScpVixht12U9T/Sy4t0f0Xkgxr22jhFeY+PYINYKSSIRMxDVw3f9IwfztxsSBkNSsadniQLPLNaahaLPBsOltIxCy0qy3/qS9aKQdbMIjA/TsgLOFfsgFm2r426eGmVKG9bQz1w31MqpthQZ9t8Ged0/dKISwJ/xBid21X9iZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB0126; 20:gmxSFvFHe7QPQ1S2/4n2QRf9ZkgF2WFrqN4y1TE1ZcJiXbOMisEEiisGkzCty1HCKTBvwwKb8BY9XhgtsHMq58DvDH9qeWwTx9GO4kMgAvzbRsbTbHmn9udzUMFy+wFmL+dz2ZX46XsqynKq6rRzb2MKq9I4jgJ93fvO+KrNpM9gvs2GQ2UZnjl/ifcb2Hor4kQwt1IEARwSdEhpaDSnjUTIjsashy6ibtMhyd1fdVXVBer01Fuh3Da/lAmUg0hT X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:12:55.3742 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c74b29e7-ae28-4e44-2efd-08d609baec77 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: MWHPR1201MB0126 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 we can place a fence to a timeline point after expanded. v2: change func parameter order Signed-off-by: Chunming Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/drm_syncobj.c | 14 ++++++++------ drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- drivers/gpu/drm/v3d/v3d_gem.c | 2 +- drivers/gpu/drm/vc4/vc4_gem.c | 2 +- include/drm/drm_syncobj.h | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 0e8cf088175f..1dba9223927a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1151,7 +1151,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p) int i; for (i = 0; i < p->num_post_dep_syncobjs; ++i) - drm_syncobj_replace_fence(p->post_dep_syncobjs[i], p->fence); + drm_syncobj_replace_fence(p->post_dep_syncobjs[i], 0, p->fence); } static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 2dcb60f4c0f7..ab43559398d0 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -140,11 +140,13 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj, /** * drm_syncobj_replace_fence - replace fence in a sync object. * @syncobj: Sync object to replace fence in + * @point: timeline point * @fence: fence to install in sync file. * - * This replaces the fence on a sync object. + * This replaces the fence on a sync object, or a timeline point fence. */ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, + u64 point, struct dma_fence *fence) { struct dma_fence *old_fence; @@ -206,7 +208,7 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) &fence->lock, 0, 0); dma_fence_signal(&fence->base); - drm_syncobj_replace_fence(syncobj, &fence->base); + drm_syncobj_replace_fence(syncobj, 0, &fence->base); dma_fence_put(&fence->base); @@ -257,7 +259,7 @@ void drm_syncobj_free(struct kref *kref) struct drm_syncobj *syncobj = container_of(kref, struct drm_syncobj, refcount); - drm_syncobj_replace_fence(syncobj, NULL); + drm_syncobj_replace_fence(syncobj, 0, NULL); kfree(syncobj); } EXPORT_SYMBOL(drm_syncobj_free); @@ -297,7 +299,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, } if (fence) - drm_syncobj_replace_fence(syncobj, fence); + drm_syncobj_replace_fence(syncobj, 0, fence); *out_syncobj = syncobj; return 0; @@ -482,7 +484,7 @@ static int drm_syncobj_import_sync_file_fence(struct drm_file *file_private, return -ENOENT; } - drm_syncobj_replace_fence(syncobj, fence); + drm_syncobj_replace_fence(syncobj, 0, fence); dma_fence_put(fence); drm_syncobj_put(syncobj); return 0; @@ -964,7 +966,7 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data, return ret; for (i = 0; i < args->count_handles; i++) - drm_syncobj_replace_fence(syncobjs[i], NULL); + drm_syncobj_replace_fence(syncobjs[i], 0, NULL); drm_syncobj_array_free(syncobjs, args->count_handles); diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 60dc2a865f5f..7209dd832d39 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -2211,7 +2211,7 @@ signal_fence_array(struct i915_execbuffer *eb, if (!(flags & I915_EXEC_FENCE_SIGNAL)) continue; - drm_syncobj_replace_fence(syncobj, fence); + drm_syncobj_replace_fence(syncobj, 0, fence); } } diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index d25c35c45c33..edb4b3651e1d 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -586,7 +586,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, /* Update the return sync object for the */ sync_out = drm_syncobj_find(file_priv, args->out_sync); if (sync_out) { - drm_syncobj_replace_fence(sync_out, + drm_syncobj_replace_fence(sync_out, 0, &exec->render.base.s_fence->finished); drm_syncobj_put(sync_out); } diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 928718b467bd..5b22e996af6c 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -681,7 +681,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec, exec->fence = &fence->base; if (out_sync) - drm_syncobj_replace_fence(out_sync, exec->fence); + drm_syncobj_replace_fence(out_sync, 0, exec->fence); vc4_update_bo_seqnos(exec, seqno); diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index ab9055f943c7..425432b85a87 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -131,7 +131,7 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj) struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, u32 handle); -void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, +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, From patchwork Fri Aug 24 12:12:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575283 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 59FBB14E1 for ; Fri, 24 Aug 2018 12:13:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 460712A732 for ; Fri, 24 Aug 2018 12:13:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37B202B3C2; Fri, 24 Aug 2018 12:13:08 +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 3E0F32A732 for ; Fri, 24 Aug 2018 12:13:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73C096E6A3; Fri, 24 Aug 2018 12:13:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0083.outbound.protection.outlook.com [104.47.40.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 331786E6A2; Fri, 24 Aug 2018 12:13:04 +0000 (UTC) Received: from DM3PR12CA0065.namprd12.prod.outlook.com (2603:10b6:0:56::33) by BN6PR1201MB0116.namprd12.prod.outlook.com (2603:10b6:405:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.13; Fri, 24 Aug 2018 12:13:02 +0000 Received: from DM3NAM03FT011.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by DM3PR12CA0065.outlook.office365.com (2603:10b6:0:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:13:01 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT011.mail.protection.outlook.com (10.152.82.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:13:01 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:13:00 -0500 From: Chunming Zhou To: Subject: [PATCH 5/8] [RFC]drm: add syncobj timeline support v2 Date: Fri, 24 Aug 2018 20:12:07 +0800 Message-ID: <20180824121210.19101-5-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(428003)(199004)(189003)(26005)(478600001)(305945005)(72206003)(16586007)(76176011)(356003)(14444005)(2616005)(104016004)(126002)(476003)(81166006)(36756003)(186003)(50226002)(8936002)(81156014)(8676002)(68736007)(77096007)(53936002)(316002)(54906003)(51416003)(7696005)(50466002)(6346003)(86362001)(48376002)(6916009)(47776003)(575784001)(2906002)(5660300001)(1076002)(53416004)(105586002)(4326008)(446003)(336012)(11346002)(106466001)(486006)(426003)(2351001)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0116; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT011; 1:Hs0WzOdrtxdQCIlcM2JhjLpn5QUdWNa1GsQn+Dhv9vVSY/xcnqHRGk4bPDI+IF8XjEUXwgU8JZ89IWuIuOHL+LRSQUmlMcG58Pmvzeh67DrahhOkQU3Dfr61XGrA4TjL X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1b21ba0-08be-47b1-6caf-08d609baf024 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BN6PR1201MB0116; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0116; 3:3BrL1iEI7I6qqL+GivWyRYAJRoc0x4Iv91xDjNoy5NSXkKIrOUiBWsTs1v1u1JdWDGa+gcbcGROmFn1wZBsIpmdFIsh35qr5VW+cdApwQ9rSnWTYh+ITXYLZ3vh463qHqFmGRL/tEZvJci2jWbTKe03UmZxXSvwGQl/VCcC335MarZoOIbBbpcRVSlD9NVmaoTbkvyXsspZA606qlCJ2sC9WxYHwiYEgw054xRH9cpJw3MMCzuxsngUocZ67ttj5fUcew1hdsiz0R4QwluwPLeZ+k0dm/DXZRDjNy+aMtm1S3RHO/IQAIbwqdngyEFdQFIy75TQsxfZQyckCS0kKMTW2srlNjcNSULXixunl6wI=; 25:F41PjLeHSIZTQjKyryh7ra7NwafCqk7Ff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TJeLOImaMaqc8yXYv/4g3CcjHQ5AIJ6+c4WnqxixS3HQevR8BPiY5I7FPbyVVwf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93003095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699016); SRVR:BN6PR1201MB0116; BCL:0; PCL:0; RULEID:; SRVR:BN6PR1201MB0116; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0116; 4:4J1uoXqEA1eq4J+XFW85o490dpGvDgr/M2OAkKfNgjE9M23H2frAoGzvE/T8IDR7dgu0LnOjaH7Uv26SIIqURr8W7OqMMymYJSxTGV6S88EKf1DlhC2UCFV7ZaOqjAHjdtdvx+x/FY5H1Zy2PIAFWiRh1CnqFt/ZFdAGoaOTWKhKGtl2nLIoikYY94H1VqmMNHYf5+dt63pKc7eRvwzT6ReDC59KVjFvFvdEflG4cuw0bim79wyIPcv+yfXSGXSzn0DMKD+4kjZQSVNXQS4tVQTfjg/3ps43lGIBoSoext6Ar7Pdm17MfuwQBfhQOhdoi/qfRnSqYb4AubSPJ4mRVw== X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0116; 23:jBPBwqYzr7VTLVgZx0Tr9JyCvy/FCx6H0k/Kjr8?= rsgky3EbYV4aLI9WSo+QbCpYQuU3cE7GNiO+Twzso8UzFWEF6QU0KlhhXD1bcbrviwTy02QTzm6Jwq7kr5q2NY8qDI+/G9uKdYymue4ArZ8g1MVCtcsUGCIdFEudO70DZDcGrZA7MWLYHffyaWx8zJUSK4ET5W+5FQIKyboe5fq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vH7n8GDt2SKRrfQ2OVWhyBRScrDe+pisp6CTaOzgPji+wx2DzNHq7IDW+bxetASR5h8LqGbZxjrAb/3ZYvkX5itlbBAR30KSPZS/eTrtfFbfA7jPN3fhW7sLz7cYv+mUin7FIHq43+yAXzivKrKEQ3qKH2zSVrF8Ws9ph/mBYSksenHg6s0HZQfSXtuYwkXxwVhuHVP6xN6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0116; 20:NNnjToMQVwEw3WflMbfvJ6Myr1X2SfkPXxgH4TyqIEPDZqnXR8RV9lAxQgcdxdKdlwL3sFMCy77PPAnYpe0yTJhnKNFNDF3ryUtmM+Rg+19bblQhrJb+ybY3iMaS0KR6EocYfeGpoQFyJ1mTrtXc25qroBTUg5jROqfPmKktNXbcfN0KljQwzGq7rm+xSF3qw2L/btQqN+xBIjlONbdH22oP3l5yv68H3vV+EFCIav/QGUjjPWByxyrX5UwmfXbf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:13:01.4021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1b21ba0-08be-47b1-6caf-08d609baf024 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: BN6PR1201MB0116 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, Daniel Rakos , Dave Airlie , Christian Konig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP VK_KHR_timeline_semaphore: This extension introduces a new type of semaphore that has an integer payload identifying a point in a timeline. Such timeline semaphores support the following operations: * CPU query - A host operation that allows querying the payload of the timeline semaphore. * CPU wait - A host operation that allows a blocking wait for a timeline semaphore to reach a specified value. * Device wait - A device operation that allows waiting for a timeline semaphore to reach a specified value. * Device signal - A device operation that allows advancing the timeline semaphore to a specified value. Since it's a timeline, that means the front time point(PT) always is signaled before the late PT. a. signal PT design: Signal PT fence N depends on PT[N-1] fence and signal opertion fence, when PT[N] fence is signaled, the timeline will increase to value of PT[N]. b. wait PT design: Wait PT fence is signaled by reaching timeline point value, when timeline is increasing, will compare wait PTs value with new timeline value, if PT value is lower than timeline value, then wait PT will be signaled, otherwise keep in list. semaphore wait operation can wait on any point of timeline, so need a RB tree to order them. And wait PT could ahead of signal PT, we need a sumission fence to perform that. v2: 1. remove unused DRM_SYNCOBJ_CREATE_TYPE_NORMAL. (Christian) 2. move unexposed denitions to .c file. (Daniel Vetter) 3. split up the change to drm_syncobj_find_fence() in a separate patch. (Christian) 4. split up the change to drm_syncobj_replace_fence() in a separate patch. 5. drop the submission_fence implementation and instead use wait_event() for that. (Christian) 6. WARN_ON(point != 0) for NORMAL type syncobj case. (Daniel Vetter) TODO: 1. CPU query and wait on timeline semaphore. 2. test application (Daniel Vetter) Signed-off-by: Chunming Zhou Cc: Christian Konig Cc: Dave Airlie Cc: Daniel Rakos Cc: Daniel Vetter --- drivers/gpu/drm/drm_syncobj.c | 384 ++++++++++++++++++++++++++++++++-- include/drm/drm_syncobj.h | 28 +++ include/uapi/drm/drm.h | 1 + 3 files changed, 390 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index ab43559398d0..e0d89a84359f 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -56,6 +56,44 @@ #include "drm_internal.h" #include +struct drm_syncobj_stub_fence { + struct dma_fence base; + spinlock_t lock; +}; + +static const char *drm_syncobj_stub_fence_get_name(struct dma_fence *fence) +{ + return "syncobjstub"; +} + +static bool drm_syncobj_stub_fence_enable_signaling(struct dma_fence *fence) +{ + return !dma_fence_is_signaled(fence); +} + +static const struct dma_fence_ops drm_syncobj_stub_fence_ops = { + .get_driver_name = drm_syncobj_stub_fence_get_name, + .get_timeline_name = drm_syncobj_stub_fence_get_name, + .enable_signaling = drm_syncobj_stub_fence_enable_signaling, + .release = NULL, +}; + +struct drm_syncobj_wait_pt { + struct drm_syncobj_stub_fence base; + u64 value; + struct rb_node node; +}; +struct drm_syncobj_signal_pt { + struct drm_syncobj_stub_fence base; + struct dma_fence *signal_fence; + struct dma_fence *pre_pt_base; + struct dma_fence_cb signal_cb; + struct dma_fence_cb pre_pt_cb; + struct drm_syncobj *syncobj; + u64 value; + struct list_head list; +}; + /** * drm_syncobj_find - lookup and reference a sync object. * @file_private: drm file private pointer @@ -137,6 +175,152 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj, spin_unlock(&syncobj->lock); } +static void drm_syncobj_timeline_signal_wait_pts(struct drm_syncobj *syncobj) +{ + struct rb_node *node = NULL; + struct drm_syncobj_wait_pt *wait_pt = NULL; + + spin_lock(&syncobj->lock); + for(node = rb_first(&syncobj->syncobj_timeline.wait_pt_tree); + node != NULL; ) { + wait_pt = rb_entry(node, struct drm_syncobj_wait_pt, node); + node = rb_next(node); + if (wait_pt->value <= syncobj->syncobj_timeline.timeline) { + dma_fence_signal(&wait_pt->base.base); + rb_erase(&wait_pt->node, + &syncobj->syncobj_timeline.wait_pt_tree); + RB_CLEAR_NODE(&wait_pt->node); + /* kfree(wait_pt) is excuted by fence put */ + dma_fence_put(&wait_pt->base.base); + } else { + /* the loop is from left to right, the later entry value is + * bigger, so don't need to check any more */ + break; + } + } + spin_unlock(&syncobj->lock); +} + + +static void pt_fence_cb(struct drm_syncobj_signal_pt *signal_pt) +{ + struct dma_fence *fence = NULL; + struct drm_syncobj *syncobj; + + fence = signal_pt->signal_fence; + signal_pt->signal_fence = NULL; + dma_fence_put(fence); + fence = signal_pt->pre_pt_base; + signal_pt->pre_pt_base = NULL; + dma_fence_put(fence); + + syncobj = signal_pt->syncobj; + spin_lock(&syncobj->lock); + list_del(&signal_pt->list); + syncobj->syncobj_timeline.timeline = signal_pt->value; + spin_unlock(&syncobj->lock); + /* kfree(signal_pt) will be executed by below fence put */ + dma_fence_put(&signal_pt->base.base); + drm_syncobj_timeline_signal_wait_pts(syncobj); +} +static void pt_signal_fence_func(struct dma_fence *fence, + struct dma_fence_cb *cb) +{ + struct drm_syncobj_signal_pt *signal_pt = + container_of(cb, struct drm_syncobj_signal_pt, signal_cb); + + if (signal_pt->pre_pt_base && + !dma_fence_is_signaled(signal_pt->pre_pt_base)) + return; + + pt_fence_cb(signal_pt); +} +static void pt_pre_fence_func(struct dma_fence *fence, + struct dma_fence_cb *cb) +{ + struct drm_syncobj_signal_pt *signal_pt = + container_of(cb, struct drm_syncobj_signal_pt, pre_pt_cb); + + if (signal_pt->signal_fence && + !dma_fence_is_signaled(signal_pt->pre_pt_base)) + return; + + pt_fence_cb(signal_pt); +} + +static int drm_syncobj_timeline_create_signal_pt(struct drm_syncobj *syncobj, + struct dma_fence *fence, + u64 point) +{ + struct drm_syncobj_signal_pt *signal_pt = + kzalloc(sizeof(struct drm_syncobj_signal_pt), GFP_KERNEL); + struct drm_syncobj_signal_pt *tail_pt; + struct dma_fence *tail_pt_fence = NULL; + int ret = 0; + + if (!signal_pt) + return -ENOMEM; + if (syncobj->syncobj_timeline.signal_point >= point) { + DRM_WARN("A later signal is ready!"); + goto out; + } + if (fence) + dma_fence_get(fence); + spin_lock(&syncobj->lock); + spin_lock_init(&signal_pt->base.lock); + dma_fence_init(&signal_pt->base.base, + &drm_syncobj_stub_fence_ops, + &signal_pt->base.lock, + syncobj->syncobj_timeline.timeline_context, point); + signal_pt->signal_fence = + rcu_dereference_protected(fence, + lockdep_is_held(&fence->lock)); + if (!list_empty(&syncobj->syncobj_timeline.signal_pt_list)) { + tail_pt = list_last_entry(&syncobj->syncobj_timeline.signal_pt_list, + struct drm_syncobj_signal_pt, list); + tail_pt_fence = &tail_pt->base.base; + if (dma_fence_is_signaled(tail_pt_fence)) + tail_pt_fence = NULL; + } + if (tail_pt_fence) + signal_pt->pre_pt_base = + dma_fence_get(rcu_dereference_protected(tail_pt_fence, + lockdep_is_held(&tail_pt_fence->lock))); + + signal_pt->value = point; + syncobj->syncobj_timeline.signal_point = point; + signal_pt->syncobj = syncobj; + INIT_LIST_HEAD(&signal_pt->list); + list_add_tail(&signal_pt->list, &syncobj->syncobj_timeline.signal_pt_list); + spin_unlock(&syncobj->lock); + wake_up_all(&syncobj->syncobj_timeline.wq); + /** + * Every pt is depending on signal fence and previous pt fence, add + * callbacks to them + */ + if (!dma_fence_is_signaled(signal_pt->signal_fence)) + dma_fence_add_callback(signal_pt->signal_fence, + &signal_pt->signal_cb, + pt_signal_fence_func); + else + pt_signal_fence_func(signal_pt->signal_fence, + &signal_pt->signal_cb); + if (signal_pt->pre_pt_base) { + if (!dma_fence_is_signaled(signal_pt->pre_pt_base)) + dma_fence_add_callback(signal_pt->pre_pt_base, + &signal_pt->pre_pt_cb, + pt_pre_fence_func); + else + pt_pre_fence_func(signal_pt->pre_pt_base, + &signal_pt->pre_pt_cb); + } + + return 0; +out: + kfree(signal_pt); + return ret; +} + /** * drm_syncobj_replace_fence - replace fence in a sync object. * @syncobj: Sync object to replace fence in @@ -152,6 +336,10 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, struct dma_fence *old_fence; struct drm_syncobj_cb *cur, *tmp; + if (syncobj->type == DRM_SYNCOBJ_TYPE_TIMELINE) { + drm_syncobj_timeline_create_signal_pt(syncobj, fence, point); + return; + } if (fence) dma_fence_get(fence); @@ -174,28 +362,6 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, } EXPORT_SYMBOL(drm_syncobj_replace_fence); -struct drm_syncobj_stub_fence { - struct dma_fence base; - spinlock_t lock; -}; - -static const char *drm_syncobj_stub_fence_get_name(struct dma_fence *fence) -{ - return "syncobjstub"; -} - -static bool drm_syncobj_stub_fence_enable_signaling(struct dma_fence *fence) -{ - return !dma_fence_is_signaled(fence); -} - -static const struct dma_fence_ops drm_syncobj_stub_fence_ops = { - .get_driver_name = drm_syncobj_stub_fence_get_name, - .get_timeline_name = drm_syncobj_stub_fence_get_name, - .enable_signaling = drm_syncobj_stub_fence_enable_signaling, - .release = NULL, -}; - static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) { struct drm_syncobj_stub_fence *fence; @@ -215,6 +381,121 @@ static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) return 0; } +static struct drm_syncobj_wait_pt * +drm_syncobj_timeline_lookup_wait_pt(struct drm_syncobj *syncobj, u64 point) +{ + struct rb_node *node = syncobj->syncobj_timeline.wait_pt_tree.rb_node; + struct drm_syncobj_wait_pt *wait_pt = NULL; + + + spin_lock(&syncobj->lock); + while(node) { + int result = point - wait_pt->value; + + wait_pt = rb_entry(node, struct drm_syncobj_wait_pt, node); + if (result < 0) + node = node->rb_left; + else if (result > 0) + node = node->rb_right; + else + break; + } + spin_unlock(&syncobj->lock); + + return wait_pt; +} + +static struct drm_syncobj_wait_pt * +drm_syncobj_timeline_create_wait_pt(struct drm_syncobj *syncobj, u64 point) +{ + struct drm_syncobj_wait_pt *wait_pt; + struct rb_node **new = &(syncobj->syncobj_timeline.wait_pt_tree.rb_node), *parent = NULL; + + wait_pt = kzalloc(sizeof(*wait_pt), GFP_KERNEL); + if (!wait_pt) + return NULL; + spin_lock_init(&wait_pt->base.lock); + dma_fence_init(&wait_pt->base.base, + &drm_syncobj_stub_fence_ops, + &wait_pt->base.lock, + syncobj->syncobj_timeline.timeline_context, point); + wait_pt->value = point; + + /* wait pt must be in an order, so that we can easily lookup and signal + * it */ + spin_lock(&syncobj->lock); + if (point <= syncobj->syncobj_timeline.timeline) + dma_fence_signal(&wait_pt->base.base); + while(*new) { + struct drm_syncobj_wait_pt *this = + rb_entry(*new, struct drm_syncobj_wait_pt, node); + int result = wait_pt->value - this->value; + + parent = *new; + if (result < 0) + new = &((*new)->rb_left); + else if (result > 0) + new = &((*new)->rb_right); + else + goto exist; + } + + rb_link_node(&wait_pt->node, parent, new); + rb_insert_color(&wait_pt->node, &syncobj->syncobj_timeline.wait_pt_tree); + spin_unlock(&syncobj->lock); + return wait_pt; +exist: + spin_unlock(&syncobj->lock); + dma_fence_put(&wait_pt->base.base); + wait_pt = drm_syncobj_timeline_lookup_wait_pt(syncobj, point); + return wait_pt; +} + +static struct dma_fence * +drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flag) +{ + struct drm_syncobj_wait_pt *wait_pt; + + /* already signaled, simply return a signaled stub fence */ + if (point <= syncobj->syncobj_timeline.timeline) { + struct drm_syncobj_stub_fence *fence; + + fence = kzalloc(sizeof(*fence), GFP_KERNEL); + if (fence == NULL) + return NULL; + + spin_lock_init(&fence->lock); + dma_fence_init(&fence->base, &drm_syncobj_stub_fence_ops, + &fence->lock, 0, 0); + dma_fence_signal(&fence->base); + return &fence->base; + } + + /* check if the wait pt exists */ + wait_pt = drm_syncobj_timeline_lookup_wait_pt(syncobj, point); + if (!wait_pt) { + /* This is a new wait pt, so create it */ + wait_pt = drm_syncobj_timeline_create_wait_pt(syncobj, point); + if (!wait_pt) + return NULL; + } + if (wait_pt) { + struct dma_fence *fence; + int ret = + wait_event_interruptible_timeout(syncobj->syncobj_timeline.wq, + wait_pt->value <= syncobj->syncobj_timeline.signal_point, + msecs_to_jiffies(10000)); /* wait 10s */ + + if (ret <= 0) + return NULL; + rcu_read_lock(); + fence = dma_fence_get_rcu(&wait_pt->base.base); + rcu_read_unlock(); + return fence; + } + return NULL; +} + /** * drm_syncobj_find_fence - lookup and reference the fence in a sync object * @file_private: drm file private pointer @@ -239,7 +520,17 @@ int drm_syncobj_find_fence(struct drm_file *file_private, if (!syncobj) return -ENOENT; - *fence = drm_syncobj_fence_get(syncobj); + if (syncobj->type == DRM_SYNCOBJ_TYPE_NORMAL) { + /* NORMAL syncobj doesn't care point value */ + WARN_ON(point != 0); + *fence = drm_syncobj_fence_get(syncobj); + } else if (syncobj->type == DRM_SYNCOBJ_TYPE_TIMELINE) { + *fence = drm_syncobj_timeline_point_get(syncobj, point, + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT); + } else { + DRM_ERROR("Don't support this type syncobj\n"); + *fence = NULL; + } if (!*fence) { ret = -EINVAL; } @@ -248,6 +539,34 @@ int drm_syncobj_find_fence(struct drm_file *file_private, } EXPORT_SYMBOL(drm_syncobj_find_fence); +static void drm_syncobj_timeline_fini(struct drm_syncobj *syncobj, + struct drm_syncobj_timeline *syncobj_timeline) +{ + struct rb_node *node = NULL; + struct drm_syncobj_wait_pt *wait_pt = NULL; + struct drm_syncobj_signal_pt *signal_pt = NULL, *tmp; + + spin_lock(&syncobj->lock); + for(node = rb_first(&syncobj_timeline->wait_pt_tree); + node != NULL; ) { + wait_pt = rb_entry(node, struct drm_syncobj_wait_pt, node); + node = rb_next(node); + rb_erase(&wait_pt->node, + &syncobj_timeline->wait_pt_tree); + RB_CLEAR_NODE(&wait_pt->node); + /* kfree(wait_pt) is excuted by fence put */ + dma_fence_put(&wait_pt->base.base); + } + list_for_each_entry_safe(signal_pt, tmp, + &syncobj_timeline->signal_pt_list, list) { + list_del(&signal_pt->list); + dma_fence_put(signal_pt->signal_fence); + dma_fence_put(signal_pt->pre_pt_base); + dma_fence_put(&signal_pt->base.base); + } + spin_unlock(&syncobj->lock); +} + /** * drm_syncobj_free - free a sync object. * @kref: kref to free. @@ -260,10 +579,23 @@ void drm_syncobj_free(struct kref *kref) struct drm_syncobj, refcount); drm_syncobj_replace_fence(syncobj, 0, NULL); + drm_syncobj_timeline_fini(syncobj, &syncobj->syncobj_timeline); kfree(syncobj); } EXPORT_SYMBOL(drm_syncobj_free); +static void drm_syncobj_timeline_init(struct drm_syncobj_timeline + *syncobj_timeline) +{ + syncobj_timeline->timeline_context = dma_fence_context_alloc(1); + syncobj_timeline->timeline = 0; + syncobj_timeline->signal_point = 0; + init_waitqueue_head(&syncobj_timeline->wq); + + syncobj_timeline->wait_pt_tree = RB_ROOT; + INIT_LIST_HEAD(&syncobj_timeline->signal_pt_list); +} + /** * drm_syncobj_create - create a new syncobj * @out_syncobj: returned syncobj @@ -289,6 +621,12 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, kref_init(&syncobj->refcount); INIT_LIST_HEAD(&syncobj->cb_list); spin_lock_init(&syncobj->lock); + if (flags & DRM_SYNCOBJ_CREATE_TYPE_TIMELINE) { + syncobj->type = DRM_SYNCOBJ_TYPE_TIMELINE; + drm_syncobj_timeline_init(&syncobj->syncobj_timeline); + } else { + syncobj->type = DRM_SYNCOBJ_TYPE_NORMAL; + } if (flags & DRM_SYNCOBJ_CREATE_SIGNALED) { ret = drm_syncobj_assign_null_handle(syncobj); diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 425432b85a87..fb4e7edf90bf 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -30,6 +30,25 @@ struct drm_syncobj_cb; +enum drm_syncobj_type { + DRM_SYNCOBJ_TYPE_NORMAL, + DRM_SYNCOBJ_TYPE_TIMELINE +}; + +struct drm_syncobj_timeline { + wait_queue_head_t wq; + u64 timeline_context; + /** + * @timeline: syncobj timeline + */ + u64 timeline; + u64 signal_point; + + + struct rb_root wait_pt_tree; + struct list_head signal_pt_list; +}; + /** * struct drm_syncobj - sync object. * @@ -40,6 +59,15 @@ struct drm_syncobj { * @refcount: Reference count of this object. */ struct kref refcount; + /** + * @type: indicate syncobj type + */ + enum drm_syncobj_type type; + /** + * @syncobj_timeline: timeline + */ + struct drm_syncobj_timeline syncobj_timeline; + /** * @fence: * NULL or a pointer to the fence bound to this object. diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 300f336633f2..cebdb2541eb7 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -717,6 +717,7 @@ struct drm_prime_handle { struct drm_syncobj_create { __u32 handle; #define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) +#define DRM_SYNCOBJ_CREATE_TYPE_TIMELINE (1 << 1) __u32 flags; }; From patchwork Fri Aug 24 12:12:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575285 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 DCAF6112E for ; Fri, 24 Aug 2018 12:13:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD56F2A732 for ; Fri, 24 Aug 2018 12:13:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C16EF2B3C2; Fri, 24 Aug 2018 12:13:12 +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 42F882A732 for ; Fri, 24 Aug 2018 12:13:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFA286E6A8; Fri, 24 Aug 2018 12:13:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690051.outbound.protection.outlook.com [40.107.69.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9CE16E6A7; Fri, 24 Aug 2018 12:13:07 +0000 (UTC) Received: from BN6PR1201CA0006.namprd12.prod.outlook.com (2603:10b6:405:4c::16) by CY4PR1201MB2503.namprd12.prod.outlook.com (2603:10b6:903:d1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Fri, 24 Aug 2018 12:13:06 +0000 Received: from DM3NAM03FT063.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by BN6PR1201CA0006.outlook.office365.com (2603:10b6:405:4c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:13:06 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT063.mail.protection.outlook.com (10.152.83.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:13:05 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:13:04 -0500 From: Chunming Zhou To: Subject: [PATCH 6/8] drm: merge normal syncobj to timeline syncobj Date: Fri, 24 Aug 2018 20:12:08 +0800 Message-ID: <20180824121210.19101-6-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(396003)(39860400002)(136003)(346002)(376002)(2980300002)(428003)(199004)(189003)(316002)(53936002)(186003)(26005)(77096007)(104016004)(336012)(50226002)(305945005)(36756003)(68736007)(356003)(8936002)(16586007)(54906003)(7696005)(51416003)(76176011)(86362001)(4326008)(575784001)(446003)(106466001)(478600001)(11346002)(8676002)(426003)(2906002)(5660300001)(450100002)(6916009)(1076002)(14444005)(81156014)(81166006)(2616005)(47776003)(48376002)(476003)(126002)(486006)(2351001)(53416004)(72206003)(50466002)(97736004)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB2503; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT063; 1:1mLOaFPuvSWYbsLenQALXRsGW9NLnbNPM3iyfxSjxycpn7iFCY94MOTbkWSwJb3UVFRgCm5F9m63uhqgjWNrcQy0ts35Q8PFV7n/xrivYYjOH+hUefiCODGqTRWT5frU X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7d7b42c-a96c-4aa8-df69-08d609baf2ca X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:CY4PR1201MB2503; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2503; 3:fkZmR0YY7Ylsspl/RuE9ug+YkawN+lpicBIHqj7pRUlv4gZVq2Z0s4xW/mBiNOVcyML32O9Ob4s7k9Y9igr/2yAvX67ADyUUsGd+ZmYNKNTdgsKUYndUdUyCe+tQ9pM0ms0M5VBG2WLm7R7x6hcMkpR5G68FP+FLAO3ALIOGp7XKde2aqgVE9tI7yv4P+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zV1RyKXE3ZlygjvDZA95C4r60Oj3RinjIY+uNvCmfQtGsrLvaA5zcwVqKL53z/FWQF2SeOY/PpFcwPxWRq14PCXzTU+dz5GTfx0uTYnq05PyGtOh0abCTWSNV5bt+xDy9JtPJKKlo2GJ5pJyRlFspy6TqpAcs1ADDnYAveRuzrCPU+kNANMc37KoTHTLHTKuE6nS692CE3XM92D/YqLIl3Fcb1pCHjf4stH9TrTWt1uZcmQnIuYBQ8NuUYAuXCtPFEsGat 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)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93003095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:CY4PR1201MB2503; BCL:0; PCL:0; RULEID:; SRVR:CY4PR1201MB2503; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2503; 4:NaIIUMN1b3x5HCzMVCvlqd4hacBS2E0yxGg97MpOoNDf68D8m5tj7YAJA/HQ8F75lxLpOz+PMMdfMg7Yok7BLur5FjcaJhH3S1KzFdxtyTQ0DCMaXc8pnmuEYxRfifEabrH1R8bEpDectMGkBSJ8wAoV34a5LuEEPceTgY7mcxXO7lTMyF14ARJfsS6r7f3mPLmgIMiB4VQ0/n8iIxz7AADrkUbRFRwx3Q0LhXEcuyopA74pXhJLqeWN7tpNJVXHmjSWWYi8DmYvk/H8Yk2YWe5t2m0aqpcAlDi3GVmr3jPlQdb4PryHiTKdlyamfRy9 X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB2503; 23:lTD9pxZEdWTqp88Z/dHkeYKb2HofEurD+SAy7tr?= 7oS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X7gmIGDU6ql6TZsX519x8jfSZqrYoo05ZYkoK4xI2omSQk4KWZjiE/0PlnK5YyU5bjDdH4W5uAF7OlZ+EEVTZepb/PawX/prRGgsbLRaKShJQJdzL2tpwx7KCgjA9oHOq8nYgLx38niX9oR3HrQ=; 7:alUdxDhKpiGgwyZUTkRthAjNFYQTvhxNGdfhCyl3VMzYHmCJ6z0jJYwnoQ8Y2hnuFGpVAMm8GsrvblezY1iRPiPE9lPuD5voOEtDe24BIX8OwZqWNrgeBoS92KGWenEPoEveV1LsijjtICU5Dj8CRoxXtXa5861Awqqe6Qitem+9Qf3h9ZI9joRycEFd/P9Cw11B+OReEz/EuPP3y7IXJ1ikv9SoetfMQ1LaTAed4cmym4hDbG3OC8ZixyXvnD6v SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB2503; 20:28tmcBqUCjT8fq/LxLENdwgI56yvwlzgxWYsPTh76UA96hq6fiaNXu6K1imcB7JcRoRIEEC4iqoIDe3lhZ3SmcrKswdsj+Nc3GUqv2J0osvo3eBH3jCt31tharuuC70Ze09g0p55gd+W7X20FXFOwPTPXG27v3N8EXzd3iqfFtAkQBWsPYXT2PYLTiSw1UQzS/4zK6dD/u8xRR4wubta+RmU0PO1dX0Noqhz6WKY4BXIwwk8GLeE0t4u5Gv3LN+3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:13:05.9733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7d7b42c-a96c-4aa8-df69-08d609baf2ca 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: CY4PR1201MB2503 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 normal syncobj can be unified to timeline syncobj. The thingking is: a. singal op always append to sinal list tail. b. wait op always wait on last sinal point. the driver indeed be simplified more. Signed-off-by: Chunming Zhou --- drivers/gpu/drm/drm_syncobj.c | 113 ++++++++++++++++------------------ 1 file changed, 52 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index e0d89a84359f..ff0b1fdfd9a8 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -56,6 +56,9 @@ #include "drm_internal.h" #include +/* merge normal syncobj to timeline syncobj, the point interval is 1 */ +#define DRM_SYNCOBJ_NORMAL_POINT 1 + struct drm_syncobj_stub_fence { struct dma_fence base; spinlock_t lock; @@ -333,32 +336,17 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point, struct dma_fence *fence) { - struct dma_fence *old_fence; - struct drm_syncobj_cb *cur, *tmp; - if (syncobj->type == DRM_SYNCOBJ_TYPE_TIMELINE) { drm_syncobj_timeline_create_signal_pt(syncobj, fence, point); return; + } else if (syncobj->type == DRM_SYNCOBJ_TYPE_NORMAL) { + u64 pt_value = syncobj->syncobj_timeline.signal_point + + DRM_SYNCOBJ_NORMAL_POINT; + drm_syncobj_timeline_create_signal_pt(syncobj, fence, pt_value); + return; + } else { + DRM_ERROR("the syncobj type isn't support\n"); } - if (fence) - dma_fence_get(fence); - - spin_lock(&syncobj->lock); - - old_fence = rcu_dereference_protected(syncobj->fence, - lockdep_is_held(&syncobj->lock)); - rcu_assign_pointer(syncobj->fence, fence); - - if (fence != old_fence) { - list_for_each_entry_safe(cur, tmp, &syncobj->cb_list, node) { - list_del_init(&cur->node); - cur->func(syncobj, cur); - } - } - - spin_unlock(&syncobj->lock); - - dma_fence_put(old_fence); } EXPORT_SYMBOL(drm_syncobj_replace_fence); @@ -452,7 +440,7 @@ drm_syncobj_timeline_create_wait_pt(struct drm_syncobj *syncobj, u64 point) } static struct dma_fence * -drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flag) +drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flags) { struct drm_syncobj_wait_pt *wait_pt; @@ -481,13 +469,15 @@ drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flag) } if (wait_pt) { struct dma_fence *fence; - int ret = - wait_event_interruptible_timeout(syncobj->syncobj_timeline.wq, - wait_pt->value <= syncobj->syncobj_timeline.signal_point, - msecs_to_jiffies(10000)); /* wait 10s */ - - if (ret <= 0) - return NULL; + int ret = 0; + + if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { + ret = wait_event_interruptible_timeout(syncobj->syncobj_timeline.wq, + wait_pt->value <= syncobj->syncobj_timeline.signal_point, + msecs_to_jiffies(10000)); /* wait 10s */ + if (ret <= 0) + return NULL; + } rcu_read_lock(); fence = dma_fence_get_rcu(&wait_pt->base.base); rcu_read_unlock(); @@ -510,23 +500,26 @@ drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flag) * contains a reference to the fence, which must be released by calling * dma_fence_put(). */ -int drm_syncobj_find_fence(struct drm_file *file_private, - u32 handle, u64 point, - struct dma_fence **fence) +static int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, + u64 flags, struct dma_fence **fence) { - struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); int ret = 0; if (!syncobj) return -ENOENT; if (syncobj->type == DRM_SYNCOBJ_TYPE_NORMAL) { + u64 tail_pt_value = syncobj->syncobj_timeline.signal_point; + + if (tail_pt_value == 0) + tail_pt_value += DRM_SYNCOBJ_NORMAL_POINT; /* NORMAL syncobj doesn't care point value */ WARN_ON(point != 0); - *fence = drm_syncobj_fence_get(syncobj); + *fence = drm_syncobj_timeline_point_get(syncobj, tail_pt_value, + flags); } else if (syncobj->type == DRM_SYNCOBJ_TYPE_TIMELINE) { *fence = drm_syncobj_timeline_point_get(syncobj, point, - DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT); + flags); } else { DRM_ERROR("Don't support this type syncobj\n"); *fence = NULL; @@ -537,6 +530,15 @@ int drm_syncobj_find_fence(struct drm_file *file_private, drm_syncobj_put(syncobj); return ret; } +int drm_syncobj_find_fence(struct drm_file *file_private, + u32 handle, u64 point, + struct dma_fence **fence) { + struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); + + return drm_syncobj_search_fence(syncobj, point, + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, + fence); +} EXPORT_SYMBOL(drm_syncobj_find_fence); static void drm_syncobj_timeline_fini(struct drm_syncobj *syncobj, @@ -578,7 +580,6 @@ void drm_syncobj_free(struct kref *kref) struct drm_syncobj *syncobj = container_of(kref, struct drm_syncobj, refcount); - drm_syncobj_replace_fence(syncobj, 0, NULL); drm_syncobj_timeline_fini(syncobj, &syncobj->syncobj_timeline); kfree(syncobj); } @@ -1031,14 +1032,11 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, signaled_count = 0; for (i = 0; i < count; ++i) { entries[i].task = current; - entries[i].fence = drm_syncobj_fence_get(syncobjs[i]); + ret = drm_syncobj_search_fence(syncobjs[i], 0, 0, + &entries[i].fence); if (!entries[i].fence) { - if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { - continue; - } else { - ret = -EINVAL; - goto cleanup_entries; - } + ret = -EINVAL; + goto cleanup_entries; } if (dma_fence_is_signaled(entries[i].fence)) { @@ -1066,15 +1064,6 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, * fallthough and try a 0 timeout wait! */ - if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) { - for (i = 0; i < count; ++i) { - drm_syncobj_fence_get_or_add_callback(syncobjs[i], - &entries[i].fence, - &entries[i].syncobj_cb, - syncobj_wait_syncobj_func); - } - } - do { set_current_state(TASK_INTERRUPTIBLE); @@ -1122,13 +1111,10 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, cleanup_entries: for (i = 0; i < count; ++i) { - if (entries[i].syncobj_cb.func) - drm_syncobj_remove_callback(syncobjs[i], - &entries[i].syncobj_cb); + dma_fence_put(entries[i].fence); if (entries[i].fence_cb.func) dma_fence_remove_callback(entries[i].fence, &entries[i].fence_cb); - dma_fence_put(entries[i].fence); } kfree(entries); @@ -1303,12 +1289,17 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data, if (ret < 0) return ret; - for (i = 0; i < args->count_handles; i++) - drm_syncobj_replace_fence(syncobjs[i], 0, NULL); - + for (i = 0; i < args->count_handles; i++) { + if (syncobjs[i]->type == DRM_SYNCOBJ_TYPE_TIMELINE) { + DRM_ERROR("timeline syncobj cannot reset!\n"); + ret = -EINVAL; + goto out; + } + } +out: drm_syncobj_array_free(syncobjs, args->count_handles); - return 0; + return ret; } int From patchwork Fri Aug 24 12:12:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575287 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 B592614E1 for ; Fri, 24 Aug 2018 12:13:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6BE52B376 for ; Fri, 24 Aug 2018 12:13:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99E422B69A; Fri, 24 Aug 2018 12:13:18 +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 40F4A2B376 for ; Fri, 24 Aug 2018 12:13:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F9B46E6A6; Fri, 24 Aug 2018 12:13:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0042.outbound.protection.outlook.com [104.47.34.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id A62036E695; Fri, 24 Aug 2018 12:13:14 +0000 (UTC) Received: from MWHPR1201CA0012.namprd12.prod.outlook.com (2603:10b6:301:4a::22) by DM5PR1201MB0121.namprd12.prod.outlook.com (2603:10b6:4:55::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Fri, 24 Aug 2018 12:13:13 +0000 Received: from DM3NAM03FT052.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by MWHPR1201CA0012.outlook.office365.com (2603:10b6:301:4a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:13:13 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT052.mail.protection.outlook.com (10.152.83.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:13:12 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:13:11 -0500 From: Chunming Zhou To: Subject: [PATCH 7/8] drm: export syncobj search fence to replace fence_get Date: Fri, 24 Aug 2018 20:12:09 +0800 Message-ID: <20180824121210.19101-7-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(136003)(39860400002)(396003)(346002)(376002)(2980300002)(428003)(199004)(189003)(86362001)(575784001)(16586007)(486006)(36756003)(316002)(426003)(446003)(336012)(7696005)(51416003)(54906003)(126002)(2616005)(11346002)(76176011)(8936002)(50226002)(476003)(72206003)(2906002)(68736007)(450100002)(478600001)(53936002)(4326008)(2351001)(48376002)(50466002)(5660300001)(105586002)(106466001)(104016004)(26005)(1076002)(6916009)(53416004)(81156014)(8676002)(81166006)(77096007)(47776003)(305945005)(97736004)(186003)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0121; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT052; 1:VTjdQ3ahAeMKQG3Jy1l/tgT4Jxo48JNInX9nlydkm5GeSHUk2XR3MYW2pdWXbmkt2TpZwkh6oVBdp1eldeF5PUHuJMwBSpFa0sZAICgC5lczHpXU5SmJzwJOgTsQKcmM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c68612ed-b0aa-4775-bb8c-08d609baf6ea X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:DM5PR1201MB0121; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0121; 3:BXvLgUBuo+CHY8TL4Jjoe5IfjiNt2EPdv/WkXIkpOv80c1QjjXsd+MJSqVUU8Xje/Ys2BdUfk4dZVOudcHAVlVMDBuUbZnjnuz4eoVI3ux53gCGzFq9rX2K3mcjIduxAjKx76TJZhOJ9ZUbG77D1qosEZqfTgggXghvYszgTXxhP3OHRxNGmwOvFfQR/SxlZNabweoqYyyJNCbdnzIckUocKqgzDBTqU3okqD+UALcbKsZjw6jQVtPDzIuWq7r8PdgPTg2e6MOf3PqwKVo3Z0Oq9QW8YiZIVOXrXc8ssxxltq1dJDxQzxR7e0OOlgheNtLVbCFpWick9RDthAkGTQnfWWdl9l8L3Gdybom3t618=; 25:qtWpR9F9kUMxf0/HluApOY2fZ9cEYtg7YTYAElkHOME25KmE9qxPfrPOcvS+mAriwI70SvXvfXEAK5tX090JeLoGqnSrGlTFL7C4fKgh1j0sriGFdbwHRnw2eOOUpV+HnbFQyzxgbGdmHojMOqLAeXmHjm9LetVZQbvz9k4dOrgLYV7sUs9nxgxyq9kMN1uGifpyKYpzANPkY5ztTBwoeARPZ4Qkha+T4PxQoFMTNMcj1t+3Vp13iDG9NLX75+7IgT7r1H9DJB5ouxUHR8S/HK1S2DSNZm9CWgMWVaiGUVmxUwZMwPW/VV1QQXjEp9CKoxawhv1T/7hhwJvLaAfp0w== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0121: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0121; 31:r+3wShjZsjbRJ4OIzGkL/SEoh49zlb0P+eSotCaUJtluFO8IrYwuNLSxfxUTp8QOVXHMGM0TAzoBoacEdYjix1Qa+QmMXKnWfVgTVsmqLyh0k01cnid5M+El0SU4jZMscxkvwBdTSt+7maos4i8okRajyXSXKMoLB6ahFc54EAzGQA7CpiPXwBMieOubFhLRb3ugQ6vCgHsgWqUq7Qk9/zXc/ypxLyg+3vouHAxTk24=; 20:IHgunLnetKm7ebuwPiyoHaZdF+JRIBdKZ6XMosaYzzHEXMIy/wOZBkTJdLjptRva9joaD6pJm23HzY2SGbAgaFoaU6VcHF5Ix8lmrTMLyImOclGFpR8LUd3hGzV3gAUMmmCF8IyR5ihbl41UNP/8rxOXgt/vENth7OYt9H1F3HDSZY53TXnQLJE0owCqL0oRVsROkZgGQBFF2OZxZj47GEj552dQhcsTUIexwH51h8sZllhu+tK10MZQ7Rug5/JQNyOhdu3GL1ZERiFiUDujaGwEpLlG2riNQeCoZGk5gqEdpXVLSR5UsIcF41pa5+IH00XiifGtgD09f1si28IggMMSvn7Q3P9fDZjBMHHVPf5sF74aLhV/AwiERK4XoVVlvkavXofsBBl6OMJxUWYDmhD7blyst4K031zZ20h+dln8f0l5V/hvfl3LsuR9Rp6kogJGPdfbf34zR47+eXDiCNYH3m9P+0IZXXW3H96dXIJSJoyBE42mof8UK7nczgMk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93003095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:DM5PR1201MB0121; BCL:0; PCL:0; RULEID:; SRVR:DM5PR1201MB0121; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0121; 4:OHL5xDStye/Z68tl8aThaS92Mkyjgn4F3ZIqeFxqXCwXnAqVsV0fSuV1/s5UEIsQnGl7Kx1oxB3spxP0K9bH0toF2ldEzOH4v0oQZxzrgrtVg52kogzAlHTXLRRo4n7lcTOvofMiv5/r8MVqtorscLBAlQRKAUZLt/b/4dEGYNozmThSN1qv7ISMgr88tE4skHu9Az588avbTh5EewN0ES+9f9Y/Pk4DBjxCHi7L97zPEfegZBihfAqh7JFxPX2hEPbpQD0mrtCURhcBWf8ODftcfNx973zRjttPk+5HKcCNlT0MoiInROZdG6chjzXBmkhVKm05R/5kYhc9FNBOnA== X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0121; 23:G6ssEenjS3jUfhcK6vPZqjo7iAJVP6c+NpTTNvm?= Ju7LJnkrpKwassnP1eFE3BOs6eYuv+Q4m8evkDz/RuExUR6hNS+uP8H5evm512Z7WYFjKAZOFlaZMWtlhztaAgX+sso8CAmxuoxuDUme6T3vTnzE9vwezXmpEpGkK6GElfDIP5UP/s2EJHs+y/+6oPwnd8ZO6VzpFPrz2XpEtsGZYCfSYeszOLCK8M4jvXep/RA/3G/nqPR96padwVFtW8dWH6eFuVrNgWRlkrqTjlGWdmZgvp53owjFe73wkiAhuh82aH1mIiibSG+3B3xjR6kVzo6UFu/TatpcbwUbE+Oe9EsvmhIXBH8b6f3CN2uG5eQ29JbXyRRY6p3rc3hQsOcFh8DLHOZdobs4dIae5o3XryYlrn+m0bBWvEbHylWcK5W8Wrfv8CRRXqWuwY4EeZH23kF1/smhXwjqP4x1CNe2ljKZXD5HNeynAuKGFBFJ+zbytZVXwBs1J72vcsVyhyL32CDmwmy+vPOgF9j+DqcbI3Mqk5sOcqPCHW6GCuGJeuewZs9KK9G0jDeTPQ8TSRq8tV1U+C+/ewev8FTmkqvgrTWH+sdb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d52vIBuTGn13x7Ynla0wKoO8QWA756YE/ovig6TsLKnaWq3GE+gnXXZLRv3VGjvTAPIOFcR1y0FrAYTS34sILMgEpW4RHSobtt3LMK1V+mV1OETAOS79MDvOmUNvT5xDqROTPACQjLh1jZvfTVfcbVIdVUOfABqpFk5zfKq X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:13:12.9086 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c68612ed-b0aa-4775-bb8c-08d609baf6ea 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: DM5PR1201MB0121 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 Signed-off-by: Chunming Zhou --- drivers/gpu/drm/drm_syncobj.c | 5 +++-- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 +++- include/drm/drm_syncobj.h | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index ff0b1fdfd9a8..0be7dd0a0e7d 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -500,8 +500,8 @@ drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flags * contains a reference to the fence, which must be released by calling * dma_fence_put(). */ -static int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, - u64 flags, struct dma_fence **fence) +int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, + u64 flags, struct dma_fence **fence) { int ret = 0; @@ -530,6 +530,7 @@ static int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, drm_syncobj_put(syncobj); return ret; } +EXPORT_SYMBOL(drm_syncobj_search_fence); int drm_syncobj_find_fence(struct drm_file *file_private, u32 handle, u64 point, struct dma_fence **fence) { diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 7209dd832d39..bb20d318c9d6 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -2182,7 +2182,9 @@ await_fence_array(struct i915_execbuffer *eb, if (!(flags & I915_EXEC_FENCE_WAIT)) continue; - fence = drm_syncobj_fence_get(syncobj); + drm_syncobj_search_fence(syncobj, 0, + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, + &fence); if (!fence) return -EINVAL; diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index fb4e7edf90bf..ec098d4798b8 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -170,5 +170,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, int drm_syncobj_get_handle(struct drm_file *file_private, struct drm_syncobj *syncobj, u32 *handle); int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd); +int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, + u64 flags, struct dma_fence **fence); #endif From patchwork Fri Aug 24 12:12:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10575289 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 DF56F14E1 for ; Fri, 24 Aug 2018 12:13:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D080F2B7A5 for ; Fri, 24 Aug 2018 12:13:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4D632B8B2; Fri, 24 Aug 2018 12:13:27 +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 510B22B7A5 for ; Fri, 24 Aug 2018 12:13:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01AD76E698; Fri, 24 Aug 2018 12:13:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680064.outbound.protection.outlook.com [40.107.68.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D7EB6E697; Fri, 24 Aug 2018 12:13:23 +0000 (UTC) Received: from BN6PR12CA0026.namprd12.prod.outlook.com (2603:10b6:405:70::12) by BN6PR1201MB2499.namprd12.prod.outlook.com (2603:10b6:404:ad::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Fri, 24 Aug 2018 12:13:22 +0000 Received: from DM3NAM03FT039.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by BN6PR12CA0026.outlook.office365.com (2603:10b6:405:70::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.14 via Frontend Transport; Fri, 24 Aug 2018 12:13:21 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT039.mail.protection.outlook.com (10.152.83.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1080.9 via Frontend Transport; Fri, 24 Aug 2018 12:13:21 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 24 Aug 2018 07:13:20 -0500 From: Chunming Zhou To: Subject: [PATCH 8/8] drm: clean up syncobj->fence and cb Date: Fri, 24 Aug 2018 20:12:10 +0800 Message-ID: <20180824121210.19101-8-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180824121210.19101-1-david1.zhou@amd.com> References: <20180824121210.19101-1-david1.zhou@amd.com> 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)(189003)(199004)(14444005)(97736004)(356003)(305945005)(36756003)(105586002)(72206003)(47776003)(68736007)(106466001)(6916009)(2351001)(2906002)(6666003)(48376002)(5660300001)(8936002)(50226002)(53416004)(50466002)(478600001)(2616005)(8676002)(476003)(76176011)(1076002)(486006)(51416003)(446003)(81156014)(104016004)(54906003)(81166006)(26005)(11346002)(316002)(336012)(77096007)(575784001)(4326008)(450100002)(86362001)(7696005)(53936002)(186003)(16586007)(126002)(426003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB2499; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT039; 1:VBPexiUZUO7vB7kJKU/LbpyKm2J3qYmbgEvoZPKcbfneKSMvgQtTcZggtLsmKFv1x9ZU36H2T8lS49DMISqTAMU5w1uSqgOEWFADfanUNNa/hG2hOvJLNfOk4NoM6jV3 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46bab458-c2b1-48cb-616b-08d609bafc47 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BN6PR1201MB2499; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB2499; 3:ncdNnSa3wmWtrUeAJ/IkyqwWg4hNk2LqzdBqNI4qYuJh/RbJOmPVGu/p08WAdHFw6mTUcZ9HtIu/wMDCZgmTFuZ/uqjm4BBuq1F58AnWouSdSo/SFQq9HDit4qtu9/4SwakxbOQjm1blFYQJsS/zB3+HOYkVZRaU/uYnvj/6vHMF23lkd08vQkXFJujbMM9w4A+VREaTQ0rd53heP9t3lKNsKiL8NTDjwlsEU6T3nrrKkgrg8EANiA1++nq6eK1pHP75yJtBIYz66vIb0UnjbfmV/afnlrEvpjpYV9vyoU7m9S+tadjz/XpxxLmWIAIQ2Cj/U1v17UpWSuyjdCvzz4kRQJN3pKU7Dx3llvziHKY=; 25:ic5YS+fw9T7Pq1M/vM5CinnJsZeu7AFk+7NBDGI5N+6b+dd9HM/fv9P4xwOCSu7STx7v6DP6yQ8FqjCcUWYkhOxK7h6eqVuiBRsyQpjHVS5KbYFZX7nj/j7cWhJr71F3XEYE6WFpjUtTPI76tq8q001KWG/chlcx2t4rfJAmLh56Ou1Kso0GUY7zu9eBp9cLjbnL1xuDZL9Qno0i1sW/vCtukUpJGKZC2/vhZT0Vl1FEuDIr8s7s/IMmp5WHk3d7jpXZ+5NdEaCPE1UZqRjLqfKRN74k9xgQcL9r4AQqmM0QCw6r4KxAaKDABIGrvcpEqZzdIbEJr3Oqw2HM3w5E1Q== X-MS-TrafficTypeDiagnostic: BN6PR1201MB2499: X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB2499; 31:q0OdA0hn3MSczJflnRo3dL6G5q3UJg6LB2uxvt0XXDmoFmTnxmpMBQqVQR9cKgi7Cuzhy+lfRjs6ch4FugH4eVeEazkTWyd3Sy7y2/drXsCsX5dnE8jsTcoBPFs8UGlfQNVyPckkyB6ZjQ1c+2S9Ot0bAK3bDg2pMtArCJvB4/jlYSXBDhNLOIS+cNP7ol/SpEHxCCEtPiadAGO9fH1GwOPZLJxHJXj4tj4DpPR4sz8=; 20:VYKVghHtId9p2nJJkP8kSjKq3UX29+9IHqI91kS6SK2EwC5DC99Z5+rArGqKVNbJ+x5I4ROhUPGpyhpL4ueZCPQf4+dS314BApwbs3Nj5qeAD6M/IVPysxrmkQnDGACJROpDt30Dsy1+SvTGwMdf9PBZ+02MnlDVCfWtYY75UZg2cQarbmAU1pHIXqF6Oo8EQdJfUnYgtQScKTwgx9tnXvTbkfDgwjWPg0/MH5yKsTNwdb4qxfxy6VpDh2V8xJZdi1DfbGG2qyIpxmpOQAXUHyKe1yTveLr7GtmPyU9ImcITHG/CW0XCK/tda1uLgezOd0MX4cc4+8AG8QONmHYhlOxPZ70vJt1ps+ncqRyBQduDcE8diVxbod+Yb60MrUS1+K/jN9Ug/0h/gbqZsGxmadfS5Y7qtLaav/AgckPnspS8CePaKK4cR30yIrQqnFO6iuWHx/6p05yAgQ7vNpZBe5xKI/kSCZXoFI+wA0L/K0Vut9GE4iP4VWrJjkig11Dn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93003095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:BN6PR1201MB2499; BCL:0; PCL:0; RULEID:; SRVR:BN6PR1201MB2499; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB2499; 4:MSZ7Ww/1cOEcpY9obmILJJImKjFkIjtfMcDvo7MkeV0idqIVpNJqYvS7UoaJXqcE+Zgzhlbav4jOTQqkyjjLOt63VjzVY3giCpZ74cCaHpbvIpbMayQqO9mP9YqYt0aHslQa+UVKkkNb6sOl4FqsPfJGxtGXTggh+nNqsBCrSlctV5cu6yof5cEDrPhWnkDUJpXFANNc/a9jtvYbOcQa9FpGkXqLGzw4B18ttixoUV8f10JxEW/+qPWlySkOLOUQMqK8eX03Kcv7nqDpHDOdOOTry6aPYA/GgAvrEuH8qgnY53gZu7+TXVC0YCYLGM54RxGs+T2c6O1E4vdNNCwKQHzJqoWEyCbQzXbojdey+hU= X-Forefront-PRVS: 07749F8C42 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB2499; 23:SFU9+splAf9jHeTuKRkavUQjxIilRUmpKsL6jIW?= NY14rfWy7bwOEyQ8v0HoABnoaUPdx3CaRc1KbmZVCN07A737us1R+wAM4e7Rs7JgDVnVHUXQR8yjHgrHvGPb33HQ4TjlcvscGYLsiw++Z4VMn7kzcQKZYIhh0Dofpk9MHo1GOgtLVryc8c+iBQJsGjqqXuWDeLX6Hyd8ywuJl1ICVzpY+dUrhKSVCITrnJ32LKGixKbdJ0mMOnJR3OLEkBiPE4vAnvgm4z8bpkkXorrbh0mmppdTzqBPB9KT886tJqhWIgE7TYYgX4rYepZhGXwUVgp6ewgF/2jfn2/j8KbToTt6hlSW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QvJ0P//GzxjQUtdyKfFGTk7vYhW8qZXU2nNcnq9smkualgpUhiQCuNnJ7AX44jDOzupxNqtzC2nuiSN5iF8rU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB2499; 20:rSKqYye51acRkeJdjphMcxl7XMlTDVoTzwM3cGf6wiotsgReAStp+efHgJoVjYle9cMn9bJ0/0DzNYAnmynshtaoa7jNsbIyweIqRpKqgQ24MUI0aYgHtUQdvLbHfH/JQnFGmHnaIvmx3TYIz6JR+pLITNFW6+I6R5pi5mcUNXkslSCleIQ3kWFjUx/XfqsxkjCRTysRAnGJXZtalEAcqVXhp+3wSBELFF1CZ8mXcSJEez8ySfD3EVFVrDcjESVf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 12:13:21.8576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46bab458-c2b1-48cb-616b-08d609bafc47 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: BN6PR1201MB2499 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 syncobj fence and cb aren't need any more. wait pt already contains sumission wait. Signed-off-by: Chunming Zhou --- drivers/gpu/drm/drm_syncobj.c | 69 ----------------------------------- include/drm/drm_syncobj.h | 56 +--------------------------- 2 files changed, 1 insertion(+), 124 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 0be7dd0a0e7d..cd358cf3cbeb 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -123,61 +123,6 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, } EXPORT_SYMBOL(drm_syncobj_find); -static void drm_syncobj_add_callback_locked(struct drm_syncobj *syncobj, - struct drm_syncobj_cb *cb, - drm_syncobj_func_t func) -{ - cb->func = func; - list_add_tail(&cb->node, &syncobj->cb_list); -} - -static int drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj, - struct dma_fence **fence, - struct drm_syncobj_cb *cb, - drm_syncobj_func_t func) -{ - int ret; - - *fence = drm_syncobj_fence_get(syncobj); - if (*fence) - return 1; - - spin_lock(&syncobj->lock); - /* We've already tried once to get a fence and failed. Now that we - * have the lock, try one more time just to be sure we don't add a - * callback when a fence has already been set. - */ - if (syncobj->fence) { - *fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, - lockdep_is_held(&syncobj->lock))); - ret = 1; - } else { - *fence = NULL; - drm_syncobj_add_callback_locked(syncobj, cb, func); - ret = 0; - } - spin_unlock(&syncobj->lock); - - return ret; -} - -void drm_syncobj_add_callback(struct drm_syncobj *syncobj, - struct drm_syncobj_cb *cb, - drm_syncobj_func_t func) -{ - spin_lock(&syncobj->lock); - drm_syncobj_add_callback_locked(syncobj, cb, func); - spin_unlock(&syncobj->lock); -} - -void drm_syncobj_remove_callback(struct drm_syncobj *syncobj, - struct drm_syncobj_cb *cb) -{ - spin_lock(&syncobj->lock); - list_del_init(&cb->node); - spin_unlock(&syncobj->lock); -} - static void drm_syncobj_timeline_signal_wait_pts(struct drm_syncobj *syncobj) { struct rb_node *node = NULL; @@ -621,7 +566,6 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, return -ENOMEM; kref_init(&syncobj->refcount); - INIT_LIST_HEAD(&syncobj->cb_list); spin_lock_init(&syncobj->lock); if (flags & DRM_SYNCOBJ_CREATE_TYPE_TIMELINE) { syncobj->type = DRM_SYNCOBJ_TYPE_TIMELINE; @@ -986,7 +930,6 @@ struct syncobj_wait_entry { struct task_struct *task; struct dma_fence *fence; struct dma_fence_cb fence_cb; - struct drm_syncobj_cb syncobj_cb; }; static void syncobj_wait_fence_func(struct dma_fence *fence, @@ -998,18 +941,6 @@ static void syncobj_wait_fence_func(struct dma_fence *fence, wake_up_process(wait->task); } -static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj, - struct drm_syncobj_cb *cb) -{ - struct syncobj_wait_entry *wait = - container_of(cb, struct syncobj_wait_entry, syncobj_cb); - - /* This happens inside the syncobj lock */ - wait->fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, - lockdep_is_held(&syncobj->lock))); - wake_up_process(wait->task); -} - static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs, uint32_t count, uint32_t flags, diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index ec098d4798b8..657c97dc25ec 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -69,19 +69,7 @@ struct drm_syncobj { struct drm_syncobj_timeline syncobj_timeline; /** - * @fence: - * NULL or a pointer to the fence bound to this object. - * - * This field should not be used directly. Use drm_syncobj_fence_get() - * and drm_syncobj_replace_fence() instead. - */ - struct dma_fence __rcu *fence; - /** - * @cb_list: List of callbacks to call when the &fence gets replaced. - */ - struct list_head cb_list; - /** - * @lock: Protects &cb_list and write-locks &fence. + * @lock: Protects timeline list and write-locks &fence. */ spinlock_t lock; /** @@ -90,25 +78,6 @@ struct drm_syncobj { struct file *file; }; -typedef void (*drm_syncobj_func_t)(struct drm_syncobj *syncobj, - struct drm_syncobj_cb *cb); - -/** - * struct drm_syncobj_cb - callback for drm_syncobj_add_callback - * @node: used by drm_syncob_add_callback to append this struct to - * &drm_syncobj.cb_list - * @func: drm_syncobj_func_t to call - * - * This struct will be initialized by drm_syncobj_add_callback, additional - * data can be passed along by embedding drm_syncobj_cb in another struct. - * The callback will get called the next time drm_syncobj_replace_fence is - * called. - */ -struct drm_syncobj_cb { - struct list_head node; - drm_syncobj_func_t func; -}; - void drm_syncobj_free(struct kref *kref); /** @@ -134,29 +103,6 @@ drm_syncobj_put(struct drm_syncobj *obj) kref_put(&obj->refcount, drm_syncobj_free); } -/** - * drm_syncobj_fence_get - get a reference to a fence in a sync object - * @syncobj: sync object. - * - * This acquires additional reference to &drm_syncobj.fence contained in @obj, - * if not NULL. It is illegal to call this without already holding a reference. - * No locks required. - * - * Returns: - * Either the fence of @obj or NULL if there's none. - */ -static inline struct dma_fence * -drm_syncobj_fence_get(struct drm_syncobj *syncobj) -{ - struct dma_fence *fence; - - rcu_read_lock(); - fence = dma_fence_get_rcu_safe(&syncobj->fence); - rcu_read_unlock(); - - return fence; -} - struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, u32 handle); void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point,