From patchwork Mon Jan 6 04:15:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8ABCAE77198 for ; Mon, 6 Jan 2025 04:36:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30EB910E56D; Mon, 6 Jan 2025 04:36:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cQylnuOh"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7419610E1E1; Mon, 6 Jan 2025 04:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138178; x=1767674178; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hM8tJp67Ysd+aNURKvDF86Qn25aCT0xz+6QQyXsqPPM=; b=cQylnuOheNVDKxukC9oU6ykXi56FUJAQ+PcY0E5wsZS9roYbDsOAZRxp 8mTWTv8ToTctjWksDAinC3RTgj5S370BjYiowTUm4HTAEScPT1lV88zaI 5SAzDfZUHWggEnwMGSosGgTmi8Xt6X7+Aj/fRrOLKAmr8U6sXOEE2B8nK Ci8ut8VMpO05Nsh3kRt5tTZcYAVfWLorrZMyhcw4EuHQoSAMgFy4e3MNg sOuoAzRmy+BMoegxeNiBj4JU+R/60juPQrU7I3WlzuiP0WVSebvVyY5ya R0KKCQTxueAx95qrHzEbGyjeFDQ7sAJme1OITwnqCysMIqlbQ3W9MPdlx Q==; X-CSE-ConnectionGUID: JZoxDtf0QT6B9BO4NKMDxw== X-CSE-MsgGUID: HTAMAYLZSra1eEFynWYd1w== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880597" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880597" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:18 -0800 X-CSE-ConnectionGUID: VCofx43oTvCrMHz1cHbUWg== X-CSE-MsgGUID: /2TfugtLSNihMYYOpEHuPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306340" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:16 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 1/6] drm/i915/lobf: Add lobf enablement in post plane update Date: Mon, 6 Jan 2025 09:45:11 +0530 Message-Id: <20250106041516.924101-2-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Enablement of LOBF is added in post plane update whenever has_lobf flag is set. As LOBF can be enabled in non-psr case as well so adding in post plane update. There is no change of configuring alpm with psr path. v1: Initial version. v2: Use encoder-mask to find the associated encoder from crtc-state. [Jani] Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 25 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_alpm.h | 4 ++++ drivers/gpu/drm/i915/display/intel_display.c | 3 +++ 3 files changed, 32 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 55f3ae1e68c9..75063342a100 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -367,6 +367,31 @@ void intel_alpm_configure(struct intel_dp *intel_dp, lnl_alpm_configure(intel_dp, crtc_state); } +void intel_alpm_post_plane_update(struct intel_atomic_state *state, + struct intel_crtc *crtc) +{ + struct intel_display *display = to_intel_display(state); + const struct intel_crtc_state *crtc_state = + intel_atomic_get_new_crtc_state(state, crtc); + struct intel_encoder *encoder; + + if (!crtc_state->has_lobf) + return; + + for_each_intel_encoder_mask(display->drm, encoder, + crtc_state->uapi.encoder_mask) { + struct intel_dp *intel_dp; + + if (!intel_encoder_is_dp(encoder)) + continue; + + intel_dp = enc_to_intel_dp(encoder); + + if (intel_dp_is_edp(intel_dp)) + intel_alpm_configure(intel_dp, crtc_state); + } +} + static int i915_edp_lobf_info_show(struct seq_file *m, void *data) { struct intel_connector *connector = m->private; diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h index 8c409b10dce6..2f862b0476a8 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.h +++ b/drivers/gpu/drm/i915/display/intel_alpm.h @@ -12,6 +12,8 @@ struct intel_dp; struct intel_crtc_state; struct drm_connector_state; struct intel_connector; +struct intel_atomic_state; +struct intel_crtc; void intel_alpm_init_dpcd(struct intel_dp *intel_dp); bool intel_alpm_compute_params(struct intel_dp *intel_dp, @@ -21,6 +23,8 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, struct drm_connector_state *conn_state); void intel_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state); +void intel_alpm_post_plane_update(struct intel_atomic_state *state, + struct intel_crtc *crtc); void intel_alpm_lobf_debugfs_add(struct intel_connector *connector); bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp); bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4271da219b41..385ef1ecf8ac 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -55,6 +55,7 @@ #include "i9xx_plane.h" #include "i9xx_plane_regs.h" #include "i9xx_wm.h" +#include "intel_alpm.h" #include "intel_atomic.h" #include "intel_atomic_plane.h" #include "intel_audio.h" @@ -1190,6 +1191,8 @@ static void intel_post_plane_update(struct intel_atomic_state *state, intel_psr_post_plane_update(state, crtc); + intel_alpm_post_plane_update(state, crtc); + intel_frontbuffer_flip(dev_priv, new_crtc_state->fb_bits); if (new_crtc_state->update_wm_post && new_crtc_state->hw.active) From patchwork Mon Jan 6 04:15:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7A59FE77199 for ; Mon, 6 Jan 2025 04:36:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2358C10E576; Mon, 6 Jan 2025 04:36:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="U7WtGOcD"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F9E410E570; Mon, 6 Jan 2025 04:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138181; x=1767674181; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PQibymLp0tYEuezQA6XA1RJUplZkwMGCyqaLj/AyHRM=; b=U7WtGOcDx4wbMNykC0eXXrQeRWk3rA3lD7RsMGUQbTX6nvlFaajLt+I5 7WBVgIcUWEKids4iGFiuevsPnfYLTJjW/gctfCXpuyXxEZppXY12JaM47 Hog1bjNhzwLeovLFb5krWFWRuH45pBcD6d45qlQorLoRvWSWIufhaCxjr +wI+dWvZ4w4yh7/YA1iOJFzfCeoAfR078ZNOjiFbVv+chtlymfqZhA7vK 3KT/h3Ymp5KdweTFJxSqZA0jjfecm0WCLPCrUkYmFTGRCjhSEefU2MdYj kqVrzqsWW2qaOa2G7VfkUv8f8wAaStfhwJcshFf699JhqNuRrjy1b4SjH w==; X-CSE-ConnectionGUID: OekRlOx9SoSZ2bDqCT+rjw== X-CSE-MsgGUID: sCNu4sH2SieLftUfi4Rc5Q== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880598" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880598" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:21 -0800 X-CSE-ConnectionGUID: lyezWNiGSVCRhcfBCf3tYA== X-CSE-MsgGUID: IE2XBVrdRM2hshYPEd507w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306352" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:19 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 2/6] drm/i915/lobf: Add fixed refresh rate check in compute_config() Date: Mon, 6 Jan 2025 09:45:12 +0530 Message-Id: <20250106041516.924101-3-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" LOBF can be enabled with vrr fixed rate mode, so add check if vmin = vmax = flipline in compute_config(). Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 75063342a100..f31f94a9c99a 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -288,6 +288,10 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, if (crtc_state->has_psr) return; + if (!(crtc_state->vrr.vmin == crtc_state->vrr.vmax && + crtc_state->vrr.vmin == crtc_state->vrr.flipline)) + return; + if (!(intel_alpm_aux_wake_supported(intel_dp) || intel_alpm_aux_less_wake_supported(intel_dp))) return; From patchwork Mon Jan 6 04:15:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1F97FE77188 for ; Mon, 6 Jan 2025 04:36:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B99D710E574; Mon, 6 Jan 2025 04:36:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gMquTvil"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1412A10E577; Mon, 6 Jan 2025 04:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138184; x=1767674184; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NLnPU8Sp0QaJ+YhQFHl0iS1hsqyMn8fn1sTNDwhCeao=; b=gMquTvil5O8ExOm7pAAGWY94/P3hpI4Kz8h0fU8OUCUkilpRV0q7aD0x fwx/N0uV3EJvXNQBq+5B8+t9HV+U7y4xTfdBiOK27gJy1w8pwvVKiGJ+/ 1zl5HyrVfH8II+8QwCt592VVCiYAMsBP7KzHqyCbyPR23ocs7MMUTweL7 K2j/NxNgp83NnGKlsVsYpKO5aKFh8Vo4G3iOF0yWvWdlOSylXgI2310jM FuNRhguY6NJlX8K0+Scd0iSygml7nlLNb19I9onIc5F6ZgrkQ1X9A0gar 8D6hNi44rF8iGiu9ld3nNgU44V1/IBY46wJN0POygKROCOiFFRh8gtcEe Q==; X-CSE-ConnectionGUID: qagPeOIYQFC1SnQTtR24ow== X-CSE-MsgGUID: VkLr8uVMRLe59vva2d2s4A== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880600" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880600" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:24 -0800 X-CSE-ConnectionGUID: tTOiUUPYRpmEBBa5fHlP3A== X-CSE-MsgGUID: qoq4IIRQT1ayGKmWflZhOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306366" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:21 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 3/6] drm/i915/lobf: Update lobf if any change in dependent parameters Date: Mon, 6 Jan 2025 09:45:13 +0530 Message-Id: <20250106041516.924101-4-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For every commit the dependent condition for LOBF is checked and accordingly update has_lobf flag which will be used to update the ALPM_CTL register during commit. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 16 ++++++++++++++++ drivers/gpu/drm/i915/display/intel_alpm.h | 1 + drivers/gpu/drm/i915/display/intel_ddi.c | 2 ++ 3 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index f31f94a9c99a..197c67363f0e 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -312,6 +312,22 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, (first_sdp_position + waketime_in_lines); } +void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state) +{ + struct intel_display *display = to_intel_display(crtc_state); + enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; + u32 alpm_ctl; + + if (DISPLAY_VER(display) < 20) + return; + + alpm_ctl = intel_de_read(display, ALPM_CTL(display, cpu_transcoder)); + if (alpm_ctl & ALPM_CTL_LOBF_ENABLE && !crtc_state->has_lobf) { + alpm_ctl &= ~ALPM_CTL_LOBF_ENABLE; + intel_de_write(display, ALPM_CTL(display, cpu_transcoder), alpm_ctl); + } +} + static void lnl_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h index 2f862b0476a8..485e511629fb 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.h +++ b/drivers/gpu/drm/i915/display/intel_alpm.h @@ -23,6 +23,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, struct drm_connector_state *conn_state); void intel_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state); +void intel_alpm_lobf_update(const struct intel_crtc_state *crtc_state); void intel_alpm_post_plane_update(struct intel_atomic_state *state, struct intel_crtc *crtc); void intel_alpm_lobf_debugfs_add(struct intel_connector *connector); diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 36aaa82f4536..cfdbe8013db6 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -35,6 +35,7 @@ #include "i915_reg.h" #include "icl_dsi.h" #include "intel_audio.h" +#include "intel_alpm.h" #include "intel_audio_regs.h" #include "intel_backlight.h" #include "intel_combo_phy.h" @@ -3543,6 +3544,7 @@ static void intel_ddi_update_pipe_dp(struct intel_atomic_state *state, intel_ddi_set_dp_msa(crtc_state, conn_state); intel_dp_set_infoframes(encoder, true, crtc_state, conn_state); + intel_alpm_lobf_update(crtc_state); intel_backlight_update(state, encoder, crtc_state, conn_state); drm_connector_update_privacy_screen(conn_state); From patchwork Mon Jan 6 04:15:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 93C2EE77198 for ; Mon, 6 Jan 2025 04:36:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F88610E579; Mon, 6 Jan 2025 04:36:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Pz69PwbX"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0291010E577; Mon, 6 Jan 2025 04:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138187; x=1767674187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OtRDFCqk8VNGGQtE2eV3xlsqASSNVUYnrgU6rBoMH5w=; b=Pz69PwbX3prpi5fsfI4xXjIwSHa0dfP2e+i/QIbCQIvi6W8X3Qc4PS3e 5jula8AMALO/9GWB5Ov4cpvoTeUYbDiOHsuNZ817Z/SvlK7xt3a/FLIv6 vf8mRLKpKFZ6Ex+rvo9SvvVBPk0TU4whj6iNg9Ho0Fi9yMskFxjjPVOnn m+TNM6J4m/hydZRGMy66KhcVBMHw1M99nZUW8gL4UakuPJYaxccTDtPxG JtD6enPsQJMu95b2WT/VLFHqQ0EjfltgvXoK8SRPoURDWtysv5LfXV5As lBoPcre9Zr3rNJ9RzgP5g92JsbppUJ0dWlQyJhNsbH6PrF8HR6mKwX+ep A==; X-CSE-ConnectionGUID: MhvzxzCIQF2KzSaxFQgTuQ== X-CSE-MsgGUID: HQFTJHyJR9yQnkVh2w5RlA== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880602" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880602" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:26 -0800 X-CSE-ConnectionGUID: WEm502/oS2iICr355MmXBw== X-CSE-MsgGUID: f/iGE2f+SFeqM71swQuI6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306376" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:24 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 4/6] drm/i915/lobf: Add debug interface for lobf Date: Mon, 6 Jan 2025 09:45:14 +0530 Message-Id: <20250106041516.924101-5-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add an interface in debugfs which will help in debugging LOBF feature. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 51 +++++++++++++++++++ .../drm/i915/display/intel_display_types.h | 6 +++ 2 files changed, 57 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 197c67363f0e..1cc0e5ed3f74 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -276,6 +276,9 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, int waketime_in_lines, first_sdp_position; int context_latency, guardband; + if (intel_dp->alpm_parameters.lobf_debug & I915_LOBF_DEBUG_DISABLE) + return; + if (!intel_dp_is_edp(intel_dp)) return; @@ -448,6 +451,51 @@ static int i915_edp_lobf_info_show(struct seq_file *m, void *data) DEFINE_SHOW_ATTRIBUTE(i915_edp_lobf_info); +static int +i915_edp_lobf_debug_get(void *data, u64 *val) +{ + struct intel_display *display = data; + struct intel_encoder *encoder; + int ret = -ENODEV; + + for_each_intel_dp(display->drm, encoder) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + + if (!intel_dp_is_edp(intel_dp)) + return ret; + + // TODO: split to each edp transcoder. + *val = READ_ONCE(intel_dp->alpm_parameters.lobf_debug); + ret = 0; + } + + return ret; +} + +static int +i915_edp_lobf_debug_set(void *data, u64 val) +{ + struct intel_display *display = data; + struct intel_encoder *encoder; + int ret = -ENODEV; + + for_each_intel_dp(display->drm, encoder) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + + if (!intel_dp_is_edp(intel_dp)) + return ret; + + // TODO: split to each edp transcoder. + intel_dp->alpm_parameters.lobf_debug = val; + } + + return ret; +} + +DEFINE_SIMPLE_ATTRIBUTE(i915_edp_lobf_debug_fops, + i915_edp_lobf_debug_get, i915_edp_lobf_debug_set, + "%llu\n"); + void intel_alpm_lobf_debugfs_add(struct intel_connector *connector) { struct intel_display *display = to_intel_display(connector); @@ -457,6 +505,9 @@ void intel_alpm_lobf_debugfs_add(struct intel_connector *connector) connector->base.connector_type != DRM_MODE_CONNECTOR_eDP) return; + debugfs_create_file("i915_edp_lobf_debug", 0644, root, + connector, &i915_edp_lobf_debug_fops); + debugfs_create_file("i915_edp_lobf_info", 0444, root, connector, &i915_edp_lobf_info_fops); } diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index f230163226d1..37f061acb204 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1800,6 +1800,12 @@ struct intel_dp { u8 aux_less_wake_lines; u8 silence_period_sym_clocks; u8 lfps_half_cycle_num_of_syms; + +#define I915_LOBF_DEBUG_MODE_MASK 0x0f +#define I915_LOBF_DEBUG_DEFAULT 0x00 +#define I915_LOBF_DEBUG_DISABLE 0x01 +#define I915_LOBF_DEBUG_FORCE_EN 0x02 + bool lobf_debug; } alpm_parameters; u8 alpm_dpcd; From patchwork Mon Jan 6 04:15:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9F70FE77198 for ; Mon, 6 Jan 2025 04:36:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4968E10E141; Mon, 6 Jan 2025 04:36:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XYdfwOiN"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1045B10E57A; Mon, 6 Jan 2025 04:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138190; x=1767674190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Voe9AwRtWkC8/R3zn01ajCbhVeIUanz7XzMhjQdRnQ0=; b=XYdfwOiNuA3sNpCb00JIbVTJAXY6gy+9PhMGXcIdeTNPRvAHwleV59hi P7logapUxpZjf6AZci0vnv1SuvrFC/vpxeLEAfqTnR8b+Y8fMQaV3Swia S7qnmjGH776/Kgc01Zjc+wTcTsbpGtdbyunhd9JIQFpzhiTzIrtW9ljLr oKvCxt1ej/9QZLwlpnvFv/qru/KSsfEhcCfTLg5QiLf3hSit7/Mebzoan A5X1E4KqEOKLrjFNcDijFdz6zNRwZC4umjeKBoi320vPKKJ76BwOjwaT1 lpacnBSvaasnt9PyGb7qMxCVnntHFrlWgb186xs7i97ocThU7EcfXOfEK A==; X-CSE-ConnectionGUID: 6YXjkYqkRNqfGEmebUsCOA== X-CSE-MsgGUID: cfrSS0n9RUKEhG64cBbL0Q== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880603" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880603" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:30 -0800 X-CSE-ConnectionGUID: c6yPn+qmR/CE1j07osdJgg== X-CSE-MsgGUID: J+UHPtJxSUGmda+2Ocri3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306389" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:27 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 5/6] drm/i915/lobf: Check for sink error and disable LOBF Date: Mon, 6 Jan 2025 09:45:15 +0530 Message-Id: <20250106041516.924101-6-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Disable LOBF/ALPM for any erroneous condition from sink side. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 38 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_alpm.h | 1 + .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 2 + 4 files changed, 42 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 1cc0e5ed3f74..ab98b48ec47e 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -388,6 +388,7 @@ void intel_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { lnl_alpm_configure(intel_dp, crtc_state); + intel_dp->alpm_parameters.transcoder = crtc_state->cpu_transcoder; } void intel_alpm_post_plane_update(struct intel_atomic_state *state, @@ -511,3 +512,40 @@ void intel_alpm_lobf_debugfs_add(struct intel_connector *connector) debugfs_create_file("i915_edp_lobf_info", 0444, root, connector, &i915_edp_lobf_info_fops); } + +void intel_alpm_short_pulse(struct intel_dp *intel_dp) +{ + struct intel_display *display = to_intel_display(intel_dp); + struct drm_dp_aux *aux = &intel_dp->aux; + enum transcoder cpu_transcoder = intel_dp->alpm_parameters.transcoder; + u8 val; + int r; + + if (DISPLAY_VER(display) < 20) + return; + + if (!(intel_de_read(display, ALPM_CTL(display, cpu_transcoder)) & ALPM_CTL_LOBF_ENABLE)) + return; + + r = drm_dp_dpcd_readb(aux, DP_RECEIVER_ALPM_STATUS, &val); + if (r != 1) { + drm_err(display->drm, "Error reading ALPM status\n"); + return; + } + + if (val & DP_ALPM_LOCK_TIMEOUT_ERROR) { + intel_de_rmw(display, ALPM_CTL(display, cpu_transcoder), + ALPM_CTL_ALPM_ENABLE | ALPM_CTL_LOBF_ENABLE | + ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0); + + intel_de_rmw(display, + PORT_ALPM_CTL(cpu_transcoder), + PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0); + + drm_dbg_kms(display->drm, + "ALPM lock timeout error, disabling LOBF\n"); + + /* Clearing error */ + drm_dp_dpcd_writeb(aux, DP_RECEIVER_ALPM_STATUS, val); + } +} diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h index 485e511629fb..96d4c903f3ea 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.h +++ b/drivers/gpu/drm/i915/display/intel_alpm.h @@ -29,4 +29,5 @@ void intel_alpm_post_plane_update(struct intel_atomic_state *state, void intel_alpm_lobf_debugfs_add(struct intel_connector *connector); bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp); bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp); +void intel_alpm_short_pulse(struct intel_dp *intel_dp); #endif diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 37f061acb204..636af4c4e94d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1806,6 +1806,7 @@ struct intel_dp { #define I915_LOBF_DEBUG_DISABLE 0x01 #define I915_LOBF_DEBUG_FORCE_EN 0x02 bool lobf_debug; + enum transcoder transcoder; } alpm_parameters; u8 alpm_dpcd; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 0d74adae2ec9..40f2760d8aaa 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5363,6 +5363,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp) intel_psr_short_pulse(intel_dp); + intel_alpm_short_pulse(intel_dp); + if (intel_dp_test_short_pulse(intel_dp)) reprobe_needed = true; From patchwork Mon Jan 6 04:15:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13926941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 90C70E77188 for ; Mon, 6 Jan 2025 04:36:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BF2010E57B; Mon, 6 Jan 2025 04:36:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gMFso2OB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id B796A10E57A; Mon, 6 Jan 2025 04:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736138192; x=1767674192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZPVK1vzmcmZZmzAeKqc/UAvpowO3tzilP7U3fthSXME=; b=gMFso2OBc4HVQHAv+Csna734LAm3/ZL8zuS6OqgPP9OpWFAO6bhOOTL9 15BUVMzk9uNOVu83sq8YVY0ja3mjLCWpMjlIKLmxNmcmMi4hmcBWWAaQu /rLhJOFjlPrKtE8vzSM+lgo0l4PjHRsjrP6GmLzpI+zf91ffiVkb2FGZX qDr2LIMf811QPXPSorYkDoJLiLnIRB39rjD3kFvKIAlIvjz3+NLJVldh/ gzgw28G5Sc0AV35Cn06cyCfMEZgEc9dqZb3+ox47GJjF0UmYufMVAPngV V3LU5cYsOQfoIwgKF8VaocDmLYencNEU9b+SmsrGCFX0sJDtz8wR8Wx/i w==; X-CSE-ConnectionGUID: DRGZgiJjQU2qkjk8iXFqIA== X-CSE-MsgGUID: kLjT15qXSSGYmi1vqslo5Q== X-IronPort-AV: E=McAfee;i="6700,10204,11306"; a="23880606" X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="23880606" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2025 20:36:32 -0800 X-CSE-ConnectionGUID: 50D4DThjQx6HSBLT3ZajFQ== X-CSE-MsgGUID: ydSX7roeQtm7hNlTNW30Yg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,292,1728975600"; d="scan'208";a="107306403" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orviesa004.jf.intel.com with ESMTP; 05 Jan 2025 20:36:30 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, jani.nikula@intel.com, jeevan.b@intel.com, Animesh Manna Subject: [PATCH v3 6/6] drm/i915/lobf: Add debug print for LOBF Date: Mon, 6 Jan 2025 09:45:16 +0530 Message-Id: <20250106041516.924101-7-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20250106041516.924101-1-animesh.manna@intel.com> References: <20250106041516.924101-1-animesh.manna@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Lobf is enabled part of ALPM configuration and if has_lobf is set to true respective bit for LOBF will be set. Add debug print while setting the bitfield of LOBF. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index ab98b48ec47e..0ddb103ba43a 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -376,8 +376,10 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp, ALPM_CTL_EXTENDED_FAST_WAKE_TIME(intel_dp->alpm_parameters.fast_wake_lines); } - if (crtc_state->has_lobf) + if (crtc_state->has_lobf) { alpm_ctl |= ALPM_CTL_LOBF_ENABLE; + drm_dbg_kms(display->drm, "Link off between frames (LOBF) enabled\n"); + } alpm_ctl |= ALPM_CTL_ALPM_ENTRY_CHECK(intel_dp->alpm_parameters.check_entry_lines);