summaryrefslogtreecommitdiff
path: root/src/i830_tv.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2009-03-03 20:26:19 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2009-03-03 20:43:39 +0800
commitaa9da5e393c804019720503fe58bdd247fe1eabd (patch)
tree6481d938b79ddf97df58e922f94047aa4fd3bde3 /src/i830_tv.c
parentab1ef05cc0fd5ba9768c26cc51bc2c7b52baa45f (diff)
TV: add option to set TV connector type
This can let user override non-stable driver TV load detect, and set connector type manually, e.g for s-video to component converter, this patch seems must needed to use HD modes.
Diffstat (limited to 'src/i830_tv.c')
-rw-r--r--src/i830_tv.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/i830_tv.c b/src/i830_tv.c
index 210070cb..e7766515 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -56,6 +56,7 @@ enum tv_margin {
/** Private structure for the integrated TV support */
struct i830_tv_priv {
int type;
+ Bool force_type;
char *tv_format;
int margin[4];
uint32_t save_TV_H_CTL_1;
@@ -1380,6 +1381,13 @@ i830_tv_detect(xf86OutputPtr output)
i830ReleaseLoadDetectPipe (output, dpms_mode);
}
+ if (dev_priv->force_type) {
+ if (type == TV_TYPE_NONE)
+ return XF86OutputStatusDisconnected;
+ else
+ return XF86OutputStatusConnected;
+ }
+
if (type != dev_priv->type)
{
dev_priv->type = type;
@@ -1743,6 +1751,7 @@ i830_tv_init(ScrnInfoPtr pScrn)
uint32_t tv_dac_on, tv_dac_off, save_tv_dac;
XF86OptionPtr mon_option_lst = NULL;
char *tv_format = NULL;
+ char *tv_type = NULL;
if (pI830->quirk_flag & QUIRK_IGNORE_TV)
return;
@@ -1810,12 +1819,32 @@ i830_tv_init(ScrnInfoPtr pScrn)
dev_priv->margin[TV_MARGIN_BOTTOM] = xf86SetIntOption (mon_option_lst,
"Bottom", 37);
- tv_format = xf86findOptionValue (mon_option_lst, "TV Format");
+ tv_format = xf86findOptionValue (mon_option_lst, "TV_Format");
if (tv_format)
dev_priv->tv_format = xstrdup (tv_format);
else
dev_priv->tv_format = xstrdup (tv_modes[0].name);
+ tv_type = xf86findOptionValue (mon_option_lst, "TV_Connector");
+ if (tv_type) {
+ dev_priv->force_type = TRUE;
+ if (strcasecmp(tv_type, "S-Video") == 0)
+ dev_priv->type = TV_TYPE_SVIDEO;
+ else if (strcasecmp(tv_type, "Composite") == 0)
+ dev_priv->type = TV_TYPE_COMPOSITE;
+ else if (strcasecmp(tv_type, "Component") == 0)
+ dev_priv->type = TV_TYPE_COMPONENT;
+ else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Unknown TV Connector type %s\n", tv_type);
+ dev_priv->force_type = FALSE;
+ }
+ }
+
+ if (dev_priv->force_type)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Force TV Connector type as %s\n", tv_type);
+
output->driver_private = intel_output;
output->interlaceAllowed = FALSE;
output->doubleScanAllowed = FALSE;