Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250595
b: refs/heads/master
c: fae1498
h: refs/heads/master
i:
  250593: a3068e8
  250591: fffce6a
v: v3
  • Loading branch information
Eric Anholt authored and Keith Packard committed May 10, 2011
1 parent 0b591a8 commit 30259aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a07d67870565e1015935f7a8d8d6ac5f507442c5
refs/heads/master: fae14981ce89fede363a8d4ddda7f7ca587195ff
57 changes: 22 additions & 35 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -4527,7 +4527,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
int pipe = intel_crtc->pipe;
int plane = intel_crtc->plane;
u32 fp_reg, dpll_reg;
int refclk, num_connectors = 0;
intel_clock_t clock, reduced_clock;
u32 dpll, fp = 0, fp2 = 0, dspcntr, pipeconf;
Expand All @@ -4537,7 +4536,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
struct intel_encoder *encoder;
const intel_limit_t *limit;
int ret;
u32 reg, temp;
u32 temp;
u32 lvds_sync = 0;

list_for_each_entry(encoder, &mode_config->encoder_list, base.head) {
Expand Down Expand Up @@ -4743,23 +4742,18 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
drm_mode_debug_printmodeline(mode);

fp_reg = FP0(pipe);
dpll_reg = DPLL(pipe);
I915_WRITE(FP0(pipe), fp);
I915_WRITE(DPLL(pipe), dpll & ~DPLL_VCO_ENABLE);

I915_WRITE(fp_reg, fp);
I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE);

POSTING_READ(dpll_reg);
POSTING_READ(DPLL(pipe));
udelay(150);

/* The LVDS pin pair needs to be on before the DPLLs are enabled.
* This is an exception to the general rule that mode_set doesn't turn
* things on.
*/
if (is_lvds) {
reg = LVDS;

temp = I915_READ(reg);
temp = I915_READ(LVDS);
temp |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP;
if (pipe == 1) {
temp |= LVDS_PIPEB_SELECT;
Expand Down Expand Up @@ -4803,17 +4797,17 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
temp &= ~(LVDS_HSYNC_POLARITY | LVDS_VSYNC_POLARITY);
temp |= lvds_sync;
}
I915_WRITE(reg, temp);
I915_WRITE(LVDS, temp);
}

if (is_dp) {
intel_dp_set_m_n(crtc, mode, adjusted_mode);
}

I915_WRITE(dpll_reg, dpll);
I915_WRITE(DPLL(pipe), dpll);

/* Wait for the clocks to stabilize. */
POSTING_READ(dpll_reg);
POSTING_READ(DPLL(pipe));
udelay(150);

if (INTEL_INFO(dev)->gen >= 4) {
Expand All @@ -4832,19 +4826,19 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
*
* So write it again.
*/
I915_WRITE(dpll_reg, dpll);
I915_WRITE(DPLL(pipe), dpll);
}

intel_crtc->lowfreq_avail = false;
if (is_lvds && has_reduced_clock && i915_powersave) {
I915_WRITE(fp_reg + 4, fp2);
I915_WRITE(FP1(pipe), fp2);
intel_crtc->lowfreq_avail = true;
if (HAS_PIPE_CXSR(dev)) {
DRM_DEBUG_KMS("enabling CxSR downclocking\n");
pipeconf |= PIPECONF_CXSR_DOWNCLOCK;
}
} else {
I915_WRITE(fp_reg + 4, fp);
I915_WRITE(FP1(pipe), fp);
if (HAS_PIPE_CXSR(dev)) {
DRM_DEBUG_KMS("disabling CxSR downclocking\n");
pipeconf &= ~PIPECONF_CXSR_DOWNCLOCK;
Expand Down Expand Up @@ -4920,7 +4914,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
int pipe = intel_crtc->pipe;
int plane = intel_crtc->plane;
u32 fp_reg, dpll_reg;
int refclk, num_connectors = 0;
intel_clock_t clock, reduced_clock;
u32 dpll, fp = 0, fp2 = 0, dspcntr, pipeconf;
Expand All @@ -4932,7 +4925,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
const intel_limit_t *limit;
int ret;
struct fdi_m_n m_n = {0};
u32 reg, temp;
u32 temp;
u32 lvds_sync = 0;
int target_clock, pixel_multiplier, lane, link_bw, bpp, factor;

Expand Down Expand Up @@ -5238,16 +5231,12 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
drm_mode_debug_printmodeline(mode);

/* assign to Ironlake registers */
fp_reg = PCH_FP0(pipe);
dpll_reg = PCH_DPLL(pipe);

/* PCH eDP needs FDI, but CPU eDP does not */
if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base)) {
I915_WRITE(fp_reg, fp);
I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
I915_WRITE(PCH_FP0(pipe), fp);
I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE);

POSTING_READ(dpll_reg);
POSTING_READ(PCH_DPLL(pipe));
udelay(150);
}

Expand Down Expand Up @@ -5279,9 +5268,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
* things on.
*/
if (is_lvds) {
reg = PCH_LVDS;

temp = I915_READ(reg);
temp = I915_READ(PCH_LVDS);
temp |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP;
if (pipe == 1) {
if (HAS_PCH_CPT(dev))
Expand Down Expand Up @@ -5324,7 +5311,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
temp &= ~(LVDS_HSYNC_POLARITY | LVDS_VSYNC_POLARITY);
temp |= lvds_sync;
}
I915_WRITE(reg, temp);
I915_WRITE(PCH_LVDS, temp);
}

/* set the dithering flag and clear for anything other than a panel. */
Expand All @@ -5347,30 +5334,30 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,

if (!has_edp_encoder ||
intel_encoder_is_pch_edp(&has_edp_encoder->base)) {
I915_WRITE(dpll_reg, dpll);
I915_WRITE(PCH_DPLL(pipe), dpll);

/* Wait for the clocks to stabilize. */
POSTING_READ(dpll_reg);
POSTING_READ(PCH_DPLL(pipe));
udelay(150);

/* The pixel multiplier can only be updated once the
* DPLL is enabled and the clocks are stable.
*
* So write it again.
*/
I915_WRITE(dpll_reg, dpll);
I915_WRITE(PCH_DPLL(pipe), dpll);
}

intel_crtc->lowfreq_avail = false;
if (is_lvds && has_reduced_clock && i915_powersave) {
I915_WRITE(fp_reg + 4, fp2);
I915_WRITE(PCH_FP1(pipe), fp2);
intel_crtc->lowfreq_avail = true;
if (HAS_PIPE_CXSR(dev)) {
DRM_DEBUG_KMS("enabling CxSR downclocking\n");
pipeconf |= PIPECONF_CXSR_DOWNCLOCK;
}
} else {
I915_WRITE(fp_reg + 4, fp);
I915_WRITE(PCH_FP1(pipe), fp);
if (HAS_PIPE_CXSR(dev)) {
DRM_DEBUG_KMS("disabling CxSR downclocking\n");
pipeconf &= ~PIPECONF_CXSR_DOWNCLOCK;
Expand Down

0 comments on commit 30259aa

Please sign in to comment.