Message ID | 4292505b249268d824834d545b73aa0ad2d33984.1733324735.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm/i915/display: handle hdmi connector init failures, and no HDMI/DP cases | expand |
> -----Original Message----- > From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Jani > Nikula > Sent: Wednesday, December 4, 2024 8:37 PM > To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org > Cc: Nikula, Jani <jani.nikula@intel.com>; Sergey Senozhatsky > <senozhatsky@chromium.org>; Ville Syrjala <ville.syrjala@linux.intel.com> > Subject: [PATCH v2 4/5] drm/i915/display: add intel_encoder_is_hdmi() > > Similar to intel_encoder_is_dp() and friends. > > Cc: Sergey Senozhatsky <senozhatsky@chromium.org> > Cc: Ville Syrjala <ville.syrjala@linux.intel.com> > Signed-off-by: Jani Nikula <jani.nikula@intel.com> LGTM, Reviewed-by: Suraj Kandpal <suraj.kandpal@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 167aa8ec4948..0ae026a850c2 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_types.h > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h > @@ -1959,6 +1959,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
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 167aa8ec4948..0ae026a850c2 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1959,6 +1959,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) {
Similar to intel_encoder_is_dp() and friends. Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/display/intel_display_types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)