aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-21 18:50:23 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-31 14:54:02 -0400
commita01025afa89ccaf1b0521f5862cbfcc73f970481 (patch)
tree070a224e0b5df9db240da82405cc4cd7fc4f573d
parent55aab33e898eb61d6187b18c2446e2cb1b06b910 (diff)
drm/i915: fixup i915_pipe_enabled check in i915_irq.c
Well, as well as we can without completely revamping the drm vblank code. The issue are that - The vblank code needs to work on both ums and kms. - It deals always deals with pipes. - It doesn't take any of the kms locks. The last part is not really fixable without revamping the drm vblank code, since the drm core <-> driver interactions is a veritable pile of spaghettis. But the other pieces can be fixed by switching on the MODESET driver flag and either checking the hw state directly (ums case) or just querying our sw tracking (with broken locking, but that's not worse than what we've had). Note that this essentially reverts commit 702e7a56af3780d8b3a717f698209bef44187bb0 Author: Paulo Zanoni <paulo.r.zanoni@intel.com> Date: Tue Oct 23 18:29:59 2012 -0200 drm/i915: convert PIPECONF to use transcoder instead of pipe for the ums case, which will fix a NULL deref (since we really don't have any crtcs set up). But the real reason to do this is to drop our reliance on the cpu_transcoder: By only checking intel_crtc->active we don't need to make sure that the pipe_config (or at least the cpu_transcoder) contain safe values even when the pipe is off. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 4df2b3fa4ebd..557acd37c788 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -381,14 +381,16 @@ static int
381i915_pipe_enabled(struct drm_device *dev, int pipe) 381i915_pipe_enabled(struct drm_device *dev, int pipe)
382{ 382{
383 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 383 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
384 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
385 pipe);
386 384
387 if (!intel_display_power_enabled(dev, 385 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
388 POWER_DOMAIN_TRANSCODER(cpu_transcoder))) 386 /* Locking is horribly broken here, but whatever. */
389 return false; 387 struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
388 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
390 389
391 return I915_READ(PIPECONF(cpu_transcoder)) & PIPECONF_ENABLE; 390 return intel_crtc->active;
391 } else {
392 return I915_READ(PIPECONF(pipe)) & PIPECONF_ENABLE;
393 }
392} 394}
393 395
394/* Called from drm generic code, passed a 'crtc', which 396/* Called from drm generic code, passed a 'crtc', which