From patchwork Mon Apr 15 15:11:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10901021 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 B4EB11669 for ; Mon, 15 Apr 2019 15:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BA6128925 for ; Mon, 15 Apr 2019 15:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F1DC2899D; Mon, 15 Apr 2019 15:12:10 +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 911B228989 for ; Mon, 15 Apr 2019 15:12:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67891897C3; Mon, 15 Apr 2019 15:12:08 +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-eopbgr770088.outbound.protection.outlook.com [40.107.77.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id E30CC897C3; Mon, 15 Apr 2019 15:12:06 +0000 (UTC) Received: from MWHPR12CA0054.namprd12.prod.outlook.com (2603:10b6:300:103::16) by DM6PR12MB2969.namprd12.prod.outlook.com (2603:10b6:5:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Mon, 15 Apr 2019 15:12:02 +0000 Received: from CO1NAM03FT014.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by MWHPR12CA0054.outlook.office365.com (2603:10b6:300:103::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.14 via Frontend Transport; Mon, 15 Apr 2019 15:12:02 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT014.mail.protection.outlook.com (10.152.80.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Mon, 15 Apr 2019 15:12:02 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Mon, 15 Apr 2019 10:12:00 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH v2 4/5] drm/amd/display: wait for fence without holding reservation lock Date: Mon, 15 Apr 2019 11:11:26 -0400 Message-ID: <1555341087-23339-4-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555341087-23339-1-git-send-email-andrey.grodzovsky@amd.com> References: <1555341087-23339-1-git-send-email-andrey.grodzovsky@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)(39860400002)(376002)(136003)(2980300002)(428003)(199004)(189003)(486006)(44832011)(446003)(106466001)(126002)(476003)(11346002)(105586002)(53416004)(2616005)(104016004)(97736004)(50226002)(2870700001)(50466002)(4326008)(47776003)(8936002)(5660300002)(2906002)(426003)(66574012)(5820100001)(54906003)(110136005)(478600001)(316002)(6666004)(356004)(36756003)(8676002)(76176011)(81166006)(81156014)(7696005)(26005)(86362001)(186003)(336012)(77096007)(14444005)(305945005)(2201001)(53936002)(72206003)(68736007)(23676004)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2969; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3769f1d7-db05-4c9b-0bf1-08d6c1b4b6ac X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:DM6PR12MB2969; X-MS-TrafficTypeDiagnostic: DM6PR12MB2969: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 000800954F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: udzdhja0lJRI6nDn0H0HGqk9pVBGah6iR12p2kH6HjAVIO0TlTwzJ08+MGdn1gsq/oXiquZrSwHgBG9N7k2AVhp/Lif7l7hPPwarY1DY6XKEWNOUq9nYE4E9O3I9UThKMqZL/WoyTCQZ5N5Z0dNIQr+Kn2M0GkAIwlK0Uz0d0Ko0QNO2B/k0wTwS/r2i0NJ04W52JpI0NR9+606epZ7MGYz3IcF3jvkpeE9IdJuH9FVCfG67l8N+1q97LnE9T7xqhHdQCtnsuB0Iul5OYO09o6118vi9EpZ4zWh6cKHXIlVMvP5aH3yX4L9PxHDPyLSJKgsXmbkWGbMr/4Sywkia1kzqCosN23bvuAr6nB5oYCrBXQOJot9NmGLEcF5TeLtgWcIeLiQ/Hw3pumkZQPeELvv340vKeiNZBQKLGMaOdKc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2019 15:12:02.0384 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3769f1d7-db05-4c9b-0bf1-08d6c1b4b6ac X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2969 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YzLnC9YryBGPnK2gy54en2ETPC5NOxoHyA8uPA/xkwg=; b=JjAXZCc5VSjZUJWEPzznbBRW0iAOHUEeK8S9nXY2a9cNXkyiU008OmrYXLdjeTe8rlEo8FTXIu3gdbrv2iupjtUhM5lGEj+ZG7R2/S5DOr144dfIeB1LImBK8+ADfaODIc+OrgynVfgKlZcKwLfk1yDoS6KX9jQH1Lq7WtNJ+Xg= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; 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: Nicholas.Kazlauskas@amd.com, =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Christian König Don't block others while waiting for the fences to finish, concurrent submission is perfectly valid in this case and holding the lock can prevent killed applications from terminating. Signed-off-by: Christian König Reviewed-by: Nicholas Kazlauskas --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 44a8bf8..5aeac2c 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5295,23 +5295,26 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, continue; } + abo = gem_to_amdgpu_bo(fb->obj[0]); + + /* Wait for all fences on this FB */ + r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true, + false, + MAX_SCHEDULE_TIMEOUT); + WARN_ON(r < 0); + /* * TODO This might fail and hence better not used, wait * explicitly on fences instead * and in general should be called for * blocking commit to as per framework helpers */ - abo = gem_to_amdgpu_bo(fb->obj[0]); r = amdgpu_bo_reserve(abo, true); if (unlikely(r != 0)) { DRM_ERROR("failed to reserve buffer before flip\n"); WARN_ON(1); } - /* Wait for all fences on this FB */ - WARN_ON(reservation_object_wait_timeout_rcu(abo->tbo.resv, true, false, - MAX_SCHEDULE_TIMEOUT) < 0); - amdgpu_bo_get_tiling_flags(abo, &tiling_flags); amdgpu_bo_unreserve(abo);