Commit 575dc34e authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 50fe4cfd
...@@ -33,15 +33,6 @@ ...@@ -33,15 +33,6 @@
#include "drm_crtc.h" #include "drm_crtc.h"
#include "drm_crtc_helper.h" #include "drm_crtc_helper.h"
/*
* Detailed mode info for 800x600@60Hz
*/
static struct drm_display_mode std_modes[] = {
{ DRM_MODE("800x600", DRM_MODE_TYPE_DEFAULT, 40000, 800, 840,
968, 1056, 0, 600, 601, 605, 628, 0,
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
};
static void drm_mode_validate_flag(struct drm_connector *connector, static void drm_mode_validate_flag(struct drm_connector *connector,
int flags) int flags)
{ {
...@@ -133,7 +124,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, ...@@ -133,7 +124,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
mode); mode);
} }
drm_mode_prune_invalid(dev, &connector->modes, true); drm_mode_prune_invalid(dev, &connector->modes, true);
if (list_empty(&connector->modes)) if (list_empty(&connector->modes))
...@@ -169,40 +159,6 @@ int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX, ...@@ -169,40 +159,6 @@ int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX,
} }
EXPORT_SYMBOL(drm_helper_probe_connector_modes); EXPORT_SYMBOL(drm_helper_probe_connector_modes);
static void drm_helper_add_std_modes(struct drm_device *dev,
struct drm_connector *connector)
{
struct drm_display_mode *mode, *t;
int i;
for (i = 0; i < ARRAY_SIZE(std_modes); i++) {
struct drm_display_mode *stdmode;
/*
* When no valid EDID modes are available we end up
* here and bailed in the past, now we add some standard
* modes and move on.
*/
stdmode = drm_mode_duplicate(dev, &std_modes[i]);
drm_mode_probed_add(connector, stdmode);
drm_mode_list_concat(&connector->probed_modes,
&connector->modes);
DRM_DEBUG_KMS("Adding mode %s to %s\n", stdmode->name,
drm_get_connector_name(connector));
}
drm_mode_sort(&connector->modes);
DRM_DEBUG_KMS("Added std modes on %s\n",
drm_get_connector_name(connector));
list_for_each_entry_safe(mode, t, &connector->modes, head) {
mode->vrefresh = drm_mode_vrefresh(mode);
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
drm_mode_debug_printmodeline(mode);
}
}
/** /**
* drm_helper_encoder_in_use - check if a given encoder is in use * drm_helper_encoder_in_use - check if a given encoder is in use
* @encoder: encoder to check * @encoder: encoder to check
...@@ -982,7 +938,6 @@ bool drm_helper_plugged_event(struct drm_device *dev) ...@@ -982,7 +938,6 @@ bool drm_helper_plugged_event(struct drm_device *dev)
*/ */
bool drm_helper_initial_config(struct drm_device *dev) bool drm_helper_initial_config(struct drm_device *dev)
{ {
struct drm_connector *connector;
int count = 0; int count = 0;
count = drm_helper_probe_connector_modes(dev, count = drm_helper_probe_connector_modes(dev,
...@@ -990,16 +945,9 @@ bool drm_helper_initial_config(struct drm_device *dev) ...@@ -990,16 +945,9 @@ bool drm_helper_initial_config(struct drm_device *dev)
dev->mode_config.max_height); dev->mode_config.max_height);
/* /*
* None of the available connectors had any modes, so add some * we shouldn't end up with no modes here.
* and try to light them up anyway
*/ */
if (!count) { WARN(!count, "Connected connector with 0 modes\n");
DRM_ERROR("connectors have no modes, using standard modes\n");
list_for_each_entry(connector,
&dev->mode_config.connector_list,
head)
drm_helper_add_std_modes(dev, connector);
}
drm_setup_crtcs(dev); drm_setup_crtcs(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment