]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/amd/display: Add helper function to check for non-address fast updates
authorIlya Bakoulin <ilya.bakoulin@amd.com>
Tue, 9 Jul 2024 17:11:55 +0000 (13:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:36:42 +0000 (17:36 -0400)
[Why/How]
Need to identify which fast updates will update more than just the
address.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakoulin@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h

index b71c4d8e73dde28334d26a48e8252b02b0d91796..b8a6c062426d9c77cbf102fb8f83f6a06bbd338a 100644 (file)
@@ -4697,7 +4697,7 @@ static bool commit_minimal_transition_state(struct dc *dc,
        return true;
 }
 
-static void populate_fast_updates(struct dc_fast_update *fast_update,
+void populate_fast_updates(struct dc_fast_update *fast_update,
                struct dc_surface_update *srf_updates,
                int surface_count,
                struct dc_stream_update *stream_update)
@@ -4707,6 +4707,9 @@ static void populate_fast_updates(struct dc_fast_update *fast_update,
        if (stream_update) {
                fast_update[0].out_transfer_func = stream_update->out_transfer_func;
                fast_update[0].output_csc_transform = stream_update->output_csc_transform;
+       } else {
+               fast_update[0].out_transfer_func = NULL;
+               fast_update[0].output_csc_transform = NULL;
        }
 
        for (i = 0; i < surface_count; i++) {
@@ -4740,6 +4743,26 @@ static bool fast_updates_exist(struct dc_fast_update *fast_update, int surface_c
        return false;
 }
 
+bool fast_nonaddr_updates_exist(struct dc_fast_update *fast_update, int surface_count)
+{
+       int i;
+
+       if (fast_update[0].out_transfer_func ||
+               fast_update[0].output_csc_transform)
+               return true;
+
+       for (i = 0; i < surface_count; i++) {
+               if (fast_update[i].input_csc_color_matrix ||
+                               fast_update[i].gamma ||
+                               fast_update[i].gamut_remap_matrix ||
+                               fast_update[i].coeff_reduction_factor ||
+                               fast_update[i].cursor_csc_color_matrix)
+                       return true;
+       }
+
+       return false;
+}
+
 static bool full_update_required(struct dc *dc,
                struct dc_surface_update *srf_updates,
                int surface_count,
index 036b23a6e324a451a9e26c7c29499b2be0b2e87e..272ae1bdc57f1995c14b6c9e001ea4351fa5a35c 100644 (file)
@@ -1587,6 +1587,12 @@ bool dc_acquire_release_mpc_3dlut(
 bool dc_resource_is_dsc_encoding_supported(const struct dc *dc);
 void get_audio_check(struct audio_info *aud_modes,
        struct audio_check *aud_chk);
+
+bool fast_nonaddr_updates_exist(struct dc_fast_update *fast_update, int surface_count);
+void populate_fast_updates(struct dc_fast_update *fast_update,
+               struct dc_surface_update *srf_updates,
+               int surface_count,
+               struct dc_stream_update *stream_update);
 /*
  * Set up streams and links associated to drive sinks
  * The streams parameter is an absolute set of all active streams.