All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Lin <PingLei.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>,
	Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
	James Lin <PingLei.Lin@amd.com>,
	Chenyu Chen <Chen-Yu.Chen@amd.com>,
	Samson Tam <Samson.Tam@amd.com>, James Lin <pinglei.lin@amd.com>
Subject: [PATCH 06/33] drm/amd/display: add extra 0.25 line reserved for TSetup/TCalc inefficiency
Date: Tue, 17 Nov 2026 05:50:43 +0800	[thread overview]
Message-ID: <20261116215641.2800595-7-PingLei.Lin@amd.com> (raw)
In-Reply-To: <20261116215641.2800595-1-PingLei.Lin@amd.com>

From: Samson Tam <Samson.Tam@amd.com>

[Why]
Some four display configurations fail to light up all displays,
 failing during prefetch validation.

[How]
Add extra 0.25 lines for min_vblank_unreserve_otg_vlines to account
 for inefficiency from TSetup/TCalc

Also fix nom_vtotal and allow_end_otg_vline calculations.  Not related
 to display config issue.

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
---
 .../src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c
index c4db8ff3ee30..71407eec2d83 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c
@@ -409,8 +409,8 @@ static bool dcn6_update_worksheet_for_pstate_admissibility(struct dml2_optimizat
 	const double vblank_ratio = 0.8;
 	const double min_vblank_unreserved_ratio = 0.15;
 	const double min_vblank_unreserved_time_us = 50.0;
-	// min reserved for prefetch + 1 line lost for max vstartup
-	const unsigned int min_vblank_unreserved_otg_vlines = 4 + 1;
+	// min reserved for prefetch + 1 line lost for max vstartup, and +1/4 for inefficiency from TSetup/TCalc, in quarter OTG vlines
+	const unsigned int min_vblank_unreserved_otg_vlines_x4 = (4 + 1) * 4 + 1; // 5.25
 
 	unsigned int plane_index, stream_index, stream_index1;
 	double ideal_disallow_time_us, disallow_time_us;
@@ -464,7 +464,7 @@ static bool dcn6_update_worksheet_for_pstate_admissibility(struct dml2_optimizat
 				vblank_time_us = display_config->stream_descriptors[stream_index].timing.vblank_nom *
 					per_stream_pstate_meta[stream_index].otg_vline_time_us;
 				min_unreserved_vblank_time_us = math_max2(
-					per_stream_pstate_meta[stream_index].otg_vline_time_us * min_vblank_unreserved_otg_vlines,
+					per_stream_pstate_meta[stream_index].otg_vline_time_us * min_vblank_unreserved_otg_vlines_x4 / 4.0,
 					math_min2(vblank_time_us * min_vblank_unreserved_ratio,
 						min_vblank_unreserved_time_us));
 
@@ -718,7 +718,7 @@ static void dcn6_build_pstate_meta_per_stream(const struct dml2_display_cfg *dis
 
 	/* common */
 	stream_pstate_meta->valid               = true;
-	stream_pstate_meta->nom_vtotal          = stream_descriptor->timing.vblank_nom + stream_descriptor->timing.v_active;
+	stream_pstate_meta->nom_vtotal          = stream_descriptor->timing.v_total;
 	stream_pstate_meta->otg_vline_time_us   = (double)timing->h_total / timing->pixel_clock_khz * 1000.0;
 	stream_pstate_meta->vblank_start        = timing->v_blank_end + timing->v_active;
 	stream_pstate_meta->nom_refresh_rate_hz = timing->pixel_clock_khz * 1000.0 /
@@ -837,7 +837,10 @@ static void dcn6_build_pstate_meta_per_stream(const struct dml2_display_cfg *dis
 		stream_pstate_meta->method_vactive.common.allow_start_otg_vline =
 				timing->v_blank_end + stream_pstate_meta->method_vactive.max_vactive_det_fill_delay_otg_vlines;
 		stream_pstate_meta->method_vactive.common.allow_end_otg_vline =
-				stream_pstate_meta->vblank_start -
+				stream_pstate_meta->vblank_start +
+				stream_pstate_meta->nom_vtotal -
+				stream_descriptor->timing.v_active -
+				stream_descriptor->timing.vblank_nom -
 				stream_pstate_meta->blackout_otg_vlines +
 				stream_pstate_meta->method_vactive.reserved_blank_required_vlines;
 	} else {
-- 
2.43.0


  parent reply	other threads:[~2026-11-17 17:13 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 21:50 [PATCH 00/33] DC Patches November 23, 2026 James Lin
2026-11-16 21:50 ` [PATCH 01/33] drm/amd/display: Clear OTG_AUTO_FORCE_VSYNC_MODE on OTG disable James Lin
2026-11-16 21:50 ` [PATCH 02/33] drm/amd/display: Rename DPMS to DPMS_v1 James Lin
2026-11-16 21:50 ` [PATCH 03/33] drm/amd/display: Power up eDP when detect link James Lin
2026-11-16 21:50 ` [PATCH 04/33] drm/amd/display: Add DPMS-v2 files James Lin
2026-11-16 21:50 ` [PATCH 05/33] drm/amd/display: Refactor DP retrain link HW sequence James Lin
2026-11-16 21:50 ` James Lin [this message]
2026-11-16 21:50 ` [PATCH 07/33] drm/amd/display: Use panel luminance range for AUX backlight in power module James Lin
2026-11-16 21:50 ` [PATCH 08/33] drm/amd/display: Read PWM back linearly with the linear backlight curve James Lin
2026-11-16 21:50 ` [PATCH 09/33] drm/amd/display: Add API to set brightness percent James Lin
2026-11-16 21:50 ` [PATCH 10/33] drm/amd/display: Pass linear brightness percent to power module James Lin
2026-11-16 21:50 ` [PATCH 11/33] drm/amd/display: Add DPMS-v2 types James Lin
2026-11-16 21:50 ` [PATCH 12/33] drm/amd/display: Always apply 0ppm pixel clock adjustment James Lin
2026-11-16 21:50 ` [PATCH 13/33] drm/amd/display: Add otg versions of get_vblank_counter/scanoutpos James Lin
2026-11-16 21:50 ` [PATCH 14/33] drm/amd/display: Queue vblank control work to sleepable context James Lin
2026-11-16 21:50 ` [PATCH 15/33] drm/amd/display: Fix KUnit tests for vblank control rework James Lin
2026-11-16 21:50 ` [PATCH 16/33] drm/amd/display: Add urgent request and assertion probes James Lin
2026-11-16 21:50 ` [PATCH 17/33] drm/amd/display: Fix G7 P-state aperture addresses James Lin
2026-11-16 21:50 ` [PATCH 18/33] drm/amd/display: Set stream min/max refresh from VRR config James Lin
2026-11-16 21:50 ` [PATCH 19/33] drm/amd/display: Add DC2 wrapped initialization for DCN401 James Lin
2026-11-16 21:50 ` [PATCH 20/33] drm/amd/display: Honor the Replay stream regeneration wait event James Lin
2026-11-16 21:50 ` [PATCH 21/33] drm/amd/display: Disable Replay when link off frame count is below 2 James Lin
2026-11-16 21:50 ` [PATCH 22/33] drm/amd/display: Skip DSC padding borrow estimate for zero padding James Lin
2026-11-16 21:51 ` [PATCH 23/33] drm/amd/display: Drop unused DC interfaces James Lin
2026-11-16 21:51 ` [PATCH 24/33] drm/amd/display: Let the DC2 commit replace or keep a stream James Lin
2026-11-16 21:51 ` [PATCH 25/33] drm/amd/display: Support two streams in the dcn401 DC2 builders James Lin
2026-11-16 21:51 ` [PATCH 26/33] drm/amd/display: Add a plane beside a kept plane in DC2 update James Lin
2026-11-16 21:51 ` [PATCH 27/33] drm/amd/display: Keep an unchanged stream in the DC2 commit James Lin
2026-11-16 21:51 ` [PATCH 28/33] drm/amd/display: Change the ODM and MPC layout in DC2 update James Lin
2026-11-16 21:51 ` [PATCH 29/33] drm/amd/display: Give the DC2 builders State pipe facts James Lin
2026-11-16 21:51 ` [PATCH 30/33] drm/amd/display: Add RGBA8888 surface pixel format support James Lin
2026-11-16 21:51 ` [PATCH 31/33] drm/amd/display: Fix DCE crossbar for RGBA8888 surface format James Lin
2026-11-16 21:51 ` [PATCH 32/33] drm/amd/display: [FW Promotion] Release 0.1.85.0 James Lin
2026-11-16 21:51 ` [PATCH 33/33] drm/amd/display: Promote DC to 3.2.408 James Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116215641.2800595-7-PingLei.Lin@amd.com \
    --to=pinglei.lin@amd.com \
    --cc=Chen-Yu.Chen@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=Samson.Tam@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=ivan.lipski@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.