diff options
-rw-r--r-- | src/i830.h | 2 | ||||
-rw-r--r-- | src/i830_crt.c | 15 | ||||
-rw-r--r-- | src/i830_driver.c | 24 | ||||
-rw-r--r-- | src/i830_dvo.c | 17 | ||||
-rw-r--r-- | src/i830_lvds.c | 15 | ||||
-rw-r--r-- | src/i830_sdvo.c | 17 | ||||
-rw-r--r-- | src/i830_tv.c | 13 |
7 files changed, 92 insertions, 11 deletions
@@ -686,6 +686,8 @@ extern void i830_crtc_dpms_video(xf86CrtcPtr crtc, Bool on); int i830_crtc_pipe (xf86CrtcPtr crtc); +extern xf86CrtcPtr i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe); + Bool i830_pipe_a_require_activate (ScrnInfoPtr scrn); diff --git a/src/i830_crt.c b/src/i830_crt.c index 3705233b..d1ed3a81 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -391,6 +391,16 @@ i830_crt_destroy (xf86OutputPtr output) xfree (output->driver_private); } +static xf86CrtcPtr +i830_crt_get_crtc(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + int pipe = !!(INREG(ADPA) & ADPA_PIPE_SELECT_MASK); + + return i830_pipe_to_crtc(pScrn, pipe); +} + static const xf86OutputFuncsRec i830_crt_output_funcs = { .dpms = i830_crt_dpms, .save = i830_crt_save, @@ -402,7 +412,10 @@ static const xf86OutputFuncsRec i830_crt_output_funcs = { .commit = i830_output_commit, .detect = i830_crt_detect, .get_modes = i830_ddc_get_modes, - .destroy = i830_crt_destroy + .destroy = i830_crt_destroy, +#ifdef RANDR_GET_CRTC_INTERFACE + .get_crtc = i830_crt_get_crtc, +#endif }; void diff --git a/src/i830_driver.c b/src/i830_driver.c index 088989d2..e1ab5364 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3165,8 +3165,6 @@ I830EnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - int o; DPRINTF(PFX, "Enter VT\n"); @@ -3213,11 +3211,6 @@ I830EnterVT(int scrnIndex, int flags) memset(pI830->FbBase + pScrn->fbOffset, 0, pScrn->virtualY * pScrn->displayWidth * pI830->cpp); - for (o = 0; o < config->num_output; o++) { - xf86OutputPtr output = config->output[o]; - output->funcs->dpms(output, DPMSModeOff); - } - if (!xf86SetDesiredModes (pScrn)) return FALSE; @@ -3483,6 +3476,23 @@ I830PMEvent(int scrnIndex, pmEvent event, Bool undo) return TRUE; } +xf86CrtcPtr +i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (pScrn); + int c; + + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + I830CrtcPrivatePtr intel_crtc = crtc->driver_private; + + if (intel_crtc->pipe == pipe) + return crtc; + } + + return NULL; +} + #if 0 /** * This function is used for testing of the screen detect functions from the diff --git a/src/i830_dvo.c b/src/i830_dvo.c index c0f76e30..75618333 100644 --- a/src/i830_dvo.c +++ b/src/i830_dvo.c @@ -330,6 +330,18 @@ i830_dvo_destroy (xf86OutputPtr output) } } +static xf86CrtcPtr +i830_dvo_get_crtc(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + I830OutputPrivatePtr intel_output = output->driver_private; + struct _I830DVODriver *drv = intel_output->i2c_drv; + int pipe = !!(INREG(drv->dvo_reg) & SDVO_PIPE_B_SELECT); + + return i830_pipe_to_crtc(pScrn, pipe); +} + static const xf86OutputFuncsRec i830_dvo_output_funcs = { .dpms = i830_dvo_dpms, .save = i830_dvo_save, @@ -341,7 +353,10 @@ static const xf86OutputFuncsRec i830_dvo_output_funcs = { .commit = i830_output_commit, .detect = i830_dvo_detect, .get_modes = i830_dvo_get_modes, - .destroy = i830_dvo_destroy + .destroy = i830_dvo_destroy, +#ifdef RANDR_GET_CRTC_INTERFACE + .get_crtc = i830_dvo_get_crtc, +#endif }; /** diff --git a/src/i830_lvds.c b/src/i830_lvds.c index a75d7e65..0b331efc 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -879,6 +879,16 @@ i830_lvds_get_property(xf86OutputPtr output, Atom property) } #endif /* RANDR_13_INTERFACE */ +static xf86CrtcPtr +i830_lvds_get_crtc(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + int pipe = !!(INREG(LVDS) & LVDS_PIPEB_SELECT); + + return i830_pipe_to_crtc(pScrn, pipe); +} + static const xf86OutputFuncsRec i830_lvds_output_funcs = { .create_resources = i830_lvds_create_resources, .dpms = i830_lvds_dpms, @@ -897,7 +907,10 @@ static const xf86OutputFuncsRec i830_lvds_output_funcs = { #ifdef RANDR_13_INTERFACE .get_property = i830_lvds_get_property, #endif - .destroy = i830_lvds_destroy + .destroy = i830_lvds_destroy, +#ifdef RANDR_GET_CRTC_INTERFACE + .get_crtc = i830_lvds_get_crtc, +#endif }; void diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index 9a89cc9b..d72b9130 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -1146,6 +1146,18 @@ i830_sdvo_destroy (xf86OutputPtr output) } } +static xf86CrtcPtr +i830_sdvo_get_crtc(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + I830OutputPrivatePtr intel_output = output->driver_private; + struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; + int pipe = !!(INREG(dev_priv->output_device) & SDVO_PIPE_B_SELECT); + + return i830_pipe_to_crtc(pScrn, pipe); +} + static const xf86OutputFuncsRec i830_sdvo_output_funcs = { .dpms = i830_sdvo_dpms, .save = i830_sdvo_save, @@ -1157,7 +1169,10 @@ static const xf86OutputFuncsRec i830_sdvo_output_funcs = { .commit = i830_output_commit, .detect = i830_sdvo_detect, .get_modes = i830_sdvo_get_modes, - .destroy = i830_sdvo_destroy + .destroy = i830_sdvo_destroy, +#ifdef RANDR_GET_CRTC_INTERFACE + .get_crtc = i830_sdvo_get_crtc, +#endif }; void diff --git a/src/i830_tv.c b/src/i830_tv.c index 095f59bd..b478cc7d 100644 --- a/src/i830_tv.c +++ b/src/i830_tv.c @@ -1640,6 +1640,16 @@ i830_tv_set_property(xf86OutputPtr output, Atom property, } #endif /* RANDR_12_INTERFACE */ +static xf86CrtcPtr +i830_tv_get_crtc(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); + int pipe = !!(INREG(TV_CTL) & TV_ENC_PIPEB_SELECT); + + return i830_pipe_to_crtc(pScrn, pipe); +} + static const xf86OutputFuncsRec i830_tv_output_funcs = { .create_resources = i830_tv_create_resources, .dpms = i830_tv_dpms, @@ -1656,6 +1666,9 @@ static const xf86OutputFuncsRec i830_tv_output_funcs = { #ifdef RANDR_12_INTERFACE .set_property = i830_tv_set_property, #endif +#ifdef RANDR_GET_CRTC_INTERFACE + .get_crtc = i830_tv_get_crtc, +#endif }; void |