drm/amd/display: detach fpu operations from dcn10_validate_bandwidth in calcs
authorMelissa Wen <mwen@igalia.com>
Sat, 26 Mar 2022 20:24:47 +0000 (19:24 -0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 1 Apr 2022 03:05:54 +0000 (23:05 -0400)
dcn10_validate_bandwidth is only used on dcn10 files, but is declared in
dcn_calcs files. Rename dcn10_* to dcn_* in calcs, remove DC_FP_* wrapper
inside DML folder and create an specific dcn10_validate_bandwidth in
dcn10_resources that calls dcn_validate_bandwidth and properly wraps that
FPU function with DC_FP_* macro.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
drivers/gpu/drm/amd/display/dc/inc/dcn_calcs.h

index 4048908dd26596e2909e33893e73776226efb408..1587a060b55afa3075df48fcae2305b7067aa2cf 100644 (file)
@@ -1141,6 +1141,20 @@ static void dcn10_destroy_resource_pool(struct resource_pool **pool)
        *pool = NULL;
 }
 
+static bool dcn10_validate_bandwidth(
+               struct dc *dc,
+               struct dc_state *context,
+               bool fast_validate)
+{
+       bool voltage_supported;
+
+       DC_FP_START();
+       voltage_supported = dcn_validate_bandwidth(dc, context, fast_validate);
+       DC_FP_END();
+
+       return voltage_supported;
+}
+
 static enum dc_status dcn10_validate_plane(const struct dc_plane_state *plane_state, struct dc_caps *caps)
 {
        if (plane_state->format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN
index e447c74be713826183e4619093fc791a84436f22..c25023f7d60467f9538a7e28ea184c9c1b94add8 100644 (file)
@@ -764,7 +764,7 @@ static unsigned int get_highest_allowed_voltage_level(uint32_t chip_family,
        return 4;
 }
 
-bool dcn10_validate_bandwidth(
+bool dcn_validate_bandwidth(
                struct dc *dc,
                struct dc_state *context,
                bool fast_validate)
@@ -790,7 +790,6 @@ bool dcn10_validate_bandwidth(
                dcn_bw_sync_calcs_and_dml(dc);
 
        memset(v, 0, sizeof(*v));
-       DC_FP_START();
 
        v->sr_exit_time = dc->dcn_soc->sr_exit_time;
        v->sr_enter_plus_exit_time = dc->dcn_soc->sr_enter_plus_exit_time;
@@ -1323,8 +1322,6 @@ bool dcn10_validate_bandwidth(
        bw_limit = dc->dcn_soc->percent_disp_bw_limit * v->fabric_and_dram_bandwidth_vmax0p9;
        bw_limit_pass = (v->total_data_read_bandwidth / 1000.0) < bw_limit;
 
-       DC_FP_END();
-
        PERFORMANCE_TRACE_END();
        BW_VAL_TRACE_FINISH();
 
index 337c0161e72da17e2fbb1355e7f5f93ba0d9f0eb..806f3041db1419ca505c5b842768f22f1da289c3 100644 (file)
@@ -619,7 +619,7 @@ struct dcn_ip_params {
 };
 extern const struct dcn_ip_params dcn10_ip_defaults;
 
-bool dcn10_validate_bandwidth(
+bool dcn_validate_bandwidth(
                struct dc *dc,
                struct dc_state *context,
                bool fast_validate);