Skip to content
Snippets Groups Projects
Commit 48f7c50b authored by Ryan Seto's avatar Ryan Seto Committed by Alex Hung
Browse files

drm/amd/display: Prevent VStartup Overflow


[WHY & HOW]
Fixed Overflow issue by clamping VStartup to max value of register.

Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Signed-off-by: default avatarRyan Seto <ryanseto@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
parent ff4eee42
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
   
#define DML2_MAX_FMT_420_BUFFER_WIDTH 4096 #define DML2_MAX_FMT_420_BUFFER_WIDTH 4096
#define TB_BORROWED_MAX 400 #define TB_BORROWED_MAX 400
#define DML_MAX_VSTARTUP_START 1023
   
// --------------------------- // ---------------------------
// Declaration Begins // Declaration Begins
...@@ -6210,6 +6211,7 @@ static dml_uint_t CalculateMaxVStartup( ...@@ -6210,6 +6211,7 @@ static dml_uint_t CalculateMaxVStartup(
dml_print("DML::%s: vblank_avail = %u\n", __func__, vblank_avail); dml_print("DML::%s: vblank_avail = %u\n", __func__, vblank_avail);
dml_print("DML::%s: max_vstartup_lines = %u\n", __func__, max_vstartup_lines); dml_print("DML::%s: max_vstartup_lines = %u\n", __func__, max_vstartup_lines);
#endif #endif
max_vstartup_lines = (dml_uint_t) dml_min(max_vstartup_lines, DML_MAX_VSTARTUP_START);
return max_vstartup_lines; return max_vstartup_lines;
} }
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment