]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/display: add intel_encoder_is_hdmi()
authorJani Nikula <jani.nikula@intel.com>
Mon, 30 Dec 2024 14:14:44 +0000 (16:14 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 3 Jan 2025 10:28:48 +0000 (12:28 +0200)
Similar to intel_encoder_is_dp() and friends.

Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/e6bf9e01deb5d0d8b566af128a762d1313638847.1735568047.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display_types.h

index eb9dd1125a4a09511936b81219e7f38fae106dfd..f230163226d144d137988aef83ec907051d5d294 100644 (file)
@@ -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)
 {