From d1c647af2ed78ba07cac9e32438c6f437239a56b Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Fri, 3 Apr 2009 11:34:50 +0000 Subject: use i915_pipe_enabled() to test to see if the pipe is lit up, instead of expanding the function in line here. --- sys/dev/pci/drm/i915_irq.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c index 6aa8541d9f0..b141c2a90fe 100644 --- a/sys/dev/pci/drm/i915_irq.c +++ b/sys/dev/pci/drm/i915_irq.c @@ -171,7 +171,7 @@ i915_get_vblank_counter(struct drm_device *dev, int plane) high_frame = pipe ? PIPEBFRAMEHIGH : PIPEAFRAMEHIGH; low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL; - if (!i915_pipe_enabled(dev, pipe)) { + if (i915_pipe_enabled(dev, pipe) == 0) { DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe); return (0); @@ -360,9 +360,8 @@ int i915_enable_vblank(struct drm_device *dev, int plane) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int pipe = i915_get_pipe(dev, plane); - int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; - - if ((I915_READ(pipeconf_reg) & PIPEACONF_ENABLE) == 0) + + if (i915_pipe_enabled(dev, pipe) == 0) return (EINVAL); mtx_enter(&dev_priv->user_irq_lock); -- cgit v1.2.3