[CI v3 5/6] drm/i915/display: add intel_encoder_is_hdmi()

Jani Nikula jani.nikula at intel.com
Mon Dec 30 14:14:44 UTC 2024


Similar to intel_encoder_is_dp() and friends.

Cc: Sergey Senozhatsky <senozhatsky at chromium.org>
Cc: Ville Syrjala <ville.syrjala at linux.intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal at intel.com>
Tested-by: Sergey Senozhatsky <senozhatsky at chromium.org>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_types.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index eb9dd1125a4a..f230163226d1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1968,6 +1968,19 @@ static inline bool intel_encoder_is_dp(struct intel_encoder *encoder)
 	}
 }
 
+static inline bool intel_encoder_is_hdmi(struct intel_encoder *encoder)
+{
+	switch (encoder->type) {
+	case INTEL_OUTPUT_HDMI:
+		return true;
+	case INTEL_OUTPUT_DDI:
+		/* See if the HDMI encoder is valid. */
+		return i915_mmio_reg_valid(enc_to_intel_hdmi(encoder)->hdmi_reg);
+	default:
+		return false;
+	}
+}
+
 static inline struct intel_lspcon *
 enc_to_intel_lspcon(struct intel_encoder *encoder)
 {
-- 
2.39.5



More information about the Intel-xe mailing list