drm/vmwgfx: Fix kms preferred mode sorting
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 29 Jun 2015 19:59:58 +0000 (12:59 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Aug 2015 12:01:11 +0000 (14:01 +0200)
The preferred mode typically didn't end up first, since the function
drm_mode_connector_list_update() reordered the modes.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index ae87e7ec06efb5af3fe52d8ac349e437bf35da92..ef605b66458f51cc1f91e00dd28af3b1c19ca4dd 100644 (file)
@@ -1554,11 +1554,9 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
                drm_mode_probed_add(connector, mode);
        }
 
-       /* Move the prefered mode first, help apps pick the right mode. */
-       if (du->pref_mode)
-               list_move(&du->pref_mode->head, &connector->probed_modes);
-
        drm_mode_connector_list_update(connector, true);
+       /* Move the prefered mode first, help apps pick the right mode. */
+       drm_mode_sort(&connector->modes);
 
        return 1;
 }