Commit 4ef03f83 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Introduce intel_encoder_is_dig_port()

Add intel_encoder_is_dig_port() to match intel_encoder_is_dp().
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180705164357.28512-3-ville.syrjala@linux.intel.comReviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 14aa521c
...@@ -1245,23 +1245,29 @@ intel_attached_encoder(struct drm_connector *connector) ...@@ -1245,23 +1245,29 @@ intel_attached_encoder(struct drm_connector *connector)
return to_intel_connector(connector)->encoder; return to_intel_connector(connector)->encoder;
} }
static inline struct intel_digital_port * static inline bool intel_encoder_is_dig_port(struct intel_encoder *encoder)
enc_to_dig_port(struct drm_encoder *encoder)
{ {
struct intel_encoder *intel_encoder = to_intel_encoder(encoder); switch (encoder->type) {
switch (intel_encoder->type) {
case INTEL_OUTPUT_DDI: case INTEL_OUTPUT_DDI:
WARN_ON(!HAS_DDI(to_i915(encoder->dev)));
/* fall through */
case INTEL_OUTPUT_DP: case INTEL_OUTPUT_DP:
case INTEL_OUTPUT_EDP: case INTEL_OUTPUT_EDP:
case INTEL_OUTPUT_HDMI: case INTEL_OUTPUT_HDMI:
return true;
default:
return false;
}
}
static inline struct intel_digital_port *
enc_to_dig_port(struct drm_encoder *encoder)
{
struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
if (intel_encoder_is_dig_port(intel_encoder))
return container_of(encoder, struct intel_digital_port, return container_of(encoder, struct intel_digital_port,
base.base); base.base);
default: else
return NULL; return NULL;
}
} }
static inline struct intel_dp_mst_encoder * static inline struct intel_dp_mst_encoder *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment