From: Michael Strauss <michael.stra...@amd.com>

[WHY]
Allow changing DET size with debug flag for testing purposes

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>
Acked-by: Bhawanpreet Lakha <bhawanpreet.la...@amd.com>
Signed-off-by: Michael Strauss <michael.stra...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h                  | 12 ++++++++++++
 .../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c    |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index 9f5745313e48..a6607d4e3985 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -75,6 +75,16 @@ enum dc_plane_type {
        DC_PLANE_TYPE_DCN_UNIVERSAL,
 };
 
+// Sizes defined as multiples of 64KB
+enum det_size {
+       DET_SIZE_DEFAULT = 0,
+       DET_SIZE_192KB = 3,
+       DET_SIZE_256KB = 4,
+       DET_SIZE_320KB = 5,
+       DET_SIZE_384KB = 6
+};
+
+
 struct dc_plane_cap {
        enum dc_plane_type type;
        uint32_t blends_with_above : 1;
@@ -691,6 +701,8 @@ struct dc_debug_options {
        /* FEC/PSR1 sequence enable delay in 100us */
        uint8_t fec_enable_delay_in100us;
        bool enable_driver_sequence_debug;
+       enum det_size crb_alloc_policy;
+       int crb_alloc_policy_min_disp_count;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
        bool disable_z10;
        bool enable_sw_cntl_psr;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
index 6187c55ac82c..dc5650212a86 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
@@ -1824,6 +1824,9 @@ static int dcn31_populate_dml_pipes_from_context(
                        context->bw_ctx.dml.ip.det_buffer_size_kbytes = 192;
                        pipes[0].pipe.src.unbounded_req_mode = true;
                }
+       } else if (context->stream_count >= 
dc->debug.crb_alloc_policy_min_disp_count
+                       && dc->debug.crb_alloc_policy > DET_SIZE_DEFAULT) {
+               context->bw_ctx.dml.ip.det_buffer_size_kbytes = 
dc->debug.crb_alloc_policy * 64;
        }
 
        return pipe_cnt;
-- 
2.25.1

Reply via email to