weston: Port DRM backend to new output handling API
authorArmin Krezović <krezovic.armin@gmail.com>
Fri, 30 Sep 2016 12:11:05 +0000 (14:11 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 3 Oct 2016 11:22:50 +0000 (14:22 +0300)
commit083681325b693a3d487bd17c9152e4b22eecb85e
treef56c3b6dc172c19b216689c17d9ec09521fb3c96
parenta3666d214fe02430a331c9819e9e33c986fe879f
weston: Port DRM backend to new output handling API

This is a complete port of the DRM backend that uses
the recently added output handling API for output
configuration.

Output can be configured at runtime by passing the
necessary configuration parameters, which can be
filled in manually or obtained from the configuration
file using previously added functionality. It is
required that the scale and transform values are set
using the previously added functionality.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Added missing drmModeFreeCrtc() to drm_output_enable()
   cleanup list in case of failure.
 - Split drm_backend_disable() into drm_backend_deinit()
   to accomodate for changes in the first patch in the
   series. Moved restoring original crtc to
   drm_output_destroy().

v3:

 - Moved origcrtc allocation to drm_output_set_mode().
 - Swapped connector_get_current_mode() and
   drm_output_add_mode() calls in drm_output_set_mode()
   to match current weston.
 - Moved crtc_allocator and connector_allocator update
   from drm_output_enable() to create_output_for_connector()
   to avoid problems when more than one monitor is connected
   at startup and crtc allocator wasn't updated before
   create_output_for_connector() was called second time,
   resulting in one screen being turned off.
 - Moved crtc_allocator and connector_allocator update from
   drm_output_deinit() to drm_output_destroy(), as it
   should not be called on drm_output_disable().
 - Use weston_compositor_add_pending_output().
 - Bump weston_drm_backend_config version to 2.

v4:

 - Reset output->original_crtc to NULL if drm_output_set_mode()
   fails.
 - Remove unneeded log message when disabling an output when a
   pageflip is pending.
 - Document that create_output_for_connector() takes ownership
   of the connector.
 - Free the connector if create output conditionals are not met
   in create_outputs() and update_outputs().

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
compositor/main.c
libweston/compositor-drm.c
libweston/compositor-drm.h