[GM965] Why does this patch fix my Intel TVOut issue?

Robert Lowery rglowery at exemail.com.au
Sun May 18 03:59:52 PDT 2008


> Hi Folks,
>
> I've never been able to obtain reliable (ie non blank) TV output on my
> AOpen MP965-DR (GM965 based) HTPC.  Spending some time investigating, I
> have found the patch below works around the problem.
>
> diff --git a/src/i830_tv.c b/src/i830_tv.c
> index 6adb9f2..f442a4f 100644
> --- a/src/i830_tv.c
> +++ b/src/i830_tv.c
> @@ -1297,7 +1297,7 @@ i830_tv_detect_type (xf86CrtcPtr    crtc,
>                 DAC_A_0_7_V |
>                 DAC_B_0_7_V |
>                 DAC_C_0_7_V);
> -       OUTREG(TV_CTL, tv_ctl);
> +       //OUTREG(TV_CTL, tv_ctl);
>         OUTREG(TV_DAC, tv_dac);
>         i830WaitForVblank(pScrn);
>         tv_dac = INREG(TV_DAC);
> @@ -1316,6 +1316,7 @@ i830_tv_detect_type (xf86CrtcPtr    crtc,
>                        "Detected Composite TV connection\n");
>         }
>         type = TV_TYPE_COMPOSITE;
> +       type = TV_TYPE_COMPONENT;
>      } else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE)
> {
>         if (pI830->debug_modes) {
>             xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>
> Basically I have turned off the code that disables the encoder and puts it
> into detection mode (stopping TV_CTL from being changed from TV_ENC_ENABLE
> | TV_OVERSAMPLE_8X to TV_TEST_MODE_MONITOR_DETECT | TV_OVERSAMPLE_8X).
> Note the second part of the diff that forces TV_TYPE_COMPONENT is really
> only required due to the detection mode being disabled, I believe the crux
> of the issue is in restoration of TV_CTL.
>
> I've also tried swapping the TV_DAC and TV_CTL restoration order and
> setting TV_DAC to 0 before restoring TV_CTL, but neither resolve the
> problem.  Is there something special that needs to be done when restoring
> TV_CTL?
>
> Suggestions welcome.
>
> Thanks
>
> -Rob

OK, I think I've worked it out.  The encoder needs to be disabled before
any other detection registers are altered, and the detection mode needs to
be enabled before modifying the DAC.  Updated patch below works for me. 
Can someone please review and then merge.  I'll also attach it to
http://bugs.freedesktop.org/show_bug.cgi?id=14000

Thanks

-Rob

diff --git a/src/i830_tv.c b/src/i830_tv.c
index 6adb9f2..a5b790b 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1286,6 +1286,8 @@ i830_tv_detect_type (xf86CrtcPtr    crtc,
        tv_ctl = INREG(TV_CTL);
        save_tv_ctl = tv_ctl;
        tv_ctl &= ~TV_ENC_ENABLE;
+       OUTREG(TV_CTL, tv_ctl);
+       i830WaitForVblank(pScrn);
        tv_ctl &= ~TV_TEST_MODE_MASK;
        tv_ctl |= TV_TEST_MODE_MONITOR_DETECT;
        tv_dac &= ~TVDAC_SENSE_MASK;
@@ -1298,6 +1300,7 @@ i830_tv_detect_type (xf86CrtcPtr    crtc,
                DAC_B_0_7_V |
                DAC_C_0_7_V);
        OUTREG(TV_CTL, tv_ctl);
+       i830WaitForVblank(pScrn);
        OUTREG(TV_DAC, tv_dac);
        i830WaitForVblank(pScrn);
        tv_dac = INREG(TV_DAC);






More information about the xorg mailing list