Skip to content

Commit

Permalink
drm/i915: don't call Haswell PCH code when we can't or don't need
Browse files Browse the repository at this point in the history
On Ironlake we have one PCH transcoder and FDI per pipe, so we know
that if ironlake_crtc_driving_pch returns false we can disable the PCH
transcoder and we also know that when we disable the crtc we can also
disable the PCH transcoder.

On Haswell there is only 1 PCH transcoder and FDI and they can be used
by any CRTC. So if for one specific crtc haswell_crtc_driving_pch
returns false we can't assert anything about the state of the PCH
transcoder or the FDI link without checking if any other CRTC is using
the PCH.

So on this commit remove the "assert_fdi_{t,r}x_disabled" form
haswell_crtc_enable and also only disable FDI and the PCH transcoder
if the port being disabled was actually a PCH port (we only have one
port using PCH: the VGA port).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Paulo Zanoni authored and Daniel Vetter committed Oct 26, 2012
1 parent fc316cb commit 8361663
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -3283,12 +3283,8 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)

is_pch_port = haswell_crtc_driving_pch(crtc);

if (is_pch_port) {
if (is_pch_port)
ironlake_fdi_pll_enable(intel_crtc);
} else {
assert_fdi_tx_disabled(dev_priv, pipe);
assert_fdi_rx_disabled(dev_priv, pipe);
}

for_each_encoder_on_crtc(dev, crtc, encoder)
if (encoder->pre_enable)
Expand Down Expand Up @@ -3430,10 +3426,13 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
struct intel_encoder *encoder;
int pipe = intel_crtc->pipe;
int plane = intel_crtc->plane;
bool is_pch_port;

if (!intel_crtc->active)
return;

is_pch_port = haswell_crtc_driving_pch(crtc);

for_each_encoder_on_crtc(dev, crtc, encoder)
encoder->disable(encoder);

Expand All @@ -3460,14 +3459,12 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
if (encoder->post_disable)
encoder->post_disable(encoder);

ironlake_fdi_disable(crtc);

intel_disable_transcoder(dev_priv, pipe);

/* disable PCH DPLL */
intel_disable_pch_pll(intel_crtc);

ironlake_fdi_pll_disable(intel_crtc);
if (is_pch_port) {
ironlake_fdi_disable(crtc);
intel_disable_transcoder(dev_priv, pipe);
intel_disable_pch_pll(intel_crtc);
ironlake_fdi_pll_disable(intel_crtc);
}

intel_crtc->active = false;
intel_update_watermarks(dev);
Expand Down

0 comments on commit 8361663

Please sign in to comment.