Commit cc263c3a authored by Joshua Aberback's avatar Joshua Aberback Committed by Alex Deucher

drm/amd/display: remove context->dml2 dependency from DML21 wrapper

[Why]
When the DML2 wrapper explicitly accesses context->dml2, that creates a
dependency on where dc saves the DML object. This dependency makes it
harder to have multiple co-existing DML objects, which we would like to
have for upcoming functionality.

[How]
 - make all DML21 interfaces take in a DML2 object as parameter
 - remove all references to context->dml2, use parameter instead
Reviewed-by: default avatarJun Lei <jun.lei@amd.com>
Reviewed-by: default avatarAric Cyr <aric.cyr@amd.com>
Acked-by: default avatarRoman Li <roman.li@amd.com>
Signed-off-by: default avatarJoshua Aberback <joshua.aberback@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c435bce6
...@@ -690,13 +690,13 @@ static void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *d ...@@ -690,13 +690,13 @@ static void dml2_apply_debug_options(const struct dc *dc, struct dml2_context *d
} }
} }
bool dml2_validate(const struct dc *in_dc, struct dc_state *context, bool fast_validate) bool dml2_validate(const struct dc *in_dc, struct dc_state *context, struct dml2_context *dml2, bool fast_validate)
{ {
bool out = false; bool out = false;
if (!(context->bw_ctx.dml2)) if (!dml2)
return false; return false;
dml2_apply_debug_options(in_dc, context->bw_ctx.dml2); dml2_apply_debug_options(in_dc, dml2);
/* Use dml_validate_only for fast_validate path */ /* Use dml_validate_only for fast_validate path */
......
...@@ -268,6 +268,7 @@ void dml2_reinit(const struct dc *in_dc, ...@@ -268,6 +268,7 @@ void dml2_reinit(const struct dc *in_dc,
*/ */
bool dml2_validate(const struct dc *in_dc, bool dml2_validate(const struct dc *in_dc,
struct dc_state *context, struct dc_state *context,
struct dml2_context *dml2,
bool fast_validate); bool fast_validate);
/* /*
......
...@@ -1799,7 +1799,7 @@ bool dcn32_validate_bandwidth(struct dc *dc, ...@@ -1799,7 +1799,7 @@ bool dcn32_validate_bandwidth(struct dc *dc,
bool out = false; bool out = false;
if (dc->debug.using_dml2) if (dc->debug.using_dml2)
out = dml2_validate(dc, context, fast_validate); out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
else else
out = dml1_validate(dc, context, fast_validate); out = dml1_validate(dc, context, fast_validate);
return out; return out;
......
...@@ -1734,7 +1734,7 @@ static bool dcn35_validate_bandwidth(struct dc *dc, ...@@ -1734,7 +1734,7 @@ static bool dcn35_validate_bandwidth(struct dc *dc,
{ {
bool out = false; bool out = false;
out = dml2_validate(dc, context, fast_validate); out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
if (fast_validate) if (fast_validate)
return out; return out;
......
...@@ -1714,7 +1714,7 @@ static bool dcn351_validate_bandwidth(struct dc *dc, ...@@ -1714,7 +1714,7 @@ static bool dcn351_validate_bandwidth(struct dc *dc,
{ {
bool out = false; bool out = false;
out = dml2_validate(dc, context, fast_validate); out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
if (fast_validate) if (fast_validate)
return out; return out;
......
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