drm_hwcomposer: Chose preferred mode with type DRM_MODE_TYPE_PREFERRED

According to the Linux Kernel: "DRM_MODE_TYPE_PREFERRED: Preferred mode,
usually the native resolution of an LCD panel. There should only be
one preferred mode per connector at any given time."
Will use it during preferred mode choice.

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index f506bfc..3123b29 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -245,14 +245,7 @@
   if (err != HWC2::Error::None || !num_configs)
     return err;
 
-  // Grab the first mode, we'll choose this as the active mode
-  // TODO: Should choose the preferred mode here
-  hwc2_config_t default_config;
-  num_configs = 1;
-  err = GetDisplayConfigs(&num_configs, &default_config);
-  if (err != HWC2::Error::None)
-    return err;
-  return SetActiveConfig(default_config);
+  return SetActiveConfig(connector_->get_preferred_mode_id());
 }
 
 HWC2::Error DrmHwcTwo::HwcDisplay::RegisterVsyncCallback(