Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3151944rdb; Thu, 16 Nov 2023 01:21:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz9xTjndCvKgMpdZg0CIbyJpvvL5Ek/VxBR3Ztd6kCnK7YvCTy5DT4AAHGiBvbCIwmUfQQ X-Received: by 2002:a05:6808:aa2:b0:3ae:170f:a39b with SMTP id r2-20020a0568080aa200b003ae170fa39bmr16992985oij.17.1700126489225; Thu, 16 Nov 2023 01:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700126489; cv=none; d=google.com; s=arc-20160816; b=WXd1yqvtzZL7P/e/l/yHdOYQ2sQEB9ZObHPWMB5BbG6zp8aOs+e+cKNn5Kms9FnJln gN8AnbEV+v7Jf3+SnyRpnx88n5M40SgT3k8aIRnjLw7wDHJz17PHQTDaOgSlQB6Tfb3s CSi/iXgn0UOIr9WW3e6KT9slVKajTnkyTXkORT7sv9lGfpAhNQ7aAKzpNHij68XPvNgT I6/yF9PwplHbT/uIHnw38iKVzd3GVhlhuYJgSoSjXWpwtWdyDuBaOrasW4nVWXGd1qjy eQ0rwesCT/iLC6KlcG/v/AsRMuefCazaHtq77+FkNqi6k/qYVorEolOtAJlXqqJ9TsFT UsyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=MzZ8NlNRqMdeCo2BAOQ7st6Ml7roeP4i2oWtfUlb2r0=; fh=4iBHsRNwNQjUE5hQZPrkfxDag3M847JFi54tiRNYHg0=; b=jSiLa6qDZt7nheJviH9MlIYg0Y8AEzaLM4OSq+ffXKQLMm+x8oOgi3uNHCI9OxWfrw XrULBGIwyOZ8dTmL5VRqQ3CmwxX452tL38IFjT/XcVVUliqi5sca7/D6J668t1lfbJB6 zfQcXQ9DLqUobn52KhHTIAh6ov2gmsIhOmkEY5cindwUt8HiAWvYCxEhiG8VSjEGcMda mgeJP6flJ3cgbsXUtjioiL+8tzzSU9Jo8bS1OCWFgQMuUDMieSZFLnEq3OD8jzslDWmS 9UjYeX2MZarI/Qb36M3h/Xd/Sj+I9/OaqcNBHnay27RULz63EJUKTdpRXlW3YK/yOM9J 5aLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iQgbqLoD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 190-20020a6301c7000000b005acba4c9bf4si11943444pgb.2.2023.11.16.01.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 01:21:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iQgbqLoD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 054ED8025811; Thu, 16 Nov 2023 01:21:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjKPJVJ (ORCPT + 99 others); Thu, 16 Nov 2023 04:21:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbjKPJVI (ORCPT ); Thu, 16 Nov 2023 04:21:08 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B6001AB; Thu, 16 Nov 2023 01:21:05 -0800 (PST) Received: from eldfell (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pq) by madras.collabora.co.uk (Postfix) with ESMTPSA id 594036607337; Thu, 16 Nov 2023 09:21:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700126464; bh=EKb5mjUvI6GYf6RTMmKQvl6BYz+R65vKj0PGe7EYqY0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iQgbqLoDLSh5kczTuOEuRiaKb3C0qaRQCyxz/Zq2OeJ2Wip5bOiwco44b/1qZYw4T eLj69aABTjhYVttVovqfx9kT/u2ifGppNWBs9N+zY/iMzcU8Q+lxJo2vq1Y8ADQBC+ u8JWqEo8I722GbNfzGjx87vY+0PtbfrArqxUXoXWIch3ySNlFMjtYTvwwjLHIIxlny EKGEXRnUlVvgmAfgflDanqtxKS8SFcL+NBaRRb1faArI+FzgLDhaXAg8RmLerjN1lO EsOME+Dbz0/782SdiGm1D7vTZFFtX0FiO9QEa3jPseezZLQZ9gWuKAP5YAbXTF88Nm aq5LqaZVMaemQ== Date: Thu, 16 Nov 2023 11:20:52 +0200 From: Pekka Paalanen To: Javier Martinez Canillas Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Gerd Hoffmann , nerdopolis , Bilal Elmoussaoui , Maxime Ripard , stable@vger.kernel.org, Sima Vetter , Erico Nunes Subject: Re: [PATCH 2/6] drm: Add drm_atomic_helper_buffer_damage_{iter_init, merged}() helpers Message-ID: <20231116112052.16d4d234.pekka.paalanen@collabora.com> In-Reply-To: <87zfzg5nif.fsf@minerva.mail-host-address-is-not-set> References: <20231109172449.1599262-1-javierm@redhat.com> <20231109172449.1599262-3-javierm@redhat.com> <6e663e37-b735-47f7-a841-fa0f93fdddaf@suse.de> <87zfzg5nif.fsf@minerva.mail-host-address-is-not-set> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/2sUMloWcoyab3bwki.cTd8D"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 16 Nov 2023 01:21:22 -0800 (PST) --Sig_/2sUMloWcoyab3bwki.cTd8D Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 14 Nov 2023 17:05:12 +0100 Javier Martinez Canillas wrote: > Thomas Zimmermann writes: >=20 > > Hi > > > > Am 09.11.23 um 18:24 schrieb Javier Martinez Canillas: =20 >=20 > [...] >=20 > >> struct drm_rect src; > >> memset(iter, 0, sizeof(*iter)); > >> @@ -223,7 +224,8 @@ __drm_atomic_helper_damage_iter_init(struct drm_at= omic_helper_damage_iter *iter, > >> iter->plane_src.x2 =3D (src.x2 >> 16) + !!(src.x2 & 0xFFFF); > >> iter->plane_src.y2 =3D (src.y2 >> 16) + !!(src.y2 & 0xFFFF); > >> =20 > >> - if (!iter->clips || !drm_rect_equals(&state->src, &old_state->src)) { > >> + if (!iter->clips || !drm_rect_equals(&state->src, &old_state->src) || > >> + (buffer_damage && old_state->fb !=3D state->fb)) { =20 > > > > I'd assume that this change effectivly disables damage handling. AFAICT= =20 > > user space often does a page flip with a new framebuffer plus damage=20 > > data. Now, with each change of the framebuffer we ignore the damage=20 > > information. It's not a blocker as that's the behavior before 6.4, but= =20 > > we should be aware of it. > > =20 >=20 > Yes, which is the goal of this patch since page flip with a new framebuff= er > attached to a plane plus damage information can't be supported by drivers > that do per-buffer uploads. >=20 > This was causing some weston and wlroots to have flickering artifacts, due > the framebuffers being changed since the last plane update. >=20 > For now it was decided with Sima, Simon and Pekka that is the best we can > do and the reason why I add a TODO in patch #6. >=20 Hi all, this made me thinking... The per-buffer damage accumulation that would be needed is per upload-buffer, not per KMS FB from userspace. So it should not make any difference whether userspace flips to another FB or not, the damage will need to be accumulated per upload-buffer anyway if the driver is flipping upload-buffers, in order to make the upload-buffer fully up-to-date. Why was that not more broken than it already was? Is there a fixed 1:1 relationship between userspace KMS FBs and the driver upload-buffers? Userspace is already taking care that the KMS FB is always fully up-to-date, FWIW, so the kernel can certainly read areas outside of FB_DAMAGE_CLIPS if it wants to. Thanks, pq --Sig_/2sUMloWcoyab3bwki.cTd8D Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmVV3vQACgkQI1/ltBGq qqfB+A/+JFbdvfCh1ktxeGlmnuTRro8T3ArktRR8nAvkOnl31N41atMY/TacQZUO oEwmgdxyqbjs0tTw7UH5OON051w/GtistMNhXJ0KPoHrrUfUca7wl4XG8FZ9BPAd PzH1/paWneZWPe45/TkaMJE8HtZOjpuGQo61BLcCqo00fJCQ3G+QJ4JMixTuLJzL Gtsx0RzXTxiwiDUInKbJwj0UIoNlHle3AA/xOShGYe8eTLsfmr7u1OG0BGtwPVSu 1IImxt/kH41g9/IFtMTqECxS0kILGGVMfJFpf/BnNf8pBXTwFf3kYz3Um6pXrnHD GcfVkytMbIBf6P9bFvfZvZhlv1BtcIbW9QQTzCFqs63qyg75xkGjbo0zC9hUaGl1 8or7w5++ItvKF/KZJdD3uT38lgULaTgGFnO/AZfxzzOj3ueF+tmeMWzdGvKGWB7j PbhCf4to71fcdkgUxTZ0YvQNvltXu52IFNYVvoW0bV27ZSh6K8XbRSSA9qqG9vBv qPA5YDQf203/VaaFZCbzci7iwB3Zx4qMqhGNfvuO1UAyGG2ZPXchBE3d5hrJh6s5 A6E//IAWkaewj2E3bGitv8GI0xvn3m4q0BAMqRTgvMKe6Jy8I5xTxVzJSQGBxF5f Mo2GaxdAnudxL0NkCGDn4HhvZJZvx/WJanI7Konp5An66OQrqD8= =iWrr -----END PGP SIGNATURE----- --Sig_/2sUMloWcoyab3bwki.cTd8D--