compositor-drm: consider the best mode of the mode_list as an option
authorFabien DESSENNE <fabien.dessenne@st.com>
Thu, 12 Dec 2013 16:13:56 +0000 (17:13 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 9 Jan 2014 06:06:05 +0000 (22:06 -0800)
commit4b2558708b7bac2b2255c3d6682ff594c0b90ae6
tree1d59319ec5028b6c310f0c506fa6dace74cc49cb
parent73d9395e68b955b537452e8b9107d2e55cf455c3
compositor-drm: consider the best mode of the mode_list as an option

This patch fixes an issue where Weston using the DRM backend, cannot start
the display. This happens in the following context:
- no video mode is set before weston starts (eg no "/dev/fb" set up)
- weston is not configured with any default video mode (nothing from
  weston.ini nor command line)
- the DRM driver provides with a list of supported modes, but none of them
  is marked as PREFERRED (which is not a usual case, but it happens)
In that case, according to the current implementation, the DRM compositor
fails to set a video mode.
This fix lets the DRM compositor selects a video mode (the best one of the
list, which is the first) from the ones provided by the driver.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
src/compositor-drm.c