[Intel-gfx] [PATCH 06/12] drm/i915/icl: Find encoder for DSI command mode
Madhav Chauhan
madhav.chauhan at intel.com
Wed Aug 8 12:15:53 UTC 2018
This patch adds a helper function to find encoder
if DSI is operating in command mode. This function
will be used while enabling/disabling TE interrupts
for DSI.
Signed-off-by: Madhav Chauhan <madhav.chauhan at intel.com>
---
drivers/gpu/drm/i915/icl_dsi.c | 17 +++++++++++++++++
drivers/gpu/drm/i915/intel_drv.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index b189398..bf7ad5e 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -29,6 +29,23 @@
#include <drm/drm_atomic_helper.h>
#include "intel_dsi.h"
+struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct intel_crtc *crtc)
+{
+ struct drm_device *dev = crtc->base.dev;
+ struct intel_encoder *encoder;
+ struct intel_dsi *intel_dsi;
+
+ for_each_encoder_on_crtc(dev, &crtc->base, encoder) {
+ if (encoder->type != INTEL_OUTPUT_DSI)
+ continue;
+ intel_dsi = enc_to_intel_dsi(&encoder->base);
+ if (intel_dsi->operation_mode == INTEL_DSI_COMMAND_MODE)
+ return encoder;
+ }
+
+ return NULL;
+}
+
static void wait_for_dsi_hdr_credit_release(struct intel_dsi *intel_dsi,
enum transcoder dsi_trans)
{
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 1b12d53..7dadfc1 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1756,6 +1756,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv);
/* icl_dsi.c */
void intel_gen11_dsi_init(struct drm_i915_private *dev_priv);
+struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct intel_crtc *crtc);
/* intel_dsi_dcs_backlight.c */
int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);
--
2.7.4
More information about the Intel-gfx
mailing list