compositor-drm: Only request vblank events if needed
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 9 Nov 2012 12:19:03 +0000 (14:19 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 9 Nov 2012 16:13:44 +0000 (11:13 -0500)
If the sprite is disabled and we're not enabling it on the next frame,
nothing is done in the vblank handler, so there's no need to ask for a
vblank event.

src/compositor-drm.c

index ee57bf0..3a7d432 100644 (file)
@@ -391,7 +391,8 @@ drm_output_repaint(struct weston_output *output_base,
                        .request.sequence = 1,
                };
 
-               if (!drm_sprite_crtc_supported(output_base, s->possible_crtcs))
+               if ((!s->fb_id && !s->pending_fb_id) ||
+                   !drm_sprite_crtc_supported(output_base, s->possible_crtcs))
                        continue;
 
                ret = drmModeSetPlane(compositor->drm.fd, s->plane_id,