diff options
author | Eric Anholt <eric@anholt.net> | 2006-10-16 16:51:04 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2006-10-16 16:51:04 -0700 |
commit | 8149681f2eac0af3b70a9457c5204e17da56142b (patch) | |
tree | a7634dbbf81c73d87324e01d0169dbbf8f940667 /src/i830_dvo.c | |
parent | 1838671476875e9f5b3dde235eacf9fb43afb66c (diff) |
Add a per-output mode-valid method.
This is currently disconnected, but will be used in more overhaul work.
This should be where any output limitations, such as clocks, resolution,
scaling limits, or other options, are validated. Other limitations, such as
chipset resolution limits, CRTC clock limits, etc. should be elsewhere.
Diffstat (limited to 'src/i830_dvo.c')
-rw-r--r-- | src/i830_dvo.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/i830_dvo.c b/src/i830_dvo.c index ea74337a..01858f2c 100644 --- a/src/i830_dvo.c +++ b/src/i830_dvo.c @@ -92,15 +92,22 @@ i830_dvo_restore(ScrnInfoPtr pScrn, I830OutputPtr output) output->i2c_drv->vid_rec->RestoreRegs(output->i2c_drv->dev_priv); } +static int +i830_dvo_mode_valid(ScrnInfoPtr pScrn, I830OutputPtr output, + DisplayModePtr pMode) +{ + if (output->i2c_drv->vid_rec->ModeValid(output->i2c_drv->dev_priv, pMode)) + return MODE_OK; + else + return MODE_BAD; +} + static void i830_dvo_pre_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output, DisplayModePtr pMode) { I830Ptr pI830 = I830PTR(pScrn); - if (output->i2c_drv == NULL) - return; - output->i2c_drv->vid_rec->Mode(output->i2c_drv->dev_priv, pMode); OUTREG(DVOC, INREG(DVOC) & ~DVO_ENABLE); @@ -179,8 +186,9 @@ i830_dvo_init(ScrnInfoPtr pScrn) pI830->output[i].dpms = i830_dvo_dpms; pI830->output[i].save = i830_dvo_save; pI830->output[i].restore = i830_dvo_restore; - pI830->output[i].pre_set_mode = i830_dvo_pre_set_mode ; - pI830->output[i].post_set_mode = i830_dvo_post_set_mode ; + pI830->output[i].mode_valid = i830_dvo_mode_valid; + pI830->output[i].pre_set_mode = i830_dvo_pre_set_mode; + pI830->output[i].post_set_mode = i830_dvo_post_set_mode; /* Set up the I2C and DDC buses */ ret = I830I2CInit(pScrn, &pI830->output[i].pI2CBus, GPIOE, "DVOI2C_E"); |