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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 21 +++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_hdmi.h |  3 +++
 2 files changed, 24 insertions(+)

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__ */
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux