All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: remove redundant CalculateTWait's
@ 2022-09-19  2:37 ` Tom Rix
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rix @ 2022-09-19  2:37 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, aric.cyr,
	Nevenko.Stupar, Pavle.Kotarac, mairacanal, aurabindo.pillai,
	Bing.Guo, hamza.mahfooz, nicholas.kazlauskas, agustin.gutierrez,
	nathan, mdaenzer, Charlene.Liu
  Cc: amd-gfx, dri-devel, linux-kernel, Tom Rix

There are several copies of CalculateTwait.
Reduce to one instance and change local variable name to match common usage.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 .../dc/dml/dcn20/display_mode_vba_20.c        | 16 +++++++-------
 .../dc/dml/dcn20/display_mode_vba_20v2.c      | 21 ++-----------------
 .../dc/dml/dcn21/display_mode_vba_21.c        | 19 +----------------
 .../dc/dml/dcn30/display_mode_vba_30.c        | 18 +---------------
 .../dc/dml/dcn31/display_mode_vba_31.c        | 13 +-----------
 .../dc/dml/dcn314/display_mode_vba_314.c      | 13 +-----------
 6 files changed, 14 insertions(+), 86 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index 6e9d7e2b5243..4ca080950924 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -153,10 +153,10 @@ static unsigned int CalculateVMAndRowBytes(
 		bool *PTEBufferSizeNotExceeded,
 		unsigned int *dpte_row_height,
 		unsigned int *meta_row_height);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime);
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
@@ -2892,20 +2892,20 @@ static void dml20_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime)
 {
 	if (PrefetchMode == 0) {
 		return dml_max(
-				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
-				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
+				DRAMClockChangeLatency + UrgentLatency,
+				dml_max(SREnterPlusExitTime, UrgentLatency));
 	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
+		return dml_max(SREnterPlusExitTime, UrgentLatency);
 	} else {
-		return UrgentLatencyPixelDataOnly;
+		return UrgentLatency;
 	}
 }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
index b02dda8ce70f..2b4dcae4e432 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
@@ -177,10 +177,10 @@ static unsigned int CalculateVMAndRowBytes(
 		bool *PTEBufferSizeNotExceeded,
 		unsigned int *dpte_row_height,
 		unsigned int *meta_row_height);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime);
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
@@ -2967,23 +2967,6 @@ static void dml20v2_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(
-				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
-				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
-	} else {
-		return UrgentLatencyPixelDataOnly;
-	}
-}
-
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
 		double VRatio,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
index 6be14f55c78d..a3ef3638d979 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
@@ -205,7 +205,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *DPDE0BytesFrame,
 		unsigned int *MetaPTEBytesFrame);
 
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
 		double UrgentLatency,
@@ -2980,23 +2980,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatency,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(
-				DRAMClockChangeLatency + UrgentLatency,
-				dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
 		double VRatio,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
index 229548733177..74f5d9742f59 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
@@ -216,7 +216,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		unsigned int *DPDE0BytesFrame,
 		unsigned int *MetaPTEBytesFrame);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
 		double UrgentLatency,
@@ -3191,22 +3191,6 @@ void dml30_CalculateBytePerPixelAnd256BBlockSizes(
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatency,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency,
-				dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml30_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
index 58dc4c046cf4..4563342275f1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
@@ -230,7 +230,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		int *DPDE0BytesFrame,
 		int *MetaPTEBytesFrame);
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
+double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
 static void CalculateRowBandwidth(
 		bool GPUVMEnable,
 		enum source_format_class SourcePixelFormat,
@@ -3323,17 +3323,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 			&dummysinglestring);
 }
 
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml31_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
index 7024412fe441..89a80eef42f4 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
@@ -244,7 +244,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		int *DPDE0BytesFrame,
 		int *MetaPTEBytesFrame);
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
+double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
 static void CalculateRowBandwidth(
 		bool GPUVMEnable,
 		enum source_format_class SourcePixelFormat,
@@ -3547,17 +3547,6 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
 	return true;
 }
 
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml314_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/amd/display: remove redundant CalculateTWait's
@ 2022-09-19  2:37 ` Tom Rix
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rix @ 2022-09-19  2:37 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, aric.cyr,
	Nevenko.Stupar, Pavle.Kotarac, mairacanal, aurabindo.pillai,
	Bing.Guo, hamza.mahfooz, nicholas.kazlauskas, agustin.gutierrez,
	nathan, mdaenzer, Charlene.Liu
  Cc: Tom Rix, dri-devel, amd-gfx, linux-kernel

There are several copies of CalculateTwait.
Reduce to one instance and change local variable name to match common usage.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 .../dc/dml/dcn20/display_mode_vba_20.c        | 16 +++++++-------
 .../dc/dml/dcn20/display_mode_vba_20v2.c      | 21 ++-----------------
 .../dc/dml/dcn21/display_mode_vba_21.c        | 19 +----------------
 .../dc/dml/dcn30/display_mode_vba_30.c        | 18 +---------------
 .../dc/dml/dcn31/display_mode_vba_31.c        | 13 +-----------
 .../dc/dml/dcn314/display_mode_vba_314.c      | 13 +-----------
 6 files changed, 14 insertions(+), 86 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index 6e9d7e2b5243..4ca080950924 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -153,10 +153,10 @@ static unsigned int CalculateVMAndRowBytes(
 		bool *PTEBufferSizeNotExceeded,
 		unsigned int *dpte_row_height,
 		unsigned int *meta_row_height);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime);
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
@@ -2892,20 +2892,20 @@ static void dml20_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime)
 {
 	if (PrefetchMode == 0) {
 		return dml_max(
-				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
-				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
+				DRAMClockChangeLatency + UrgentLatency,
+				dml_max(SREnterPlusExitTime, UrgentLatency));
 	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
+		return dml_max(SREnterPlusExitTime, UrgentLatency);
 	} else {
-		return UrgentLatencyPixelDataOnly;
+		return UrgentLatency;
 	}
 }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
index b02dda8ce70f..2b4dcae4e432 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
@@ -177,10 +177,10 @@ static unsigned int CalculateVMAndRowBytes(
 		bool *PTEBufferSizeNotExceeded,
 		unsigned int *dpte_row_height,
 		unsigned int *meta_row_height);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
+		double UrgentLatency,
 		double SREnterPlusExitTime);
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
@@ -2967,23 +2967,6 @@ static void dml20v2_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatencyPixelDataOnly,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(
-				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
-				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
-	} else {
-		return UrgentLatencyPixelDataOnly;
-	}
-}
-
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
 		double VRatio,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
index 6be14f55c78d..a3ef3638d979 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
@@ -205,7 +205,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *DPDE0BytesFrame,
 		unsigned int *MetaPTEBytesFrame);
 
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
 		double UrgentLatency,
