aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-02-18 17:00:26 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-02-19 19:33:46 -0500
commitb242b7f745650832f445dca3e19efc3dd2d65a66 (patch)
treef929f7e5db5ba190a1f986f047dc41509195bf1d /drivers/gpu/drm
parent9ed35ab1dd286ed04adde8c988925f1eb149a38a (diff)
drm/i915: rename sdvox_reg to hdmi_reg on HDMI context
Some (but not all) of the HDMI registers can be used to control sDVO, so those registers have two names. IMHO, when we're talking about HDMI, we really should call the HDMI control register "hdmi_reg" instead of "sdvox_reg", otherwise we'll just confuse people reading our code (we now have platforms with HDMI but without SDVO). So now "struct intel_hdmi" has a member called "hdmi_reg" instead of "sdvox_reg". Also, don't worry: "struct intel_sdvo" still has a member called "sdvo_reg". v2: Rebase (v1 was sent in May 2012). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c4
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h4
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c72
3 files changed, 39 insertions, 41 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 816c45c71b72..56bb7cb78263 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1538,9 +1538,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
1538 intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) & 1538 intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
1539 DDI_BUF_PORT_REVERSAL; 1539 DDI_BUF_PORT_REVERSAL;
1540 if (hdmi_connector) 1540 if (hdmi_connector)
1541 intel_dig_port->hdmi.sdvox_reg = DDI_BUF_CTL(port); 1541 intel_dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
1542 else
1543 intel_dig_port->hdmi.sdvox_reg = 0;
1544 intel_dig_port->dp.output_reg = DDI_BUF_CTL(port); 1542 intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
1545 1543
1546 intel_encoder->type = INTEL_OUTPUT_UNKNOWN; 1544 intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index f21e22612bd8..010e998dda5f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -347,7 +347,7 @@ struct dip_infoframe {
347} __attribute__((packed)); 347} __attribute__((packed));
348 348
349struct intel_hdmi { 349struct intel_hdmi {
350 u32 sdvox_reg; 350 u32 hdmi_reg;
351 int ddc_bus; 351 int ddc_bus;
352 uint32_t color_range; 352 uint32_t color_range;
353 bool color_range_auto; 353 bool color_range_auto;
@@ -444,7 +444,7 @@ extern void intel_attach_broadcast_rgb_property(struct drm_connector *connector)
444 444
445extern void intel_crt_init(struct drm_device *dev); 445extern void intel_crt_init(struct drm_device *dev);
446extern void intel_hdmi_init(struct drm_device *dev, 446extern void intel_hdmi_init(struct drm_device *dev,
447 int sdvox_reg, enum port port); 447 int hdmi_reg, enum port port);
448extern void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, 448extern void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
449 struct intel_connector *intel_connector); 449 struct intel_connector *intel_connector);
450extern struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder); 450extern struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index ed65c6ddf5a2..fcb36c6b4434 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -50,7 +50,7 @@ assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
50 50
51 enabled_bits = HAS_DDI(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE; 51 enabled_bits = HAS_DDI(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE;
52 52
53 WARN(I915_READ(intel_hdmi->sdvox_reg) & enabled_bits, 53 WARN(I915_READ(intel_hdmi->hdmi_reg) & enabled_bits,
54 "HDMI port enabled, expecting disabled\n"); 54 "HDMI port enabled, expecting disabled\n");
55} 55}
56 56
@@ -597,40 +597,40 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
597 struct drm_i915_private *dev_priv = dev->dev_private; 597 struct drm_i915_private *dev_priv = dev->dev_private;
598 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 598 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
599 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); 599 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
600 u32 sdvox; 600 u32 hdmi_val;
601 601
602 sdvox = SDVO_ENCODING_HDMI; 602 hdmi_val = SDVO_ENCODING_HDMI;
603 if (!HAS_PCH_SPLIT(dev)) 603 if (!HAS_PCH_SPLIT(dev))
604 sdvox |= intel_hdmi->color_range; 604 hdmi_val |= intel_hdmi->color_range;
605 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) 605 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
606 sdvox |= SDVO_VSYNC_ACTIVE_HIGH; 606 hdmi_val |= SDVO_VSYNC_ACTIVE_HIGH;
607 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) 607 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
608 sdvox |= SDVO_HSYNC_ACTIVE_HIGH; 608 hdmi_val |= SDVO_HSYNC_ACTIVE_HIGH;
609 609
610 if (intel_crtc->bpp > 24) 610 if (intel_crtc->bpp > 24)
611 sdvox |= COLOR_FORMAT_12bpc; 611 hdmi_val |= COLOR_FORMAT_12bpc;
612 else 612 else
613 sdvox |= COLOR_FORMAT_8bpc; 613 hdmi_val |= COLOR_FORMAT_8bpc;
614 614
615 /* Required on CPT */ 615 /* Required on CPT */
616 if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev)) 616 if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
617 sdvox |= HDMI_MODE_SELECT; 617 hdmi_val |= HDMI_MODE_SELECT;
618 618
619 if (intel_hdmi->has_audio) { 619 if (intel_hdmi->has_audio) {
620 DRM_DEBUG_DRIVER("Enabling HDMI audio on pipe %c\n", 620 DRM_DEBUG_DRIVER("Enabling HDMI audio on pipe %c\n",
621 pipe_name(intel_crtc->pipe)); 621 pipe_name(intel_crtc->pipe));
622 sdvox |= SDVO_AUDIO_ENABLE; 622 hdmi_val |= SDVO_AUDIO_ENABLE;
623 sdvox |= SDVO_NULL_PACKETS_DURING_VSYNC; 623 hdmi_val |= SDVO_NULL_PACKETS_DURING_VSYNC;
624 intel_write_eld(encoder, adjusted_mode); 624 intel_write_eld(encoder, adjusted_mode);
625 } 625 }
626 626
627 if (HAS_PCH_CPT(dev)) 627 if (HAS_PCH_CPT(dev))
628 sdvox |= PORT_TRANS_SEL_CPT(intel_crtc->pipe); 628 hdmi_val |= PORT_TRANS_SEL_CPT(intel_crtc->pipe);
629 else if (intel_crtc->pipe == PIPE_B) 629 else if (intel_crtc->pipe == PIPE_B)
630 sdvox |= SDVO_PIPE_B_SELECT; 630 hdmi_val |= SDVO_PIPE_B_SELECT;
631 631
632 I915_WRITE(intel_hdmi->sdvox_reg, sdvox); 632 I915_WRITE(intel_hdmi->hdmi_reg, hdmi_val);
633 POSTING_READ(intel_hdmi->sdvox_reg); 633 POSTING_READ(intel_hdmi->hdmi_reg);
634 634
635 intel_hdmi->set_infoframes(encoder, adjusted_mode); 635 intel_hdmi->set_infoframes(encoder, adjusted_mode);
636} 636}
@@ -643,7 +643,7 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
643 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 643 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
644 u32 tmp; 644 u32 tmp;
645 645
646 tmp = I915_READ(intel_hdmi->sdvox_reg); 646 tmp = I915_READ(intel_hdmi->hdmi_reg);
647 647
648 if (!(tmp & SDVO_ENABLE)) 648 if (!(tmp & SDVO_ENABLE))
649 return false; 649 return false;
@@ -667,7 +667,7 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)
667 if (intel_hdmi->has_audio) 667 if (intel_hdmi->has_audio)
668 enable_bits |= SDVO_AUDIO_ENABLE; 668 enable_bits |= SDVO_AUDIO_ENABLE;
669 669
670 temp = I915_READ(intel_hdmi->sdvox_reg); 670 temp = I915_READ(intel_hdmi->hdmi_reg);
671 671
672 /* HW workaround for IBX, we need to move the port to transcoder A 672 /* HW workaround for IBX, we need to move the port to transcoder A
673 * before disabling it. */ 673 * before disabling it. */
@@ -684,21 +684,21 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)
684 * we do this anyway which shows more stable in testing. 684 * we do this anyway which shows more stable in testing.
685 */ 685 */
686 if (HAS_PCH_SPLIT(dev)) { 686 if (HAS_PCH_SPLIT(dev)) {
687 I915_WRITE(intel_hdmi->sdvox_reg, temp & ~SDVO_ENABLE); 687 I915_WRITE(intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE);
688 POSTING_READ(intel_hdmi->sdvox_reg); 688 POSTING_READ(intel_hdmi->hdmi_reg);
689 } 689 }
690 690
691 temp |= enable_bits; 691 temp |= enable_bits;
692 692
693 I915_WRITE(intel_hdmi->sdvox_reg, temp); 693 I915_WRITE(intel_hdmi->hdmi_reg, temp);
694 POSTING_READ(intel_hdmi->sdvox_reg); 694 POSTING_READ(intel_hdmi->hdmi_reg);
695 695
696 /* HW workaround, need to write this twice for issue that may result 696 /* HW workaround, need to write this twice for issue that may result
697 * in first write getting masked. 697 * in first write getting masked.
698 */ 698 */
699 if (HAS_PCH_SPLIT(dev)) { 699 if (HAS_PCH_SPLIT(dev)) {
700 I915_WRITE(intel_hdmi->sdvox_reg, temp); 700 I915_WRITE(intel_hdmi->hdmi_reg, temp);
701 POSTING_READ(intel_hdmi->sdvox_reg); 701 POSTING_READ(intel_hdmi->hdmi_reg);
702 } 702 }
703} 703}
704 704
@@ -710,7 +710,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
710 u32 temp; 710 u32 temp;
711 u32 enable_bits = SDVO_ENABLE | SDVO_AUDIO_ENABLE; 711 u32 enable_bits = SDVO_ENABLE | SDVO_AUDIO_ENABLE;
712 712
713 temp = I915_READ(intel_hdmi->sdvox_reg); 713 temp = I915_READ(intel_hdmi->hdmi_reg);
714 714
715 /* HW workaround for IBX, we need to move the port to transcoder A 715 /* HW workaround for IBX, we need to move the port to transcoder A
716 * before disabling it. */ 716 * before disabling it. */
@@ -720,12 +720,12 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
720 720
721 if (temp & SDVO_PIPE_B_SELECT) { 721 if (temp & SDVO_PIPE_B_SELECT) {
722 temp &= ~SDVO_PIPE_B_SELECT; 722 temp &= ~SDVO_PIPE_B_SELECT;
723 I915_WRITE(intel_hdmi->sdvox_reg, temp); 723 I915_WRITE(intel_hdmi->hdmi_reg, temp);
724 POSTING_READ(intel_hdmi->sdvox_reg); 724 POSTING_READ(intel_hdmi->hdmi_reg);
725 725
726 /* Again we need to write this twice. */ 726 /* Again we need to write this twice. */
727 I915_WRITE(intel_hdmi->sdvox_reg, temp); 727 I915_WRITE(intel_hdmi->hdmi_reg, temp);
728 POSTING_READ(intel_hdmi->sdvox_reg); 728 POSTING_READ(intel_hdmi->hdmi_reg);
729 729
730 /* Transcoder selection bits only update 730 /* Transcoder selection bits only update
731 * effectively on vblank. */ 731 * effectively on vblank. */
@@ -740,21 +740,21 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
740 * we do this anyway which shows more stable in testing. 740 * we do this anyway which shows more stable in testing.
741 */ 741 */
742 if (HAS_PCH_SPLIT(dev)) { 742 if (HAS_PCH_SPLIT(dev)) {
743 I915_WRITE(intel_hdmi->sdvox_reg, temp & ~SDVO_ENABLE); 743 I915_WRITE(intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE);
744 POSTING_READ(intel_hdmi->sdvox_reg); 744 POSTING_READ(intel_hdmi->hdmi_reg);
745 } 745 }
746 746
747 temp &= ~enable_bits; 747 temp &= ~enable_bits;
748 748
749 I915_WRITE(intel_hdmi->sdvox_reg, temp); 749 I915_WRITE(intel_hdmi->hdmi_reg, temp);
750 POSTING_READ(intel_hdmi->sdvox_reg); 750 POSTING_READ(intel_hdmi->hdmi_reg);
751 751
752 /* HW workaround, need to write this twice for issue that may result 752 /* HW workaround, need to write this twice for issue that may result
753 * in first write getting masked. 753 * in first write getting masked.
754 */ 754 */
755 if (HAS_PCH_SPLIT(dev)) { 755 if (HAS_PCH_SPLIT(dev)) {
756 I915_WRITE(intel_hdmi->sdvox_reg, temp); 756 I915_WRITE(intel_hdmi->hdmi_reg, temp);
757 POSTING_READ(intel_hdmi->sdvox_reg); 757 POSTING_READ(intel_hdmi->hdmi_reg);
758 } 758 }
759} 759}
760 760
@@ -1075,7 +1075,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1075 } 1075 }
1076} 1076}
1077 1077
1078void intel_hdmi_init(struct drm_device *dev, int sdvox_reg, enum port port) 1078void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port)
1079{ 1079{
1080 struct intel_digital_port *intel_dig_port; 1080 struct intel_digital_port *intel_dig_port;
1081 struct intel_encoder *intel_encoder; 1081 struct intel_encoder *intel_encoder;
@@ -1108,7 +1108,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg, enum port port)
1108 intel_encoder->cloneable = false; 1108 intel_encoder->cloneable = false;
1109 1109
1110 intel_dig_port->port = port; 1110 intel_dig_port->port = port;
1111 intel_dig_port->hdmi.sdvox_reg = sdvox_reg; 1111 intel_dig_port->hdmi.hdmi_reg = hdmi_reg;
1112 intel_dig_port->dp.output_reg = 0; 1112 intel_dig_port->dp.output_reg = 0;
1113 1113
1114 intel_hdmi_init_connector(intel_dig_port, intel_connector); 1114 intel_hdmi_init_connector(intel_dig_port, intel_connector);