]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm: Allow drivers to indicate the damage helpers to ignore damage clips
authorJavier Martinez Canillas <javierm@redhat.com>
Thu, 23 Nov 2023 22:13:00 +0000 (23:13 +0100)
committerJavier Martinez Canillas <javierm@redhat.com>
Fri, 24 Nov 2023 14:15:25 +0000 (15:15 +0100)
It allows drivers to set a struct drm_plane_state .ignore_damage_clips in
their plane's .atomic_check callback, as an indication to damage helpers
such as drm_atomic_helper_damage_iter_init() that the damage clips should
be ignored.

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.

That way, these drivers could force a full plane update if the framebuffer
attached to a plane's state has changed since the last update (page-flip).

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: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Acked-by: Sima Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-2-javierm@redhat.com
Documentation/gpu/drm-kms.rst
drivers/gpu/drm/drm_damage_helper.c
include/drm/drm_plane.h

index 4a112b8cc7fbe5ee5b39a34110120978677f0d2a..13d3627d8bc083f0eb48b4c3f955f5c8e7117489 100644 (file)
@@ -548,6 +548,8 @@ Plane Composition Properties
 .. kernel-doc:: drivers/gpu/drm/drm_blend.c
    :doc: overview
 
+.. _damage_tracking_properties:
+
 Damage Tracking Properties
 --------------------------
 
index d8b2955e88fd0a606c37e74ed454f4a27874a26d..afb02aae707b4f98f4084d65436166c56b7b5006 100644 (file)
@@ -241,7 +241,8 @@ drm_atomic_helper_damage_iter_init(struct drm_atomic_helper_damage_iter *iter,
        iter->plane_src.x2 = (src.x2 >> 16) + !!(src.x2 & 0xFFFF);
        iter->plane_src.y2 = (src.y2 >> 16) + !!(src.y2 & 0xFFFF);
 
-       if (!iter->clips || !drm_rect_equals(&state->src, &old_state->src)) {
+       if (!iter->clips || state->ignore_damage_clips ||
+           !drm_rect_equals(&state->src, &old_state->src)) {
                iter->clips = NULL;
                iter->num_clips = 0;
                iter->full_update = true;
index e2c671585775b6f4dcd4b9aae4c3451e7efc981a..c6565a6f9324cfb0cd2f8ed990d1321c539bedd5 100644 (file)
@@ -194,6 +194,16 @@ struct drm_plane_state {
         */
        struct drm_property_blob *fb_damage_clips;
 
+       /**
+        * @ignore_damage_clips:
+        *
+        * Set by drivers to indicate the drm_atomic_helper_damage_iter_init()
+        * helper that the @fb_damage_clips blob property should be ignored.
+        *
+        * See :ref:`damage_tracking_properties` for more information.
+        */
+       bool ignore_damage_clips;
+
        /**
         * @src:
         *