Commit 050790cc authored by Anthony Koo's avatar Anthony Koo Committed by Alex Deucher

drm/amd/display: Fix bug that causes black screen

Ignore MSA bit on DP display is usually set during SetTimings, but
there was a case where the module thought refresh rate was not valid
and ignore MSA bit was not set.

Later, a valid refresh rate range was requested but since ignore MSA bit
not set, it caused black screen.

Issue if with how the module checked for VRR support. Fix up that logic.
DM should call new valid_range function to determine if timing is supported.
Signed-off-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ff6014d6
......@@ -613,7 +613,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
{
struct core_freesync *core_freesync = NULL;
unsigned long long nominal_field_rate_in_uhz = 0;
bool nominal_field_rate_in_range = true;
unsigned int refresh_range = 0;
unsigned int min_refresh_in_uhz = 0;
unsigned int max_refresh_in_uhz = 0;
......@@ -638,15 +637,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
if (max_refresh_in_uhz > nominal_field_rate_in_uhz)
max_refresh_in_uhz = nominal_field_rate_in_uhz;
/* Allow for some rounding error of actual video timing by taking ceil.
* For example, 144 Hz mode timing may actually be 143.xxx Hz when
* calculated from pixel rate and vertical/horizontal totals, but
* this should be allowed instead of blocking FreeSync.
*/
if ((min_refresh_in_uhz / 1000000) >
((nominal_field_rate_in_uhz + 1000000 - 1) / 1000000))
nominal_field_rate_in_range = false;
// Full range may be larger than current video timing, so cap at nominal
if (min_refresh_in_uhz > nominal_field_rate_in_uhz)
min_refresh_in_uhz = nominal_field_rate_in_uhz;
......@@ -658,10 +648,14 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
in_out_vrr->state = in_config->state;
if ((in_config->state == VRR_STATE_UNSUPPORTED) ||
(!nominal_field_rate_in_range)) {
if (in_config->state == VRR_STATE_UNSUPPORTED) {
in_out_vrr->state = VRR_STATE_UNSUPPORTED;
in_out_vrr->supported = false;
in_out_vrr->adjust.v_total_min = stream->timing.v_total;
in_out_vrr->adjust.v_total_max = stream->timing.v_total;
return;
} else {
in_out_vrr->min_refresh_in_uhz = min_refresh_in_uhz;
in_out_vrr->max_duration_in_us =
......
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