From patchwork Mon Jul 22 08:26:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738535 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 C3245C3DA63 for ; Mon, 22 Jul 2024 08:26:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2166A10E408; Mon, 22 Jul 2024 08:26:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="jq6yhuOF"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id D136910E405 for ; Mon, 22 Jul 2024 08:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636764; x=1753172764; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V2hoTn3OkPXKShTV9FOTa07TSoo/nTt3TxGh/Sf3a28=; b=jq6yhuOFencdS4obyPxiuEykNFAMbhPz+boUFvNuP91K4ZCKg8L1H5EU yTdF+B6VcHeHEnY4c6n3IuBTjXthEgCfLEcx9HHhEYp5ICvqmBB4ACtKn bWZZcl9OwsOwCNfaxSZXFZuLYVbbH4pJRMkX/8qfLlLC0o9dT/6j3Mu0X bleP8otMicrA8f5zh/2oD/U/0WrZe903N/NlDPXL3xlifjYOSryeWyOh4 oN5ZAbovIq8Fo06R7utsIMSr9GB7DZ5+w7xd3iQFuqmJomJOy6xs2e6Vk URWNNZES60TFsP4RtopeJiUImn1SHv4THWNh4JzxDiqhSsvb/fGT/wGt1 A==; X-CSE-ConnectionGUID: anJt89ycTbWgfyKwegDaWw== X-CSE-MsgGUID: wCSFVgdGQpmML50BqcZe3g== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806924" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806924" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:04 -0700 X-CSE-ConnectionGUID: lsOlHpgYQSKI0F34dP2MXw== X-CSE-MsgGUID: IEG5c7ztRsOk02JnjJGA/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752876" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:02 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 01/10] drm/i915/dp: fix the Adaptive sync Operation mode for SDP Date: Mon, 22 Jul 2024 13:56:56 +0530 Message-ID: <20240722082705.3635041-2-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" Currently we support Adaptive sync operation mode with dynamic frame rate, but instead the operation mode with fixed rate is set. This was initially set correctly in the earlier version of changes but later got changed, while defining a macro for the same. Fixes: a5bd5991cb8a ("drm/i915/display: Compute AS SDP parameters") Cc: Mitul Golani Cc: Ankit Nautiyal Cc: Jani Nikula Reviewed-by: Mitul Golani Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index d4b1b18453dc..59fc72b533de 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2622,7 +2622,6 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp, crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC); - /* Currently only DP_AS_SDP_AVT_FIXED_VTOTAL mode supported */ as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC; as_sdp->length = 0x9; as_sdp->duration_incr_ms = 0; @@ -2634,7 +2633,7 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp, as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode); as_sdp->target_rr_divider = true; } else { - as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL; + as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL; as_sdp->vtotal = adjusted_mode->vtotal; as_sdp->target_rr = 0; } From patchwork Mon Jul 22 08:26:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738537 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 71AC0C3DA5D for ; Mon, 22 Jul 2024 08:26:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D04AD10E40B; Mon, 22 Jul 2024 08:26:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Q47Hjusz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE3E010E407 for ; Mon, 22 Jul 2024 08:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636766; x=1753172766; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0HlWX1n165B++Cst2oPrCHg/9cb/97qa8DXda+8pv28=; b=Q47Hjusz6rF3N+qcKBPde+vi8zPjmMsm943iLwEUZ2iqcDlZiUvTOhdY GMm6iEiXPXcl0i/0X1DnfUreo/z4bVrlVIEttm/YnIT+B42/Tc6jEjFm9 1cGCEtdqtfOcBKjokDZKMHckdfP19i3cF2Db9h+VOamJ++mRF4Wv21w56 BTxRlwafjP1g93eBqPX9stDmhYXraLS49/1AJucM9nlhqK1hgr1VZ5lno dAPltwL7mdqgUdqvzhEoBqZpU578DYsTKvwQ0eObmDy3VFwcMrGKeBJ1O KH7LoSsjT5Cgi29GwBboD/GKOsMjV/RK/xu6Tl6/hceXWdRxqkzok/xHX g==; X-CSE-ConnectionGUID: ofeuvJzaTqSR62onTJssjg== X-CSE-MsgGUID: zsS1Xzd7TF6tnQkFw4EpNg== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806927" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806927" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:06 -0700 X-CSE-ConnectionGUID: oXGvt6DtSOqYIyaJ2IrvIg== X-CSE-MsgGUID: FK+tF+IkRD+e1a6Vs5rg+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752881" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:04 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 02/10] drm/i915/display: Add member fixed_rr to denote Fixed refresh rate with VRRTG Date: Mon, 22 Jul 2024 13:56:57 +0530 Message-ID: <20240722082705.3635041-3-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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 fixed_rr member to struct vrr to represent the case where a fixed refresh rate with VRR timing generator is required. v2: Move get_config change where vrr.fixed is actually set. (Mitul) Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_display.c | 4 +++- drivers/gpu/drm/i915/display/intel_display_types.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 01a5faa3fea5..ecfd77c0b741 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -1004,7 +1004,8 @@ static bool vrr_params_changed(const struct intel_crtc_state *old_crtc_state, old_crtc_state->vrr.vmin != new_crtc_state->vrr.vmin || old_crtc_state->vrr.vmax != new_crtc_state->vrr.vmax || old_crtc_state->vrr.guardband != new_crtc_state->vrr.guardband || - old_crtc_state->vrr.pipeline_full != new_crtc_state->vrr.pipeline_full; + old_crtc_state->vrr.pipeline_full != new_crtc_state->vrr.pipeline_full || + old_crtc_state->vrr.fixed_rr != new_crtc_state->vrr.fixed_rr; } static bool cmrr_params_changed(const struct intel_crtc_state *old_crtc_state, @@ -5479,6 +5480,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, if (!fastset) { PIPE_CONF_CHECK_BOOL(vrr.enable); + PIPE_CONF_CHECK_BOOL(vrr.fixed_rr); PIPE_CONF_CHECK_I(vrr.vmin); PIPE_CONF_CHECK_I(vrr.vmax); PIPE_CONF_CHECK_I(vrr.flipline); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index a9d2acdc51a4..4c0a18143c23 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1407,7 +1407,7 @@ struct intel_crtc_state { /* Variable Refresh Rate state */ struct { - bool enable, in_range; + bool enable, in_range, fixed_rr; u8 pipeline_full; u16 flipline, vmin, vmax, guardband; u32 vsync_end, vsync_start; From patchwork Mon Jul 22 08:26:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738538 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 881C9C3DA63 for ; Mon, 22 Jul 2024 08:26:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC68B10E40C; Mon, 22 Jul 2024 08:26:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="egS8/Fhv"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1B8810E407 for ; Mon, 22 Jul 2024 08:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636768; x=1753172768; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=96XA+DRg+SSThbpKpA1dJqjJlDkV968mycg+zkjWMZY=; b=egS8/FhvhQuHE2QW/Hl0h0mg8aBFv9LZFoBKJUTlGT3Gin4mKZDi2lo2 oi9Q3bfppH852E1bn3aDYNwzXrm9Rwp2qgZQIaeYKi53iZastoQ+5fnVW I71Nu1Ao6TxJ3y+5roqFjju8xCOpp/1YXvAIGYf+c/FJ4gcb80/7dXvMm ckopnaB6Isbn8y7rCj0k/d/E09sv170L+StxvY/2sDEfqPWltl5rH7azx aNbSkTxKHo2XkE6nrg6zZUxReNA3kBGn/5H7sS4CUPgPFhYYY4ejvA5IE fmJbFCIR040Vuek0QjmVD6Ka0EKDx8mqhPhvJ3pWWzHJdNN1u+0afI69w A==; X-CSE-ConnectionGUID: KG9HHBzsS66aHLPPpu6A9A== X-CSE-MsgGUID: fAMBX2eeRzGKq2tDXxHLYA== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806931" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806931" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:08 -0700 X-CSE-ConnectionGUID: 6ZnT0dB7TEaMdF9J6w4kiA== X-CSE-MsgGUID: LG5A/K3IRIiZ0Ik4cS2dmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752890" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:05 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 03/10] drm/i915/dp: Set FAVT mode in DP SDP with fixed refresh rate Date: Mon, 22 Jul 2024 13:56:58 +0530 Message-ID: <20240722082705.3635041-4-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" While running with fixed refresh rate and VRR timing generator set FAVT mode (Fixed Vtotal) in DP Adaptive Sync SDP to intimate the panel about Fixed refresh rate. Signed-off-by: Ankit Nautiyal Reviewed-by: Mitul Golani --- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 59fc72b533de..9c632f569f62 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2633,6 +2633,10 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp, as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode); as_sdp->target_rr_divider = true; } else { + if (crtc_state->vrr.fixed_rr) + as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL; + else + as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL; as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL; as_sdp->vtotal = adjusted_mode->vtotal; as_sdp->target_rr = 0; From patchwork Mon Jul 22 08:26:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738539 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 0DC9BC3DA5D for ; Mon, 22 Jul 2024 08:26:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFFD210E410; Mon, 22 Jul 2024 08:26:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="LS60c2v4"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEDFC10E40F for ; Mon, 22 Jul 2024 08:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636770; x=1753172770; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wz1Suvt6U5UlydbtyzxfM1hUp2uSzXgSBvucOp3qjBw=; b=LS60c2v4UCL197dYTx6TQT25OSUSv1FNA4NOlOsBjSwL+rk8QnTU2RJQ iqklscahX6YG41hnhk9P8CCQFIsoDQu3f9HpuoXZ0xU5qR9iKSbkemPti Qv4k1ajhns30fWz0PuiyFr6rC1ZH52hsdPTHKDDc3YW1/TYtfaj6kDCz7 YmIDdvBDTxGaCBhv4rkw8NQa8Y0vsYIUOYL7KQBFkRPEMRAnvhAfC1KAO CTJGWWDSc82J4kFp2TaeBj/BGmfvazOqND04kKtzqckTR5YTZ0VllEjh6 pXPCCzkvgyVjBGWvZWPRPiCxJCrA44ekf73G40AEGVVmmN4CueQqWIdRQ Q==; X-CSE-ConnectionGUID: 1GhjjBHQTTS8b0aCwKPsfA== X-CSE-MsgGUID: oK/obCrCTISfehNU/SH1rQ== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806936" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806936" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:10 -0700 X-CSE-ConnectionGUID: tSkv3DvmRAGtDl1MB68XGg== X-CSE-MsgGUID: dYXnOmwvT7+XIRBuu3t5Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752897" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:07 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 04/10] drm/i915/vrr: Compute vrr vsync if platforms support it Date: Mon, 22 Jul 2024 13:56:59 +0530 Message-ID: <20240722082705.3635041-5-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" Previously, TRANS_VRR_VSYNC was exclusively used for panels with adaptive-sync SDP support in VRR scenarios. However, to drive fixed refresh rates using the VRR Timing generator, we now need to program TRANS_VRR_VSYNC regardless of adaptive sync SDP support. Therefore, let's remove the adaptive sync SDP check and program TRANS_VRR_VSYNC for platforms where VRR timing generator is used. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_vrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index 7e1d9c718214..5a80a8eae087 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -233,7 +233,7 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, crtc_state->mode_flags |= I915_MODE_FLAG_VRR; } - if (intel_dp->as_sdp_supported && crtc_state->vrr.enable) { + if (HAS_AS_SDP(i915) && crtc_state->vrr.enable) { crtc_state->vrr.vsync_start = (crtc_state->hw.adjusted_mode.crtc_vtotal - crtc_state->hw.adjusted_mode.vsync_start); From patchwork Mon Jul 22 08:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738540 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 6A84DC3DA59 for ; Mon, 22 Jul 2024 08:26:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EEBC310E407; Mon, 22 Jul 2024 08:26:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZHDwcwJR"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74CD010E40A for ; Mon, 22 Jul 2024 08:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636772; x=1753172772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xwZC+8BQx0Ju6kd3npKEUkokpAlKZZoB5HJtWHe8kFc=; b=ZHDwcwJRjKAxGKFEWDp8x8YYLuiT8t50hXOCzLahcKci+WCjwPenBGuW Tbi5h9feefQRCfiWHD37w7xvQs/cw5Q+En1bb5K3B4uUQZsd+HQ8oVWlt Otfg7067aZyeqsGSlCDs/l0LYIejzHCzazw5zxKkH3sQO3xEaUnnAJQuE 0loPHMut9UakgoX/O3uUaf2mVtH3wvxptCP63Mgl31L+RlybNZWmX+FcC xlw9cH8L9A7beMQvq7i94JPtBXudLRISLAIpH4vEJQQe4xJM+Vm5Gs148 lqxs9NrL52QzcF94cY0JZAmUEJBWKjk87QKg5BWCF3zf7x9xR1kVxqCJI A==; X-CSE-ConnectionGUID: 6pfQHhmZSa2p5St+zALLxQ== X-CSE-MsgGUID: /Uf2wMUGSreUBvy0ycuWQw== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806940" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806940" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:11 -0700 X-CSE-ConnectionGUID: CMjzWDZ1TGGXtpMWRf+8Cw== X-CSE-MsgGUID: QueJC7mZQ46FFaKV8WDfXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752906" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:09 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 05/10] drm/i915/hdmi: Use VRR Timing generator for HDMI Date: Mon, 22 Jul 2024 13:57:00 +0530 Message-ID: <20240722082705.3635041-6-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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 support for using VRR Timing generator for HDMI panels. Signed-off-by: Ankit Nautiyal Reviewed-by: Mitul Golani --- drivers/gpu/drm/i915/display/intel_hdmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 19498ee455fa..c8442772bacf 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -59,6 +59,7 @@ #include "intel_lspcon.h" #include "intel_panel.h" #include "intel_snps_phy.h" +#include "intel_vrr.h" inline struct drm_i915_private *intel_hdmi_to_i915(struct intel_hdmi *intel_hdmi) { @@ -2366,6 +2367,8 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder, } } + intel_vrr_compute_config(pipe_config, conn_state); + intel_hdmi_compute_gcp_infoframe(encoder, pipe_config, conn_state); From patchwork Mon Jul 22 08:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738545 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 23625C3DA5D for ; Mon, 22 Jul 2024 08:26:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6E7410E414; Mon, 22 Jul 2024 08:26:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="maI3WqJa"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 602D610E411 for ; Mon, 22 Jul 2024 08:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636773; x=1753172773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2u6rjuClwUjethBj4zM/vZK0aYf4TDfZHZLFrN8ua8o=; b=maI3WqJac9C47mYFiF3BnrZndysLBk3A//j6QyONV9p3QgLA1SrSaFZY IytYt1bkkInlqzr4Jm9UmvI2erSdKuTf09Gfz0aPxsj6s+dRwuIEI+b3/ XNL593PCHOfv+rsj4iPQhl3AssSj2I7zX9hB0f79r4aO7sECYJJHcJaco 6WL0ZPcQxS83cuU52rlzupe45lq9v48MOPmGoIPZLLqrmjWkwpMKLx4Y9 B2sUfPB+dpeseL/YrEZte2tb4mS7DVQynN77GIpZz3ReMUccNY4WeBLZ3 AVIVnUVrzQPFtpj90Omd2G5YU6/7f/ylV8lY6Df1mM3K115g25Mxfrwk3 g==; X-CSE-ConnectionGUID: GXPOtCjVRviW8CijOUfVug== X-CSE-MsgGUID: z8fm1j0AQjui5tzVH0OC4Q== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806944" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806944" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:13 -0700 X-CSE-ConnectionGUID: 1wI0O6bgTjGRP+A5rAbzkw== X-CSE-MsgGUID: FJF8Q5TiS/aAduz6Hm918A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752916" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:11 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 06/10] drm/i915/display: Disable PSR before disabling VRR Date: Mon, 22 Jul 2024 13:57:01 +0530 Message-ID: <20240722082705.3635041-7-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" As per bspec 49268: Disable PSR before disabling VRR. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index ecfd77c0b741..95fe58613bf6 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -1192,6 +1192,8 @@ static void intel_pre_plane_update(struct intel_atomic_state *state, intel_atomic_get_new_crtc_state(state, crtc); enum pipe pipe = crtc->pipe; + intel_psr_pre_plane_update(state, crtc); + if (intel_crtc_vrr_disabling(state, crtc)) { intel_vrr_disable(old_crtc_state); intel_crtc_update_active_timings(old_crtc_state, false); @@ -1202,8 +1204,6 @@ static void intel_pre_plane_update(struct intel_atomic_state *state, intel_drrs_deactivate(old_crtc_state); - intel_psr_pre_plane_update(state, crtc); - if (hsw_ips_pre_update(state, crtc)) intel_crtc_wait_for_next_vblank(crtc); From patchwork Mon Jul 22 08:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738544 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 EC789C3DA59 for ; Mon, 22 Jul 2024 08:26:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8075710E413; Mon, 22 Jul 2024 08:26:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EE00nqtx"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id A027410E40A for ; Mon, 22 Jul 2024 08:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636776; x=1753172776; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BIqnBqC6sW295DggbwjkX9RUJKx0A6yFAo/utKx2Vws=; b=EE00nqtxu5vERuo0Vha4e10wyN5UZsBYZJeDvzwDCb4gk69nyfdNFghb Qa4ogs/hIuL7lG4D0bIpF40nmNrXZFMzUUrFi7gxv+iJZ0oYW9iIhDDe+ eSKhOmxClM7VelE00PAm0hg6/uJkPh5SIWE8eOxAXM7hAFYf9ndRLuspd 1EtrDtzKjdyl/JSfsOcgcFax7j0O7s0tbmwoLWXyfspFL1JvWpThmyalG 6eaYzbHqcUE0WpgnTVI5VTISOLuDG1RMtdC2OMaxMGMjjF925YJDzJ88H 8gA9tCXh8tJWpzchbOLfmc0N1WnJSdVTUbwwfy0obnQcvRhsMy0QlNWUi w==; X-CSE-ConnectionGUID: m7MO+lPeRoacbYE5kKxTzA== X-CSE-MsgGUID: oX2Q7dCPSxWzA4CKPy4NIA== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806950" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806950" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:15 -0700 X-CSE-ConnectionGUID: uhUOCiliTuqtQa7XanUBaA== X-CSE-MsgGUID: MmzN3NIFQhCFlD8P8+BPgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752924" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:13 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 07/10] drm/i915/psr: Allow PSR for fixed refrsh rate with VRR TG Date: Mon, 22 Jul 2024 13:57:02 +0530 Message-ID: <20240722082705.3635041-8-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" At the moment PSR/PSR2 are not supported with variable refresh rate. However it can be supported with fixed refresh rate while running with VRR timing generator. Enable PSR for fixed refresh rate when using the VRR timing generator. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 9cb1cdaaeefa..5a228d8e93b5 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1523,7 +1523,7 @@ static bool _psr_compute_config(struct intel_dp *intel_dp, * Current PSR panels don't work reliably with VRR enabled * So if VRR is enabled, do not enable PSR. */ - if (crtc_state->vrr.enable) + if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr) return false; if (!CAN_PSR(intel_dp)) From patchwork Mon Jul 22 08:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738542 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 80621C3DA63 for ; Mon, 22 Jul 2024 08:26:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02F2C10E411; Mon, 22 Jul 2024 08:26:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="fY77xZbU"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 765D410E413 for ; Mon, 22 Jul 2024 08:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636778; x=1753172778; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xm4EEx0wY+arIdJH8Jsk7QtHV3nrsx5Hc12XAcDz6E4=; b=fY77xZbUv6zhb2yORW01N5zraqzVYkgIbFeDBgYCtrycrxfZOmKUUccs 5kFGsAZs+4Vi/qh2NPszXPcJJYdoHfXoktN/CDLfDlN0a1DIfVjn5PecR EIkPYtLM6iwvRAA14N33rBVZR6uo04U04+avPxyBRWn8G3fV5J5bMfXh0 HuDqzIXLla1tfe/dRHLe+qPEREQHo4/qGUB5NcdV5ZOjbjaBYOMkd00Kv JjJyq12MDrb2J+tDepmqC2wm1aMIG5FKC4k0PLkBcOsZmXMljKg3r1lkX jtphcc7Gcdemb9hRH1dvp47eudt1WoQQIydEDjoFd8BalSApILN2HK9EZ w==; X-CSE-ConnectionGUID: pY+e9GW/RludmAiGpF6N6Q== X-CSE-MsgGUID: uVzMeKXyRmqlynFBRR6uPw== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806951" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806951" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:17 -0700 X-CSE-ConnectionGUID: 2bXz30n+QxGH+Req1lO/Jw== X-CSE-MsgGUID: iRk1GU+MTqGzgSYpdV2zQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752930" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:15 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 08/10] drm/i915/vrr: Avoid sending PUSH when VRR TG is used with Fixed refresh rate Date: Mon, 22 Jul 2024 13:57:03 +0530 Message-ID: <20240722082705.3635041-9-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" As per Bspec:68925: Push enable must be set if not configuring for a fixed refresh rate (i.e Vmin == Flipline == Vmax is not true). Signed-off-by: Ankit Nautiyal Reviewed-by: Mitul Golani --- drivers/gpu/drm/i915/display/intel_vrr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index 5a80a8eae087..e60a8833bd7b 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -316,7 +316,7 @@ void intel_vrr_send_push(const struct intel_crtc_state *crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; - if (!crtc_state->vrr.enable) + if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr) return; intel_de_write(dev_priv, TRANS_PUSH(dev_priv, cpu_transcoder), @@ -329,7 +329,7 @@ bool intel_vrr_is_push_sent(const struct intel_crtc_state *crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; - if (!crtc_state->vrr.enable) + if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr) return false; return intel_de_read(dev_priv, TRANS_PUSH(dev_priv, cpu_transcoder)) & TRANS_PUSH_SEND; @@ -343,8 +343,9 @@ void intel_vrr_enable(const struct intel_crtc_state *crtc_state) if (!crtc_state->vrr.enable) return; - intel_de_write(dev_priv, TRANS_PUSH(dev_priv, cpu_transcoder), - TRANS_PUSH_EN); + if (!crtc_state->vrr.fixed_rr) + intel_de_write(dev_priv, TRANS_PUSH(dev_priv, cpu_transcoder), + TRANS_PUSH_EN); if (HAS_AS_SDP(dev_priv)) intel_de_write(dev_priv, From patchwork Mon Jul 22 08:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738541 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 7C4E5C3DA5D for ; Mon, 22 Jul 2024 08:26:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED30B10E40A; Mon, 22 Jul 2024 08:26:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="HY4Ygqln"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38F3410E448 for ; Mon, 22 Jul 2024 08:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721636779; x=1753172779; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BFJjZEZ/r4u8ShFzdHVo04LgsUApQJD4Dm93FsK+M6w=; b=HY4YgqlnzJH2yng6tPrWoGDCkN/ZkMpsSa8dFce6yXp45wMjOYhDwaao ncYpvkVWlp1Q/sAVQAdTnbofCvNb1Y7YxkCmvDYSBktqNjp1pq+H+4571 imr2aJeVG0b0MlU4idt9v8LIZqc2STFGktCsg8F/ZGdaWJf+tSYErEfm3 udQJpX8/n4+pV8gHtyx2IwrISh7sS7LW1GzAgRZVQSWvHRFfyL6qGjT4g irxr9cnalqgqy03FRO6cdRBszklowrIC0b9IdciPAG9Hnqj1hqjIDkr+r Pm3d0rv2D9E0fIQRPoBwmdW3JsnvjTRPdfYO5UbdWKzuIvNpTydrj0DAp A==; X-CSE-ConnectionGUID: iVdzverJTJaeaWDQhXvWBw== X-CSE-MsgGUID: CBlDD8F6Q/qw7WOEs5c46w== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806953" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806953" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:19 -0700 X-CSE-ConnectionGUID: 62X5mLCIR4eSK4yUl2FlUg== X-CSE-MsgGUID: OlPEtexVSLWAGKiT/Bz0cA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752934" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:17 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 09/10] drm/i915/vrr: Handle joiner with vrr Date: Mon, 22 Jul 2024 13:57:04 +0530 Message-ID: <20240722082705.3635041-10-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" Do not program transcoder registers for VRR for the secondary pipe of the joiner. Remove check to skip VRR for joiner case. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_vrr.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index e60a8833bd7b..50ac2770a42d 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -171,13 +171,6 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, const struct drm_display_info *info = &connector->base.display_info; int vmin, vmax; - /* - * FIXME all joined pipes share the same transcoder. - * Need to account for that during VRR toggle/push/etc. - */ - if (crtc_state->joiner_pipes) - return; - if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) return; @@ -274,6 +267,9 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; + if (intel_crtc_is_joiner_secondary(crtc_state)) + return; + /* * This bit seems to have two meanings depending on the platform: * TGL: generate VRR "safe window" for DSB vblank waits @@ -316,6 +312,9 @@ void intel_vrr_send_push(const struct intel_crtc_state *crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; + if (intel_crtc_is_joiner_secondary(crtc_state)) + return; + if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr) return; @@ -340,6 +339,9 @@ void intel_vrr_enable(const struct intel_crtc_state *crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; + if (intel_crtc_is_joiner_secondary(crtc_state)) + return; + if (!crtc_state->vrr.enable) return; @@ -369,6 +371,9 @@ void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state) struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; + if (intel_crtc_is_joiner_secondary(old_crtc_state)) + return; + if (!old_crtc_state->vrr.enable) return; From patchwork Mon Jul 22 08:27:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Nautiyal X-Patchwork-Id: 13738543 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 2A47DC3DA5D for ; Mon, 22 Jul 2024 08:26:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7998810E417; Mon, 22 Jul 2024 08:26:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Rn6ZGvhi"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C97F10E411 for ; Mon, 22 Jul 2024 08:26: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=1721636781; x=1753172781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xhVNF+b4Tb0wGdM52Jrx4zUqvoR2QqVcMM/zQ5uXZXQ=; b=Rn6ZGvhivEDGUp4YyBFcnXSgKOHgF4fGYC+i8us1XC8SHrgH1iBrFbjn oQ7AZvB1E4yOQDuz8WVudtNKoEGLTcag1AQ3YItTrm/ScEPp4Iw5x+tJj mNJPGWSq+tYQxb9ZyAaJWCVnkaAFWPA/ogw/zwKQDRNhND4jqnqVc0thj qkRDOGM7qfC3QHyzfnkKKvbrV9u18Viy5awH1jDw6T1SuV3PfjjqFuGR1 2r37YaVK9kAWLmP/fEyCh090cys+MWll912+iRpOzpiZb7KuHmoW+pjA1 9BatTVcsGrEt4fCkpyGFmVNRNEz2kFBS/bdr9F2kz5APZr0sB1xvPeJ51 Q==; X-CSE-ConnectionGUID: p4flPDH6Tjef3kW+RBwBWw== X-CSE-MsgGUID: ++JiOgxASzm9VYKU1r+yNg== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="29806959" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="29806959" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:21 -0700 X-CSE-ConnectionGUID: C5kQ/lZKR5iiNxrE/h1EDQ== X-CSE-MsgGUID: YaglC5gLRq+QyITX5qFt7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51752939" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:26:19 -0700 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, mitulkumar.ajitkumar.golani@intel.com Subject: [PATCH 10/10] drm/i915/vrr: Always use VRR timing generator for XELPD+ Date: Mon, 22 Jul 2024 13:57:05 +0530 Message-ID: <20240722082705.3635041-11-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722082705.3635041-1-ankit.k.nautiyal@intel.com> References: <20240722082705.3635041-1-ankit.k.nautiyal@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" Currently VRR timing generator is used only when VRR is enabled by userspace. From XELPD+, gradually move away from older timing generator and use VRR timing generator for fixed refresh rate also. In such a case, Flipline VMin and VMax all are set to the Vtotal of the mode, which effectively makes the VRR timing generator work in fixed refresh rate mode. v2: Use VRR Timing Generator from XELPD+ instead of MTL as it needs Wa_14015406119. v3: Set vrr.fixed during vrr_get_config (Mitul) Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_vrr.c | 63 +++++++++++++++--------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c index 50ac2770a42d..ef965c273a9e 100644 --- a/drivers/gpu/drm/i915/display/intel_vrr.c +++ b/drivers/gpu/drm/i915/display/intel_vrr.c @@ -174,41 +174,56 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state, if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) return; - crtc_state->vrr.in_range = - intel_vrr_is_in_range(connector, drm_mode_vrefresh(adjusted_mode)); - if (!crtc_state->vrr.in_range) - return; - if (HAS_LRR(i915)) crtc_state->update_lrr = true; - vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000, - adjusted_mode->crtc_htotal * info->monitor_range.max_vfreq); - vmax = adjusted_mode->crtc_clock * 1000 / - (adjusted_mode->crtc_htotal * info->monitor_range.min_vfreq); + if (!crtc_state->uapi.vrr_enabled && DISPLAY_VER(i915) >= 20) { + /* + * for XELPD+ always go for VRR timing generator even for + * fixed refresh rate. + */ + crtc_state->vrr.vmin = adjusted_mode->crtc_vtotal; + crtc_state->vrr.vmax = adjusted_mode->crtc_vtotal; + crtc_state->vrr.flipline = adjusted_mode->crtc_vtotal; + crtc_state->vrr.fixed_rr = true; + } else { - vmin = max_t(int, vmin, adjusted_mode->crtc_vtotal); - vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal); + crtc_state->vrr.in_range = + intel_vrr_is_in_range(connector, drm_mode_vrefresh(adjusted_mode)); - if (vmin >= vmax) - return; + if (!crtc_state->vrr.in_range) + return; - /* - * flipline determines the min vblank length the hardware will - * generate, and flipline>=vmin+1, hence we reduce vmin by one - * to make sure we can get the actual min vblank length. - */ - crtc_state->vrr.vmin = vmin - 1; - crtc_state->vrr.vmax = vmax; - crtc_state->vrr.flipline = crtc_state->vrr.vmin + 1; + vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000, + adjusted_mode->crtc_htotal * info->monitor_range.max_vfreq); + vmax = adjusted_mode->crtc_clock * 1000 / + (adjusted_mode->crtc_htotal * info->monitor_range.min_vfreq); + + vmin = max_t(int, vmin, adjusted_mode->crtc_vtotal); + vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal); + + if (vmin >= vmax) + return; + + /* + * flipline determines the min vblank length the hardware will + * generate, and flipline>=vmin+1, hence we reduce vmin by one + * to make sure we can get the actual min vblank length. + */ + crtc_state->vrr.vmin = vmin - 1; + crtc_state->vrr.vmax = vmax; + + crtc_state->vrr.flipline = crtc_state->vrr.vmin + 1; + crtc_state->vrr.fixed_rr = false; + } /* * When panel is VRR capable and userspace has * not enabled adaptive sync mode then Fixed Average * Vtotal mode should be enabled. */ - if (crtc_state->uapi.vrr_enabled) { + if (crtc_state->uapi.vrr_enabled || crtc_state->vrr.fixed_rr) { crtc_state->vrr.enable = true; crtc_state->mode_flags |= I915_MODE_FLAG_VRR; } else if (is_cmrr_frac_required(crtc_state) && is_edp) { @@ -426,6 +441,10 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state) TRANS_VRR_VMAX(dev_priv, cpu_transcoder)) + 1; crtc_state->vrr.vmin = intel_de_read(dev_priv, TRANS_VRR_VMIN(dev_priv, cpu_transcoder)) + 1; + + if (crtc_state->vrr.vmax == crtc_state->vrr.flipline && + crtc_state->vrr.vmin == crtc_state->vrr.flipline) + crtc_state->vrr.fixed_rr = true; } if (crtc_state->vrr.enable) {