Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
xorg-x11-driver-video
xf86-video-intel-bnc381139-vga-output-detection...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xf86-video-intel-bnc381139-vga-output-detection.diff of Package xorg-x11-driver-video
From 9e915b8b819f548ff9abb1829faf20613263954a Mon Sep 17 00:00:00 2001 From: Keith Packard <keithp@keithp.com> Date: Thu, 6 Nov 2008 15:04:27 -0800 Subject: [PATCH 1/3] Use long crt hotplug activation time on GM45. The GM45 b-spec requires the use of the longer hotplug activation period, but does not require looping twice over the detection logic. With this patch, CRT detection appears solid on my GM45. Signed-off-by: Keith Packard <keithp@keithp.com> --- src/i810_reg.h | 15 ++++++++++++++ src/i830_crt.c | 60 +++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/src/i810_reg.h b/src/i810_reg.h index 6458008..1431ed6 100644 --- a/src/i810_reg.h +++ b/src/i810_reg.h @@ -1242,7 +1242,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # define SDVOC_HOTPLUG_INT_EN (1 << 25) # define TV_HOTPLUG_INT_EN (1 << 18) # define CRT_HOTPLUG_INT_EN (1 << 9) +# define CRT_HOTPLUG_ACTIVATION_PERIOD_32 (0 << 8) +/* must use period 64 on GM45 according to docs */ +# define CRT_HOTPLUG_ACTIVATION_PERIOD_64 (1 << 8) +# define CRT_HOTPLUG_DAC_ON_TIME_2M (0 << 7) +# define CRT_HOTPLUG_DAC_ON_TIME_4M (1 << 7) +# define CRT_HOTPLUG_VOLTAGE_COMPARE_40 (0 << 5) +# define CRT_HOTPLUG_VOLTAGE_COMPARE_50 (1 << 5) +# define CRT_HOTPLUG_VOLTAGE_COMPARE_60 (2 << 5) +# define CRT_HOTPLUG_VOLTAGE_COMPARE_70 (3 << 5) +# define CRT_HOTPLUG_VOLTAGE_COMPARE_MASK (3 << 5) +# define CRT_HOTPLUG_DETECT_DELAY_1G (0 << 4) +# define CRT_HOTPLUG_DETECT_DELAY_2G (1 << 4) # define CRT_HOTPLUG_FORCE_DETECT (1 << 3) +# define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) +# define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) +# define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */ #define PORT_HOTPLUG_STAT 0x61114 # define HDMIB_HOTPLUG_INT_STATUS (1 << 29) diff --git a/src/i830_crt.c b/src/i830_crt.c index 479fbe5..ad81fbb 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -158,39 +158,55 @@ i830_crt_detect_hotplug(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; I830Ptr pI830 = I830PTR(pScrn); - uint32_t temp; + uint32_t hotplug_en, temp; const int timeout_ms = 1000; int starttime, curtime; int tries = 1; + int try; - /* On 4 series, CRT detect sequence need to be done twice for safe. */ - if (IS_G4X(pI830)) + /* On 4 series desktop, CRT detect sequence need to be done twice + * to get a reliable result. */ + if (IS_G4X(pI830) && !IS_GM45(pI830)) tries = 2; + else + tries = 1; -retry: - tries--; + hotplug_en = INREG(PORT_HOTPLUG_EN); - temp = INREG(PORT_HOTPLUG_EN); + hotplug_en &= ~CRT_HOTPLUG_MASK; - OUTREG(PORT_HOTPLUG_EN, temp | CRT_HOTPLUG_FORCE_DETECT | (1 << 5)); + /* This starts the detection sequence */ + hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; - for (curtime = starttime = GetTimeInMillis(); - (curtime - starttime) < timeout_ms; curtime = GetTimeInMillis()) - { - if ((INREG(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT) == 0) - break; - } + /* GM45 requires a longer activation period to reliably + * detect CRT + */ + if (IS_GM45(pI830)) + hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64; - if (tries > 0) - goto retry; + /* Use the default voltage value */ + hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50; - if ((INREG(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) == - CRT_HOTPLUG_MONITOR_COLOR) - { - return TRUE; - } else { - return FALSE; + for (try = 0; try < tries; try++) { + /* turn FORCE_DETECT on */ + OUTREG(PORT_HOTPLUG_EN, hotplug_en); + + /* wait for FORCE_DETECT to go off */ + for (curtime = starttime = GetTimeInMillis(); + (curtime - starttime) < timeout_ms; + curtime = GetTimeInMillis()) + { + temp = INREG(PORT_HOTPLUG_EN); + + if ((temp & CRT_HOTPLUG_FORCE_DETECT) == 0) + break; + } } + + /* Check the status to see if both blue and green are on now */ + temp = INREG(PORT_HOTPLUG_STAT); + return ((temp & CRT_HOTPLUG_MONITOR_MASK) == + CRT_HOTPLUG_MONITOR_COLOR); } /** -- 1.6.0.2 From 841a619f3fe181a6b04bf38bc6f7e92230052879 Mon Sep 17 00:00:00 2001 From: Ma Ling <ling.ma@intel.com> Date: Fri, 15 May 2009 14:01:18 +0800 Subject: [PATCH 2/3] Set activation periods as 64 cdclk sync up with KMS We use force CRT detect trigger bit(1 << 3) to detect VGA in hot plug mode, which triggers a CRT hotplug/unplug detection cycle independent of the interrupt enable bit(1 << 9), so keep bit 9. And although spec says CRT_HOTPLUG_ACTIVATION_PERIOD_64(1 << 8) is only useful for mobile platform, it is also required to detect vga on G4x platform correctly. Tested the patch on G45/G43/Q45 platforms with no regressions It fixed freedesktop.org bug #21120 and part of bug #21210. Signed-off-by: Ma Ling <ling.ma@intel.com> --- src/i810_reg.h | 1 + src/i830_crt.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i810_reg.h b/src/i810_reg.h index 1431ed6..295e67d 100644 --- a/src/i810_reg.h +++ b/src/i810_reg.h @@ -1258,6 +1258,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) # define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) # define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */ +# define CRT_FORCE_HOTPLUG_MASK 0xfffffe1f #define PORT_HOTPLUG_STAT 0x61114 # define HDMIB_HOTPLUG_INT_STATUS (1 << 29) diff --git a/src/i830_crt.c b/src/i830_crt.c index ad81fbb..acfe053 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -173,7 +173,7 @@ i830_crt_detect_hotplug(xf86OutputPtr output) hotplug_en = INREG(PORT_HOTPLUG_EN); - hotplug_en &= ~CRT_HOTPLUG_MASK; + hotplug_en &= CRT_FORCE_HOTPLUG_MASK; /* This starts the detection sequence */ hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; @@ -181,7 +181,7 @@ i830_crt_detect_hotplug(xf86OutputPtr output) /* GM45 requires a longer activation period to reliably * detect CRT */ - if (IS_GM45(pI830)) + if (IS_G4X(pI830) || IS_GM45(pI830)) hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64; /* Use the default voltage value */ -- 1.6.0.2 From e3f6e87ac763e9db617ac890a398cf30a9568a6a Mon Sep 17 00:00:00 2001 From: Ma Ling <ling.ma@intel.com> Date: Fri, 15 May 2009 15:22:11 +0800 Subject: [PATCH 3/3] Wait doubled regis to be stable for load pipe detection We have two approaches for VGA detections: hot plug detection for 945G onwards and load pipe detection for Pre-945G. load pipe detection will get one free pipe ,and set border color as red and blue, then check CRT status by swf register. Because pipe registers in hires mode are double buffered, once set force border bit in pipeconf register, we have to wait for a vblank until it is effective, otherwise result is unstable. It fixed freedesktop bug #20463 Signed-off-by: Ma Ling <ling.ma@intel.com> --- src/i830_crt.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/i830_crt.c b/src/i830_crt.c index acfe053..46bb6f4 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -274,7 +274,8 @@ i830_crt_detect_load (xf86CrtcPtr crtc, { uint32_t pipeconf = INREG(pipeconf_reg); OUTREG(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER); - + /* Wait for next Vblank to substitue border color for Color info */ + i830WaitForVblank (pScrn); st00 = pI830->readStandard (pI830, 0x3c2); present = (st00 & (1 << 4)) != 0; OUTREG(pipeconf_reg, pipeconf); -- 1.6.0.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor