Commit b130cc4e authored by Lewis Huang's avatar Lewis Huang Committed by Alex Deucher

drm/amd/display: temporary clamp the vratio used to 1.0

[Why]
in Is_Support function, driver report different caps between
same timing but different scaling cause OS inconsistent.

[How]
min_row_time is a local that’s only used for verifying immediate
flip support. Clamp the vratio used for its calculation to 1.0.
Signed-off-by: default avatarLewis Huang <Lewis.Huang@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f00889dc
...@@ -3190,6 +3190,7 @@ static void CalculateFlipSchedule( ...@@ -3190,6 +3190,7 @@ static void CalculateFlipSchedule(
double TimeForFetchingRowInVBlankImmediateFlip; double TimeForFetchingRowInVBlankImmediateFlip;
double ImmediateFlipBW; double ImmediateFlipBW;
double HostVMInefficiencyFactor; double HostVMInefficiencyFactor;
double VRatioClamped;
if (GPUVMEnable == true && HostVMEnable == true) { if (GPUVMEnable == true && HostVMEnable == true) {
HostVMInefficiencyFactor = HostVMInefficiencyFactor =
...@@ -3222,31 +3223,32 @@ static void CalculateFlipSchedule( ...@@ -3222,31 +3223,32 @@ static void CalculateFlipSchedule(
*DestinationLinesToRequestRowInImmediateFlip = dml_ceil(4.0 * (TimeForFetchingRowInVBlankImmediateFlip / LineTime), 1) / 4.0; *DestinationLinesToRequestRowInImmediateFlip = dml_ceil(4.0 * (TimeForFetchingRowInVBlankImmediateFlip / LineTime), 1) / 4.0;
*final_flip_bw = dml_max(PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / (*DestinationLinesToRequestVMInImmediateFlip * LineTime), (MetaRowBytes + DPTEBytesPerRow) * HostVMInefficiencyFactor / (*DestinationLinesToRequestRowInImmediateFlip * LineTime)); *final_flip_bw = dml_max(PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / (*DestinationLinesToRequestVMInImmediateFlip * LineTime), (MetaRowBytes + DPTEBytesPerRow) * HostVMInefficiencyFactor / (*DestinationLinesToRequestRowInImmediateFlip * LineTime));
VRatioClamped = (VRatio < 1.0) ? 1.0 : VRatio;
if (SourcePixelFormat == dm_420_8 || SourcePixelFormat == dm_420_10) { if (SourcePixelFormat == dm_420_8 || SourcePixelFormat == dm_420_10) {
if (GPUVMEnable == true && DCCEnable != true) { if (GPUVMEnable == true && DCCEnable != true) {
min_row_time = dml_min( min_row_time = dml_min(
dpte_row_height * LineTime / VRatio, dpte_row_height * LineTime / VRatioClamped,
dpte_row_height_chroma * LineTime / (VRatio / 2)); dpte_row_height_chroma * LineTime / (VRatioClamped / 2));
} else if (GPUVMEnable != true && DCCEnable == true) { } else if (GPUVMEnable != true && DCCEnable == true) {
min_row_time = dml_min( min_row_time = dml_min(
meta_row_height * LineTime / VRatio, meta_row_height * LineTime / VRatioClamped,
meta_row_height_chroma * LineTime / (VRatio / 2)); meta_row_height_chroma * LineTime / (VRatioClamped / 2));
} else { } else {
min_row_time = dml_min4( min_row_time = dml_min4(
dpte_row_height * LineTime / VRatio, dpte_row_height * LineTime / VRatioClamped,
meta_row_height * LineTime / VRatio, meta_row_height * LineTime / VRatioClamped,
dpte_row_height_chroma * LineTime / (VRatio / 2), dpte_row_height_chroma * LineTime / (VRatioClamped / 2),
meta_row_height_chroma * LineTime / (VRatio / 2)); meta_row_height_chroma * LineTime / (VRatioClamped / 2));
} }
} else { } else {
if (GPUVMEnable == true && DCCEnable != true) { if (GPUVMEnable == true && DCCEnable != true) {
min_row_time = dpte_row_height * LineTime / VRatio; min_row_time = dpte_row_height * LineTime / VRatioClamped;
} else if (GPUVMEnable != true && DCCEnable == true) { } else if (GPUVMEnable != true && DCCEnable == true) {
min_row_time = meta_row_height * LineTime / VRatio; min_row_time = meta_row_height * LineTime / VRatioClamped;
} else { } else {
min_row_time = dml_min( min_row_time = dml_min(
dpte_row_height * LineTime / VRatio, dpte_row_height * LineTime / VRatioClamped,
meta_row_height * LineTime / VRatio); meta_row_height * LineTime / VRatioClamped);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment