Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1171162rdh; Fri, 24 Nov 2023 06:43:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIPwx7xmZTNJiapwzo02q7k1RrJxrY4jtHjJ5iXNDpyMncqJ5Azo6qD6eHBHhdhsPPW53Z X-Received: by 2002:a05:6a00:1512:b0:6cb:e3c5:7cb3 with SMTP id q18-20020a056a00151200b006cbe3c57cb3mr4207863pfu.16.1700837022552; Fri, 24 Nov 2023 06:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700837022; cv=none; d=google.com; s=arc-20160816; b=FyqSFFVezdfBPcJAcMKnzdzH6zhitxiVkg+dRsjpPksu/FcDDQV7Flo2pUYs8ZhaiP hZLnZqD0W6V0KtPKmILMQ3gfSn+JhV1aUBhl1ICTO0LHrqCpHisEjLKwerJvZgdYBrvK FHTGGu76gA+/NxFCJNPg9mpLDrERfSW+yqzB1lscEAW2Gne3vnqUTYkwNvlYkSNP18+7 OXRR9YUO4XmJh4WQ6z5oc8chblpkZGF06JxBYv8i5olcRa8DI5ma3/CjZCWwX6rctf3p yAXqn9JMuVxMkb9FZu5ShVKww2XKXIvY+gijEOUzwkS4x5AFJeaV51CwrBbnLayZiIzz VdpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=a/pi8w6/WijyPjt6aPj0xPcMBW60wKYF9Ml5rCWYt0U=; fh=UzccCZQ1iTNTwg+gBXzxZfD9j4FQsPx4rn27/WAZ7eA=; b=QrJSU3328fckPrZRcEldHXC6YYKGs7fgciwOYfjAEzFKNfN2ogoqIkgJi7qL0wlVY4 ZTiAikzJb5GhjnK2Lv7/fQrjP+JLOoisklkhPHQuFzBcRaMtJSubNdQ1+fRhMbYFp2b8 Ik1DrdaX9H92iUtrtVqKY7GRQldJGZwLbp4nN7I6F58XFIEVrO2aK74YSEz/3kDA3CP5 KwXJPXD9ykPXo/ulQF/URVbsfNZjY0i5YWfGzPuvoulVjfGKoyQXj0Uv20Ly1GoL4a6D XnpvmNgqh775E9ctRtZmmcEk/ewxgGvkwVLH971RFJxIdMFYHL1EYs6gehGCXGgz6Qut kWSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZZCj1z3g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j11-20020a65430b000000b005c2783b71d7si3349788pgq.354.2023.11.24.06.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 06:43:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZZCj1z3g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A60F681E7A4C; Fri, 24 Nov 2023 06:43:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235401AbjKXOnJ (ORCPT + 99 others); Fri, 24 Nov 2023 09:43:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235238AbjKXOm5 (ORCPT ); Fri, 24 Nov 2023 09:42:57 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57671FD4 for ; Fri, 24 Nov 2023 06:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700836965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a/pi8w6/WijyPjt6aPj0xPcMBW60wKYF9Ml5rCWYt0U=; b=ZZCj1z3gz8ySTu9xGpIPch3DdhLd05oouM+EWkMAJ99pIVaJ/uPqJBT87SyONltoymJUmn b3fEvINh1t1ZcXscLwo6VjZmKEkdyvHuMy86kxvWUax+hCyNzJ8TcYF35o6mgSFu9a/lnn Cw7bLX4I85Zvm09mBj1S843eM5ci1Vc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-EfLUNPkFPXiADLmWbQJCcQ-1; Fri, 24 Nov 2023 09:42:43 -0500 X-MC-Unique: EfLUNPkFPXiADLmWbQJCcQ-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-332e71b8841so551871f8f.0 for ; Fri, 24 Nov 2023 06:42:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700836961; x=1701441761; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a/pi8w6/WijyPjt6aPj0xPcMBW60wKYF9Ml5rCWYt0U=; b=eKjuFMXTsLjvdHbkIdpjJ8/rTRskX2RELmXWs4hajWhzv1aZkHd7mKUXcHcHwxwKtS hONRMwB7F+QYlygO1Ll1Blxu4Qg4PnHFyfZqC/1vQ1cP+W/8ylnLbEMlgniCFqi6qcmY mxPwtkQC9OcrrD834wAJe4/1IgCLhLUb2BD39muvxD5oE0BmXf/uqK49bgTr3xoV0a+4 D6gtgtniR4u3jnhD/eGuFQrIZdzFHHh2YTi/CGi8YZ5bWhdHetrIrt7lbF4bvupFQtW+ XzS7QtUaRosKzpchFo0o087Z3fkz9YqNeGqovIyqmZFoqNO9tHKzRAOFNqltABVbyiHX TQfw== X-Gm-Message-State: AOJu0Yy3yN640++1ZhY7UxT6mgVZWV+njsBTDsZ8VS6udn6o8EKXgAJj c9We8lbAnkv3g2WEslT9V1Od/UQ3KpSclvKUNrw95aQcdGhlJ2TzEhn+aUO86L3rn4hn8rJVwAS MxZLFT8SuwMaPSTxFW75XzoFO1UN34/FQ0t0AhHU4gM3pdVzjwfhZp3bvEM2JgipmBcNC7lvbme Tuz+HPbs3+ X-Received: by 2002:a5d:66d1:0:b0:331:3c1f:b94b with SMTP id k17-20020a5d66d1000000b003313c1fb94bmr2312270wrw.6.1700836961584; Fri, 24 Nov 2023 06:42:41 -0800 (PST) X-Received: by 2002:a5d:66d1:0:b0:331:3c1f:b94b with SMTP id k17-20020a5d66d1000000b003313c1fb94bmr2312234wrw.6.1700836961142; Fri, 24 Nov 2023 06:42:41 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id q1-20020a5d6581000000b00331a55d3875sm4455226wru.38.2023.11.24.06.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 06:42:40 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Zack Rusin , Thomas Zimmermann , Pekka Paalanen , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Sima Vetter , Chia-I Wu , Daniel Vetter , David Airlie , David Airlie , Gerd Hoffmann , Gurchetan Singh , Jonathan Corbet , Maarten Lankhorst , VMware Graphics Reviewers , dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, virtualization@lists.linux.dev Subject: Re: [PATCH v4 0/5] drm: Allow the damage helpers to handle buffer damage In-Reply-To: <20231123221315.3579454-1-javierm@redhat.com> References: <20231123221315.3579454-1-javierm@redhat.com> Date: Fri, 24 Nov 2023 15:42:40 +0100 Message-ID: <87edgfcivz.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 24 Nov 2023 06:43:39 -0800 (PST) Javier Martinez Canillas writes: > Hello, > > This series is to fix an issue that surfaced after damage clipping was > enabled for the virtio-gpu by commit 01f05940a9a7 ("drm/virtio: Enable > fb damage clips property for the primary plane"). > > After that change, flickering artifacts was reported to be present with > both weston and wlroots wayland compositors when running in a virtual > machine. The cause was identified by Sima Vetter, who pointed out that > virtio-gpu does per-buffer uploads and for this reason it needs to do > a buffer damage handling, instead of frame damage handling. > > Their suggestion was to extend the damage helpers to cover that case > and given that there's isn't a buffer damage accumulation algorithm > (e.g: buffer age), just do a full plane update if the framebuffer that > is attached to a plane changed since the last plane update (page-flip). > > It is a v4 that addresses issues pointed out by Sima Vetter in v3: > > https://lists.freedesktop.org/archives/dri-devel/2023-November/431409.html > > Patch #1 adds a ignore_damage_clips field to struct drm_plane_state to be > set by drivers that want the damage helpers to ignore the damage clips. > > Patch #2 fixes the virtio-gpu damage handling logic by asking the damage > helper to ignore the damage clips if the framebuffer attached to a plane > has changed since the last page-flip. > > Patch #3 does the same but for the vmwgfx driver that also needs to handle > buffer damage and should have the same issue (although I haven't tested it > due not having a VMWare setup). > > Patch #4 adds to the KMS damage tracking kernel-doc some paragraphs about > damage tracking types and references to links that explain frame damage vs > buffer damage. > > Finally patch #5 adds an item to the DRM todo, about the need to implement > some buffer damage accumulation algorithm instead of just doing full plane > updates in this case. > > Because commit 01f05940a9a7 landed in v6.4, the first 2 patches are marked > as Fixes and Cc stable. > > I've tested this on a VM with weston, was able to reproduce the issue > reported and the patches did fix the problem. > > Best regards, > Javier > > Changes in v4: > - Refer in ignore_damage_clips kernel-doc to "Damage Tracking Properties" > KMS documentation section (Sima Vetter). > - Add another paragraph to "Damage Tracking Properties" section to mention > the fields that drivers with per-buffer upload target should check to set > drm_plane_state.ignore_damage_clips (Sima Vetter). > - Reference the &drm_plane_state.ignore_damage_clips and the damage helpers > in the buffer damage TODO entry (Sima Vetter). > > Changes in v3: > - Fix typo in the kernel-doc (Simon Ser). > - Add a paragraph explaining what the problem in the kernel is and > make it clear that the refeference documents are related to how > user-space handles this case (Thomas Zimmermann). > > Changes in v2: > - Add a struct drm_plane_state .ignore_damage_clips to set in the plane's > .atomic_check, instead of having different helpers (Thomas Zimmermann). > - Set struct drm_plane_state .ignore_damage_clips in virtio-gpu plane's > .atomic_check instead of using a different helpers (Thomas Zimmermann). > - Set struct drm_plane_state .ignore_damage_clips in vmwgfx plane's > .atomic_check instead of using a different helpers (Thomas Zimmermann). > > Javier Martinez Canillas (5): > drm: Allow drivers to indicate the damage helpers to ignore damage > clips > drm/virtio: Disable damage clipping if FB changed since last page-flip > drm/vmwgfx: Disable damage clipping if FB changed since last page-flip > drm/plane: Extend damage tracking kernel-doc > drm/todo: Add entry about implementing buffer age for damage tracking > Pushed to drm-misc (drm-misc-next). Thanks! -- Best regards, Javier Martinez Canillas Core Platforms Red Hat