diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-10-11 08:01:08 (GMT) |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-04-18 09:05:05 (GMT) |
commit | 1d2fa7e7e9182bbd085e314d6c804ab34d068e47 (patch) | |
tree | a4a01805eca6a8246408202f36b0bda9e241bf72 /drivers/gpu/drm | |
parent | aa66ee9749278e793e720037937c66c4d96c7517 (diff) | |
download | linux-fsl-qoriq-1d2fa7e7e9182bbd085e314d6c804ab34d068e47.tar.xz |
drm: add drm_set_preferred_mode
commit 3cf70dafd7bbbc91df0a9ecb081d46f9f3d867f6 upstream.
New helper function to set the preferred video mode. Can be called
after drm_add_modes_noedid if you don't want the largest supported
video mode be used by default.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index d0d3eae..1cb5026 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3296,6 +3296,19 @@ int drm_add_modes_noedid(struct drm_connector *connector, } EXPORT_SYMBOL(drm_add_modes_noedid); +void drm_set_preferred_mode(struct drm_connector *connector, + int hpref, int vpref) +{ + struct drm_display_mode *mode; + + list_for_each_entry(mode, &connector->probed_modes, head) { + if (drm_mode_width(mode) == hpref && + drm_mode_height(mode) == vpref) + mode->type |= DRM_MODE_TYPE_PREFERRED; + } +} +EXPORT_SYMBOL(drm_set_preferred_mode); + /** * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with * data from a DRM display mode |