The mode-setting pipeline can disabled damage clippings for a commit
by setting ignore_damage_clips in struct drm_plane_state. The commit
will then do a full display update.

Test the flag in the primary plane's atomic_update and do a full update
if it has been set.

Commit 35ed38d58257 ("drm: Allow drivers to indicate the damage helpers
to ignore damage clips") introduced ignore_damage_clips to selectively
ignore damage clipping in certain framebuffer changes. Vboxvideo does not
do that, but DRM's damage iterator will soon rely on the flag. Therefore
supporting it here as well make sense for consistency.

While at it, also replace uint32_t with the preferred u32.

Signed-off-by: Thomas Zimmermann <[email protected]>
Fixes: 35ed38d58257 ("drm: Allow drivers to indicate the damage helpers to 
ignore damage clips")
Cc: Javier Martinez Canillas <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Zack Rusin <[email protected]>
Cc: [email protected]
Cc: <[email protected]> # v6.8+
---
 drivers/gpu/drm/vboxvideo/vbox_mode.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c 
b/drivers/gpu/drm/vboxvideo/vbox_mode.c
index 8e4e5fc9d3c5..635777f1ca23 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
@@ -283,8 +283,9 @@ static void vbox_primary_atomic_update(struct drm_plane 
*plane,
        struct drm_crtc *crtc = new_state->crtc;
        struct drm_framebuffer *fb = new_state->fb;
        struct vbox_private *vbox = to_vbox_dev(fb->dev);
-       struct drm_mode_rect *clips;
-       uint32_t num_clips, i;
+       struct drm_mode_rect *clips = NULL;
+       u32 num_clips = 0;
+       u32 i;
 
        vbox_crtc_set_base_and_mode(crtc, fb,
                                    new_state->src_x >> 16,
@@ -292,8 +293,10 @@ static void vbox_primary_atomic_update(struct drm_plane 
*plane,
 
        /* Send information about dirty rectangles to VBVA. */
 
-       clips = drm_plane_get_damage_clips(new_state);
-       num_clips = drm_plane_get_damage_clips_count(new_state);
+       if (!new_state->ignore_damage_clips) {
+               clips = drm_plane_get_damage_clips(new_state);
+               num_clips = drm_plane_get_damage_clips_count(new_state);
+       }
 
        if (!num_clips)
                return;
-- 
2.54.0

Reply via email to