diff options
author | Owain G. Ainsworth <oga@openbsd.org> | 2010-03-01 13:42:39 +0000 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-03-01 13:42:39 +0000 |
commit | 152c35e4764f9042588b53734575ec5ab0536af3 (patch) | |
tree | 9a144c25850d911fdff5379fb77e86a0ad485986 /src/i830_lvds.c | |
parent | 2af019dc983d0c6b3fbe4c842ef91792f17d3684 (diff) |
Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.
This is the beginning of the campaign to remove some of the absurd use of
Hungarian in the driver. Not that I don't like Hungarian, but I don't need
to know that pI830 is a pPointer.
(cherry picked from commit cc5d3ba3c331c3b1becf2d19277b24144bf34cfa)
Conflicts:
src/i830.h
src/i830_batchbuffer.c
src/i830_batchbuffer.h
src/i830_dri.c
src/i830_driver.c
src/i830_hwmc.c
src/i830_memory.c
src/i830_uxa.c
src/i830_video.c
src/i915_hwmc.c
src/i965_hwmc.c
Diffstat (limited to 'src/i830_lvds.c')
-rw-r--r-- | src/i830_lvds.c | 192 |
1 files changed, 96 insertions, 96 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 806a965d..bc5a8e42 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -134,13 +134,13 @@ static void i830_set_lvds_backlight_method(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t blc_pwm_ctl, blc_pwm_ctl2; enum backlight_control method = BCM_NATIVE; /* Default to native */ if (i830_kernel_backlight_available(output)) { method = BCM_KERNEL; - } else if (IS_I965GM(pI830) || IS_GM45(pI830)) { + } else if (IS_I965GM(intel) || IS_GM45(intel)) { blc_pwm_ctl2 = INREG(BLC_PWM_CTL2); if (blc_pwm_ctl2 & BLM_LEGACY_MODE2) method = BCM_COMBO; @@ -150,7 +150,7 @@ i830_set_lvds_backlight_method(xf86OutputPtr output) method = BCM_COMBO; } - pI830->backlight_control_method = method; + intel->backlight_control_method = method; } /* @@ -160,7 +160,7 @@ static void i830_lvds_set_backlight_native(xf86OutputPtr output, int level) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t blc_pwm_ctl; blc_pwm_ctl = INREG(BLC_PWM_CTL); @@ -172,7 +172,7 @@ static int i830_lvds_get_backlight_native(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t blc_pwm_ctl; blc_pwm_ctl = INREG(BLC_PWM_CTL); @@ -184,11 +184,11 @@ static int i830_lvds_get_backlight_max_native(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t pwm_ctl = INREG(BLC_PWM_CTL); int val; - if (IS_I965GM(pI830) || IS_GM45(pI830)) { + if (IS_I965GM(intel) || IS_GM45(intel)) { val = ((pwm_ctl & BACKLIGHT_MODULATION_FREQ_MASK2) >> BACKLIGHT_MODULATION_FREQ_SHIFT2); } else { @@ -206,9 +206,9 @@ static void i830_lvds_set_backlight_legacy(xf86OutputPtr output, int level) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); - pci_device_cfg_write_u8(pI830->PciInfo, level, + pci_device_cfg_write_u8(intel->PciInfo, level, LEGACY_BACKLIGHT_BRIGHTNESS); } @@ -216,10 +216,10 @@ static int i830_lvds_get_backlight_legacy(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint8_t lbb; - pci_device_cfg_read_u8(pI830->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS); + pci_device_cfg_read_u8(intel->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS); return lbb; } @@ -231,17 +231,17 @@ static void i830_lvds_set_backlight_combo(xf86OutputPtr output, int level) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t blc_pwm_ctl; uint8_t lbb; - pci_device_cfg_read_u8(pI830->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS); + pci_device_cfg_read_u8(intel->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS); /* * If LBB is zero and we're shooting for a non-zero brightness level, * we have to increase LBB by at least 1. */ if (!lbb && level) { - pci_device_cfg_write_u8(pI830->PciInfo, 1, + pci_device_cfg_write_u8(intel->PciInfo, 1, LEGACY_BACKLIGHT_BRIGHTNESS); } @@ -260,7 +260,7 @@ static int i830_lvds_get_backlight_combo(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t blc_pwm_ctl; blc_pwm_ctl = INREG(BLC_PWM_CTL); @@ -378,7 +378,7 @@ static int i830_lvds_acpi_lid_open(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); int fd; DIR *button_dir; DIR *lid_dir; @@ -387,7 +387,7 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) char state[64]; enum lid_status ret = LID_UNKNOWN; - if (pI830->quirk_flag & QUIRK_BROKEN_ACPI_LID) + if (intel->quirk_flag & QUIRK_BROKEN_ACPI_LID) goto out; button_dir = opendir(ACPI_BUTTON); @@ -440,7 +440,7 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) ret = LID_UNKNOWN; out: - if (pI830->debug_modes && (ret != LID_UNKNOWN)) + if (intel->debug_modes && (ret != LID_UNKNOWN)) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LID switch detect %s with ACPI button\n", ret ? "closed" : "open"); @@ -455,7 +455,7 @@ static Bool i830_lvds_swf_lid_close(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t swf14 = INREG(SWF14); Bool ret; @@ -464,7 +464,7 @@ i830_lvds_swf_lid_close(xf86OutputPtr output) else ret = FALSE; - if (pI830->debug_modes) + if (intel->debug_modes) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LID switch detect %s with SWF14 0x%8x\n", ret ? "closed" : "open", swf14); @@ -481,7 +481,7 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on) I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t pp_status; if (on) { @@ -498,7 +498,7 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on) */ if (!(INREG(PP_CONTROL) & POWER_TARGET_ON) && dev_priv->backlight_duty_cycle == 0 && - pI830->backlight_control_method < BCM_KERNEL) + intel->backlight_control_method < BCM_KERNEL) dev_priv->backlight_duty_cycle = dev_priv->backlight_max; OUTREG(PP_CONTROL, INREG(PP_CONTROL) | POWER_TARGET_ON); @@ -543,15 +543,15 @@ i830_lvds_save (xf86OutputPtr output) I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); - - if (IS_I965GM(pI830) || IS_GM45(pI830)) - pI830->saveBLC_PWM_CTL2 = INREG(BLC_PWM_CTL2); - pI830->savePP_ON = INREG(PP_ON_DELAYS); - pI830->savePP_OFF = INREG(PP_OFF_DELAYS); - pI830->savePP_CONTROL = INREG(PP_CONTROL); - pI830->savePP_DIVISOR = INREG(PP_DIVISOR); - pI830->saveBLC_PWM_CTL = INREG(BLC_PWM_CTL); + intel_screen_private *intel = intel_get_screen_private(pScrn); + + if (IS_I965GM(intel) || IS_GM45(intel)) + intel->saveBLC_PWM_CTL2 = INREG(BLC_PWM_CTL2); + intel->savePP_ON = INREG(PP_ON_DELAYS); + intel->savePP_OFF = INREG(PP_OFF_DELAYS); + intel->savePP_CONTROL = INREG(PP_CONTROL); + intel->savePP_DIVISOR = INREG(PP_DIVISOR); + intel->saveBLC_PWM_CTL = INREG(BLC_PWM_CTL); if ((INREG(PP_CONTROL) & POWER_TARGET_ON) && !dev_priv->dpmsoff) dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output); } @@ -560,16 +560,16 @@ static void i830_lvds_restore(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); - - if (IS_I965GM(pI830) || IS_GM45(pI830)) - OUTREG(BLC_PWM_CTL2, pI830->saveBLC_PWM_CTL2); - OUTREG(BLC_PWM_CTL, pI830->saveBLC_PWM_CTL); - OUTREG(PP_ON_DELAYS, pI830->savePP_ON); - OUTREG(PP_OFF_DELAYS, pI830->savePP_OFF); - OUTREG(PP_DIVISOR, pI830->savePP_DIVISOR); - OUTREG(PP_CONTROL, pI830->savePP_CONTROL); - if (pI830->savePP_CONTROL & POWER_TARGET_ON) + intel_screen_private *intel = intel_get_screen_private(pScrn); + + if (IS_I965GM(intel) || IS_GM45(intel)) + OUTREG(BLC_PWM_CTL2, intel->saveBLC_PWM_CTL2); + OUTREG(BLC_PWM_CTL, intel->saveBLC_PWM_CTL); + OUTREG(PP_ON_DELAYS, intel->savePP_ON); + OUTREG(PP_OFF_DELAYS, intel->savePP_OFF); + OUTREG(PP_DIVISOR, intel->savePP_DIVISOR); + OUTREG(PP_CONTROL, intel->savePP_CONTROL); + if (intel->savePP_CONTROL & POWER_TARGET_ON) i830SetLVDSPanelPower(output, TRUE); else i830SetLVDSPanelPower(output, FALSE); @@ -579,8 +579,8 @@ static int i830_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); - DisplayModePtr pFixedMode = pI830->lvds_fixed_mode; + intel_screen_private *intel = intel_get_screen_private(pScrn); + DisplayModePtr pFixedMode = intel->lvds_fixed_mode; if (pFixedMode) { @@ -602,7 +602,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, ScrnInfoPtr pScrn = output->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); I830CrtcPrivatePtr intel_crtc = output->crtc->driver_private; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); uint32_t pfit_control = 0, pfit_pgm_ratios = 0; float panel_ratio, desired_ratio, vert_scale, horiz_scale; float horiz_ratio, vert_ratio; @@ -631,7 +631,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, } /* If we don't have a panel mode there's not much we can do */ - if (pI830->lvds_fixed_mode == NULL) + if (intel->lvds_fixed_mode == NULL) return TRUE; /* If we have timings from the BIOS for the panel, put them in @@ -639,19 +639,19 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, * with the panel scaling set up to source from the H/VDisplay * of the original mode. */ - adjusted_mode->HDisplay = pI830->lvds_fixed_mode->HDisplay; - adjusted_mode->HSyncStart = pI830->lvds_fixed_mode->HSyncStart; - adjusted_mode->HSyncEnd = pI830->lvds_fixed_mode->HSyncEnd; - adjusted_mode->HTotal = pI830->lvds_fixed_mode->HTotal; - adjusted_mode->VDisplay = pI830->lvds_fixed_mode->VDisplay; - adjusted_mode->VSyncStart = pI830->lvds_fixed_mode->VSyncStart; - adjusted_mode->VSyncEnd = pI830->lvds_fixed_mode->VSyncEnd; - adjusted_mode->VTotal = pI830->lvds_fixed_mode->VTotal; - adjusted_mode->Clock = pI830->lvds_fixed_mode->Clock; + adjusted_mode->HDisplay = intel->lvds_fixed_mode->HDisplay; + adjusted_mode->HSyncStart = intel->lvds_fixed_mode->HSyncStart; + adjusted_mode->HSyncEnd = intel->lvds_fixed_mode->HSyncEnd; + adjusted_mode->HTotal = intel->lvds_fixed_mode->HTotal; + adjusted_mode->VDisplay = intel->lvds_fixed_mode->VDisplay; + adjusted_mode->VSyncStart = intel->lvds_fixed_mode->VSyncStart; + adjusted_mode->VSyncEnd = intel->lvds_fixed_mode->VSyncEnd; + adjusted_mode->VTotal = intel->lvds_fixed_mode->VTotal; + adjusted_mode->Clock = intel->lvds_fixed_mode->Clock; xf86SetModeCrtc(adjusted_mode, INTERLACE_HALVE_V); /* Make sure pre-965s set dither correctly */ - if (!IS_I965G(pI830) && pI830->lvds_dither) + if (!IS_I965G(intel) && intel->lvds_dither) pfit_control |= PANEL_8TO6_DITHER_ENABLE; /* Native modes don't need fitting */ @@ -663,7 +663,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, } /* 965+ wants fuzzy fitting */ - if (IS_I965G(pI830)) + if (IS_I965G(intel)) pfit_control |= (intel_crtc->pipe << PFIT_PIPE_SHIFT) | PFIT_FILTER_FUZZY; @@ -698,12 +698,12 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, * LVDS borders are enabled (see i830_display.c). */ left_border = - (pI830->lvds_fixed_mode->HDisplay - mode->HDisplay) / 2; + (intel->lvds_fixed_mode->HDisplay - mode->HDisplay) / 2; right_border = left_border; if (mode->HDisplay & 1) right_border++; top_border = - (pI830->lvds_fixed_mode->VDisplay - mode->VDisplay) / 2; + (intel->lvds_fixed_mode->VDisplay - mode->VDisplay) / 2; bottom_border = top_border; if (mode->VDisplay & 1) bottom_border++; @@ -743,7 +743,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, case FULL_ASPECT: /* Scale but preserve aspect ratio */ pfit_control |= PFIT_ENABLE; - if (IS_I965G(pI830)) { + if (IS_I965G(intel)) { /* * 965+ is easy, it does everything in hw */ @@ -779,7 +779,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, HORIZ_INTERP_BILINEAR; /* Pillar will have left/right borders */ - left_border = (pI830->lvds_fixed_mode->HDisplay - + left_border = (intel->lvds_fixed_mode->HDisplay - scaled_width) / 2; right_border = left_border; if (mode->HDisplay & 1) /* odd resolutions */ @@ -811,7 +811,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, HORIZ_INTERP_BILINEAR; /* Letterbox will have top/bottom borders */ - top_border = (pI830->lvds_fixed_mode->VDisplay - + top_border = (intel->lvds_fixed_mode->VDisplay - scaled_height) / 2; bottom_border = top_border; if (mode->VDisplay & 1) @@ -851,7 +851,7 @@ i830_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, * this is all done for us in hw. */ pfit_control |= PFIT_ENABLE; - if (IS_I965G(pI830)) + if (IS_I965G(intel)) pfit_control |= PFIT_SCALING_AUTO; else pfit_control |= VERT_AUTO_SCALE | HORIZ_AUTO_SCALE | @@ -892,7 +892,7 @@ i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); /* * PFIT must be enabled/disabled while LVDS is on but pipes are still off @@ -962,7 +962,7 @@ static DisplayModePtr i830_lvds_get_modes(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; xf86MonPtr edid_mon; DisplayModePtr modes; @@ -1020,11 +1020,11 @@ i830_lvds_get_modes(xf86OutputPtr output) edid_mon->ver.version = 1; edid_mon->ver.revision = 4; - if (pI830->lvds_fixed_mode != NULL) { + if (intel->lvds_fixed_mode != NULL) { /* now we construct new EDID monitor, * so filled one detailed timing block */ - fill_detailed_block(det_mon, pI830->lvds_fixed_mode); + fill_detailed_block(det_mon, intel->lvds_fixed_mode); /* the filed timing block should be set preferred*/ edid_mon->features.msc |= 0x2; det_mon = det_mon + 1; @@ -1042,8 +1042,8 @@ i830_lvds_get_modes(xf86OutputPtr output) } } - if (pI830->lvds_fixed_mode != NULL) - return xf86DuplicateMode(pI830->lvds_fixed_mode); + if (intel->lvds_fixed_mode != NULL) + return xf86DuplicateMode(intel->lvds_fixed_mode); return NULL; } @@ -1052,10 +1052,10 @@ static void i830_lvds_destroy (xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; - xf86DeleteMode (&pI830->lvds_fixed_mode, pI830->lvds_fixed_mode); + xf86DeleteMode (&intel->lvds_fixed_mode, intel->lvds_fixed_mode); if (intel_output) xfree (intel_output); } @@ -1107,11 +1107,11 @@ static Bool i830_lvds_set_backlight_control(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; - switch (pI830->backlight_control_method) { + switch (intel->backlight_control_method) { case BCM_NATIVE: dev_priv->set_backlight = i830_lvds_set_backlight_native; dev_priv->get_backlight = i830_lvds_get_backlight_native; @@ -1166,7 +1166,7 @@ i830_lvds_create_resources(xf86OutputPtr output) { #ifdef RANDR_12_INTERFACE ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; INT32 backlight_range[2]; @@ -1219,7 +1219,7 @@ i830_lvds_create_resources(xf86OutputPtr output) } err = RRChangeOutputProperty(output->randr_output, backlight_control_atom, XA_ATOM, 32, PropModeReplace, 1, - &backlight_control_name_atoms[pI830->backlight_control_method], + &backlight_control_name_atoms[intel->backlight_control_method], FALSE, TRUE); if (err != 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1231,7 +1231,7 @@ i830_lvds_create_resources(xf86OutputPtr output) */ /* Disable panel fitting setting on untested pre-915 chips */ - if (!IS_I9XX(pI830) && !(pI830->quirk_flag & QUIRK_PFIT_SAFE)) + if (!IS_I9XX(intel) && !(intel->quirk_flag & QUIRK_PFIT_SAFE)) return; panel_fitting_atom = MakeAtom(PANEL_FITTING_NAME, @@ -1266,7 +1266,7 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; @@ -1304,7 +1304,7 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property, if (ret < 0) return FALSE; - pI830->backlight_control_method = ret; + intel->backlight_control_method = ret; i830_lvds_set_backlight_control(output); /* @@ -1375,7 +1375,7 @@ static Bool i830_lvds_get_property(xf86OutputPtr output, Atom property) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; int ret; @@ -1407,7 +1407,7 @@ static xf86CrtcPtr i830_lvds_get_crtc(xf86OutputPtr output) { ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); int pipe = !!(INREG(LVDS) & LVDS_PIPEB_SELECT); return i830_pipe_to_crtc(pScrn, pipe); @@ -1441,21 +1441,21 @@ static const xf86OutputFuncsRec i830_lvds_output_funcs = { void i830_lvds_init(ScrnInfoPtr pScrn) { - I830Ptr pI830 = I830PTR(pScrn); + intel_screen_private *intel = intel_get_screen_private(pScrn); xf86OutputPtr output; I830OutputPrivatePtr intel_output; DisplayModePtr modes, scan; DisplayModePtr lvds_ddc_mode = NULL; struct i830_lvds_priv *dev_priv; - if (!pI830->integrated_lvds) { - if (pI830->debug_modes) + if (!intel->integrated_lvds) { + if (intel->debug_modes) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Skipping LVDS from driver feature BDB's LVDS config info.\n"); return; } - if (pI830->quirk_flag & QUIRK_IGNORE_LVDS) + if (intel->quirk_flag & QUIRK_IGNORE_LVDS) return; output = xf86OutputCreate (pScrn, &i830_lvds_output_funcs, "LVDS"); @@ -1494,7 +1494,7 @@ i830_lvds_init(ScrnInfoPtr pScrn) */ I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOC, "LVDSDDC_C"); - if (pI830->skip_panel_detect) { + if (intel->skip_panel_detect) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Skipping any attempt to determine panel fixed mode.\n"); goto found_mode; @@ -1526,7 +1526,7 @@ i830_lvds_init(ScrnInfoPtr pScrn) xf86DeleteMode(&modes, modes); if (lvds_ddc_mode) { - pI830->lvds_fixed_mode = lvds_ddc_mode; + intel->lvds_fixed_mode = lvds_ddc_mode; goto found_mode; } @@ -1534,29 +1534,29 @@ i830_lvds_init(ScrnInfoPtr pScrn) * the BIOS being unavailable or broken, but lack the configuration options * for now. */ - if (pI830->lvds_fixed_mode) + if (intel->lvds_fixed_mode) goto found_mode; /* If we *still* don't have a mode, try checking if the panel is already * turned on. If so, assume that whatever is currently programmed is the * correct mode. */ - if (!pI830->lvds_fixed_mode) { + if (!intel->lvds_fixed_mode) { uint32_t lvds = INREG(LVDS); int pipe = (lvds & LVDS_PIPEB_SELECT) ? 1 : 0; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcPtr crtc = xf86_config->crtc[pipe]; if (lvds & LVDS_PORT_EN) { - pI830->lvds_fixed_mode = i830_crtc_mode_get(pScrn, crtc); - if (pI830->lvds_fixed_mode != NULL) { - pI830->lvds_fixed_mode->type |= M_T_PREFERRED; + intel->lvds_fixed_mode = i830_crtc_mode_get(pScrn, crtc); + if (intel->lvds_fixed_mode != NULL) { + intel->lvds_fixed_mode->type |= M_T_PREFERRED; goto found_mode; } } } - if (!pI830->lvds_fixed_mode) + if (!intel->lvds_fixed_mode) goto disable_exit; found_mode: @@ -1564,7 +1564,7 @@ found_mode: /* Blacklist machines with BIOSes that list an LVDS panel without actually * having one. */ - if (pI830->quirk_flag & QUIRK_IGNORE_MACMINI_LVDS) { + if (intel->quirk_flag & QUIRK_IGNORE_MACMINI_LVDS) { /* It's a Mac Mini or Macbook Pro. * * Apple hardware is out to get us. The macbook pro has a real @@ -1574,9 +1574,9 @@ found_mode: * display. */ - if (pI830->lvds_fixed_mode != NULL && - pI830->lvds_fixed_mode->HDisplay == 800 && - pI830->lvds_fixed_mode->VDisplay == 600) + if (intel->lvds_fixed_mode != NULL && + intel->lvds_fixed_mode->HDisplay == 800 && + intel->lvds_fixed_mode->VDisplay == 600) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Suspected Mac Mini, ignoring the LVDS\n"); @@ -1586,7 +1586,7 @@ found_mode: i830_set_lvds_backlight_method(output); - switch (pI830->backlight_control_method) { + switch (intel->backlight_control_method) { case BCM_NATIVE: dev_priv->set_backlight = i830_lvds_set_backlight_native; dev_priv->get_backlight = i830_lvds_get_backlight_native; |