drm/amd/display: SW cursor fallback for SubVP
authorAlvin Lee <Alvin.Lee2@amd.com>
Wed, 24 Aug 2022 15:53:50 +0000 (11:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Sep 2022 18:32:59 +0000 (14:32 -0400)
[Description]
Leverage SW cursor fall back for SubVP when the cursor is too big. We
want to take advantage of being able to fallback to SW cursor when
possible because it's not worth it to disable MCLK switching because the
cursor is slightly too big.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Aurabindo Pillai <Aurabindo.Pillai@amd.com>
Acked-by: Pavle Kotarac <Pavle.Kotarac@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c

index 6752ca44e6e0b3d9add05d4a0e3fecaefce32243..0c85ab5933b4a5c7203b8cc1063437f0646379dd 100644 (file)
@@ -328,6 +328,11 @@ bool dc_stream_set_cursor_attributes(
        }
 
        dc = stream->ctx->dc;
+
+       if (dc->debug.allow_sw_cursor_fallback && attributes->height * attributes->width * 4 > 16384)
+               if (stream->mall_stream_config.type == SUBVP_MAIN)
+                       return false;
+
        stream->cursor_attributes = *attributes;
 
        dc_z10_restore(dc);
index 75dbc665f4355cc6b118cd70f0ab8d4b9676540a..c48403d49f2e784f023be617242e6f7e89dfdfee 100644 (file)
@@ -830,6 +830,7 @@ struct dc_debug_options {
        bool disable_fixed_vs_aux_timeout_wa;
        bool force_disable_subvp;
        bool force_subvp_mclk_switch;
+       bool allow_sw_cursor_fallback;
        bool force_usr_allow;
        /* uses value at boot and disables switch */
        bool disable_dtb_ref_clk_switch;
index 5a21cf041732ba534e52e47a89937f67fdcaf5e8..5953083b76a70ad53dd602ee4112ae88a2df5575 100644 (file)
@@ -747,6 +747,7 @@ static const struct dc_debug_options debug_defaults_drv = {
        .exit_idle_opt_for_cursor_updates = true,
        .enable_single_display_2to1_odm_policy = true,
        .enable_dp_dig_pixel_rate_div_policy = 1,
+       .allow_sw_cursor_fallback = false,
 };
 
 static const struct dc_debug_options debug_defaults_diags = {
index 8a89c28add0dc47a1c74f5c4a6423cf381c5805d..64c225ee3a46589407158101343ae69a8940707d 100644 (file)
@@ -750,6 +750,7 @@ static const struct dc_debug_options debug_defaults_drv = {
        .exit_idle_opt_for_cursor_updates = true,
        .enable_single_display_2to1_odm_policy = true,
        .enable_dp_dig_pixel_rate_div_policy = 1,
+       .allow_sw_cursor_fallback = false,
 };
 
 static const struct dc_debug_options debug_defaults_diags = {