drm/amd/display: Separate caps for maximum RGB and YUV plane counts
authorAtufa Khan <Atufa.Khan@amd.com>
Thu, 25 Feb 2021 21:18:35 +0000 (16:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 03:33:06 +0000 (23:33 -0400)
Not all ASICs have same plane capabilities so need to split them
out for proper support handling.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Atufa Khan <Atufa.Khan@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c

index 2088508dac1ad4cd1b6bb7627808bbfe31495f5d..d26472ef1572cac4e3d670b75554f2328d280320 100644 (file)
@@ -155,6 +155,8 @@ struct dc_caps {
        uint32_t max_links;
        uint32_t max_audios;
        uint32_t max_slave_planes;
+       uint32_t max_slave_yuv_planes;
+       uint32_t max_slave_rgb_planes;
        uint32_t max_planes;
        uint32_t max_downscale_ratio;
        uint32_t i2c_speed_in_khz;
index d7fcc5cccdce11a6f7a8d65f3db108916754618d..ef56eab4e5daa451217e5d0f967eba005b7d1533 100644 (file)
@@ -1272,6 +1272,8 @@ static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool)
 
        /* update the public caps to indicate an underlay is available */
        ctx->dc->caps.max_slave_planes = 1;
+       ctx->dc->caps.max_slave_yuv_planes = 1;
+       ctx->dc->caps.max_slave_rgb_planes = 0;
 
        return true;
 }
index 33811953585b3d4ef1a00d2d33ecb0e164320b9c..d079f4e491e59ff92c19026fad4b4b5539f201a7 100644 (file)
@@ -1422,6 +1422,8 @@ static bool dcn10_resource_construct(
        dc->caps.max_cursor_size = 256;
        dc->caps.min_horizontal_blanking_period = 80;
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 0;
        dc->caps.is_apu = true;
        dc->caps.post_blend_color_processing = false;
        dc->caps.extended_aux_timeout_support = false;
index 9ae12a87d685853fe1618f4a614d9ae497d31d2d..2307b3517821da946f2de5a9bf356cad71825c53 100644 (file)
@@ -3703,6 +3703,8 @@ static bool dcn20_resource_construct(
        dc->caps.dmdata_alloc_size = 2048;
 
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 1;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
        dc->caps.extended_aux_timeout_support = true;
index bd8e4c0f92db30a7926a3268fc8e124728fee972..e62f931fc269fcfb7e9c04798a17924fd4bd32c3 100644 (file)
@@ -1982,6 +1982,8 @@ static bool dcn21_resource_construct(
        dc->caps.dmdata_alloc_size = 2048;
 
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 1;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
        dc->caps.extended_aux_timeout_support = true;
index a3ac7e275f3d685706225527526a6473c10dbe19..deab48806fa2bc1a6b7c619b1167b1d062913bd1 100644 (file)
@@ -2568,6 +2568,8 @@ static bool dcn30_resource_construct(
        dc->caps.cursor_cache_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size * 8;
 
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 1;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
        dc->caps.extended_aux_timeout_support = true;
index 039541924c9f05c7c359a40de6a3a7283e82533d..950b9a08084ef9929f01d1c0d603fbed2a6456ce 100644 (file)
@@ -1672,6 +1672,8 @@ static bool dcn301_resource_construct(
        dc->caps.min_horizontal_blanking_period = 80;
        dc->caps.dmdata_alloc_size = 2048;
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 1;
        dc->caps.is_apu = true;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
index 98b464e8b25eb6677d0f645e9b348e577117835a..daa16a41e6b7231341a836b48f7c2c44ef58017b 100644 (file)
@@ -1483,6 +1483,8 @@ static bool dcn302_resource_construct(
        dc->caps.mall_size_total = dc->caps.mall_size_per_mem_channel * dc->ctx->dc_bios->vram_info.num_chans * 1048576;
        dc->caps.cursor_cache_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size * 8;
        dc->caps.max_slave_planes = 1;
+       dc->caps.max_slave_yuv_planes = 1;
+       dc->caps.max_slave_rgb_planes = 1;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
        dc->caps.extended_aux_timeout_support = true;