diff mbox series

[v2,2/5] drm/i915: Add checking a specific Video DIP is enabled or not

Message ID 20191025125530.1015447-3-gwan-gyeong.mun@intel.com (mailing list archive)
State New, archived
Headers show
Series Update VSC SDP / HDR Metadata SDP states on pipe updates. | expand

Commit Message

Gwan-gyeong Mun Oct. 25, 2019, 12:55 p.m. UTC
Because DP ports don't use intel_hdmi_infoframes_enabled() machanism,
DP ports requires a way to check a specific infoframe (aka. Video DIP )
is enabled or not.

Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 21 +++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_hdmi.h |  3 +++
 2 files changed, 24 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index b62afeccd44e..6a3dff9b5ef9 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -621,6 +621,27 @@  void intel_enable_infoframe(struct intel_encoder *encoder,
 	}
 }
 
+bool intel_infoframe_enabled(struct intel_encoder *encoder,
+			     const struct intel_crtc_state *crtc_state,
+			     unsigned int type)
+{
+	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
+	u32 val = 0;
+
+	val = dig_port->infoframes_enabled(encoder, crtc_state);
+
+	if (HAS_DDI(dev_priv)) {
+		if (val & hsw_infoframe_enable(type))
+			return true;
+	} else {
+		if (val & g4x_infoframe_enable(type))
+			return true;
+	}
+
+	return false;
+}
+
 u32 intel_hdmi_infoframe_enable(unsigned int type)
 {
 	int i;
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index 86f925526514..96d50f591b69 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -51,5 +51,8 @@  void intel_read_infoframe(struct intel_encoder *encoder,
 void intel_enable_infoframe(struct intel_encoder *encoder, bool enable,
 			    const struct intel_crtc_state *crtc_state,
 			    unsigned int type);
+bool intel_infoframe_enabled(struct intel_encoder *encoder,
+			     const struct intel_crtc_state *crtc_state,
+			     unsigned int type);
 
 #endif /* __INTEL_HDMI_H__ */