[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9296c184-22c1-4d71-8b11-2d26f49a5790@suse.de>
Date: Tue, 14 Nov 2023 16:40:59 +0100
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Javier Martinez Canillas <javierm@...hat.com>,
linux-kernel@...r.kernel.org
Cc: Simon Ser <contact@...rsion.fr>,
Sima Vetter <daniel.vetter@...ll.ch>,
Pekka Paalanen <pekka.paalanen@...labora.com>,
Maxime Ripard <mripard@...nel.org>,
Bilal Elmoussaoui <belmouss@...hat.com>,
Erico Nunes <nunes.erico@...il.com>,
Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...il.com>,
David Airlie <airlied@...hat.com>,
Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>,
Jonathan Corbet <corbet@....net>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
VMware Graphics Reviewers
<linux-graphics-maintainer@...are.com>,
Zack Rusin <zackr@...are.com>, dri-devel@...ts.freedesktop.org,
linux-doc@...r.kernel.org,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 0/6] drm: Allow the damage helpers to handle buffer damage
Hi Javier
Am 09.11.23 um 18:24 schrieb Javier Martinez Canillas:
> 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.
I'm having problem understanding the types of damage. You never say what
buffer damage is. I also don't know what a frame is in this context.
Regular damage handling marks parts of a plane as dirty/damaged. That is
per-plane damage handling. The individual planes more or less
independent from each other.
Buffer damage, I guess, marks the underlying buffer as dirty and
requires synchronization of the buffer with some backing storage. The
planes using that buffer are then updated more or less automatically.
Is that right?
And why does it flicker? Is there old data stored somewhere?
Best regards
Thomas
>
> 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).
>
> Patch #1 is just a refactoring to allow the logic of the frame damage
> helpers to be shared by the buffer damage helpers.
>
> Patch #2 adds the helpers that are needed for buffer damage handling.
>
> Patch #3 fixes the virtio-gpu damage handling logic by using the
> helper that is required by drivers that need to handle buffer damage.
>
> Patch #4 fixes the vmwgfx similarly, since that driver also needs to
> handle buffer damage and should have the same issue (although I have
> not tested it due not having a VMWare setup).
>
> Patch #5 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 #6 adds an item to the DRM/KMS todo, about the need to
> implement some buffer damage accumulation algorithm instead of just
> doing a full plane update in this case.
>
> Because commit 01f05940a9a7 landed in v6.4, the first three 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.
>
> Please let me know what you think. Specially on the wording since could
> made mistakes due just learning about these concepts yesterday thanks to
> Sima, Simon and Pekka.
>
> Best regards,
> Javier
>
>
> Javier Martinez Canillas (6):
> drm: Move drm_atomic_helper_damage_{iter_init,merged}() to helpers
> drm: Add drm_atomic_helper_buffer_damage_{iter_init,merged}() helpers
> drm/virtio: Use drm_atomic_helper_buffer_damage_merged() for buffer
> damage
> drm/vmwgfx: Use drm_atomic_helper_buffer_damage_iter_init() for buffer
> damage
> drm/plane: Extend damage tracking kernel-doc
> drm/todo: Add entry about implementing buffer age for damage tracking
>
> Documentation/gpu/todo.rst | 20 +++
> drivers/gpu/drm/drm_damage_helper.c | 166 +++++++++++++++++++------
> drivers/gpu/drm/drm_plane.c | 22 +++-
> drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +-
> include/drm/drm_damage_helper.h | 7 ++
> 6 files changed, 173 insertions(+), 46 deletions(-)
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists