From d4463a77da40e5290b7460e889561eb8a98864b7 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Mon, 2 Feb 2009 11:27:24 +0800 Subject: [PATCH] Use VGA EDID info for TV detect on Mac Book This is a debug patch, which trys to check VGA EDID info for TV detect on Mac book. --- src/i830_tv.c | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/src/i830_tv.c b/src/i830_tv.c index 635d870..d9da4e6 100644 --- a/src/i830_tv.c +++ b/src/i830_tv.c @@ -1370,6 +1370,10 @@ i830_tv_detect(xf86OutputPtr output) struct i830_tv_priv *dev_priv = intel_output->dev_priv; int dpms_mode; int type = dev_priv->type; + ScrnInfoPtr pScrn = output->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86OutputPtr crt; + I830OutputPrivatePtr i830_output; mode = reported_modes[0]; xf86SetModeCrtc (&mode, INTERLACE_HALVE_V); @@ -1380,6 +1384,26 @@ i830_tv_detect(xf86OutputPtr output) i830ReleaseLoadDetectPipe (output, dpms_mode); } + /* Mac book hack */ + if (type == TV_TYPE_NONE) { + crt = xf86_config->output[0]; + i830_output = crt->driver_private; + if (i830_output->type == I830_OUTPUT_ANALOG && + crt->MonInfo != NULL && + !strcmp((char*)&crt->MonInfo->vendor.name, "APP")) + { + int i; + for (i = 0; i < 4; i++) + if (crt->MonInfo->det_mon[i].type == DS_NAME && + !strcmp((char*)crt->MonInfo->det_mon[i].section.name, "NTSC/PAL")) + { + /* Mac book has VGA EDID info with TV output */ + xf86OutputDestroy(crt); + type = TV_TYPE_SVIDEO; + } + } + } + if (type != dev_priv->type) { dev_priv->type = type; @@ -1390,7 +1414,7 @@ i830_tv_detect(xf86OutputPtr output) switch (type) { case TV_TYPE_NONE: - return XF86OutputStatusDisconnected; + return XF86OutputStatusDisconnected; case TV_TYPE_UNKNOWN: return XF86OutputStatusUnknown; default: -- 1.5.6.5