mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
	linux-kernel@vger.kernel.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	nerdopolis <bluescreen_avenger@verizon.net>,
	Pekka Paalanen <pekka.paalanen@collabora.com>,
	dri-devel@lists.freedesktop.org,
	Bilal Elmoussaoui <belmouss@redhat.com>,
	Maxime Ripard <mripard@kernel.org>,
	stable@vger.kernel.org, Sima Vetter <daniel.vetter@ffwll.ch>,
	Erico Nunes <nunes.erico@gmail.com>
Subject: Re: [PATCH 2/6] drm: Add drm_atomic_helper_buffer_damage_{iter_init,merged}() helpers
Date: Tue, 14 Nov 2023 17:31:39 +0100	[thread overview]
Message-ID: <a8731f9f-3652-4efd-b40e-06a792d0fccf@suse.de> (raw)
In-Reply-To: <8734x872dy.fsf@minerva.mail-host-address-is-not-set>


[-- Attachment #1.1: Type: text/plain, Size: 3172 bytes --]

Hi

Am 14.11.23 um 16:58 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
> 
> Hello Thomas,
> 
> Thanks a lot for your feedback.
> 
>> Hi
>>
>> Am 09.11.23 um 18:24 schrieb Javier Martinez Canillas:
>>> To be used by drivers that do per-buffer (e.g: virtio-gpu) uploads (rather
>>> than per-plane uploads), since these type of drivers need to handle buffer
>>> damages instead of frame damages.
>>>
>>> The drm_atomic_helper_buffer_damage_iter_init() has the same logic than
>>> drm_atomic_helper_damage_iter_init() but it also takes into account if the
>>> framebuffer attached to plane's state has changed since the last update.
>>>
>>> And the drm_atomic_helper_buffer_damage_merged() is just a version of the
>>> drm_atomic_helper_damage_merged() helper, but it uses the iter_init helper
>>> that is mentioned above.
>>>
>>> Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane")
>>> Cc: <stable@vger.kernel.org> # v6.4+
>>> Reported-by: nerdopolis <bluescreen_avenger@verizon.net>
>>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115
>>> Suggested-by: Sima Vetter <daniel.vetter@ffwll.ch>
>>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>>> ---
>>>
>>>    drivers/gpu/drm/drm_damage_helper.c | 79 ++++++++++++++++++++++++++---
>>>    include/drm/drm_damage_helper.h     |  7 +++
>>>    2 files changed, 80 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c
>>> index aa2325567918..b72062c9d31c 100644
>>> --- a/drivers/gpu/drm/drm_damage_helper.c
>>> +++ b/drivers/gpu/drm/drm_damage_helper.c
>>> @@ -204,7 +204,8 @@ EXPORT_SYMBOL(drm_atomic_helper_dirtyfb);
>>>    static void
>>>    __drm_atomic_helper_damage_iter_init(struct drm_atomic_helper_damage_iter *iter,
>>>    				     const struct drm_plane_state *old_state,
>>> -				     const struct drm_plane_state *state)
>>> +				     const struct drm_plane_state *state,
>>> +				     bool buffer_damage)
>>
>> I think it would be preferable to drop patches one and two and instead
>> add this parameter directly to drm_atomic_helper_damage_iter_init() and
>> drm_atomic_helper_damage_merged().  That's a bit of churn, but more
>> readable code.
>>
> 
> Makes sense. I'll do that in v2.

Instead of modifying these function interfaces, it might be even better 
to introduce a state flag in struct drm_plane_state that you can modify 
in the plane's atomic_check helper. Something simple like this:

   if (old_fb != new_fb)
     plane_state->ignore_damage_clips = true;

in the affected drivers/planes. In drm_atomic_helper_damage_iter_init() 
you can use it to generate a full update. This avoids the churn and is 
in line with the overall check/commit design of the DRM framework.

Best regards
Thomas

> 
>> Best regards
>> Thomas
>>
> 

-- 
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)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-11-14 16:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 17:24 [PATCH 0/6] drm: Allow the damage helpers to handle buffer damage Javier Martinez Canillas
2023-11-09 17:24 ` [PATCH 1/6] drm: Move drm_atomic_helper_damage_{iter_init,merged}() to helpers Javier Martinez Canillas
2023-11-09 17:24 ` [PATCH 2/6] drm: Add drm_atomic_helper_buffer_damage_{iter_init,merged}() helpers Javier Martinez Canillas
2023-11-14 15:43   ` Thomas Zimmermann
2023-11-14 15:58     ` Javier Martinez Canillas
2023-11-14 16:31       ` Thomas Zimmermann [this message]
2023-11-14 18:09         ` Javier Martinez Canillas
2023-11-14 15:49   ` [PATCH 2/6] drm: Add drm_atomic_helper_buffer_damage_{iter_init, merged}() helpers Thomas Zimmermann
2023-11-14 16:05     ` Javier Martinez Canillas
2023-11-16  9:20       ` Pekka Paalanen
2023-11-09 17:24 ` [PATCH 3/6] drm/virtio: Use drm_atomic_helper_buffer_damage_merged() for buffer damage Javier Martinez Canillas
2023-11-09 17:24 ` [PATCH 4/6] drm/vmwgfx: Use drm_atomic_helper_buffer_damage_iter_init() " Javier Martinez Canillas
2023-11-09 17:24 ` [PATCH 5/6] drm/plane: Extend damage tracking kernel-doc Javier Martinez Canillas
2023-11-10 10:48   ` Simon Ser
2023-11-09 17:24 ` [PATCH 6/6] drm/todo: Add entry about implementing buffer age for damage tracking Javier Martinez Canillas
2023-11-10 10:39   ` Simon Ser
2023-11-14 15:40 ` [PATCH 0/6] drm: Allow the damage helpers to handle buffer damage Thomas Zimmermann
2023-11-14 16:28   ` Javier Martinez Canillas
2023-11-14 16:36     ` Thomas Zimmermann
2023-11-14 18:06       ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8731f9f-3652-4efd-b40e-06a792d0fccf@suse.de \
    --to=tzimmermann@suse.de \
    --cc=belmouss@redhat.com \
    --cc=bluescreen_avenger@verizon.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=nunes.erico@gmail.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®