xf86-video-intel, modesetting branch

Krzysztof Halasa khc at pm.waw.pl
Sun Jan 28 09:30:05 PST 2007


Keith Packard <keithp at keithp.com> writes:

>>         DefaultDepth    24
>>         SubSection "Display"
>>                 Viewport        0 0
>>                 Virtual         1600 1200
>>                 Depth           24
>>                 Modes          "640x480" "800x600" "1024x768"
>
> Having a Modes entry here shouldn't have any effect; the only way to
> affect which mode is used by default is to set the preferred mode option
> in the monitor section.

Right. The problem is, I want only few modes, or even just one.

> Right, with multiple outputs, I'm not sure which one (or ones) to
> associate with the single monitor supported in the existing
> configuration. There is a notion of the 'compat output' in the driver
> which is used for other places where the system assumes there is only
> one monitor; perhaps I could use that here as well?

I still don't get the concept right.

There are (usually) two CRT controllers (PIPEs). Each can be connected
to any number of output devices such as analog VGA, digital DVI etc.
But a video mode is a function of CRTC, not output device, isn't it?
If I set 800x600 60Hz for VGA connected to PIPEA, SDVO connected to
the same PIPEA will get the same 800x600 60 Hz.

So I think we should have one list of video modes per pipe, not per
output device.

Now, how do we generate the list?
- The user could specify ModeLines in "main" monitor section
  (the one specified in "Screen" section). The HSync and VSync values
  would apply as well.
- Second, the "default" mode list would be used.
- Then, every output device could add its modes.

That means pScrn->Modes would be the master list and no other mode
list would exist after initialization.

Now we have the full list. Then:
- sort by "quality".
- if specified, only modes from "Modes" list in "Screen/Display"
  section would be allowed, the rest would go.
- the list should be validated against capabilities of all output
  devices connected to the pipe in question:

a) if a mode was specifically requested by the user, it should be allowed
   if at least one output can display it, and if that means multiple
   modes (for example, multiple 800x600), the one which covers most
   outputs would be used
b) if the user hasn't requested mode list (no "Modes" line), a mode
   would have to cover all respective outputs to be included.

(but I'm not sure if a+b aren't an overkill).

What would the above change?
- we wouldn't need monitor section for every output device (plug and
  play, it would work the same; if the system has CRT with Hsync
  30-111 kHz and LCD with HSync 30-86 kHz _and_ no DDC the user
  would have to specify sync range common to both monitors or
  whatever he/she wants) -> compatibility with traditional config
  file and tools.
- less complicated code
- I think this mode of operation is common to all dual+ head adapters
  (including "clone mode" etc) and it should probably be moved outside
  of the driver.


Now the interlaced mode...
It looks (please don't apply yet) the following does the trick, more
or less. I'm using ModeLine "PAL" 28.16 1440 1482 1614 1802
576 580 600 625 -hsync -vsync interlace which gives 25.0033 Hz (full
frame) and there are no field parity errors (though the player doesn't
seem to sync frames to Vsync). It seems it sends bottom field first.

I wonder what other bits in PIPECONF do?
bits
31 PIPE[AB]CONF_ENABLE
30 PIPE[AB]CONF_DOUBLE_WIDE
25 PIPECONF_FORCE_BORDER (PIPEACONF_PIPE_LOCKED?)
24 PIPE[AB]CONF_GAMMA
23-21 0 = PIPECONF_PROGRESSIVE
      6 = PIPECONF_INTERLACE_W_FIELD_INDICATION
      7 = PIPECONF_INTERLACE_FIELD_0_ONLY
What 1-5 values do? Perhaps it could do top field first as well?

+++ b/src/i830_display.c
@@ -809,6 +809,13 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     /* Wait for the clocks to stabilize. */
     usleep(150);
 
+    if (adjusted_mode->Flags & V_INTERLACE)
+       pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
+    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) |
+++ b/src/i830_xf86Modes.c
@@ -125,7 +125,7 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
     p->CrtcVSyncEnd             = p->VSyncEnd;
     p->CrtcVTotal               = p->VTotal;
     if (p->Flags & V_INTERLACE) {
-       if (adjustFlags & INTERLACE_HALVE_V) {
+       if (adjustFlags & INTERLACE_HALVE_V & 0 /* FIXME */) {
            p->CrtcVDisplay         /= 2;
            p->CrtcVSyncStart       /= 2;
            p->CrtcVSyncEnd         /= 2;
@@ -507,6 +507,7 @@ i830xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr 
*modeList,
 {
     DisplayModePtr mode;
 
+    i830xf86ValidateModesUserConfig(pScrn, *modeList);
     for (mode = *modeList; mode != NULL;) {
        DisplayModePtr next = mode->next, first = *modeList;
-- 
Krzysztof Halasa



More information about the xorg mailing list