Lines Matching defs:intel_hdmi
42 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
44 return hdmi_to_dig_port(intel_hdmi)->base.base.dev;
48 assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
50 struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
56 if (I915_READ(intel_hdmi->hdmi_reg) & enabled_bits)
60 struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
67 static struct intel_hdmi *intel_attached_hdmi(struct drm_connector *connector)
338 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
341 intel_hdmi->write_infoframe(encoder, frame);
347 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
358 if (intel_hdmi->rgb_quant_range_selectable) {
390 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
395 assert_hdmi_port_disabled(intel_hdmi);
408 if (!intel_hdmi->has_hdmi_sink) {
455 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
460 assert_hdmi_port_disabled(intel_hdmi);
465 if (!intel_hdmi->has_hdmi_sink) {
515 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
519 assert_hdmi_port_disabled(intel_hdmi);
524 if (!intel_hdmi->has_hdmi_sink) {
550 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
554 assert_hdmi_port_disabled(intel_hdmi);
559 if (!intel_hdmi->has_hdmi_sink) {
584 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
588 assert_hdmi_port_disabled(intel_hdmi);
590 if (!intel_hdmi->has_hdmi_sink) {
614 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
619 hdmi_val |= intel_hdmi->color_range;
631 if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
634 if (intel_hdmi->has_audio) {
647 I915_WRITE(intel_hdmi->hdmi_reg, hdmi_val);
648 POSTING_READ(intel_hdmi->hdmi_reg);
650 intel_hdmi->set_infoframes(encoder, adjusted_mode);
658 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
661 tmp = I915_READ(intel_hdmi->hdmi_reg);
677 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
681 tmp = I915_READ(intel_hdmi->hdmi_reg);
701 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
705 if (intel_hdmi->has_audio)
708 temp = I915_READ(intel_hdmi->hdmi_reg);
719 I915_WRITE(intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE);
720 POSTING_READ(intel_hdmi->hdmi_reg);
725 I915_WRITE(intel_hdmi->hdmi_reg, temp);
726 POSTING_READ(intel_hdmi->hdmi_reg);
732 I915_WRITE(intel_hdmi->hdmi_reg, temp);
733 POSTING_READ(intel_hdmi->hdmi_reg);
749 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
753 temp = I915_READ(intel_hdmi->hdmi_reg);
763 I915_WRITE(intel_hdmi->hdmi_reg, temp);
764 POSTING_READ(intel_hdmi->hdmi_reg);
767 I915_WRITE(intel_hdmi->hdmi_reg, temp);
768 POSTING_READ(intel_hdmi->hdmi_reg);
783 I915_WRITE(intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE);
784 POSTING_READ(intel_hdmi->hdmi_reg);
789 I915_WRITE(intel_hdmi->hdmi_reg, temp);
790 POSTING_READ(intel_hdmi->hdmi_reg);
796 I915_WRITE(intel_hdmi->hdmi_reg, temp);
797 POSTING_READ(intel_hdmi->hdmi_reg);
801 static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
830 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
834 int portclock_limit = hdmi_portclock_limit(intel_hdmi);
837 if (intel_hdmi->color_range_auto) {
839 if (intel_hdmi->has_hdmi_sink &&
841 intel_hdmi->color_range = HDMI_COLOR_RANGE_16_235;
843 intel_hdmi->color_range = 0;
846 if (intel_hdmi->color_range)
887 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
889 hdmi_to_dig_port(intel_hdmi);
895 intel_hdmi->has_hdmi_sink = false;
896 intel_hdmi->has_audio = false;
897 intel_hdmi->rgb_quant_range_selectable = false;
900 intel_hdmi->ddc_bus));
905 if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI)
906 intel_hdmi->has_hdmi_sink =
908 intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
909 intel_hdmi->rgb_quant_range_selectable =
916 if (intel_hdmi->force_audio != HDMI_AUDIO_AUTO)
917 intel_hdmi->has_audio =
918 (intel_hdmi->force_audio == HDMI_AUDIO_ON);
927 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
936 intel_hdmi->ddc_bus));
942 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
949 intel_hdmi->ddc_bus));
964 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
966 hdmi_to_dig_port(intel_hdmi);
978 if (i == intel_hdmi->force_audio)
981 intel_hdmi->force_audio = i;
989 intel_hdmi->has_hdmi_sink = 0;
991 intel_hdmi->has_audio = has_audio;
996 bool old_auto = intel_hdmi->color_range_auto;
997 uint32_t old_range = intel_hdmi->color_range;
1001 intel_hdmi->color_range_auto = true;
1004 intel_hdmi->color_range_auto = false;
1005 intel_hdmi->color_range = 0;
1008 intel_hdmi->color_range_auto = false;
1009 intel_hdmi->color_range = HDMI_COLOR_RANGE_16_235;
1015 if (old_auto == intel_hdmi->color_range_auto &&
1016 old_range == intel_hdmi->color_range)
1149 intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
1153 intel_hdmi->color_range_auto = true;
1160 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
1175 intel_hdmi->ddc_bus = GMBUS_PORT_DPB;
1179 intel_hdmi->ddc_bus = GMBUS_PORT_DPC;
1183 intel_hdmi->ddc_bus = GMBUS_PORT_DPD;
1194 intel_hdmi->write_infoframe = vlv_write_infoframe;
1195 intel_hdmi->set_infoframes = vlv_set_infoframes;
1197 intel_hdmi->write_infoframe = g4x_write_infoframe;
1198 intel_hdmi->set_infoframes = g4x_set_infoframes;
1200 intel_hdmi->write_infoframe = hsw_write_infoframe;
1201 intel_hdmi->set_infoframes = hsw_set_infoframes;
1203 intel_hdmi->write_infoframe = ibx_write_infoframe;
1204 intel_hdmi->set_infoframes = ibx_set_infoframes;
1206 intel_hdmi->write_infoframe = cpt_write_infoframe;
1207 intel_hdmi->set_infoframes = cpt_set_infoframes;
1215 intel_hdmi_add_properties(intel_hdmi, connector);