]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: remove context->dml2 dependency from DML21 wrapper
authorJoshua Aberback <joshua.aberback@amd.com>
Thu, 7 Mar 2024 10:13:04 +0000 (05:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 02:04:39 +0000 (22:04 -0400)
[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: Jun Lei <jun.lei@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c

index e2489eaabb207dc3e44d61e837771d88a58b98da..abf946f089b3bb0cf3d6fc5b3a9c2788f444b385 100644 (file)
@@ -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;
 
-       if (!(context->bw_ctx.dml2))
+       if (!dml2)
                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 */
index 54aff9beb73ace069de3cff553e2323bb16a860e..20fd5b8e511728184c5ab6d22e472959422ca540 100644 (file)
@@ -268,6 +268,7 @@ void dml2_reinit(const struct dc *in_dc,
  */
 bool dml2_validate(const struct dc *in_dc,
                                   struct dc_state *context,
+                                  struct dml2_context *dml2,
                                   bool fast_validate);
 
 /*
index 0c8dd71148b4a82978302f49698194fadf972452..61fd0f2e69fe0ba008d5c38e3a085fc4630976ef 100644 (file)
@@ -1799,7 +1799,7 @@ bool dcn32_validate_bandwidth(struct dc *dc,
        bool out = false;
 
        if (dc->debug.using_dml2)
-               out = dml2_validate(dc, context, fast_validate);
+               out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
        else
                out = dml1_validate(dc, context, fast_validate);
        return out;
index 479641fedcd4ee4fbb7e3323c25040f99d0f7abf..e0544484e8c07073347b75c09bbbe8d1be3ed5a7 100644 (file)
@@ -1734,7 +1734,7 @@ static bool dcn35_validate_bandwidth(struct dc *dc,
 {
        bool out = false;
 
-       out = dml2_validate(dc, context, fast_validate);
+       out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
 
        if (fast_validate)
                return out;
index 07ac9f3130b771fe714ca5ae5f6077711289775b..690e1ade361e6a35c73bb1e3d3d8a291f90adbbc 100644 (file)
@@ -1714,7 +1714,7 @@ static bool dcn351_validate_bandwidth(struct dc *dc,
 {
        bool out = false;
 
-       out = dml2_validate(dc, context, fast_validate);
+       out = dml2_validate(dc, context, context->bw_ctx.dml2, fast_validate);
 
        if (fast_validate)
                return out;