From patchwork Wed Oct 21 16:32:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11849423 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 F1E15C388F9 for ; Wed, 21 Oct 2020 16:32:52 +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 D04202177B for ; Wed, 21 Oct 2020 16:32:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Q04BouVn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D04202177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32C1C6EDD3; Wed, 21 Oct 2020 16:32:51 +0000 (UTC) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id C56AB6EDD3 for ; Wed, 21 Oct 2020 16:32:49 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id h5so3787322wrv.7 for ; Wed, 21 Oct 2020 09:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dWPluaY/fdJwctZMykbZWvFFDF2mR5Py4vGKTofXd+8=; b=Q04BouVngbRdV5wxTNhSSRkra+WMFXFg42+1lRqECLQTCZDbklwhEdm0f2rJo5CANi vmnguTyOeZs8XJk7LhX5VabUxiNOIISI5gaFcY4pmcBWD6lEr3FQVqWdUQX5n5zad239 z9v+HG6iHSssDx+bxSYzpdmoxS3o9jDC/DVgo= 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:mime-version :content-transfer-encoding; bh=dWPluaY/fdJwctZMykbZWvFFDF2mR5Py4vGKTofXd+8=; b=JVIo6GaWAHRBEWWJkrO1Gy32WOb8VUGyLXt8bVVpul+aIFYJT5F1SIzPuouc9U4Ix4 kAyFJmoiOdDA8xVGNP+VKkIXiu0ITHg2eQgklI2aypyXJtaSzuabun5hOXnOiz9X3Vof uZ8rw3K4/YMmv2IcFj+Nq5W+PRJSFzukeFgGV6A5W2TbN7QQ/c2ECh7DsYKhvckWmI/n 8zMx1FFRKsJHLsWxjV3KvuhWvr/QXvH7YYNO8A4beHJTsOw4eqZptsvpvu23/7qYTl1+ RYU82p3i8c1QD4R6UgOKhh8wylOMXGYhpVYSeWGi6kl1HV9Ip6K4r6Y8uHEHrO2DO4M7 huOA== X-Gm-Message-State: AOAM532OG/bkWDA48Qv2PnM2CG+DV5SAvVGEpDLwGpsMsGpZl0qHEuOl fv2equnhrHODTxD7spRtvrkicJhq802U3DEB X-Google-Smtp-Source: ABdhPJwmOTGqHFKqQUTMBuUZBxeF86lPtUg/wWEwfEhIb64Cv8KLNJhnmQddksJTzyoEd1TV0Dullw== X-Received: by 2002:adf:f54c:: with SMTP id j12mr5802564wrp.413.1603297968501; Wed, 21 Oct 2020 09:32:48 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id v17sm5547431wrc.23.2020.10.21.09.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 09:32:47 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 21 Oct 2020 18:32:40 +0200 Message-Id: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/atomic-helpers: remove legacy_cursor_update hacks X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter , mikita.lipski@amd.com, harry.wentland@amd.com, =?utf-8?q?Michel_D=C3=A4nzer?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The stuff never really worked, and leads to lots of fun because it out-of-order frees atomic states. Which upsets KASAN, among other things. For async updates we now have a more solid solution with the ->atomic_async_check and ->atomic_async_commit hooks. Support for that for msm and vc4 landed. nouveau and i915 have their own commit routines, doing something similar. For everyone else it's probably better to remove the use-after-free bug, and encourage folks to use the async support instead. The affected drivers which register a legacy cursor plane and don't either use the new async stuff or their own commit routine are: amdgpu, atmel, mediatek, qxl, rockchip, sti, sun4i, tegra, virtio, and vmwgfx. Inspired by an amdgpu bug report. v2: Drop RFC, I think with amdgpu converted over to use atomic_async_check/commit done in commit 674e78acae0dfb4beb56132e41cbae5b60f7d662 Author: Nicholas Kazlauskas Date: Wed Dec 5 14:59:07 2018 -0500 drm/amd/display: Add fast path for cursor plane updates we don't have any driver anymore where we have userspace expecting solid legacy cursor support _and_ they are using the atomic helpers in their fully glory. So we can retire this. References: https://bugzilla.kernel.org/show_bug.cgi?id=199425 Cc: mikita.lipski@amd.com Cc: Michel Dänzer Cc: harry.wentland@amd.com Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index a7bcb4b4586c..549a31e6042c 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1481,13 +1481,6 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, int i, ret; unsigned crtc_mask = 0; - /* - * Legacy cursor ioctls are completely unsynced, and userspace - * relies on that (by doing tons of cursor updates). - */ - if (old_state->legacy_cursor_update) - return; - for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { if (!new_crtc_state->active) continue; @@ -2106,12 +2099,6 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, continue; } - /* Legacy cursor updates are fully unsynced. */ - if (state->legacy_cursor_update) { - complete_all(&commit->flip_done); - continue; - } - if (!new_crtc_state->event) { commit->event = kzalloc(sizeof(*commit->event), GFP_KERNEL); From patchwork Wed Oct 21 16:32:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11849421 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 E6C6BC55179 for ; Wed, 21 Oct 2020 16:32:58 +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 5FFF920872 for ; Wed, 21 Oct 2020 16:32:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Y10x1ZyW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FFF920872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 083B16EDD9; Wed, 21 Oct 2020 16:32:52 +0000 (UTC) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id ECE216EDD3 for ; Wed, 21 Oct 2020 16:32:50 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id h5so3787392wrv.7 for ; Wed, 21 Oct 2020 09:32:50 -0700 (PDT) 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=guHCCErCMqoPbxQI9pil+wt2PYB+uT5fZSBV+IuYGoA=; b=Y10x1ZyW9cBf2IYQfraxyqHnte2j1vKPkZDKGfNLZX8FZcIT6ICCVS8H/mf5mM+Dzy 7qd2NPqxetu4FZAMngxam5735bXm3XImaHvTZa5GYsW2gGIEB15x90wBnBOriqNL2C8y hW50s3Q4q7Vouo0VwFpxrYthga4fMIiKT4zCA= 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=guHCCErCMqoPbxQI9pil+wt2PYB+uT5fZSBV+IuYGoA=; b=dbLRlzUpD4hBPEEuuT+WZ9QCsCJQAbc9S8D2AecrYmCVRZTFqdKNF1FVl1Jh5aJ6cN SfVxvdu+lfNQX+SK+pJCdSMg5yGVhXQvnptnSiLGjsUx6+3JS6gD/WthSwbaHoBEoMlg IRozN0nScC7uIGWF8Xwugemsx4W/qBgEshj0qXHBxDTHnSJGeWUBjCXrLQieppgS42yz idB83ku+LlrDxwlSkpP1IWMejr94k5H+yaQ/czCpJP6kTmj9EDcugks9pNbzrHq2Adm3 8ieMK03ZmKCX4SEpOFXl+pB0mTFMFjkPTVl34LGbrSnV97uX0ZaBoXFdDDiHoNpl6KVX 8VYQ== X-Gm-Message-State: AOAM532f3Y+quC5PTBKTgzntzAPgA2oTq4si3Uaj6A3VQq2E9EF43ewt lptlHIbb5iDmSE07Mw+8OYw3BA== X-Google-Smtp-Source: ABdhPJwY8XOaqu6hwwlk7FG8YBRsgOoqjN1dLgy7AmQLLDxeOylFCjbhJynt2jWidTnUKaUpqBLWhA== X-Received: by 2002:adf:dd89:: with SMTP id x9mr5728198wrl.284.1603297969692; Wed, 21 Oct 2020 09:32:49 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id v17sm5547431wrc.23.2020.10.21.09.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 09:32:49 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 21 Oct 2020 18:32:41 +0200 Message-Id: <20201021163242.1458885-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/3] drm/vc4: Drop legacy_cursor_update override X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Anholt , Daniel Vetter , Intel Graphics Development , Maxime Ripard , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" With the removal of helper support it doesn't do anything anymore. Also, we already have async plane update code in vc4. Signed-off-by: Daniel Vetter Cc: Eric Anholt Cc: Maxime Ripard Acked-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 149825ff5df8..bf0da77ab2e6 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -353,12 +353,6 @@ static int vc4_atomic_commit(struct drm_device *dev, return 0; } - /* We know for sure we don't want an async update here. Set - * state->legacy_cursor_update to false to prevent - * drm_atomic_helper_setup_commit() from auto-completing - * commit->flip_done. - */ - state->legacy_cursor_update = false; ret = drm_atomic_helper_setup_commit(state, nonblock); if (ret) return ret; From patchwork Wed Oct 21 16:32:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11849419 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 2E13FC56202 for ; Wed, 21 Oct 2020 16:33:00 +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 BCC3820872 for ; Wed, 21 Oct 2020 16:32:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="aVI71n9m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCC3820872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CB376EDE9; Wed, 21 Oct 2020 16:32:55 +0000 (UTC) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D54A6EDDA for ; Wed, 21 Oct 2020 16:32:52 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id i1so3896523wro.1 for ; Wed, 21 Oct 2020 09:32:52 -0700 (PDT) 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=WpciX4s5+nlfIa0YzJ767hWGBGfbGF0VES+27qIdEFs=; b=aVI71n9mfFbtGud447m49jzDnSQzAsufn/Y3KLvKMgw6LrfxD1hy4W47TLTUBc526g 7UrvMthB97RymJYgAVXR1sMsuhMqFy1SJM3Pj/ATMxxLfN2Wd/L0SpIzcS0/wyaQ8dAX Q8geoXmZxf+eJaPjuSK63328msKk72goZBSgg= 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=WpciX4s5+nlfIa0YzJ767hWGBGfbGF0VES+27qIdEFs=; b=kiQ3SAmEixOaMHs5l/ebTdseROwzhLP3N3Z/+3mnJsIQJdQr4IetZaz19iBLKKd00g mpZFRYbZrA3QBO1fQeFhfzZ769LbYa2QzAAHMpi6lnYZcNRgftSTMAjVMwuK4yCywRz7 w9IBApkbWh4Ut4eDOMe6OSom2scR+vymwr+AjzicsRhlGvmgX/TJwQCvhtkNoWjBzQTU /rIL2WyFTYKzOaNnYxeaHfSdLqUo5xYKeTZkZl/w6WiGsnhIEjkHJ0FOphftbhYxea/q Cr/nByb01rGpVsQ453C0rfS5RvEeZv7q106xPJiaWhOJuNTDZhNvCfU4udeQ+Zvq4B17 J6XA== X-Gm-Message-State: AOAM53158Q0gsEsLDcAzjMItizrN9S5kTmAhtay/TT2g4zvpW4UUp5K3 3oCOLkcvhEDuCsk85+IPf7z6CQ== X-Google-Smtp-Source: ABdhPJz0drR5QGnvXTrbsKs/gzrgNUywAFQo3pHS14qJJsTmrdBiEqKAcYhIGN0ni8U1pJlWEEJwlA== X-Received: by 2002:adf:de91:: with SMTP id w17mr5643934wrl.84.1603297971025; Wed, 21 Oct 2020 09:32:51 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id v17sm5547431wrc.23.2020.10.21.09.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 09:32:50 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 21 Oct 2020 18:32:42 +0200 Message-Id: <20201021163242.1458885-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/doc: Document legacy_cursor_update better X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , Intel Graphics Development , Maxime Ripard , Thomas Zimmermann , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" It's the horror and shouldn't be used. Realized we're not clear on this in a discussion with Rob about what msm is doing to better support async commits. v2: Refine existing todo item to include this (Thomas) Cc: Sean Paul Cc: Rob Clark Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter --- Documentation/gpu/todo.rst | 4 ++++ include/drm/drm_atomic.h | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 700637e25ecd..6b224ef14455 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -105,6 +105,10 @@ converted over to the new infrastructure. One issue with the helpers is that they require that drivers handle completion events for atomic commits correctly. But fixing these bugs is good anyway. +Somewhat related is the legacy_cursor_update hack, which should be replaced with +the new atomic_async_check/commit functionality in the helpers in drivers that +still look at that flag. + Contact: Daniel Vetter, respective driver maintainers Level: Advanced diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index d07c851d255b..413fd0ca56a8 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -308,7 +308,6 @@ struct __drm_private_objs_state { * struct drm_atomic_state - the global state object for atomic updates * @ref: count of all references to this state (will not be freed until zero) * @dev: parent DRM device - * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics * @async_update: hint for asynchronous plane update * @planes: pointer to array of structures with per-plane data * @crtcs: pointer to array of CRTC pointers @@ -336,6 +335,17 @@ struct drm_atomic_state { * drm_atomic_crtc_needs_modeset(). */ bool allow_modeset : 1; + /** + * @legacy_cursor_update: + * + * Hint to enforce legacy cursor IOCTL semantics. + * + * WARNING: This is thoroughly broken and pretty much impossible to + * implement correctly. Drivers must ignore this and should instead + * implement &drm_plane_helper_funcs.atomic_async_check and + * &drm_plane_helper_funcs.atomic_async_commit hooks. New users of this + * flag are not allowed. + */ bool legacy_cursor_update : 1; bool async_update : 1; /** From patchwork Fri Oct 23 12:21:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853047 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 EE9D5C63777 for ; Fri, 23 Oct 2020 12:23:00 +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 95F2E2465B for ; Fri, 23 Oct 2020 12:23:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="h2UcRa9U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95F2E2465B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29B276E53C; Fri, 23 Oct 2020 12:22:36 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 515D06E512 for ; Fri, 23 Oct 2020 12:22:33 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id l15so1296183wmi.3 for ; Fri, 23 Oct 2020 05:22:33 -0700 (PDT) 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=+fkOMfIAhHnIvKJblgrObApVFyijBiqdZwYQpautVWE=; b=h2UcRa9UQoJClDthSwfwclF7bhL3oBVRME7c7/5zSRqhORAazkbgsGc4/vw6kIZtIK fhou2mbGdVANXK1CAFqIvL046sqBvxJGq5gDLkYCxZejl9o44OcJnB+RHw52tVnqbiHm JEDd6QHk5g7ytqeIZjF9fLUc3+7QOoDG7T1g8= 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=+fkOMfIAhHnIvKJblgrObApVFyijBiqdZwYQpautVWE=; b=CVIR1jljA3w7ur7LUcoRjWjBDhmMymOSZ25F2f7K9pOLqtZz3thUI4PbrUH6VXCyz3 zp55Dr2yalWXL5wWO4IJspFYqKRCkMSeIr0CbCgfqoAfKBBt1f5rLOz/ClLSrlZVtdEP xv8C9fTyH34RFs5j0u++5bech8rPZnL2fcNWjCuA9EggXU+Lz+rG7n8yRBzGQAObhK2X qVWwa0EB5RQKv/o9xrM6gEl55ojoNga9SCuRKDD10Ee+RRlE3g3Sp8Hkk/xhLpUMGh75 q1X9H/GEVlufGTfRCaDgLFSAikchPB3FM4x2vnqkDvFkcq/l7p5XatqwUqDbMSGULbg8 Lskw== X-Gm-Message-State: AOAM533lJozhcZ/AhtiKRI/WRIBe0XnoaP0sWIT9+uYCeZYQtieoqMVW CtF4+6ZvmvSQLXlTJShy7GLSoA== X-Google-Smtp-Source: ABdhPJxH4xe48wzE/NSho9ypMHFrSsNZaDWF+abLcTHBzoHtv3gPf22+aRfQRDawp5z3s1pKd7nXCw== X-Received: by 2002:a1c:4445:: with SMTP id r66mr2000497wma.140.1603455748879; Fri, 23 Oct 2020 05:22:28 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y4sm3056484wrp.74.2020.10.23.05.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:22:28 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 23 Oct 2020 14:21:17 +0200 Message-Id: <20201023122216.2373294-6-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023122216.2373294-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 06/65] drm/vkms: Annotate vblank timer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-mm-sig@lists.linaro.org, Rodrigo Siqueira , Haneen Mohammed , linux-rdma@vger.kernel.org, Daniel Vetter , Intel Graphics Development , amd-gfx@lists.freedesktop.org, Chris Wilson , Melissa Wen , Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is needed to signal the fences from page flips, annotate it accordingly. We need to annotate entire timer callback since if we get stuck anywhere in there, then the timer stops, and hence fences stop. Just annotating the top part that does the vblank handling isn't enough. Tested-by: Melissa Wen Reviewed-by: Rodrigo Siqueira Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: linux-rdma@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Christian König Signed-off-by: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Cc: Daniel Vetter --- drivers/gpu/drm/vkms/vkms_crtc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index e43e4e1b268a..8124d8f2ee15 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ +#include + #include #include #include @@ -14,7 +16,9 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) struct drm_crtc *crtc = &output->crtc; struct vkms_crtc_state *state; u64 ret_overrun; - bool ret; + bool ret, fence_cookie; + + fence_cookie = dma_fence_begin_signalling(); ret_overrun = hrtimer_forward_now(&output->vblank_hrtimer, output->period_ns); @@ -49,6 +53,8 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) DRM_DEBUG_DRIVER("Composer worker already queued\n"); } + dma_fence_end_signalling(fence_cookie); + return HRTIMER_RESTART; } From patchwork Fri Oct 23 12:21:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853045 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 E2583C56201 for ; Fri, 23 Oct 2020 12:22:50 +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 8FE2C20795 for ; Fri, 23 Oct 2020 12:22:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="QL0X80IR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FE2C20795 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C6646E512; Fri, 23 Oct 2020 12:22:34 +0000 (UTC) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9CF06E112 for ; Fri, 23 Oct 2020 12:22:32 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id b8so1599024wrn.0 for ; Fri, 23 Oct 2020 05:22:32 -0700 (PDT) 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=9/R15F1LsgpmrfF3NNCzaFiRsuDDTsIACKqWmG0SISo=; b=QL0X80IRynXXMUZCjYkwF4TVxPMv6OvJXEja8o1OkGXOMBO4FW8qKjIlQHiTaMX6lC Vted5qkM0/57rDsZq+bhda1RMP0UNp2QiZQKvEGxG3qdHN+b54wJSOKQ91pPGKKIz2Ar +nKGcH1SKaXqQODHi7K9iRIwpw1YNdCyzAKLI= 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=9/R15F1LsgpmrfF3NNCzaFiRsuDDTsIACKqWmG0SISo=; b=Ge8oiy9WSYOAMnMFCi39hl52pyxuYCetT7iZnKgXYttNCVg0uF76YLStNL+bnhiLqk 418NAoIIDhmGiQ46PUieWpS0ZQ9wvCkTXIOY0Xg1b9lNLRkcJDmUdV4/ohvbhl61ezLO OOu8Aa/FoXFIWuAyATFwpja0FfCg88Rg53RPUG7eg4pLz6h7Lrykiw4GYgHXgRGhLBTn +di6g+r4epRw599gfaC7GT6xAm3Vsu9MFzQ4RYwdOl9IxMIHPweAXo5IV0EtiaAuItn4 AMfP5Q4icwNL41DHXwALcFkctStUQ/GXbTa0ZLLaYIMaZnKcEA5C/htK0tiAgjSb0Wvb lKHA== X-Gm-Message-State: AOAM532sRBs4wvaB/4cuOoLqWLA9rkv6Rowq2ve5R+X84Tix/glpIkTY 5CJcnzJYrD/wxe1H5u3ByAqQ0Q== X-Google-Smtp-Source: ABdhPJzjwHFFX0eYKKTO5kCI7ZhG3p97yKYVzt0PU/hjOwBpbNrm4zEFSBi8+JEVc4oqTj3X2egovA== X-Received: by 2002:adf:a1cb:: with SMTP id v11mr2261703wrv.86.1603455751311; Fri, 23 Oct 2020 05:22:31 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y4sm3056484wrp.74.2020.10.23.05.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:22:30 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 23 Oct 2020 14:21:19 +0200 Message-Id: <20201023122216.2373294-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023122216.2373294-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 08/65] drm/amdgpu: add dma-fence annotations to atomic commit path X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rdma@vger.kernel.org, Daniel Vetter , Intel Graphics Development , amd-gfx@lists.freedesktop.org, Chris Wilson , linaro-mm-sig@lists.linaro.org, Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , linux-media@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" I need a canary in a ttm-based atomic driver to make sure the dma_fence_begin/end_signalling annotations actually work. Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Cc: linux-rdma@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Christian König Signed-off-by: Daniel Vetter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 bb1bc7f5d149..b05fecf06f25 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -57,6 +57,7 @@ #include "ivsrcid/ivsrcid_vislands30.h" +#include #include #include #include @@ -7492,6 +7493,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; int crtc_disable_count = 0; bool mode_set_reset_required = false; + bool fence_cookie; + + fence_cookie = dma_fence_begin_signalling(); drm_atomic_helper_update_legacy_modeset_state(dev, state); drm_atomic_helper_calc_timestamping_constants(state); @@ -7816,6 +7820,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) /* Signal HW programming completion */ drm_atomic_helper_commit_hw_done(state); + dma_fence_end_signalling(fence_cookie); + if (wait_for_vblank) drm_atomic_helper_wait_for_flip_done(dev, state); From patchwork Fri Oct 23 12:21:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853051 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 DA834C83008 for ; Fri, 23 Oct 2020 12:23:03 +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 95B6E2225F for ; Fri, 23 Oct 2020 12:23:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="NegaIL95" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95B6E2225F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF1E06E520; Fri, 23 Oct 2020 12:22:36 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98F266E51A for ; Fri, 23 Oct 2020 12:22:33 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id c16so1298583wmd.2 for ; Fri, 23 Oct 2020 05:22:33 -0700 (PDT) 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=b6rkxHUpAoW3ADDD9yecvzJ/H8V6QUCVWd37I73mhug=; b=NegaIL95AZMZrYGEqpllAPuC4YEXKBSPt9ZC7f3moTusYcOgVcquEa7EUPPwSNw6VX P8XlYhkp9fN2p0U2nDvu/GspeLO3MxC4mkMamOxURRDVec3O22ixrxUe9gOzG3Fxy1ZU bdOffu5jdeoXA1UFdxglK3jWwRG0E30/YhqVw= 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=b6rkxHUpAoW3ADDD9yecvzJ/H8V6QUCVWd37I73mhug=; b=B3V0oVeDoGdnyEiuGkjhpMavEV6UppEQnlEFJTk9K7fn8txFDKs4cfyqcF6PJ9ITtC F8Yjs0jkeXEtIYr+U1mCx29ZZv87BnFr4rWjoSw6bLSgxR55Ti3Nver1kNexnOvYYG7P mZaAsHHxGdYO6/8spPNNZktQwl2ujn+wLEamWLZkmL9a2biqJM37FHOt2lKUyHPzr+tY mBt/UZV9VFA8+kP8BesgJx3sWbW98TCRIGkJFb1f30Xb3C48VZqMwnfHhMqtuLsut1kR I+qMurJ+aBiixzaW76Ytd5s3x0kdJwJXutXLVJdsu3Qe1a2t9B6xUYBpxEBuEoomCe5L cP0w== X-Gm-Message-State: AOAM532Ctaw1N8XV7lxyQq78YSHyc8+z+iVlAykch4Fvq/J3kM69vlqb ez4HpgLqe1WWChWyqTF1RF8hjQ== X-Google-Smtp-Source: ABdhPJxaXmfrljo2z/YC6BMM1jXiTv3getDGMOtXk2mx5+EFG5MTRnEQFcRRKNnuONVbcKQ3sPx42A== X-Received: by 2002:a1c:2681:: with SMTP id m123mr1987673wmm.138.1603455752369; Fri, 23 Oct 2020 05:22:32 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y4sm3056484wrp.74.2020.10.23.05.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:22:31 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 23 Oct 2020 14:21:20 +0200 Message-Id: <20201023122216.2373294-9-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023122216.2373294-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 09/65] drm/komeda: Annotate dma-fence critical section in commit path X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , James Qian Wang , Daniel Vetter , Mihail Atanassov Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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. Reviewed-by: James Qian Wang 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 1f6682032ca4..cc5b5915bc5e 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 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_commit_hw_done(old_state); + dma_fence_end_signalling(fence_cookie); + drm_atomic_helper_cleanup_planes(dev, old_state); }