diff options
author | Eric Anholt <eric@anholt.net> | 2006-10-31 17:10:08 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2006-10-31 17:10:08 -0800 |
commit | 7195dfabd56239f08cdd8175a2ef3a66ef9600de (patch) | |
tree | c83545579654d375332e01d19a4a79e8604b00a9 /src/i830_modes.c | |
parent | cc3728be2481637dda321d3bc2e4e89a220699cd (diff) |
Give each output a get_modes function and expose those modes through RandR.
The get_modes should return the probed modes only. The driver should then
append to the list (for example, compatible modes listed in other outputs,
or standard VESA modes) to create the list to expose through RandR. That
isn't done yet.
Diffstat (limited to 'src/i830_modes.c')
-rw-r--r-- | src/i830_modes.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/i830_modes.c b/src/i830_modes.c index 130b7fe5..1ba1defb 100644 --- a/src/i830_modes.c +++ b/src/i830_modes.c @@ -933,11 +933,22 @@ int I830ValidateXF86ModeList(ScrnInfoPtr pScrn, Bool first_time) { I830Ptr pI830 = I830PTR(pScrn); - int pipe; + int pipe, i; DisplayModePtr saved_mode, last; Bool pipes_reconfigured = FALSE; int originalVirtualX, originalVirtualY; + /* Re-probe the list of modes for each output. */ + for (i = 0; i < pI830->num_outputs; i++) { + while (pI830->output[i].probed_modes != NULL) { + xf86DeleteMode(&pI830->output[i].probed_modes, + pI830->output[i].probed_modes); + } + + pI830->output[i].probed_modes = + pI830->output[i].get_modes(pScrn, &pI830->output[i]); + } + for (pipe = 0; pipe < pI830->availablePipes; pipe++) { I830ReprobePipeModeList(pScrn, pipe); } @@ -1099,3 +1110,23 @@ I830ValidateXF86ModeList(ScrnInfoPtr pScrn, Bool first_time) return 1; /* XXX */ } + +/** + * Generic get_modes function using DDC, used by many outputs. + */ +DisplayModePtr +i830_ddc_get_modes(ScrnInfoPtr pScrn, I830OutputPtr output) +{ + xf86MonPtr ddc_mon; + DisplayModePtr ddc_modes; + + ddc_mon = xf86DoEDID_DDC2(pScrn->scrnIndex, output->pDDCBus); + if (ddc_mon == NULL) + return NULL; + + ddc_modes = i830GetDDCModes(pScrn, ddc_mon); + + xfree(ddc_mon); + + return ddc_modes; +} |