aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-09-07 04:43:26 -0400
committerDave Airlie <airlied@redhat.com>2009-09-07 04:44:46 -0400
commit575dc34ee0de867ba83abf25998e0963bff451fa (patch)
treeb71c77f8741b15b432d274208a97ea14873ff7d6 /drivers/gpu/drm/drm_crtc_helper.c
parent50fe4cfdc759fb3c0cffc3b90281efb139631fb7 (diff)
drm/kms: remove old std mode fallback code.
The new code adds modes in the helper, which makes more sense I disliked the non-driver code adding modes. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 6f4b4446fcdf..c9a50c729330 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -33,15 +33,6 @@
33#include "drm_crtc.h" 33#include "drm_crtc.h"
34#include "drm_crtc_helper.h" 34#include "drm_crtc_helper.h"
35 35
36/*
37 * Detailed mode info for 800x600@60Hz
38 */
39static struct drm_display_mode std_modes[] = {
40 { DRM_MODE("800x600", DRM_MODE_TYPE_DEFAULT, 40000, 800, 840,
41 968, 1056, 0, 600, 601, 605, 628, 0,
42 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
43};
44
45static void drm_mode_validate_flag(struct drm_connector *connector, 36static void drm_mode_validate_flag(struct drm_connector *connector,
46 int flags) 37 int flags)
47{ 38{
@@ -133,7 +124,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
133 mode); 124 mode);
134 } 125 }
135 126
136
137 drm_mode_prune_invalid(dev, &connector->modes, true); 127 drm_mode_prune_invalid(dev, &connector->modes, true);
138 128
139 if (list_empty(&connector->modes)) 129 if (list_empty(&connector->modes))
@@ -169,40 +159,6 @@ int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX,
169} 159}
170EXPORT_SYMBOL(drm_helper_probe_connector_modes); 160EXPORT_SYMBOL(drm_helper_probe_connector_modes);
171 161
172static void drm_helper_add_std_modes(struct drm_device *dev,
173 struct drm_connector *connector)
174{
175 struct drm_display_mode *mode, *t;
176 int i;
177
178 for (i = 0; i < ARRAY_SIZE(std_modes); i++) {
179 struct drm_display_mode *stdmode;
180
181 /*
182 * When no valid EDID modes are available we end up
183 * here and bailed in the past, now we add some standard
184 * modes and move on.
185 */
186 stdmode = drm_mode_duplicate(dev, &std_modes[i]);
187 drm_mode_probed_add(connector, stdmode);
188 drm_mode_list_concat(&connector->probed_modes,
189 &connector->modes);
190
191 DRM_DEBUG_KMS("Adding mode %s to %s\n", stdmode->name,
192 drm_get_connector_name(connector));
193 }
194 drm_mode_sort(&connector->modes);
195
196 DRM_DEBUG_KMS("Added std modes on %s\n",
197 drm_get_connector_name(connector));
198 list_for_each_entry_safe(mode, t, &connector->modes, head) {
199 mode->vrefresh = drm_mode_vrefresh(mode);
200
201 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
202 drm_mode_debug_printmodeline(mode);
203 }
204}
205
206/** 162/**
207 * drm_helper_encoder_in_use - check if a given encoder is in use 163 * drm_helper_encoder_in_use - check if a given encoder is in use
208 * @encoder: encoder to check 164 * @encoder: encoder to check
@@ -982,7 +938,6 @@ bool drm_helper_plugged_event(struct drm_device *dev)
982 */ 938 */
983bool drm_helper_initial_config(struct drm_device *dev) 939bool drm_helper_initial_config(struct drm_device *dev)
984{ 940{
985 struct drm_connector *connector;
986 int count = 0; 941 int count = 0;
987 942
988 count = drm_helper_probe_connector_modes(dev, 943 count = drm_helper_probe_connector_modes(dev,
@@ -990,16 +945,9 @@ bool drm_helper_initial_config(struct drm_device *dev)
990 dev->mode_config.max_height); 945 dev->mode_config.max_height);
991 946
992 /* 947 /*
993 * None of the available connectors had any modes, so add some 948 * we shouldn't end up with no modes here.
994 * and try to light them up anyway
995 */ 949 */
996 if (!count) { 950 WARN(!count, "Connected connector with 0 modes\n");
997 DRM_ERROR("connectors have no modes, using standard modes\n");
998 list_for_each_entry(connector,
999 &dev->mode_config.connector_list,
1000 head)
1001 drm_helper_add_std_modes(dev, connector);
1002 }
1003 951
1004 drm_setup_crtcs(dev); 952 drm_setup_crtcs(dev);
1005 953