Beispiel #1
0
static void intel_hdmi_mode_set(struct drm_encoder *encoder,
				struct drm_display_mode *mode,
				struct drm_display_mode *adjusted_mode)
{
	struct drm_device *dev = encoder->dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_crtc *crtc = encoder->crtc;
	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
	struct intel_output *intel_output = enc_to_intel_output(encoder);
	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
	u32 sdvox;

	sdvox = SDVO_ENCODING_HDMI |
		SDVO_BORDER_ENABLE |
		SDVO_VSYNC_ACTIVE_HIGH |
		SDVO_HSYNC_ACTIVE_HIGH;

	if (hdmi_priv->has_hdmi_sink)
		sdvox |= SDVO_AUDIO_ENABLE;

	if (intel_crtc->pipe == 1)
		sdvox |= SDVO_PIPE_B_SELECT;

	I915_WRITE(hdmi_priv->sdvox_reg, sdvox);
	POSTING_READ(hdmi_priv->sdvox_reg);
}
Beispiel #2
0
static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
{
	struct drm_device *dev = encoder->dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct intel_output *intel_output = enc_to_intel_output(encoder);
	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
	u32 temp;

	temp = I915_READ(hdmi_priv->sdvox_reg);

	
	if (IS_IGDNG(dev)) {
		I915_WRITE(hdmi_priv->sdvox_reg, temp & ~SDVO_ENABLE);
		POSTING_READ(hdmi_priv->sdvox_reg);
	}

	if (mode != DRM_MODE_DPMS_ON) {
		temp &= ~SDVO_ENABLE;
	} else {
		temp |= SDVO_ENABLE;
	}

	I915_WRITE(hdmi_priv->sdvox_reg, temp);
	POSTING_READ(hdmi_priv->sdvox_reg);

	
	if (IS_IGDNG(dev)) {
		I915_WRITE(hdmi_priv->sdvox_reg, temp);
		POSTING_READ(hdmi_priv->sdvox_reg);
	}
}
Beispiel #3
0
static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
{
	struct drm_device *dev = encoder->dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct intel_output *intel_output = enc_to_intel_output(encoder);
	struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
	u32 temp;

	temp = I915_READ(hdmi_priv->sdvox_reg);

	/* HW workaround, need to toggle enable bit off and on for 12bpc, but
	 * we do this anyway which shows more stable in testing.
	 */
	if (IS_IRONLAKE(dev)) {
		I915_WRITE(hdmi_priv->sdvox_reg, temp & ~SDVO_ENABLE);
		POSTING_READ(hdmi_priv->sdvox_reg);
	}

	if (mode != DRM_MODE_DPMS_ON) {
		temp &= ~SDVO_ENABLE;
	} else {
		temp |= SDVO_ENABLE;
	}

	I915_WRITE(hdmi_priv->sdvox_reg, temp);
	POSTING_READ(hdmi_priv->sdvox_reg);

	/* HW workaround, need to write this twice for issue that may result
	 * in first write getting masked.
	 */
	if (IS_IRONLAKE(dev)) {
		I915_WRITE(hdmi_priv->sdvox_reg, temp);
		POSTING_READ(hdmi_priv->sdvox_reg);
	}
}