Skip to content

Commit

Permalink
drm/kms: remove old std mode fallback code.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Airlie committed Sep 7, 2009
1 parent 50fe4cf commit 575dc34
Showing 1 changed file with 2 additions and 54 deletions.
56 changes: 2 additions & 54 deletions drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
#include "drm_crtc.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,
int flags)
{
Expand Down Expand Up @@ -133,7 +124,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
mode);
}


drm_mode_prune_invalid(dev, &connector->modes, true);

if (list_empty(&connector->modes))
Expand Down Expand Up @@ -169,40 +159,6 @@ int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX,
}
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
* @encoder: encoder to check
Expand Down Expand Up @@ -982,24 +938,16 @@ bool drm_helper_plugged_event(struct drm_device *dev)
*/
bool drm_helper_initial_config(struct drm_device *dev)
{
struct drm_connector *connector;
int count = 0;

count = drm_helper_probe_connector_modes(dev,
dev->mode_config.max_width,
dev->mode_config.max_height);

/*
* None of the available connectors had any modes, so add some
* and try to light them up anyway
* we shouldn't end up with no modes here.
*/
if (!count) {
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);
}
WARN(!count, "Connected connector with 0 modes\n");

drm_setup_crtcs(dev);

Expand Down

0 comments on commit 575dc34

Please sign in to comment.