/* Reading certain registers when the pipe is disabled can hang the chip. Use this routine to make sure the PLL is running and the pipe is active before reading such registers if unsure.  */
static int i915_pipe_enabled(struct drm_device *dev, int pipe)
/* Reading certain registers when the pipe is disabled can hang the chip. Use this routine to make sure the PLL is running and the pipe is active before reading such registers if unsure.  */
static int i915_pipe_enabled(struct drm_device *dev, int pipe)
{
	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
	unsigned long pipeconf = pipe ? PIPEBCONF : PIPEACONF;
	if (I915_READ(pipeconf) & PIPEACONF_ENABLE)
		return 1;
	return 0;
}