diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-02 07:27:29 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-09-06 01:58:22 -0400 |
commit | 85234cdc28f622dc94d8bb0089635113e2aa5609 (patch) | |
tree | 63540fb49e240f9219e5ded9e4d032910c235792 /drivers/gpu/drm/i915/intel_ddi.c | |
parent | 19d8fe154497bc48e25cbed61066731daca3df43 (diff) |
drm/i915/hdmi: implement get_hw_state
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 38a7006a84f4..bfe375466a0e 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -757,6 +757,35 @@ void intel_ddi_mode_set(struct drm_encoder *encoder, | |||
757 | intel_hdmi->set_infoframes(encoder, adjusted_mode); | 757 | intel_hdmi->set_infoframes(encoder, adjusted_mode); |
758 | } | 758 | } |
759 | 759 | ||
760 | bool intel_ddi_get_hw_state(struct intel_encoder *encoder, | ||
761 | enum pipe *pipe) | ||
762 | { | ||
763 | struct drm_device *dev = encoder->base.dev; | ||
764 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
765 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); | ||
766 | u32 tmp; | ||
767 | int i; | ||
768 | |||
769 | tmp = I915_READ(DDI_BUF_CTL(intel_hdmi->ddi_port)); | ||
770 | |||
771 | if (!(tmp & DDI_BUF_CTL_ENABLE)) | ||
772 | return false; | ||
773 | |||
774 | for_each_pipe(i) { | ||
775 | tmp = I915_READ(DDI_FUNC_CTL(i)); | ||
776 | |||
777 | if ((tmp & PIPE_DDI_PORT_MASK) | ||
778 | == PIPE_DDI_SELECT_PORT(intel_hdmi->ddi_port)) { | ||
779 | *pipe = i; | ||
780 | return true; | ||
781 | } | ||
782 | } | ||
783 | |||
784 | DRM_DEBUG_KMS("No pipe for ddi port %i found\n", intel_hdmi->ddi_port); | ||
785 | |||
786 | return true; | ||
787 | } | ||
788 | |||
760 | void intel_enable_ddi(struct intel_encoder *encoder) | 789 | void intel_enable_ddi(struct intel_encoder *encoder) |
761 | { | 790 | { |
762 | struct drm_device *dev = encoder->base.dev; | 791 | struct drm_device *dev = encoder->base.dev; |