problem with i830M interlaced VGA output (915G works fine)

Thomas Hilber xorg at toh.cx
Sun Oct 5 00:21:45 PDT 2008


Hi list,

with the attached patch and xorg.conf I successfully use interlaced modes
like 720x576i on a 915G chipset. For an i830M this unfortunately does not
yet work completely. First of all thanks to Keith Packard and 
Krzysztof Halasa for their basic PIPEACONF investigations posted here:

http://lists.freedesktop.org/archives/xorg/2007-January/021271.html

I dug deeper into this:

Video mode setup is done by the same function i830_crtc_mode_set() for 
both i830M and 915G. To PIPEACONF register of both chipsets the same
value is written to by:

OUTREG(PIPEACONF, PIPEACONF_ENABLE | PIPECONF_INTERLACE_W_FIELD_INDICATION);

It reads back the same value on a 915G where the interlaced mode works fine.
But it reads back only as

PIPEACONF_ENABLE

on an i830M chipset. The other bits of this register probably are reserved
there and thus are cleared. This makes me believe that 
PIPECONF_INTERLACE_W_FIELD_INDICATION is not implemented on i830M hardware. 

All the other register initialization needed for i830M interlaced mode 
setup appears to work already. I exactly get the correct timings there but
they are progressive.

So I think there is just a tiny little thing missing which keeps my i830M
from operating in interlaced mode.

My question:
Does anybody have information what register to program to put an i830M
into interlaced mode?

It must to be something equivalent to

/* for i810 chipset */
#define INTERLACE_ENABLE 0x80
i810Reg->InterlaceControl = INTERLACE_ENABLE;

or

/* for 9xx-class chipsets */
#define PIPECONF_INTERLACE_W_FIELD_INDICATION (6 << 21)
OUTREG(PIPEACONF, PIPEACONF_ENABLE | PIPECONF_INTERLACE_W_FIELD_INDICATION);

Thanks in advance
   Thomas

-------------- next part --------------
diff -ur xserver-xorg-video-intel-2.4.2.org/src/i810_driver.c xserver-xorg-video-intel-2.4.2/src/i810_driver.c
--- xserver-xorg-video-intel-2.4.2.org/src/i810_driver.c	2008-10-02 18:56:10.000000000 +0200
+++ xserver-xorg-video-intel-2.4.2/src/i810_driver.c	2008-10-02 20:31:37.000000000 +0200
@@ -2857,7 +2857,9 @@
 	 xf86DrvMsg(scrnIndex, X_PROBED,
 		    "Removing interlaced mode \"%s\"\n", mode->name);
       }
+#if 0 /* allow interlaced mode */
       return MODE_BAD;
+#endif
    }
    return MODE_OK;
 }
diff -ur xserver-xorg-video-intel-2.4.2.org/src/i830_crt.c xserver-xorg-video-intel-2.4.2/src/i830_crt.c
--- xserver-xorg-video-intel-2.4.2.org/src/i830_crt.c	2008-03-26 03:15:53.000000000 +0100
+++ xserver-xorg-video-intel-2.4.2/src/i830_crt.c	2008-10-02 20:31:37.000000000 +0200
@@ -87,7 +87,7 @@
     if (pMode->Flags & V_DBLSCAN)
 	return MODE_NO_DBLESCAN;
 
-    if (pMode->Clock > 400000 || pMode->Clock < 25000)
+    if (pMode->Clock > 400000 || pMode->Clock < 12000)
 	return MODE_CLOCK_RANGE;
 
     return MODE_OK;
@@ -446,7 +446,7 @@
 			       (1 << I830_OUTPUT_DVO_TMDS));
     
     output->driver_private = i830_output;
-    output->interlaceAllowed = FALSE;
+    output->interlaceAllowed = TRUE;
     output->doubleScanAllowed = FALSE;
 
     /* Set up the DDC bus. */
diff -ur xserver-xorg-video-intel-2.4.2.org/src/i830_display.c xserver-xorg-video-intel-2.4.2/src/i830_display.c
--- xserver-xorg-video-intel-2.4.2.org/src/i830_display.c	2008-10-02 18:56:10.000000000 +0200
+++ xserver-xorg-video-intel-2.4.2/src/i830_display.c	2008-10-02 20:31:37.000000000 +0200
@@ -71,7 +71,7 @@
     intel_p2_t	    p2;
 } intel_limit_t;
 
