From patchwork Thu Jan 21 15:29:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12036667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F70AC433DB for ; Thu, 21 Jan 2021 15:30:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A20523A1C for ; Thu, 21 Jan 2021 15:30:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A20523A1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B89646E90C; Thu, 21 Jan 2021 15:30:17 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60A7E6E8FF for ; Thu, 21 Jan 2021 15:30:11 +0000 (UTC) Received: by mail-wr1-x434.google.com with SMTP id v15so2149101wrx.4 for ; Thu, 21 Jan 2021 07:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sfm+N6VHymLjQmYycaoCq/05lkdq1IkwzaFXG+6Nf6k=; b=bS2VNm0lnS5hfBUVa3UxzWQJjNqNmZi9HxwbR9Sx8zcMiETNikJg/e0EW4Qn4zOWaC 1x8MUCc3tWbpLFVS9GdBhYdqwzjxJDhpJMWQl3ZXgwDXvla0oDAZNJLWVLJse5psqO6j jiYVJmiIspYvPTlO2V1Ip3Dbd1R/hnW0xVVUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sfm+N6VHymLjQmYycaoCq/05lkdq1IkwzaFXG+6Nf6k=; b=LHGnLuAVIvFsQOiobWvQb38ZuYPM/7SiOw3QKpOXof6XvX+5gI/A/Fnk89NTiEamdq H0WrNHcfeuAxO7tTu8WrWAoyUdxyBpgRCM4jQ8ZaBeVq995Hpznt6PPOF9YK5sJjZOP/ 8UZS7+t4UfNJG4PrKhFZaKorHchK5aEwJBpGOCHMvmQA9dQEXJlpBa5cihkmRznyeq91 ZJF6MPDZPR7+UDmyceW98xHoG9nq4cY/HBlk+L9GDB1fbwKF4JvrP9yYe+Tu6dmCFW+7 b6Jn3TM/VY4dQdcxdNiHKnyC3C9oR/ODXz73ijq9wIfL1HTsCwfqHmBF44U68vUr+sV7 zVRQ== X-Gm-Message-State: AOAM533Wq20sJ5tfTcesHp11rVBDPkRwU7/wS4Gfo18tXdx3OHuHzKQW cWlBoXS9wiW5GQe6QpTTI6anJVelB22i/JlM X-Google-Smtp-Source: ABdhPJzCb4KS+fiszHb49zxZ2I+3tYJfaUh5SocU4KSsf00COANFVLxkherARcZtJSJKoFnMbUI0DQ== X-Received: by 2002:adf:fa02:: with SMTP id m2mr22159wrr.130.1611243010044; Thu, 21 Jan 2021 07:30:10 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id f14sm8269866wre.69.2021.01.21.07.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 07:30:09 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 04/11] drm/komeda: Annotate dma-fence critical section in commit path Date: Thu, 21 Jan 2021 16:29:52 +0100 Message-Id: <20210121152959.1725404-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210121152959.1725404-1-daniel.vetter@ffwll.ch> References: <20210121152959.1725404-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Liviu Dudau , Mihail Atanassov , James Qian Wang , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Like the helpers, nothing special. Well except not, because we the critical section extends until after hw_done(), since that's the last thing which could hold up a subsequent atomic commit. That means the wait_for_flip_done is included, but that's not a problem, we're allowed to call dma_fence_wait() from signalling critical sections. Even on our own fence (which this does), it's just a bit confusing. But in a way those last 2 function calls are already part of the fence signalling critical section for the next atomic commit. Reading this I'm wondering why komeda waits for flip_done() before calling hw_done(), which is a bit backwards (but hey hw can be special). Might be good to throw a comment in there that explains why, because the original commit that added this just doesn't. v2: Small rebase Reviewed-by: James Qian Wang (v1) Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Signed-off-by: Daniel Vetter --- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 034ee08482e0..aeda4e5ec4f4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -73,6 +73,7 @@ static const struct drm_driver komeda_kms_driver = { static void komeda_kms_commit_tail(struct drm_atomic_state *old_state) { struct drm_device *dev = old_state->dev; + bool fence_cookie = dma_fence_begin_signalling(); drm_atomic_helper_commit_modeset_disables(dev, old_state); @@ -85,6 +86,8 @@ static void komeda_kms_commit_tail(struct drm_atomic_state *old_state) drm_atomic_helper_wait_for_flip_done(dev, old_state); + dma_fence_end_signalling(fence_cookie); + drm_atomic_helper_cleanup_planes(dev, old_state); }