compositor-fbdev: simplify FB destroy/unmap/disable
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 13 Sep 2017 14:14:19 +0000 (17:14 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 4 Oct 2017 13:18:06 +0000 (16:18 +0300)
commita51e71fbf0b3b1faceca2fb1272728177c56951d
tree96224885a7b8382ab4da7cd0e0f93cdd61f379be
parent82db6b79a3736dba4896b5bd16feec56d1ed6499
compositor-fbdev: simplify FB destroy/unmap/disable

Rename fbdev_frame_buffer_destroy() to fbdev_frame_buffer_unmap()
because that is what it does. Adding the destruction of hw_surface in it
makes it the perfect counterpart to fbdev_frame_buffer_map() which
simplifies the code.

fbdev_frame_buffer_map() can no longer call that, so just open-code the
munmap() there. It is an error path, we don't really care about
failures in an error path.

The error path of fbdev_output_enable() is converted to call
buffer_unmap() since that is exactly what it did.

fbdev_output_disable() became redundant, being identical to
fbdev_frame_buffer_unmap().

Invariant: output->hw_surface cannot be non-NULL without output->fb
being non-NULL. hw_surface wraps the mmapped memory so cannot exist
without the mmap.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by Daniel Stone <daniels@collabora.com>
libweston/compositor-fbdev.c