Commit 6f66ccf0 authored by Roman Li's avatar Roman Li Committed by Alex Deucher

drm/amd/display: fix potential infinite loop in fbc path

- Fixing integer overflow bug in wait_for_fbc_state_changed()
- Correct the max value of retries for the corresponding warning
Signed-off-by: default avatarRoman Li <Roman.Li@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d4fa93e0
...@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed( ...@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
struct dce110_compressor *cp110, struct dce110_compressor *cp110,
bool enabled) bool enabled)
{ {
uint16_t counter = 0; uint32_t counter = 0;
uint32_t addr = mmFBC_STATUS; uint32_t addr = mmFBC_STATUS;
uint32_t value; uint32_t value;
...@@ -158,7 +158,7 @@ static void wait_for_fbc_state_changed( ...@@ -158,7 +158,7 @@ static void wait_for_fbc_state_changed(
counter++; counter++;
} }
if (counter == 10) { if (counter == 1000) {
DC_LOG_WARNING("%s: wait counter exceeded, changes to HW not applied", DC_LOG_WARNING("%s: wait counter exceeded, changes to HW not applied",
__func__); __func__);
} else { } else {
......
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