aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_tv.c
diff options
context:
space:
mode:
authorMa Ling <ling.ma@intel.com>2009-08-24 01:50:25 -0400
committerEric Anholt <eric@anholt.net>2009-09-04 16:05:10 -0400
commit213c2e643145fc7d8a67f2d5d54ee0f6d7193e2e (patch)
tree30a631bfdbaaa6fc6c33bcb209c28b0cb839c4b0 /drivers/gpu/drm/i915/intel_tv.c
parent5f6a169598938d9e5703f06b64c4f4f972561ce5 (diff)
drm/i915: select TV format according to connector type
For integrated TV there are 3 connector types: S-VIDEO, Composite and Component(YprPb). Those tv formats whose component flag is true should be assigned to Component connector, others are for S-VIDEO and Composite. The patch intends to find appropriate tv format for each connector. In such case it will return the correct modeline to user space. Otherwise it will return the incorrect modeline when S-video/composite is connected. Signed-off-by: Ma Ling <ling.ma@intel.com> reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 2fbe13a0de81..a6c686cded54 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1437,6 +1437,35 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output)
1437 return type; 1437 return type;
1438} 1438}
1439 1439
1440/*
1441 * Here we set accurate tv format according to connector type
1442 * i.e Component TV should not be assigned by NTSC or PAL
1443 */
1444static void intel_tv_find_better_format(struct drm_connector *connector)
1445{
1446 struct intel_output *intel_output = to_intel_output(connector);
1447 struct intel_tv_priv *tv_priv = intel_output->dev_priv;
1448 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
1449 int i;
1450
1451 if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) ==
1452 tv_mode->component_only)
1453 return;
1454
1455
1456 for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) {
1457 tv_mode = tv_modes + i;
1458
1459 if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) ==
1460 tv_mode->component_only)
1461 break;
1462 }
1463
1464 tv_priv->tv_format = tv_mode->name;
1465 drm_connector_property_set_value(connector,
1466 connector->dev->mode_config.tv_mode_property, i);
1467}
1468
1440/** 1469/**
1441 * Detect the TV connection. 1470 * Detect the TV connection.
1442 * 1471 *
@@ -1473,6 +1502,7 @@ intel_tv_detect(struct drm_connector *connector)
1473 if (type < 0) 1502 if (type < 0)
1474 return connector_status_disconnected; 1503 return connector_status_disconnected;
1475 1504
1505 intel_tv_find_better_format(connector);
1476 return connector_status_connected; 1506 return connector_status_connected;
1477} 1507}
1478 1508