Merge tag 'topic/core-stuff-2014-08-15' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / drm_modes.c
index 8b410576fce4b42998bb8e9a0334de5ff38207db..d1b7d20065293338ccf88282369dda6a59c78c7f 100644 (file)
@@ -1013,6 +1013,7 @@ EXPORT_SYMBOL(drm_mode_sort);
 /**
  * drm_mode_connector_list_update - update the mode list for the connector
  * @connector: the connector to update
+ * @merge_type_bits: whether to merge or overright type bits.
  *
  * This moves the modes from the @connector probed_modes list
  * to the actual mode list. It compares the probed mode against the current
@@ -1021,7 +1022,8 @@ EXPORT_SYMBOL(drm_mode_sort);
  * This is just a helper functions doesn't validate any modes itself and also
  * doesn't prune any invalid modes. Callers need to do that themselves.
  */
-void drm_mode_connector_list_update(struct drm_connector *connector)
+void drm_mode_connector_list_update(struct drm_connector *connector,
+                                   bool merge_type_bits)
 {
        struct drm_display_mode *mode;
        struct drm_display_mode *pmode, *pt;
@@ -1039,7 +1041,10 @@ void drm_mode_connector_list_update(struct drm_connector *connector)
                                /* if equal delete the probed mode */
                                mode->status = pmode->status;
                                /* Merge type bits together */
-                               mode->type |= pmode->type;
+                               if (merge_type_bits)
+                                       mode->type |= pmode->type;
+                               else
+                                       mode->type = pmode->type;
                                list_del(&pmode->head);
                                drm_mode_destroy(connector->dev, pmode);
                                break;
@@ -1254,6 +1259,7 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev,
        if (!mode)
                return NULL;
 
+       mode->type |= DRM_MODE_TYPE_USERDEF;
        drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
        return mode;
 }