Commit f669089a authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amd/display: Add stateless surface validation to validate_resources

Signed-off-by: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@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 cbd19488
...@@ -675,6 +675,21 @@ static bool validate_streams ( ...@@ -675,6 +675,21 @@ static bool validate_streams (
return true; return true;
} }
static bool validate_surfaces(
const struct dc *dc,
const struct dc_validation_set set[],
int set_count)
{
int i, j;
for (i = 0; i < set_count; i++)
for (j = 0; j < set[i].surface_count; j++)
if (!dc_validate_surface(dc, set[i].surfaces[j]))
return false;
return true;
}
struct validate_context *dc_get_validate_context( struct validate_context *dc_get_validate_context(
const struct dc *dc, const struct dc *dc,
const struct dc_validation_set set[], const struct dc_validation_set set[],
...@@ -726,6 +741,9 @@ bool dc_validate_resources( ...@@ -726,6 +741,9 @@ bool dc_validate_resources(
if (!validate_streams(dc, set, set_count)) if (!validate_streams(dc, set, set_count))
return false; return false;
if (!validate_surfaces(dc, set, set_count))
return false;
context = dm_alloc(sizeof(struct validate_context)); context = dm_alloc(sizeof(struct validate_context));
if (context == NULL) if (context == NULL)
goto context_alloc_fail; goto context_alloc_fail;
...@@ -1065,6 +1083,9 @@ bool dc_commit_streams( ...@@ -1065,6 +1083,9 @@ bool dc_commit_streams(
if (!validate_streams(dc, set, stream_count)) if (!validate_streams(dc, set, stream_count))
return false; return false;
if (!validate_surfaces(dc, set, stream_count))
return false;
context = dm_alloc(sizeof(struct validate_context)); context = dm_alloc(sizeof(struct validate_context));
if (context == NULL) if (context == NULL)
goto context_alloc_fail; goto context_alloc_fail;
......
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