compositor-drm: Refactor sprite create/destroy into helpers
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 5 Jun 2014 08:22:25 +0000 (11:22 +0300)
committerDaniel Stone <daniels@collabora.com>
Mon, 28 Aug 2017 19:07:13 +0000 (20:07 +0100)
commitec27271492cc3ad86db31436f5aa38032f99a16f
tree63885436fa0e300510af8f9db068e09f72981b1c
parentacd71fb0af82fb6065dd239865bd18bbbf1ceab4
compositor-drm: Refactor sprite create/destroy into helpers

This moves the single sprite creation code from create_sprites() into a
new function. The readability clean-up is small, but my intention is to
write an alternate version of create_sprites(), and sharing the single
sprite creation code is useful.

The removal code now actually removes the plane from the list.

In doing this, the gymnastics required to exact the CRTC ID the plane
was last on when making a disabling drmModeSetPlane call have been
removed; specifying the CRTC is not necessary when disabling a plane.
(The atomic API goes a step further, mandating it be zero.)

[daniels: Genericised from drm_sprite to drm_plane, moving some of the
          logic back into create_sprites(), also symmetrical
          drm_plane_destroy.]

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
libweston/compositor-drm.c