From patchwork Mon Oct 14 11:01:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kulkarni, Vandita" X-Patchwork-Id: 11188351 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7F5B139A for ; Mon, 14 Oct 2019 11:31:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A054820650 for ; Mon, 14 Oct 2019 11:31:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A054820650 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EA9A6E28A; Mon, 14 Oct 2019 11:31:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA5CC6E28A for ; Mon, 14 Oct 2019 11:30:54 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 04:30:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,295,1566889200"; d="scan'208";a="185465916" Received: from vandita-desktop.iind.intel.com ([10.223.74.218]) by orsmga007.jf.intel.com with ESMTP; 14 Oct 2019 04:30:52 -0700 From: Vandita Kulkarni To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Oct 2019 16:31:22 +0530 Message-Id: <20191014110122.31923-8-vandita.kulkarni@intel.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a In-Reply-To: <20191014110122.31923-1-vandita.kulkarni@intel.com> References: <20191014110122.31923-1-vandita.kulkarni@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 7/7] drm/i915/dsi: Initiate frame request in cmd mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In TE Gate mode, on every flip we need to set the frame update request bit. After this bit is set transcoder hardware will automatically send the frame data to the panel when it receives the TE event. Signed-off-by: Vandita Kulkarni --- drivers/gpu/drm/i915/display/icl_dsi.c | 27 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_display.c | 16 +++++++++++ .../drm/i915/display/intel_display_types.h | 3 +++ drivers/gpu/drm/i915/display/intel_dsi.h | 3 +++ 4 files changed, 49 insertions(+) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 877746416e52..c72917ddf8e7 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -90,6 +90,33 @@ struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct intel_crtc *crtc) return NULL; } +void gen11_dsi_check_frame_update_needed(struct intel_crtc *intel_crtc, + struct intel_crtc_state *crtc_state) +{ + struct intel_encoder *intel_encoder = NULL; + + intel_encoder = gen11_dsi_find_cmd_mode_encoder(intel_crtc); + if (!intel_encoder) + return; + + /* TBD Use bits to say update on which dsi port instead of a bool */ + crtc_state->dsi_frame_update = true; +} + +void gen11_dsi_frame_update(struct intel_crtc_state *crtc_state) +{ + struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + u32 tmp; + + /* TBD: add check on port */ + if (crtc_state->dsi_frame_update) { + tmp = I915_READ(ICL_DSI_CMD_FRMCTL(PORT_A)); + tmp |= ICL_FRAME_UPDATE_REQUEST; + I915_WRITE(ICL_DSI_CMD_FRMCTL(PORT_A), tmp); + } +} + static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder) { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 3cf39fc153b3..a902bb2bf075 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -11858,6 +11858,11 @@ static int intel_crtc_atomic_check(struct drm_crtc *_crtc, crtc_state); } + if ((INTEL_GEN(dev_priv) >= 11) && + (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))) { + gen11_dsi_check_frame_update_needed(crtc, crtc_state); + } + if (HAS_IPS(dev_priv)) crtc_state->ips_enabled = hsw_compute_ips_config(crtc_state); @@ -13618,6 +13623,7 @@ static int intel_atomic_check(struct drm_device *dev, if (ret) goto fail; + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { if (!needs_modeset(new_crtc_state) && @@ -14108,6 +14114,16 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state) intel_color_load_luts(new_crtc_state); } + /* + * Incase of mipi dsi command mode, we need to set frame update + * for every commit + */ + for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) { + if (new_crtc_state->base.active && + !needs_modeset(new_crtc_state) && + new_crtc_state->dsi_frame_update) + gen11_dsi_frame_update(new_crtc_state); + } /* * Now that the vblank has passed, we can go ahead and program the * optimal watermarks on platforms that need two-step watermark diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 40390d855815..69da4ec45691 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -991,6 +991,9 @@ struct intel_crtc_state { /* Forward Error correction State */ bool fec_enable; + + /* frame update for dsi command mode */ + bool dsi_frame_update; }; struct intel_crtc { diff --git a/drivers/gpu/drm/i915/display/intel_dsi.h b/drivers/gpu/drm/i915/display/intel_dsi.h index 071dad7ee04a..d9350b842115 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi.h +++ b/drivers/gpu/drm/i915/display/intel_dsi.h @@ -203,6 +203,9 @@ void bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port); /* icl_dsi.c */ struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct intel_crtc *crtc); +void gen11_dsi_check_frame_update_needed(struct intel_crtc *crtc, + struct intel_crtc_state *crtc_state); +void gen11_dsi_frame_update(struct intel_crtc_state *crtc_state); /* intel_dsi_vbt.c */ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id);