From 261408178efd5574a2f0cca3b0a3ef2c71c0b770 Mon Sep 17 00:00:00 2001 From: Mathew McKernan Date: Wed, 6 Apr 2011 07:13:58 +0100 Subject: [PATCH] drm/i915/tv: Remember the detected TV type During detect() we would probe the connection bits to determine if there was a TV attached, and what video input type (Component, S-Video, Composite, etc) to use. However, we promptly discarded this vital bit of information and never propagated it to where it was used to determine the correct modes and setup the control registers. Fix it! Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_tv.c | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 4256b8e..63ad8f7 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1318,25 +1318,24 @@ intel_tv_detect_type (struct intel_tv *intel_tv, * Here we set accurate tv format according to connector type * i.e Component TV should not be assigned by NTSC or PAL */ -static void intel_tv_find_better_format(struct drm_connector *connector) +static void intel_tv_find_better_format(struct drm_connector *connector, + int type) { struct intel_tv *intel_tv = intel_attached_tv(connector); const struct tv_mode *tv_mode = intel_tv_mode_find(intel_tv); + bool is_component_only = type == DRM_MODE_CONNECTOR_Component; int i; - if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) == - tv_mode->component_only) - return; - - - for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) { - tv_mode = tv_modes + i; + if (is_component_only != tv_mode->component_only) { + for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) { + tv_mode = tv_modes + i; - if ((intel_tv->type == DRM_MODE_CONNECTOR_Component) == - tv_mode->component_only) - break; + if (is_component_only == tv_mode->component_only) + break; + } } + intel_tv->type = type; intel_tv->tv_format = tv_mode->name; drm_connector_property_set_value(connector, connector->dev->mode_config.tv_mode_property, i); @@ -1378,7 +1377,7 @@ intel_tv_detect(struct drm_connector *connector, bool force) if (type < 0) return connector_status_disconnected; - intel_tv_find_better_format(connector); + intel_tv_find_better_format(connector, type); return connector_status_connected; } -- 1.7.4.1