From patchwork Fri Oct 23 12:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853355 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 13A22C4363A for ; Fri, 23 Oct 2020 12:39:34 +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 97E0E2168B for ; Fri, 23 Oct 2020 12:39:33 +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="bSbE2nT7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97E0E2168B 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 C2AA06F63C; Fri, 23 Oct 2020 12:39:32 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 737376F63C for ; Fri, 23 Oct 2020 12:39:32 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id y12so1640907wrp.6 for ; Fri, 23 Oct 2020 05:39: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:mime-version :content-transfer-encoding; bh=KPJV6pgXYvIyIebW+FLMHGoXfGGSrvlz8saNgZrREPI=; b=bSbE2nT7uAnIg/gP/L22NprivILlDUwF2Pax3T1qm8rf3pzs5IBtWU79iTAMPxFC2X vSwcF88lWcx9t+hc+Zsr3H3l6cfzF0eYwa2sYPNKTd/el3XvMamQ/FOYeO4j49CB3LPi QLTKAJj2m9x/Nsuk0YoC8xIEGlB9+Uav34+wU= 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=KPJV6pgXYvIyIebW+FLMHGoXfGGSrvlz8saNgZrREPI=; b=T+qBa6EI6OB+Vm7AcyMbZYH2rTKIGuiTyov2kpwBQbHoefMo/AkR4Npl69ZeYasmod /SdZdQotJMXlJgUXR77hUZnNm0rULx3ny5fw9kG0mMnn9onKWpFFDXd4YgssIzU1hty3 BABhAjkiexWLRj3Y+qd5sbpjFBMqyYIy7O/WIoO0eBgLWOPIQEpUkFWCD5zCzHbBK8NC rmDHuWYjvykGZb8p0FzmrojPoL9E6GYpj1N2hpxX8raejChY40QzHistPpzI070m6MSc +P2HBi4FNHaxm5yT5qqsx71NXmFHdOESmJLf39i2ZwayF/9Ra59qC3SvNYy/KumNi8br gdxw== X-Gm-Message-State: AOAM533M9eqTsXEdQB3JuPOktwZD+f6G48yrezpBUMFByfU0HgsUMeJD s7jmTMdkgzU9mWCMdT6wiFRx0qHQKl3AXzO/ X-Google-Smtp-Source: ABdhPJzMN6V/IQnYJnKyScmt43oDU0iNKbSaaPmNJSAYmrSAcIeyOfLuBrQ/GETnjM2hm16iTpHV2g== X-Received: by 2002:adf:ff8e:: with SMTP id j14mr2536043wrr.255.1603456770821; Fri, 23 Oct 2020 05:39:30 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 133sm3286462wmb.2.2020.10.23.05.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:39:30 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/3] drm/atomic-helpers: remove legacy_cursor_update hacks Date: Fri, 23 Oct 2020 14:39:23 +0200 Message-Id: <20201023123925.2374863-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 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 , Intel Graphics Development , "Kazlauskas, Nicholas" , Daniel Vetter , mikita.lipski@amd.com, =?utf-8?q?M?= =?utf-8?q?ichel_D=C3=A4nzer?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. v3: Paper over msm and i915 regression. The complete_all is the only thing missing afaict. References: https://bugzilla.kernel.org/show_bug.cgi?id=199425 Cc: mikita.lipski@amd.com Cc: Michel Dänzer Cc: harry.wentland@amd.com Cc: Rob Clark Cc: "Kazlauskas, Nicholas" Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 13 ------------- drivers/gpu/drm/i915/display/intel_display.c | 13 +++++++++++++ drivers/gpu/drm/msm/msm_atomic.c | 2 ++ 3 files changed, 15 insertions(+), 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); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 130303e0298a..4257ad7c69c7 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -16122,6 +16122,19 @@ static int intel_atomic_commit(struct drm_device *dev, state->base.legacy_cursor_update = false; } + /* + * FIXME: Cut over to (async) commit helpers instead of hand-rolling + * everything. + */ + if (state->base.legacy_cursor_update) { + struct intel_crtc_state *new_crtc_state; + struct intel_crtc *crtc; + int i; + + for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) + complete_all(&new_crtc_state->uapi.commit->flip_done); + } + ret = intel_atomic_prepare_commit(state); if (ret) { drm_dbg_atomic(&dev_priv->drm, diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 561bfa48841c..e0599b16a4ef 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -215,6 +215,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) /* async updates are limited to single-crtc updates: */ WARN_ON(crtc_mask != drm_crtc_mask(async_crtc)); + complete_all(&async_crtc->state->commit->flip_done); + /* * Start timer if we don't already have an update pending * on this crtc: From patchwork Fri Oct 23 12:39:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853351 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 2EC0DC388F9 for ; Fri, 23 Oct 2020 12:39:37 +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 D1764208C3 for ; Fri, 23 Oct 2020 12:39:36 +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="cIiVlFPM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1764208C3 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 9C8626F64E; Fri, 23 Oct 2020 12:39: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 5CDF56F875 for ; Fri, 23 Oct 2020 12:39:33 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id t9so1618051wrq.11 for ; Fri, 23 Oct 2020 05:39: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=PGEKwn6M9eko3KN/fzTkRc1z8KxmYtWMP0qrwYX/alg=; b=cIiVlFPMyq3bo3bTzWHFm2wxUwLPGAJ95lFXtpkG7HuLE3NSES2nceiPcSSwB4dbqH oHT7dPIuKZvj9Pg2nFIuj7Pdtzya4KT+OWfnglmKFZnYD3aO6tDZSDWk6QJo7XjWBcI1 i80ahkHRr4QJjp7N8fSM377apfJdawTkeK7js= 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=PGEKwn6M9eko3KN/fzTkRc1z8KxmYtWMP0qrwYX/alg=; b=p8EA/Y+Cn3dk3Mq6BrjE0j8zhmNseyAezRnTGROXo+mtVNs16eN5DWQFWV6779WKtq VB170xWFTbaH0vLlTeapDCJUnhJVoYjoxmh9BdcgC0xpNyt2GEZc76VWCdWCBm88cxEO Ws6bSMGG/XOdsjimc4V28woosU3X+VMLSqwyXcFLvjpzZLKg4Gl+5f+oRdMedSmtrbOB ZOzKbZl4hEUBbNBBcPDwXwb8fLYMOIMMn77mL7GHJONSVK7LfeOhUENWEhGmPPL0WWYr +ckrsYZ2nYn+2HRAkG/srha1P1XjCY2PUNhud5lXDSIL50QmO2DpP7R3Q5uIB4bUktk2 n/lA== X-Gm-Message-State: AOAM533C0FifZWGPAQd6ZQgClmYsDr8hJNX5WM8E3xsht8A+PE9j8crp 5AvvqBMYrIAHLw6RmPuy66fp3w2seABPZwwm X-Google-Smtp-Source: ABdhPJz/PhUu+t/aX5G/Cmsm+zg+bBHfzem38LjjBD1fJ5nh4ZQ24gZbtRqGyRFbvbs6SiAd7xq1wg== X-Received: by 2002:adf:f101:: with SMTP id r1mr2584805wro.392.1603456771835; Fri, 23 Oct 2020 05:39:31 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 133sm3286462wmb.2.2020.10.23.05.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:39:31 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/3] drm/vc4: Drop legacy_cursor_update override Date: Fri, 23 Oct 2020 14:39:24 +0200 Message-Id: <20201023123925.2374863-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023123925.2374863-1-daniel.vetter@ffwll.ch> References: <20201023123925.2374863-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 , Intel Graphics Development , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With the removal of helper support it doesn't do anything anymore. Also, we already have async plane update code in vc4. Acked-by: Maxime Ripard Signed-off-by: Daniel Vetter Cc: Eric Anholt Cc: 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 Fri Oct 23 12:39:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853353 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 47FD5C4363A for ; Fri, 23 Oct 2020 12:39:41 +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 E5405208C3 for ; Fri, 23 Oct 2020 12:39:40 +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="Lg09kVA/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5405208C3 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 C62586F877; Fri, 23 Oct 2020 12:39:38 +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 83FD06F62C for ; Fri, 23 Oct 2020 12:39:34 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id n6so1615538wrm.13 for ; Fri, 23 Oct 2020 05:39:34 -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=Lg09kVA/TC+phyXr2IX0mua8MRqPtBfIo4d5vLaqbdE0CpR493Sg+vFnN44aI8zDLV r+LxdCzq1LqcmApfKePQe1EkWIPSC/vRctPmgwARDwuz3Mdjau+2FFZzMxwOUGJ+BJPA TBRjJuPBwSQSN/ciEudftjDBPuln5kecKD7VQ= 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=nqCpkDwkw1T+urehS9f9VPUjpbqrOI9ZkBwfe6A0Cw2XasrvKBH5K8qA0EF3bQKcOp p3TMp/GWiI4hn1baXNaU3OhfOZfRsry5kVp7+wXuLdLDmX2giEdYd66LM1ly8W+7rs92 8+L1Rzqd2jASuHoI0gwjV5O663P0lem4fplAgVx/fGlVOMngjVqJ00SxvXAlh5TViH+/ dJ/6uAGi7JUsCOQUQd0B1GQu7q/KLZ8DHWKUe9ENe302IveiUa5lp7wGi745c61Mc+AI HpO+aingk1neOv+6lMv3mVcC/cl12XOV5gtG16EmOQfosz8OMV0UTQFOWzaUq2m/9jMz 0sAQ== X-Gm-Message-State: AOAM530o/uoSjYQutJ2Ax+6gdPzxoF7UIWaPAZhSm1+nadp9ESXkquUa rd9PBBPF+nH9kWg3sadT7axYa+V6MWHjaoPO X-Google-Smtp-Source: ABdhPJxov/z9JGQ/goN+8gRvDUoKmux6Ei3d9p5hk15hz3ivj6QLwybQibyApQ/mMQ+0x+ehjWQl0A== X-Received: by 2002:adf:f1c1:: with SMTP id z1mr2424340wro.331.1603456773008; Fri, 23 Oct 2020 05:39:33 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 133sm3286462wmb.2.2020.10.23.05.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:39:32 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/3] drm/doc: Document legacy_cursor_update better Date: Fri, 23 Oct 2020 14:39:25 +0200 Message-Id: <20201023123925.2374863-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023123925.2374863-1-daniel.vetter@ffwll.ch> References: <20201023123925.2374863-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: David Airlie , Daniel Vetter , Intel Graphics Development , Thomas Zimmermann , Daniel Vetter , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; /**