-#define I8XX_DOT_MIN		  25000
+#define I8XX_DOT_MIN		  12000
 #define I8XX_DOT_MAX		 350000
 #define I8XX_VCO_MIN		 930000
 #define I8XX_VCO_MAX		1400000
@@ -95,9 +95,9 @@
 #define I8XX_P2_LVDS_FAST	      7
 #define I8XX_P2_SLOW_LIMIT	 165000
 
-#define I9XX_DOT_MIN		  20000
+#define I9XX_DOT_MIN		  12000
 #define I9XX_DOT_MAX		 400000
-#define I9XX_VCO_MIN		1400000
+#define I9XX_VCO_MIN		1000000
 #define I9XX_VCO_MAX		2800000
 
 /* Haven't found any reason to go this fast, but newer chips support it */
@@ -495,7 +495,7 @@
 	return FALSE;
     if (crtc->enabled)
 	return FALSE;
-    xf86SetModeCrtc (&mode, INTERLACE_HALVE_V);
+    xf86SetModeCrtc (&mode, 0);
     crtc->funcs->mode_set (crtc, &mode, &mode, 0, 0);
     crtc->funcs->dpms (crtc, DPMSModeOn);
     return TRUE;
@@ -962,8 +962,16 @@
 
 static Bool
 i830_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
-		     DisplayModePtr adjusted_mode)
+                    DisplayModePtr ajd_mode)
 {
+    if (mode->Flags & V_INTERLACE) {
+       mode->CrtcVDisplay = ajd_mode->CrtcVDisplay = mode->VDisplay;
+       mode->CrtcVSyncStart = ajd_mode->CrtcVSyncStart = mode->VSyncStart;
+       mode->CrtcVSyncEnd = ajd_mode->CrtcVSyncEnd = mode->VSyncEnd;
+       mode->CrtcVBlankStart = ajd_mode->CrtcVBlankStart = mode->CrtcVDisplay;
+       mode->CrtcVBlankEnd = ajd_mode->CrtcVBlankEnd = mode->VTotal;
+       mode->CrtcVTotal = ajd_mode->CrtcVTotal = mode->VTotal;
+    }
     return TRUE;
 }
 
@@ -1355,6 +1363,12 @@
     /* Wait for the clocks to stabilize. */
     usleep(150);
 
+    if (adjusted_mode->Flags & V_INTERLACE) {
+       pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
+       xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "khc PIPECONF_INTERLACE\n");
+    } else
+       pipeconf &= ~PIPECONF_INTERLACE_W_FIELD_INDICATION;
+
     OUTREG(htot_reg, (adjusted_mode->CrtcHDisplay - 1) |
 	((adjusted_mode->CrtcHTotal - 1) << 16));
     OUTREG(hblank_reg, (adjusted_mode->CrtcHBlankStart - 1) |
-------------- next part --------------
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/X11/misc"
	FontPath     "/usr/share/fonts/X11/cyrillic"
	FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/Type1"
	FontPath     "/usr/share/fonts/X11/100dpi"
	FontPath     "/usr/share/fonts/X11/75dpi"
	FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
	Load  "dbe"
	Load  "dri"
	Load  "extmod"
	Load  "glx"
	Load  "xtrap"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"

        HorizSync    15-16
        VertRefresh  50
	Modeline "720x576i"   13.875 720  744  808  888  576  580  585  625 -hsync -vsync interlace
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "CacheLines"         	# <i>
        #Option     "Dac6Bit"            	# [<bool>]
        #Option     "DRI"                	# [<bool>]
        #Option     "NoDDC"              	# [<bool>]
        #Option     "ShowCache"          	# [<bool>]
        #Option     "XvMCSurfaces"       	# <i>
        #Option     "PageFlip"           	# [<bool>]
	Identifier  "Card0"
	Driver      "intel"
	VendorName  "Intel Corporation"
	BoardName   "915G Integrated Graphics Controller"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"

        DefaultDepth  24
        SubSection "Display"
            Depth     24
            Modes     "720x576i"
        EndSubSection
EndSection



More information about the xorg mailing list