@@ -2980,23 +2980,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatency,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(
-				DRAMClockChangeLatency + UrgentLatency,
-				dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 static double CalculateRemoteSurfaceFlipDelay(
 		struct display_mode_lib *mode_lib,
 		double VRatio,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
index 229548733177..74f5d9742f59 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
@@ -216,7 +216,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		unsigned int *DPDE0BytesFrame,
 		unsigned int *MetaPTEBytesFrame);
-static double CalculateTWait(
+double CalculateTWait(
 		unsigned int PrefetchMode,
 		double DRAMClockChangeLatency,
 		double UrgentLatency,
@@ -3191,22 +3191,6 @@ void dml30_CalculateBytePerPixelAnd256BBlockSizes(
 	}
 }
 
-static double CalculateTWait(
-		unsigned int PrefetchMode,
-		double DRAMClockChangeLatency,
-		double UrgentLatency,
-		double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency,
-				dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml30_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
index 58dc4c046cf4..4563342275f1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
@@ -230,7 +230,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		int *DPDE0BytesFrame,
 		int *MetaPTEBytesFrame);
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
+double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
 static void CalculateRowBandwidth(
 		bool GPUVMEnable,
 		enum source_format_class SourcePixelFormat,
@@ -3323,17 +3323,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
 			&dummysinglestring);
 }
 
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml31_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
index 7024412fe441..89a80eef42f4 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
@@ -244,7 +244,7 @@ static unsigned int CalculateVMAndRowBytes(
 		unsigned int *PTERequestSize,
 		int *DPDE0BytesFrame,
 		int *MetaPTEBytesFrame);
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
+double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
 static void CalculateRowBandwidth(
 		bool GPUVMEnable,
 		enum source_format_class SourcePixelFormat,
@@ -3547,17 +3547,6 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
 	return true;
 }
 
-static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
-{
-	if (PrefetchMode == 0) {
-		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
-	} else if (PrefetchMode == 1) {
-		return dml_max(SREnterPlusExitTime, UrgentLatency);
-	} else {
-		return UrgentLatency;
-	}
-}
-
 double dml314_CalculateWriteBackDISPCLK(
 		enum source_format_class WritebackPixelFormat,
 		double PixelClock,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant CalculateTWait's
  2022-09-19  2:37 ` Tom Rix
@ 2022-09-19 23:02   ` Maíra Canal
  -1 siblings, 0 replies; 4+ messages in thread
From: Maíra Canal @ 2022-09-19 23:02 UTC (permalink / raw)
  To: Tom Rix, harry.wentland, sunpeng.li, Rodrigo.Siqueira,
	alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	aric.cyr, Nevenko.Stupar, Pavle.Kotarac, aurabindo.pillai,
	Bing.Guo, hamza.mahfooz, nicholas.kazlauskas, agustin.gutierrez,
	nathan, mdaenzer, Charlene.Liu
  Cc: dri-devel, amd-gfx, linux-kernel

Hi Tom,

On 9/18/22 23:37, Tom Rix wrote:
> There are several copies of CalculateTwait.
> Reduce to one instance and change local variable name to match common usage.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Maíra Canal <mairacanal@riseup.net>

Although, it would be nice to put this function on the
display_mode_vba.h file, as all DCNs use this function.

Best Regards,
- Maíra Canal

> ---
>  .../dc/dml/dcn20/display_mode_vba_20.c        | 16 +++++++-------
>  .../dc/dml/dcn20/display_mode_vba_20v2.c      | 21 ++-----------------
>  .../dc/dml/dcn21/display_mode_vba_21.c        | 19 +----------------
>  .../dc/dml/dcn30/display_mode_vba_30.c        | 18 +---------------
>  .../dc/dml/dcn31/display_mode_vba_31.c        | 13 +-----------
>  .../dc/dml/dcn314/display_mode_vba_314.c      | 13 +-----------
>  6 files changed, 14 insertions(+), 86 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> index 6e9d7e2b5243..4ca080950924 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> @@ -153,10 +153,10 @@ static unsigned int CalculateVMAndRowBytes(
>  		bool *PTEBufferSizeNotExceeded,
>  		unsigned int *dpte_row_height,
>  		unsigned int *meta_row_height);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime);
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
> @@ -2892,20 +2892,20 @@ static void dml20_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime)
>  {
>  	if (PrefetchMode == 0) {
>  		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
> -				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
> +				DRAMClockChangeLatency + UrgentLatency,
> +				dml_max(SREnterPlusExitTime, UrgentLatency));
>  	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
> +		return dml_max(SREnterPlusExitTime, UrgentLatency);
>  	} else {
> -		return UrgentLatencyPixelDataOnly;
> +		return UrgentLatency;
>  	}
>  }
>  
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> index b02dda8ce70f..2b4dcae4e432 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> @@ -177,10 +177,10 @@ static unsigned int CalculateVMAndRowBytes(
>  		bool *PTEBufferSizeNotExceeded,
>  		unsigned int *dpte_row_height,
>  		unsigned int *meta_row_height);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime);
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
> @@ -2967,23 +2967,6 @@ static void dml20v2_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
> -				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
> -	} else {
> -		return UrgentLatencyPixelDataOnly;
> -	}
> -}
> -
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
>  		double VRatio,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> index 6be14f55c78d..a3ef3638d979 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> @@ -205,7 +205,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *DPDE0BytesFrame,
>  		unsigned int *MetaPTEBytesFrame);
>  
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
>  		double UrgentLatency,
> @@ -2980,23 +2980,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatency,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatency,
> -				dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
>  		double VRatio,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> index 229548733177..74f5d9742f59 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> @@ -216,7 +216,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		unsigned int *DPDE0BytesFrame,
>  		unsigned int *MetaPTEBytesFrame);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
>  		double UrgentLatency,
> @@ -3191,22 +3191,6 @@ void dml30_CalculateBytePerPixelAnd256BBlockSizes(
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatency,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency,
> -				dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml30_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> index 58dc4c046cf4..4563342275f1 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> @@ -230,7 +230,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		int *DPDE0BytesFrame,
>  		int *MetaPTEBytesFrame);
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
> +double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
>  static void CalculateRowBandwidth(
>  		bool GPUVMEnable,
>  		enum source_format_class SourcePixelFormat,
> @@ -3323,17 +3323,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  			&dummysinglestring);
>  }
>  
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml31_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> index 7024412fe441..89a80eef42f4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> @@ -244,7 +244,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		int *DPDE0BytesFrame,
>  		int *MetaPTEBytesFrame);
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
> +double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
>  static void CalculateRowBandwidth(
>  		bool GPUVMEnable,
>  		enum source_format_class SourcePixelFormat,
> @@ -3547,17 +3547,6 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
>  	return true;
>  }
>  
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml314_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant CalculateTWait's
@ 2022-09-19 23:02   ` Maíra Canal
  0 siblings, 0 replies; 4+ messages in thread
From: Maíra Canal @ 2022-09-19 23:02 UTC (permalink / raw)
  To: Tom Rix, harry.wentland, sunpeng.li, Rodrigo.Siqueira,
	alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	aric.cyr, Nevenko.Stupar, Pavle.Kotarac, aurabindo.pillai,
	Bing.Guo, hamza.mahfooz, nicholas.kazlauskas, agustin.gutierrez,
	nathan, mdaenzer, Charlene.Liu
  Cc: amd-gfx, dri-devel, linux-kernel

Hi Tom,

On 9/18/22 23:37, Tom Rix wrote:
> There are several copies of CalculateTwait.
> Reduce to one instance and change local variable name to match common usage.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Maíra Canal <mairacanal@riseup.net>

Although, it would be nice to put this function on the
display_mode_vba.h file, as all DCNs use this function.

Best Regards,
- Maíra Canal

> ---
>  .../dc/dml/dcn20/display_mode_vba_20.c        | 16 +++++++-------
>  .../dc/dml/dcn20/display_mode_vba_20v2.c      | 21 ++-----------------
>  .../dc/dml/dcn21/display_mode_vba_21.c        | 19 +----------------
>  .../dc/dml/dcn30/display_mode_vba_30.c        | 18 +---------------
>  .../dc/dml/dcn31/display_mode_vba_31.c        | 13 +-----------
>  .../dc/dml/dcn314/display_mode_vba_314.c      | 13 +-----------
>  6 files changed, 14 insertions(+), 86 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> index 6e9d7e2b5243..4ca080950924 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
> @@ -153,10 +153,10 @@ static unsigned int CalculateVMAndRowBytes(
>  		bool *PTEBufferSizeNotExceeded,
>  		unsigned int *dpte_row_height,
>  		unsigned int *meta_row_height);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime);
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
> @@ -2892,20 +2892,20 @@ static void dml20_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime)
>  {
>  	if (PrefetchMode == 0) {
>  		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
> -				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
> +				DRAMClockChangeLatency + UrgentLatency,
> +				dml_max(SREnterPlusExitTime, UrgentLatency));
>  	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
> +		return dml_max(SREnterPlusExitTime, UrgentLatency);
>  	} else {
> -		return UrgentLatencyPixelDataOnly;
> +		return UrgentLatency;
>  	}
>  }
>  
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> index b02dda8ce70f..2b4dcae4e432 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
> @@ -177,10 +177,10 @@ static unsigned int CalculateVMAndRowBytes(
>  		bool *PTEBufferSizeNotExceeded,
>  		unsigned int *dpte_row_height,
>  		unsigned int *meta_row_height);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> +		double UrgentLatency,
>  		double SREnterPlusExitTime);
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
> @@ -2967,23 +2967,6 @@ static void dml20v2_DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatencyPixelDataOnly,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatencyPixelDataOnly,
> -				dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatencyPixelDataOnly);
> -	} else {
> -		return UrgentLatencyPixelDataOnly;
> -	}
> -}
> -
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
>  		double VRatio,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> index 6be14f55c78d..a3ef3638d979 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
> @@ -205,7 +205,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *DPDE0BytesFrame,
>  		unsigned int *MetaPTEBytesFrame);
>  
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
>  		double UrgentLatency,
> @@ -2980,23 +2980,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatency,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(
> -				DRAMClockChangeLatency + UrgentLatency,
> -				dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  static double CalculateRemoteSurfaceFlipDelay(
>  		struct display_mode_lib *mode_lib,
>  		double VRatio,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> index 229548733177..74f5d9742f59 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> @@ -216,7 +216,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		unsigned int *DPDE0BytesFrame,
>  		unsigned int *MetaPTEBytesFrame);
> -static double CalculateTWait(
> +double CalculateTWait(
>  		unsigned int PrefetchMode,
>  		double DRAMClockChangeLatency,
>  		double UrgentLatency,
> @@ -3191,22 +3191,6 @@ void dml30_CalculateBytePerPixelAnd256BBlockSizes(
>  	}
>  }
>  
> -static double CalculateTWait(
> -		unsigned int PrefetchMode,
> -		double DRAMClockChangeLatency,
> -		double UrgentLatency,
> -		double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency,
> -				dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml30_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> index 58dc4c046cf4..4563342275f1 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> @@ -230,7 +230,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		int *DPDE0BytesFrame,
>  		int *MetaPTEBytesFrame);
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
> +double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
>  static void CalculateRowBandwidth(
>  		bool GPUVMEnable,
>  		enum source_format_class SourcePixelFormat,
> @@ -3323,17 +3323,6 @@ static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
>  			&dummysinglestring);
>  }
>  
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml31_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> index 7024412fe441..89a80eef42f4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> @@ -244,7 +244,7 @@ static unsigned int CalculateVMAndRowBytes(
>  		unsigned int *PTERequestSize,
>  		int *DPDE0BytesFrame,
>  		int *MetaPTEBytesFrame);
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
> +double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime);
>  static void CalculateRowBandwidth(
>  		bool GPUVMEnable,
>  		enum source_format_class SourcePixelFormat,
> @@ -3547,17 +3547,6 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
>  	return true;
>  }
>  
> -static double CalculateTWait(unsigned int PrefetchMode, double DRAMClockChangeLatency, double UrgentLatency, double SREnterPlusExitTime)
> -{
> -	if (PrefetchMode == 0) {
> -		return dml_max(DRAMClockChangeLatency + UrgentLatency, dml_max(SREnterPlusExitTime, UrgentLatency));
> -	} else if (PrefetchMode == 1) {
> -		return dml_max(SREnterPlusExitTime, UrgentLatency);
> -	} else {
> -		return UrgentLatency;
> -	}
> -}
> -
>  double dml314_CalculateWriteBackDISPCLK(
>  		enum source_format_class WritebackPixelFormat,
>  		double PixelClock,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-19 23:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19  2:37 [PATCH] drm/amd/display: remove redundant CalculateTWait's Tom Rix
2022-09-19  2:37 ` Tom Rix
2022-09-19 23:02 ` Maíra Canal
2022-09-19 23:02   ` Maíra Canal

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.