From bb7a34856bf3f6e346ff9e755e0dfc1e5b1c2348 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 2 Feb 2024 03:15:11 +0000 Subject: [PATCH] drm: Allow drivers to indicate the damage helpers to ignore damage clips From Javier Martinez Canillas 45aafb5075754bbe6458a6b3e8ad02b408c35211 in linux-6.6.y/6.6.15 35ed38d58257336c1df26b14fd5110b026e2adde in mainline linux --- sys/dev/pci/drm/drm_damage_helper.c | 3 ++- sys/dev/pci/drm/include/drm/drm_plane.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/drm_damage_helper.c b/sys/dev/pci/drm/drm_damage_helper.c index d8b2955e88f..afb02aae707 100644 --- a/sys/dev/pci/drm/drm_damage_helper.c +++ b/sys/dev/pci/drm/drm_damage_helper.c @@ -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; diff --git a/sys/dev/pci/drm/include/drm/drm_plane.h b/sys/dev/pci/drm/include/drm/drm_plane.h index 79d62856def..fef775200a8 100644 --- a/sys/dev/pci/drm/include/drm/drm_plane.h +++ b/sys/dev/pci/drm/include/drm/drm_plane.h @@ -190,6 +190,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: * -- 2.20.1