From: Javier Martinez Canillas <javierm@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
Maxime Ripard <mripard@kernel.org>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
Sima Vetter <daniel.vetter@ffwll.ch>,
Erico Nunes <nunes.erico@gmail.com>,
Simon Ser <contact@emersion.fr>,
Bilal Elmoussaoui <belmouss@redhat.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
dri-devel@lists.freedesktop.org
Subject: [PATCH v3 4/5] drm/plane: Extend damage tracking kernel-doc
Date: Sun, 19 Nov 2023 11:57:00 +0100 [thread overview]
Message-ID: <20231119105709.3143489-5-javierm@redhat.com> (raw)
In-Reply-To: <20231119105709.3143489-1-javierm@redhat.com>
The "Damage Tracking Properties" section in the documentation doesn't have
info about the two type of damage handling: frame damage vs buffer damage.
Add it to the section and mention that helpers only support frame damage,
and how drivers handling buffer damage can indicate that the damage clips
should be ignored.
Also add references to further documentation about the two damage types.
Suggested-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
---
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).
drivers/gpu/drm/drm_plane.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 24e7998d1731..87edd6c3c5a4 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -1442,6 +1442,32 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
* Drivers implementing damage can use drm_atomic_helper_damage_iter_init() and
* drm_atomic_helper_damage_iter_next() helper iterator function to get damage
* rectangles clipped to &drm_plane_state.src.
+ *
+ * Note that there are two types of damage handling: frame damage and buffer
+ * damage, the type of damage handling implemented depends on a driver's upload
+ * target. Drivers implementing a per-plane or per-CRTC upload target need to
+ * handle frame damage, while drivers implementing a per-buffer upload target
+ * need to handle buffer damage.
+ *
+ * The existing damage helpers only support the frame damage type, there is no
+ * buffer age support or similar damage accumulation algorithm implemented yet.
+ *
+ * Only drivers handling frame damage can use the mentioned damage helpers to
+ * iterate over the damaged regions. Drivers that handle buffer damage, need to
+ * set &struct drm_plane_state.ignore_damage_clips as an indication to
+ * drm_atomic_helper_damage_iter_init() that the damage clips should be ignored.
+ * In that case, the returned damage rectangle is the &drm_plane_state.src since
+ * a full plane update should happen.
+ *
+ * That is because drivers with a per-plane upload target, expect the backing
+ * storage buffer to not change for a given plane. If the upload buffer changes
+ * between page flips, the new upload buffer has to be updated as a whole. This
+ * can be improved in the future if support for frame damage is added to the DRM
+ * damage helpers, similarly to how user-space already handle this case as it is
+ * explained in the following documents:
+ *
+ * https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_swap_buffers_with_damage.txt
+ * https://emersion.fr/blog/2019/intro-to-damage-tracking/
*/
/**
--
2.41.0
next prev parent reply other threads:[~2023-11-19 10:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 10:56 [PATCH v3 0/5] drm: Allow the damage helpers to handle buffer damage Javier Martinez Canillas
2023-11-19 10:56 ` [PATCH v3 1/5] drm: Allow drivers to indicate the damage helpers to ignore damage clips Javier Martinez Canillas
2023-11-19 10:56 ` [PATCH v3 2/5] drm/virtio: Disable damage clipping if FB changed since last page-flip Javier Martinez Canillas
2023-11-19 10:56 ` [PATCH v3 3/5] drm/vmwgfx: " Javier Martinez Canillas
2023-11-19 10:57 ` Javier Martinez Canillas [this message]
2023-11-19 10:57 ` [PATCH v3 5/5] drm/todo: Add entry about implementing buffer age for damage tracking Javier Martinez Canillas
2023-11-20 2:49 ` [PATCH v3 0/5] drm: Allow the damage helpers to handle buffer damage Zack Rusin
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=20231119105709.3143489-5-javierm@redhat.com \
--to=javierm@redhat.com \
--cc=airlied@gmail.com \
--cc=belmouss@redhat.com \
--cc=contact@emersion.fr \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nunes.erico@gmail.com \
--cc=pekka.paalanen@collabora.com \
--cc=tzimmermann@suse.de \
/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