From patchwork Fri Jun 7 13:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13689999 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 8DECCC27C53 for ; Fri, 7 Jun 2024 13:49:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02FB210EC5B; Fri, 7 Jun 2024 13:49:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="A+OfvMVs"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDD6510EC5B for ; Fri, 7 Jun 2024 13:49: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=1717768171; x=1749304171; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DR6so6indaTxNA2RQe+Ol8fnPV/ZK8kaNavJAP/WNUE=; b=A+OfvMVsdNCIzWV0jtOhCAvNBBLz+MRRCAWrH3K65SpAnT264IkwfXKd o/L9ugTWQdcseXuYI1IOcyk7wvxHhePTPQZbpKliTnmTdyWhdAQqwHAto aKjTnFjz1nheZg67W0cbZeC6MYp4QghjbASLlJKzmGnru6gGdkHfqlG3l zdjN7BbgRQtt6xqxlNSGfKkcdkVF89tB7kloOhxWXQ8/r+KeIWbBe5Uvd cGa1gKbSAEaGIQ7n6t2oqsCGcfaZM5YCTyYfVJijj9cWEB+K1GOFg8Czb fXroFziSdgUXDe3UtkFIrZqdm0P/yp5q2qRzwHsOb956J9e2N0Aipedq6 Q==; X-CSE-ConnectionGUID: R8rCWbU7RwyofK91cgHE/w== X-CSE-MsgGUID: 3uU8VKIRRyegDPeUkYxSow== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331631" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331631" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:31 -0700 X-CSE-ConnectionGUID: OWDIb37sRL+tU4oRia9jxQ== X-CSE-MsgGUID: 2v4LcZtiSA6fWm6uVKqVoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458908" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:29 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 01/13] drm/i915/alpm: Do not use fast_wake_lines for aux less wake time Date: Fri, 7 Jun 2024 16:49:05 +0300 Message-Id: <20240607134917.1327574-2-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" We want to have own variables for fast wake lines and aux less wake time. It might be needed to choose if we can enable Panel Replay Selective Update or PSR2. Also currently aux less wake time is overwritten by calculated fast wake time. v2:use aux less wake time in intel_alpm_lobf_compute_config Fixes: da6a9836ac09 ("drm/i915/psr: Calculate aux less wake time") Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 4 ++-- drivers/gpu/drm/i915/display/intel_display_types.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index a26716c14aa3..52a573367976 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -159,7 +159,7 @@ static int _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp, if (i915->display.params.psr_safest_params) aux_less_wake_lines = ALPM_CTL_AUX_LESS_WAKE_TIME_MASK; - intel_dp->alpm_parameters.fast_wake_lines = aux_less_wake_lines; + intel_dp->alpm_parameters.aux_less_wake_lines = aux_less_wake_lines; intel_dp->alpm_parameters.silence_period_sym_clocks = silence_period; intel_dp->alpm_parameters.lfps_half_cycle_num_of_syms = lfps_half_cycle; @@ -298,7 +298,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, if (intel_alpm_aux_less_wake_supported(intel_dp)) waketime_in_lines = intel_dp->alpm_parameters.io_wake_lines; else - waketime_in_lines = intel_dp->alpm_parameters.fast_wake_lines; + waketime_in_lines = intel_dp->alpm_parameters.aux_less_wake_lines; crtc_state->has_lobf = (context_latency + guardband) > (first_sdp_position + waketime_in_lines); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 83d6a3d901fd..a012c3a5c8eb 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1848,6 +1848,7 @@ struct intel_dp { /* LNL and beyond */ u8 check_entry_lines; + u8 aux_less_wake_lines; u8 silence_period_sym_clocks; u8 lfps_half_cycle_num_of_syms; } alpm_parameters; From patchwork Fri Jun 7 13:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690000 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 6CFFFC27C5F for ; Fri, 7 Jun 2024 13:49:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C223410EC5D; Fri, 7 Jun 2024 13:49:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="CaO/3XnP"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 906EF10EC5B for ; Fri, 7 Jun 2024 13:49: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=1717768173; x=1749304173; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ktH6sqmvPSuo+bZQQ9IUh63up4NT2YIe4umu0B6ntyA=; b=CaO/3XnPvm56yaOyn/GKXy4yczcRhph6WFQIfZlomF+L/jbklYm2AChd dHaCiXxcK6s9fkU1v9cw84RPTOzjiVduW3gBepcLY+40syFzaj4slQFl4 x+Oq75nXK/6xJWdnxcCnFzZdxOCdNLryfmWlPFluW+YrtuGCnG7Dub/0L wtt/TSpnF6Ku8mluxEL72c2uvwAODXn76HL4oq6f5B2dzQts1plIqmAOi P32wN/x/3RKtUCuIX2y9e7kymGyvq7zboyRMILXqg9xpo1hXjzbR56VG+ uIlSi7JU2g/LbapOSNLEW1zbvL4bY4v5J7BwWYCtGEnI3Eh8039T5Vtyv A==; X-CSE-ConnectionGUID: OvV/YU2YQDWmCFP+c6rBIQ== X-CSE-MsgGUID: ZlwWU+RWS2+yo1KFiH23BA== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331632" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331632" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:33 -0700 X-CSE-ConnectionGUID: iGC4AWR1TteuEYZYUFx+bw== X-CSE-MsgGUID: KKUWuYIlTeOV+6bRFzG+Pg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458920" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:31 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 02/13] drm/i915/alpm: Write also AUX Less Wake lines into ALPM_CTL Date: Fri, 7 Jun 2024 16:49:06 +0300 Message-Id: <20240607134917.1327574-3-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Currently AUX Less Wake lines are not written into ALPM_CTL. Fix this. Fixes: 1ccbf135862b ("drm/i915/psr: Enable ALPM on source side for eDP Panel replay") Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_alpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 52a573367976..18c1c5803670 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -323,7 +323,8 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp, (crtc_state->has_lobf && intel_alpm_aux_less_wake_supported(intel_dp))) { alpm_ctl = ALPM_CTL_ALPM_ENABLE | ALPM_CTL_ALPM_AUX_LESS_ENABLE | - ALPM_CTL_AUX_LESS_SLEEP_HOLD_TIME_50_SYMBOLS; + ALPM_CTL_AUX_LESS_SLEEP_HOLD_TIME_50_SYMBOLS | + ALPM_CTL_AUX_LESS_WAKE_TIME(intel_dp->alpm_parameters.aux_less_wake_lines); intel_de_write(dev_priv, PORT_ALPM_CTL(dev_priv, cpu_transcoder), From patchwork Fri Jun 7 13:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690001 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 1C35CC27C6E for ; Fri, 7 Jun 2024 13:49:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4327B10EC60; Fri, 7 Jun 2024 13:49:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kn4ZZOt4"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E54610EC5D for ; Fri, 7 Jun 2024 13:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768174; x=1749304174; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oUfcznki0aEb+R6oJY/r3qQ2uBIDCe0F1UdoW48wgHU=; b=kn4ZZOt4+y1ME5t+HhOOAcZ5DUCJHNuZ1k+GkjlBoe6EkHTYV5lqqmYI CEw+woI/5/wJbzRIdInHlD1SVmXpEYkF25w5jFenAheN9z/wMNcE4PVtK 1NGdgNW5IUcv+RICUECl7wdJY1zS4gJVMlNSyMEk4IEvvy4VAen/xIz3I 9qwSHo02GxWS88AYD3lOWxNdAO/SzDdYKSImOc4Oy/VN/JY5Q+oDKjdkt DGpKE5wwosc4346QoBUJrZBgDJq3PE6YU897wtvngx5ZMRCJOiD2zS6v1 cmtgUzBXEQ6RttoVpsGyLt1Zjj6kqb5/9KM5pHwAKjzKTY0vCKc/fxPbE g==; X-CSE-ConnectionGUID: yHIwfHf/SFCKMzu4eih6qw== X-CSE-MsgGUID: +zK//A+5QOG7F4omrptlow== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331636" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331636" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:34 -0700 X-CSE-ConnectionGUID: D5U4qKSnR1KHup3YlimAWA== X-CSE-MsgGUID: ZbU+v/xbTHOqF1t7ZygkuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458933" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:32 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 03/13] drm/i915/display: Take panel replay into account in vsc sdp unpacking Date: Fri, 7 Jun 2024 16:49:07 +0300 Message-Id: <20240607134917.1327574-4-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Currently intel_dp_vsc_sdp_unpack is not taking into account Panel Replay vsc sdp. Fix this by adding vsc sdp revision 0x6 and length 0x10 into intel_dp_vsc_sdp_unpack Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_dp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index fd054e16850d..286119eb77f8 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4438,7 +4438,8 @@ static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc, vsc->length = sdp->sdp_header.HB3; if ((sdp->sdp_header.HB2 == 0x2 && sdp->sdp_header.HB3 == 0x8) || - (sdp->sdp_header.HB2 == 0x4 && sdp->sdp_header.HB3 == 0xe)) { + (sdp->sdp_header.HB2 == 0x4 && sdp->sdp_header.HB3 == 0xe) || + (sdp->sdp_header.HB2 == 0x6 && sdp->sdp_header.HB3 == 0x10)) { /* * - HB2 = 0x2, HB3 = 0x8 * VSC SDP supporting 3D stereo + PSR @@ -4446,6 +4447,8 @@ static int intel_dp_vsc_sdp_unpack(struct drm_dp_vsc_sdp *vsc, * VSC SDP supporting 3D stereo + PSR2 with Y-coordinate of * first scan line of the SU region (applies to eDP v1.4b * and higher). + * - HB2 = 0x6, HB3 = 0x10 + * VSC SDP supporting 3D stereo + Panel Replay. */ return 0; } else if (sdp->sdp_header.HB2 == 0x5 && sdp->sdp_header.HB3 == 0x13) { From patchwork Fri Jun 7 13:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690002 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 C96D4C27C53 for ; Fri, 7 Jun 2024 13:49:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0463310EC5E; Fri, 7 Jun 2024 13:49:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="HVVGiV/e"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10BF110EC5F for ; Fri, 7 Jun 2024 13:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768176; x=1749304176; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+oZBJJ4UsyM9VcYOis+YllpY4eQloSoEcA3XiKqboQA=; b=HVVGiV/e4Hr0yDGB3ARsMGWe0VgEHJ/wO4CniobotDDT9lkIKlMxoL4N AzB/Dv4UcIbQsilYBBPYYcPFwv9ac8pfWv5R5zR3VUXtWPUuK8lKTkeGT 4cgh+y9ELxxdvJL07GfQ6rL8HeP3KbhGIUrFFv+r6xDiwwNaVTTptD6Yt uroYNRUNGXRCtUOpAkUZ2aObClbRElM2d1ulLgizAuf8z2NMHVOmXri3b BHr5+V1xRs+ibzyFkaJBQ3ej2GPjuSg6AxVng1XxqZUVGL+l/XEn7r0ap br3w6Ua4vRaY6uXhJZgcNhz8unVl6szcRYF/9Opmk6uQYh42gYxtcDhrH Q==; X-CSE-ConnectionGUID: GQ7DzR4nSr6N9g3NsBlyEA== X-CSE-MsgGUID: cW/WEN+ITlCXBkXFCITapQ== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331641" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331641" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:36 -0700 X-CSE-ConnectionGUID: uksWmuc6TLW2v9T1/S07kA== X-CSE-MsgGUID: LRJuS1o5SkGx+z4HFkgAtA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458941" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:34 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 04/13] drm/i915/display: Skip Panel Replay on pipe comparison if no active planes Date: Fri, 7 Jun 2024 16:49:08 +0300 Message-Id: <20240607134917.1327574-5-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Panel Replay is not enabled if there are no active planes. Do not compare it on pipe comparison. Otherwise we get pipe mismatch. Fixes: ac9ef327327b ("drm/i915/psr: Panel replay has to be enabled before link training") Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7370acdd6b8b..2747dd01bb0a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -5331,7 +5331,9 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, * Panel replay has to be enabled before link training. PSR doesn't have * this requirement -> check these only if using panel replay */ - if (current_config->has_panel_replay || pipe_config->has_panel_replay) { + if (current_config->active_planes && + (current_config->has_panel_replay || + pipe_config->has_panel_replay)) { PIPE_CONF_CHECK_BOOL(has_psr); PIPE_CONF_CHECK_BOOL(has_sel_update); PIPE_CONF_CHECK_BOOL(enable_psr2_sel_fetch); From patchwork Fri Jun 7 13:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690003 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 14D14C27C6E for ; Fri, 7 Jun 2024 13:49:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60ADC10EC63; Fri, 7 Jun 2024 13:49:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="KCOLtkeq"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAC1810EC5F for ; Fri, 7 Jun 2024 13:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768178; x=1749304178; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G2J+qj76rY+K065BrL+ephQIvvjiVyMQ0xsCXFezTjM=; b=KCOLtkeq6GqpwEDGbA9d1Jjkpf7BFodezG3zq1fejsvVqr5mhYX+lyjj AkLCngj83aO3clS5jSOhztcZlTYtn/85vZ1+abzmVk8vGmMlQlHR0bIub lXrQ30UrB0KjIjgigOznCOjquoJ65v7vyQgtSzBsVNolDpOex5wCDRM4U WU3+tTbFxlB3mXMsvuT+2WKVCIMldQWeFCkaGRkBVBjHTL8qqz2bCx/5F xUm1QRGAUlhGqbu8cUJeR0uyZsEmxymGqqQUTIZO8Qi5oEZLyFvAszzF7 nNu69A6uLw5oK1MPQWLuGV2VS598kq9z231qz9Wa/NgktgKP9WHk+h4f0 w==; X-CSE-ConnectionGUID: dUKvoh/1T0SbPDmjF5O3Nw== X-CSE-MsgGUID: XttxDxyGR0axUlrRm0kHcA== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331647" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331647" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:38 -0700 X-CSE-ConnectionGUID: XIVVerhXR7OYcote0jjocw== X-CSE-MsgGUID: epfsZEPlQlOAD0hao3XC4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458958" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:36 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 05/13] drm/display: Add missing Panel Replay Enable SU Region ET bit Date: Fri, 7 Jun 2024 16:49:09 +0300 Message-Id: <20240607134917.1327574-6-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 missing Panel Replay Enable SU Region ET bit defined in DP2.1 specification. Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna Acked-by: Maarten Lankhorst --- include/drm/display/drm_dp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index f246fa03a3cb..173548c6473a 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -743,6 +743,7 @@ # define DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN (1 << 4) # define DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN (1 << 5) # define DP_PANEL_REPLAY_SU_ENABLE (1 << 6) +# define DP_PANEL_REPLAY_ENABLE_SU_REGION_ET (1 << 7) /* DP 2.1 */ #define PANEL_REPLAY_CONFIG2 0x1b1 /* eDP 1.5 */ # define DP_PANEL_REPLAY_SINK_REFRESH_RATE_UNLOCK_GRANTED (1 << 0) From patchwork Fri Jun 7 13:49:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690004 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 0C1F3C27C53 for ; Fri, 7 Jun 2024 13:49:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C27710EC65; Fri, 7 Jun 2024 13:49:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BT/O3Ue/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 79CA110EC63 for ; Fri, 7 Jun 2024 13:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768180; x=1749304180; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9QY4riPRrDVOm6tk3+kZW+qMYyWBgR9IFrT16thdhZI=; b=BT/O3Ue/aPkJUfKQRZ9njMaZ5RZ8E106ebSiHfPEkUSnBLJPQNex1klX hSGfk5pdc+xq9bL2Ci3w1imFR/je1Y2EbJ5gVwc+n+3xTqK6RWc1sM1W3 pMKarHE2OxtU/cwNtamHViVP4J8cyX4+KymQmPL0m1NAfStV+Ro+RJ9Kc V+L/j0GWAntMGj3EIGMTOktWRicBPELqJA+j5+/EzBQekeNBdrsnfBtJU RCFfquVJLJYMVVmz5ucnXw/30fU8noduDIi+RDx9bh0QXQPqlsp46QXJU jZYfWC/nxhuS/7g4plBmjONW6idGw+2wc3t8iQap2OycIMZUrpVa8+mc0 A==; X-CSE-ConnectionGUID: hT3XRae5TiC2QbBRZww2yg== X-CSE-MsgGUID: mIECnsbkQZivoXOxhXDyZA== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331651" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331651" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:39 -0700 X-CSE-ConnectionGUID: fIY5jWkMRuK9U5o08eS9PQ== X-CSE-MsgGUID: +GfflOvAR7iS1+u7FdFk5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458970" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:38 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 06/13] drm/i915/psr: Split enabling sink for PSR and Panel Replay Date: Fri, 7 Jun 2024 16:49:10 +0300 Message-Id: <20240607134917.1327574-7-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Current intel_psr_enable_sink is a mess due to partly reusing PSR bit definitions for Panel Replay. Even thought PSR and Panel Replay enable registers do have common bits they still have also different bits and same bits with different meaning. For sake of clarity split enabling sink to PSR and Panel Replay specific parts. Also fix issue caused by using psr->panel_replay_enabled to early. Fixes: 88ae6c65ecdb ("drm/i915/psr: Unify panel replay enable/disable sink") Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_psr.c | 81 +++++++++++++----------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 4a4124a92a0d..3cc38ba2f954 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -686,56 +686,62 @@ static bool psr2_su_region_et_valid(struct intel_dp *intel_dp) return false; } -static unsigned int intel_psr_get_enable_sink_offset(struct intel_dp *intel_dp) +static void _panel_replay_enable_sink(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state) { - return intel_dp->psr.panel_replay_enabled ? - PANEL_REPLAY_CONFIG : DP_PSR_EN_CFG; + u8 val = DP_PANEL_REPLAY_ENABLE | + DP_PANEL_REPLAY_VSC_SDP_CRC_EN | + DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN | + DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN | + DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN; + + if (crtc_state->has_sel_update) + val |= DP_PANEL_REPLAY_SU_ENABLE; + + if (crtc_state->enable_psr2_su_region_et) + val |= DP_PANEL_REPLAY_ENABLE_SU_REGION_ET; + + drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG, val); } -/* - * Note: Most of the bits are same in PANEL_REPLAY_CONFIG and DP_PSR_EN_CFG. We - * are relying on PSR definitions on these "common" bits. - */ -void intel_psr_enable_sink(struct intel_dp *intel_dp, - const struct intel_crtc_state *crtc_state) +static void _psr_enable_sink(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - u8 dpcd_val = DP_PSR_ENABLE; + struct drm_i915_private *i915 = dp_to_i915(intel_dp); + u8 val = DP_PSR_ENABLE; if (crtc_state->has_sel_update) { - /* Enable ALPM at sink for psr2 */ - if (!crtc_state->has_panel_replay) { - drm_dp_dpcd_writeb(&intel_dp->aux, - DP_RECEIVER_ALPM_CONFIG, - DP_ALPM_ENABLE | - DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE); - - if (crtc_state->enable_psr2_su_region_et) - dpcd_val |= DP_PSR_ENABLE_SU_REGION_ET; - } - - dpcd_val |= DP_PSR_ENABLE_PSR2 | DP_PSR_IRQ_HPD_WITH_CRC_ERRORS; + val |= DP_PSR_ENABLE_PSR2 | DP_PSR_IRQ_HPD_WITH_CRC_ERRORS; } else { if (intel_dp->psr.link_standby) - dpcd_val |= DP_PSR_MAIN_LINK_ACTIVE; + val |= DP_PSR_MAIN_LINK_ACTIVE; - if (!crtc_state->has_panel_replay && DISPLAY_VER(dev_priv) >= 8) - dpcd_val |= DP_PSR_CRC_VERIFICATION; + if (DISPLAY_VER(i915) >= 8) + val |= DP_PSR_CRC_VERIFICATION; } - if (crtc_state->has_panel_replay) - dpcd_val |= DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN | - DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN; - - if (crtc_state->req_psr2_sdp_prior_scanline) - dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE; + if (crtc_state->enable_psr2_su_region_et) + val |= DP_PANEL_REPLAY_ENABLE_SU_REGION_ET; if (intel_dp->psr.entry_setup_frames > 0) - dpcd_val |= DP_PSR_FRAME_CAPTURE; + val |= DP_PSR_FRAME_CAPTURE; - drm_dp_dpcd_writeb(&intel_dp->aux, - intel_psr_get_enable_sink_offset(intel_dp), - dpcd_val); + drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, val); +} + +void intel_psr_enable_sink(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state) +{ + /* Enable ALPM at sink for psr2 */ + if (!crtc_state->has_panel_replay && crtc_state->has_sel_update) + drm_dp_dpcd_writeb(&intel_dp->aux, + DP_RECEIVER_ALPM_CONFIG, + DP_ALPM_ENABLE | + DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE); + + crtc_state->has_panel_replay ? + _panel_replay_enable_sink(intel_dp, crtc_state) : + _psr_enable_sink(intel_dp, crtc_state); if (intel_dp_is_edp(intel_dp)) drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0); @@ -1920,7 +1926,8 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp) /* Disable PSR on Sink */ drm_dp_dpcd_writeb(&intel_dp->aux, - intel_psr_get_enable_sink_offset(intel_dp), 0); + intel_dp->psr.panel_replay_enabled ? + PANEL_REPLAY_CONFIG : DP_PSR_EN_CFG, 0); if (!intel_dp->psr.panel_replay_enabled && intel_dp->psr.sel_update_enabled) From patchwork Fri Jun 7 13:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690006 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 A2A5BC27C5F for ; Fri, 7 Jun 2024 13:49:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE11510EC66; Fri, 7 Jun 2024 13:49:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gBdXKiVC"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3499610EC62 for ; Fri, 7 Jun 2024 13:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768181; x=1749304181; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i8+LuICqY5Lev7F8TrhgmkwCeCyq90siQ631dvayorw=; b=gBdXKiVCwUjZpkTLk+/G+n8XpWu1pl85ceCa/eU0iun1GOzQjV7/lrOb 6UrGV98bX0jYEulWes/xmcDWjigQDnOxArqhLnVU/rN99jej3Ok0wd29P 22My+t7b37SXU18LuFOh+KaK6pFbgaT39q9G3U9WYpgroYN74x3t+6B8s pwuNhAE/PPJEDpS3NQRipb8//Db9xph9Gj15c2TV3squDjjAaY5GekxGI dX0mUhrfQfeSWEt4ux1nVKM5qoMn1CQ/W55h7ejc8l1Og9tX37Prb6/83 5L0ouFjjzWFlLMK5A3jGi908cFdg5ypfGCGjrK1nWVgzOhADlcp3JSXf4 g==; X-CSE-ConnectionGUID: GhgBq+JbSHODex56MslaFA== X-CSE-MsgGUID: 7clx3BfwR4Wo8fVvTVtJiw== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331652" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331652" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:41 -0700 X-CSE-ConnectionGUID: cBIDXo/DTriYRtKE/9brTQ== X-CSE-MsgGUID: ZMfek7SQQ/u1KLBjCYiGbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458980" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:39 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 07/13] drm/i915/alpm: Share alpm support checks with PSR code Date: Fri, 7 Jun 2024 16:49:11 +0300 Message-Id: <20240607134917.1327574-8-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Convert intel_alpm_aux_wake_supported and intel_alpm_aux_less_wake_supported as non-static. Use them in intel_psr.c instead of local variables. Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_alpm.c | 4 ++-- drivers/gpu/drm/i915/display/intel_alpm.h | 2 ++ drivers/gpu/drm/i915/display/intel_psr.c | 14 ++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c index 18c1c5803670..90072f6e3a33 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.c +++ b/drivers/gpu/drm/i915/display/intel_alpm.c @@ -11,12 +11,12 @@ #include "intel_dp_aux.h" #include "intel_psr_regs.h" -static bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp) +bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp) { return intel_dp->alpm_dpcd & DP_ALPM_CAP; } -static bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp) +bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp) { return intel_dp->alpm_dpcd & DP_ALPM_AUX_LESS_CAP; } diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h index c82ecc7b4001..d4fb60393c91 100644 --- a/drivers/gpu/drm/i915/display/intel_alpm.h +++ b/drivers/gpu/drm/i915/display/intel_alpm.h @@ -22,4 +22,6 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, void intel_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_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); #endif diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 3cc38ba2f954..a3ad4488fcee 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -446,16 +446,6 @@ void intel_psr_irq_handler(struct intel_dp *intel_dp, u32 psr_iir) } } -static bool intel_dp_get_alpm_status(struct intel_dp *intel_dp) -{ - u8 alpm_caps = 0; - - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_RECEIVER_ALPM_CAP, - &alpm_caps) != 1) - return false; - return alpm_caps & DP_ALPM_CAP; -} - static u8 intel_dp_get_sink_sync_latency(struct intel_dp *intel_dp) { struct drm_i915_private *i915 = dp_to_i915(intel_dp); @@ -600,7 +590,6 @@ static void _psr_init_dpcd(struct intel_dp *intel_dp) intel_dp->psr_dpcd[0] >= DP_PSR2_WITH_Y_COORD_IS_SUPPORTED) { bool y_req = intel_dp->psr_dpcd[1] & DP_PSR2_SU_Y_COORDINATE_REQUIRED; - bool alpm = intel_dp_get_alpm_status(intel_dp); /* * All panels that supports PSR version 03h (PSR2 + @@ -613,7 +602,8 @@ static void _psr_init_dpcd(struct intel_dp *intel_dp) * Y-coordinate requirement panels we would need to enable * GTC first. */ - intel_dp->psr.sink_psr2_support = y_req && alpm; + intel_dp->psr.sink_psr2_support = y_req && + intel_alpm_aux_wake_supported(intel_dp); drm_dbg_kms(&i915->drm, "PSR2 %ssupported\n", intel_dp->psr.sink_psr2_support ? "" : "not "); } From patchwork Fri Jun 7 13:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690005 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 C710DC27C53 for ; Fri, 7 Jun 2024 13:49:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22DF810EC62; Fri, 7 Jun 2024 13:49:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Kw+RO4Ym"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CF2510EC62 for ; Fri, 7 Jun 2024 13:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768183; x=1749304183; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Imlm3Aie+ImScS62pEktIy4LA+OuLj2HGOmJnZ2T2GI=; b=Kw+RO4YmsXCiEJorEFJanmr8t8V//f1ZQqiwVJ+hDb1FxTvZHRWD4mvK XUlA5Vyk//2mhYUCCqtVjWDa7/8QNVnQ6Snr6SvY8rukuABpVhDQr5NMD uKgRHjaxmyWGf48EkQl6Zz+qlpjmnLACgPUxqzGnJESx0meUyQDJq7pl/ lC5fujQAI7n6WiL5BqDldcXmt/8ZjEAEsMI1VE82xWIw+VZhq/hhU4Prr kuPAVSnCqfO1AgFeEceaQZU4oh8Q+3KLf7VMi6Rm1EKGPWP3IQ3WpM2ft 3D2FFbvOJb/Yx/gmNqYPcfiVAfHcI3oOoWWd/3cgj5RJDz7wwG0AnyAnT Q==; X-CSE-ConnectionGUID: kPo05jMNS6mBlgbAgEB+Nw== X-CSE-MsgGUID: fPwUPfSAS26tcwG5Pj3EFQ== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331658" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331658" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:43 -0700 X-CSE-ConnectionGUID: 2u2f/gIpSlezU+KdUB1G6w== X-CSE-MsgGUID: aSzfY6NCTYmBop4b8SnI6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43458994" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:41 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 08/13] drm/i915/psr: Add Panel Replay support to intel_psr2_config_et_valid Date: Fri, 7 Jun 2024 16:49:12 +0300 Message-Id: <20240607134917.1327574-9-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Early Transport is possible and in our HW mandatory on eDP Panel Replay. Add parameter to intel_psr2_config_et_valid to differentiate validity check for Panel Replay. v2: fix intel_dp->psr_dpcd[0] check Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_psr.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index a3ad4488fcee..95281c2d401c 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -664,16 +664,17 @@ static void hsw_psr_setup_aux(struct intel_dp *intel_dp) aux_ctl); } -static bool psr2_su_region_et_valid(struct intel_dp *intel_dp) +static bool psr2_su_region_et_valid(struct intel_dp *intel_dp, bool panel_replay) { struct drm_i915_private *i915 = dp_to_i915(intel_dp); - if (DISPLAY_VER(i915) >= 20 && - intel_dp->psr_dpcd[0] == DP_PSR2_WITH_Y_COORD_ET_SUPPORTED && - !(intel_dp->psr.debug & I915_PSR_DEBUG_SU_REGION_ET_DISABLE)) - return true; + if (DISPLAY_VER(i915) < 20 || !intel_dp_is_edp(intel_dp) || + intel_dp->psr.debug & I915_PSR_DEBUG_SU_REGION_ET_DISABLE) + return false; - return false; + return panel_replay ? + intel_dp->pr_dpcd & DP_PANEL_REPLAY_EARLY_TRANSPORT_SUPPORT : + intel_dp->psr_dpcd[0] == DP_PSR2_WITH_Y_COORD_ET_SUPPORTED; } static void _panel_replay_enable_sink(struct intel_dp *intel_dp, @@ -1351,7 +1352,7 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, tgl_dc3co_exitline_compute_config(intel_dp, crtc_state); - if (psr2_su_region_et_valid(intel_dp)) + if (psr2_su_region_et_valid(intel_dp, crtc_state->has_panel_replay)) crtc_state->enable_psr2_su_region_et = true; return true; From patchwork Fri Jun 7 13:49:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690007 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 8578CC27C6F for ; Fri, 7 Jun 2024 13:49:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E30E210EC67; Fri, 7 Jun 2024 13:49:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="IGTZ67jt"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E31D10EC67 for ; Fri, 7 Jun 2024 13:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768185; x=1749304185; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DJPxXBReG9FM9/4SmE99QcVQstOFoSnnRvxQTWT9IbE=; b=IGTZ67jt080Ey8iQ9yyX5pMLvYkuw6Tguf7FQ00kzS9AGUbLjB5cB1Sk p6SsSJrMTn4a6dNfDyTnV0bN2MLXq63G0oNxeWMhEqHVtFs2KBr2QIJlP XzQ353ymCUrKaByP6I0BKYlb1Iw7mMTuRUaK/OSwurhxOwI0ZHrc1UMlD q7QtXryWsUajiLAPDV0RU5mpB3duHn4LU2F525LWoOgvw4uO2HhHgITmR sumfs4dCF+NI70ySG3z/3Cmi8zcDGRZ9dvSrOB+oq7WwoUSfNI14F7v2m b62mP6ppqEeQY4B8sGQZdqjQ74BBK/jHRopdlbG6pYvnDg6uOxZWyEMyR g==; X-CSE-ConnectionGUID: KfMh0m49RkKFMGYSFMRPFg== X-CSE-MsgGUID: Ox9Pq93NSsOyUC8uJ1dx6Q== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331661" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331661" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:45 -0700 X-CSE-ConnectionGUID: z9iMbqW3TYaByCtJ/6b0jw== X-CSE-MsgGUID: LKcMUm6PTZWZ906cIUEKWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43459004" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:43 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 09/13] drm/i915/psr: Print Panel Replay status instead of frame lock status Date: Fri, 7 Jun 2024 16:49:13 +0300 Message-Id: <20240607134917.1327574-10-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Currently Panel Replay status printout is printing frame lock status. It should print Panel Replay status instead. Panel Replay status register field follows PSR status register field. Use existing PSR code for that. Fixes: ef75c25e8fed ("drm/i915/panelreplay: Debugfs support for panel replay") Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_psr.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 95281c2d401c..a292c6c5de30 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -3579,16 +3579,9 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data) "reserved", "sink internal error", }; - static const char * const panel_replay_status[] = { - "Sink device frame is locked to the Source device", - "Sink device is coasting, using the VTotal target", - "Sink device is governing the frame rate (frame rate unlock is granted)", - "Sink device in the process of re-locking with the Source device", - }; const char *str; int ret; u8 status, error_status; - u32 idx; if (!(CAN_PSR(intel_dp) || CAN_PANEL_REPLAY(intel_dp))) { seq_puts(m, "PSR/Panel-Replay Unsupported\n"); @@ -3602,16 +3595,11 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data) if (ret) return ret; - str = "unknown"; - if (intel_dp->psr.panel_replay_enabled) { - idx = (status & DP_SINK_FRAME_LOCKED_MASK) >> DP_SINK_FRAME_LOCKED_SHIFT; - if (idx < ARRAY_SIZE(panel_replay_status)) - str = panel_replay_status[idx]; - } else if (intel_dp->psr.enabled) { - idx = status & DP_PSR_SINK_STATE_MASK; - if (idx < ARRAY_SIZE(sink_status)) - str = sink_status[idx]; - } + status &= DP_PSR_SINK_STATE_MASK; + if (status < ARRAY_SIZE(sink_status)) + str = sink_status[status]; + else + str = "unknown"; seq_printf(m, "Sink %s status: 0x%x [%s]\n", psr_mode_str(intel_dp), status, str); From patchwork Fri Jun 7 13:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690009 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 ED123C27C53 for ; Fri, 7 Jun 2024 13:49:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6158A10EC6A; Fri, 7 Jun 2024 13:49:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mYPIEroc"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id BBA2910EC61 for ; Fri, 7 Jun 2024 13:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768187; x=1749304187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oOxYXTvYLq7SA9aE7KQ+KdkrkC3FoMFjE/hBLtMlbi8=; b=mYPIErocdoO+PwBTKLuRn5BzSJsSWtA2+BLQ/OAFv3c8puqiKY/uTSU0 AGTMWjDg+70GAXaoMmEnUuny0MX6qNTBey6H3h8r/8qzl76JnnbzaCs5Z LX3C8kNX+q/zv0vSEhXPMgiXyUNAqQDzPvnOiVhWNYjSbtoEcRtc3cK4h iBzBSf0V5IRM+NSuaCcSLwaO3qBnoK1sXwdMBuPRWEHUM4WQ0XobL5fKz RIbvqLw50dzQuvYfDSQSWeO/K5VN+C+MXo6L7thVdOc7Ina23z+WbfDBr 6b9NhDbFFdMz/iLX3XIqmBjiTWSbzn/9T4wd489OtnW/Q+caIazBw4xY5 Q==; X-CSE-ConnectionGUID: 671mFLQQST6phxpsXzt7bg== X-CSE-MsgGUID: IPqLuGItSPmDFVgSzVqTZA== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331662" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331662" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:47 -0700 X-CSE-ConnectionGUID: gUaGYHqIRnWxHlldkfoK4A== X-CSE-MsgGUID: o4+l4XajScmcjBh8MDhwqg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43459016" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:45 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 10/13] drm/i915/psr: Move vblank length check to separate function Date: Fri, 7 Jun 2024 16:49:14 +0300 Message-Id: <20240607134917.1327574-11-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" We are about to add more complexity to vblank length check. It makes sense to move it to separate function for sake of clarity. v2: change name to wake_lines_fit_into_vblank Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_psr.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index a292c6c5de30..98b0018704f3 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1243,6 +1243,20 @@ static int intel_psr_entry_setup_frames(struct intel_dp *intel_dp, return entry_setup_frames; } +static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state) +{ + int vblank = crtc_state->hw.adjusted_mode.crtc_vblank_end - + crtc_state->hw.adjusted_mode.crtc_vblank_start; + int wake_lines = psr2_block_count_lines(intel_dp); + + /* Vblank >= PSR2_CTL Block Count Number maximum line count */ + if (vblank < wake_lines) + return false; + + return true; +} + static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state) { @@ -1333,9 +1347,7 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, } /* Vblank >= PSR2_CTL Block Count Number maximum line count */ - if (crtc_state->hw.adjusted_mode.crtc_vblank_end - - crtc_state->hw.adjusted_mode.crtc_vblank_start < - psr2_block_count_lines(intel_dp)) { + if (!wake_lines_fit_into_vblank(intel_dp, crtc_state)) { drm_dbg_kms(&dev_priv->drm, "PSR2 not enabled, too short vblank time\n"); return false; From patchwork Fri Jun 7 13:49:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690008 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 05AC5C27C5F for ; Fri, 7 Jun 2024 13:49:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82FF810EC61; Fri, 7 Jun 2024 13:49:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="A5wtcAqI"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8083010EC71 for ; Fri, 7 Jun 2024 13:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768189; x=1749304189; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oD0GZaWPp6MU7iYaYLjkrJUMzK/hVhJelVqqMsbnXVM=; b=A5wtcAqIR6ViNlL+JDEUr7PHtYycWnzf51NNsZl3HaG88RxF1Lm9M5vP Uwr7P3vgOU6Vodq2r97WYeumsZvYvdvO82RTas0KIOB5HMF5ocmEy4I99 jrWVknVVMP/dW+kOOh3ODYef9yA/ym2OvovjYR6ykQOKA4QMaeWLFhmGv t30KHuRVGNEGr2heMMitGFm5luSxQ1Ub8r6qPRP1jfbn8QXSu9KpN2TaF f6BRw0xMRDMxCCua2GQM37GhcjXJLdkRDCkYdY9WR2+HLIZ4uBahAd6rr tWAFcZzuXF5t7DwnOnG+jThFpDNr669Q3o7rtfmt+qKUcvn3GTo7A2MGq Q==; X-CSE-ConnectionGUID: amKYRmA9TjaPt4gb5E6CYA== X-CSE-MsgGUID: 1RivfOkpSiO/q2qOEdmtDQ== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331663" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331663" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:49 -0700 X-CSE-ConnectionGUID: mUirWE4oSg6thsrQiapKrw== X-CSE-MsgGUID: V7AVdWhURDuNJ0OXaVOqZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43459026" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:47 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 11/13] drm/i915/psr: Take into account SU SDP scanline indication in vblank check Date: Fri, 7 Jun 2024 16:49:15 +0300 Message-Id: <20240607134917.1327574-12-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" SU SDP scanline indication should be taken into account when checking vblank length. In Bspec we have: PSR2_CTL[ SU SDP scanline indication ] = 0: (TRANS_VBLANK Vertical Blank End- TRANS_VBLANK Vertical Blank Start) > PSR2_CTL Block Count Number value in lines PSR2_CTL[ SU SDP scanline indication ] = 1: (TRANS_VBLANK Vertical Blank End- TRANS_VBLANK Vertical Blank Start- 1) > PSR2_CTL Block Count Number value in lines Bspec: 49274 Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_psr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 98b0018704f3..8ff0729df6a2 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1250,6 +1250,9 @@ static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp, crtc_state->hw.adjusted_mode.crtc_vblank_start; int wake_lines = psr2_block_count_lines(intel_dp); + if (crtc_state->req_psr2_sdp_prior_scanline) + vblank -= 1; + /* Vblank >= PSR2_CTL Block Count Number maximum line count */ if (vblank < wake_lines) return false; From patchwork Fri Jun 7 13:49:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690011 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 1C47FC27C5F for ; Fri, 7 Jun 2024 13:49:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7784310EC6D; Fri, 7 Jun 2024 13:49:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="D+zdrqLe"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41E8410EC68 for ; Fri, 7 Jun 2024 13:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768190; x=1749304190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7K8GFAx61x2RZbCsDB1JaNQVQNoZxjGyYgIsqkaDWr8=; b=D+zdrqLeltKMtLHwVp1wel3apabWr1FW/91TZBbvMpL2Kogz5q1belfP Z59o/EgQvd9/ifW/Lw9ZFHmA4AXQBDVsrX6uIqXTWu45JMrJsHX+m8USZ OMHKq+Km4HAW37gV/T4t642WWIG173J3/hekNDVQPibGUG+Z4+1rPi42Y DEcVqpqZPZYrU59f10YwWX7vVszeb2l6LiIHHYSeLAxyr9Thm9sLF+HVt foo9CjusbMqe/szeaXOEPdrGOQTm6uEnuT8xpcWgvQ3jeNkaxWfKDTsjt XLLMbs7W3UKtyJ028pFvnGxY+0dtIvbFzexYLc1WL64NGinQCOl8ClUSR g==; X-CSE-ConnectionGUID: 7h5s3GZVR9y+4ZEjhyYW3w== X-CSE-MsgGUID: YG4J4OSLRUesPrglOynr5w== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331665" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331665" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:50 -0700 X-CSE-ConnectionGUID: I5zx2oraTHO5HtAlbghCXA== X-CSE-MsgGUID: tI2or0DmQsCG1TBrUepBjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43459042" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:48 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 12/13] drm/i915/psr: Check vblank against IO buffer wake time on Lunarlake Date: Fri, 7 Jun 2024 16:49:16 +0300 Message-Id: <20240607134917.1327574-13-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" As Lunarlake doesn't have block count configuration vblank should be checked against IO buffer wake time. Bspec: 68920 Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_psr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 8ff0729df6a2..a7d030ffc4e0 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1246,9 +1246,13 @@ static int intel_psr_entry_setup_frames(struct intel_dp *intel_dp, static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { + struct drm_i915_private *i915 = dp_to_i915(intel_dp); int vblank = crtc_state->hw.adjusted_mode.crtc_vblank_end - crtc_state->hw.adjusted_mode.crtc_vblank_start; - int wake_lines = psr2_block_count_lines(intel_dp); + int wake_lines; + + wake_lines = DISPLAY_VER(i915) < 20 ? psr2_block_count_lines(intel_dp) : + intel_dp->alpm_parameters.io_wake_lines; if (crtc_state->req_psr2_sdp_prior_scanline) vblank -= 1; From patchwork Fri Jun 7 13:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13690010 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 AAE54C27C53 for ; Fri, 7 Jun 2024 13:49:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23C1410EC6B; Fri, 7 Jun 2024 13:49:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VyXDplGa"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07D1510EC6B for ; Fri, 7 Jun 2024 13:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717768192; x=1749304192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zYWYFdFf0roIW2gFCYsGABgv6sJr4EifPxBE7fr5fLk=; b=VyXDplGaE7MPZHsQ6FoFfctXm8w4ILERqLIzhVIMgU5Rn8ty/xjnZchO 8w+iYpUIy6qqt3tszFmrwkqHjlwiNn6IkEVPEVqja1rl72Y2bJ4y50VHd K2mR2xDNISPQOfD9uYBYtPUb3deiKg35NFkeHXX1bz9O6nWTt+TIs1xJQ YRUi22aW86Gy2fd1kGMgmqG1kxv+XuKUw7R6Zuv74axAz3cmdKu7W0Xqv Q2WUBjTfCNDbMWK1DuSn8Pvvd6bfz1OEIOlZO/UAUaOIIJ1ErGfR6iUbx 6/xJ/1vFUcot+F9SmUQ0FMul+WnleSkb3hrkEmnOSlg5nlDY+Z8NHmwdS g==; X-CSE-ConnectionGUID: +daUsNVnRxKgXEBIORiRbA== X-CSE-MsgGUID: lejCcL/QTBKo98PvQPKtIA== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14331666" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14331666" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:52 -0700 X-CSE-ConnectionGUID: PYqxLkDJR1WzRTpL0PGxHw== X-CSE-MsgGUID: 9Zb26/TaRW+rPDjlBwQATQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43459057" Received: from lhorenst-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.251.213.83]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 06:49:50 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Cc: animesh.manna@intel.com, mika.kahola@intel.com, =?utf-8?q?Jouni_H=C3=B6g?= =?utf-8?q?ander?= Subject: [PATCH 13/13] drm/i915/psr: Wake time is aux less wake time for Panel Replay Date: Fri, 7 Jun 2024 16:49:17 +0300 Message-Id: <20240607134917.1327574-14-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607134917.1327574-1-jouni.hogander@intel.com> References: <20240607134917.1327574-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" When checking vblank length used wake time is aux less wake time for eDP Panel Replay (vblank length is not checked for DP2.0 Panel Replay). Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_psr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index a7d030ffc4e0..043ab3ec5201 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1251,8 +1251,12 @@ static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp, crtc_state->hw.adjusted_mode.crtc_vblank_start; int wake_lines; - wake_lines = DISPLAY_VER(i915) < 20 ? psr2_block_count_lines(intel_dp) : - intel_dp->alpm_parameters.io_wake_lines; + if (crtc_state->has_panel_replay) + wake_lines = intel_dp->alpm_parameters.aux_less_wake_lines; + else + wake_lines = DISPLAY_VER(i915) < 20 ? + psr2_block_count_lines(intel_dp) : + intel_dp->alpm_parameters.io_wake_lines; if (crtc_state->req_psr2_sdp_prior_scanline) vblank -= 1;