@@ -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)
{
@@ -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);
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@intel.com> --- drivers/gpu/drm/i915/icl_dsi.c | 17 +++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 18 insertions(+)