Skip to content

Commit c7c703e

Browse files
Karthi Kandasamyalexdeucher
authored andcommitted
drm/amd/display: Ensure correct GFX tiling info passed to DML
[Why] To ensure DML validation receives the correct tiling information, such as swizzle mode or array mode, based on the active GFX format [How] - For new GFX format passed swizzle_mode to DML. - For legacy GFX format passed array_mode to DML. - Dynamically determined the appropriate tiling info based on the active GFX format. [Description] This commit ensures that the correct GFX tiling information is passed to DML. Depending on the active GFX format, the appropriate tiling info is passed to DML. This change accommodates the different GFX formats supported by latest platforms, ensuring compatibility and proper DML validation. Reviewed-by: Alvin Lee <[email protected]> Signed-off-by: Karthi Kandasamy <[email protected]> Signed-off-by: Roman Li <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 080950c commit c7c703e

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static void amdgpu_dm_plane_fill_gfx8_tiling_info_from_flags(struct dc_tiling_in
190190
tile_split = AMDGPU_TILING_GET(tiling_flags, TILE_SPLIT);
191191
num_banks = AMDGPU_TILING_GET(tiling_flags, NUM_BANKS);
192192

193+
tiling_info->gfxversion = DcGfxVersion8;
193194
/* XXX fix me for VI */
194195
tiling_info->gfx8.num_banks = num_banks;
195196
tiling_info->gfx8.array_mode =
@@ -317,6 +318,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdg
317318

318319
amdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier(adev, tiling_info, modifier);
319320
tiling_info->gfx9.swizzle = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier);
321+
tiling_info->gfxversion = DcGfxVersion9;
320322

321323
if (amdgpu_dm_plane_modifier_has_dcc(modifier)) {
322324
uint64_t dcc_address = afb->address + afb->base.offsets[1];
@@ -369,6 +371,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amd
369371
amdgpu_dm_plane_fill_gfx9_tiling_info_from_device(adev, tiling_info);
370372

371373
tiling_info->gfx9.swizzle = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier);
374+
tiling_info->gfxversion = DcGfxAddr3;
372375

373376
if (amdgpu_dm_plane_modifier_has_dcc(modifier)) {
374377
int max_compressed_block = AMD_FMT_MOD_GET(DCC_MAX_COMPRESSED_BLOCK, modifier);

drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,21 @@ static void populate_dml21_surface_config_from_plane_state(
721721
surface->dcc.informative.fraction_of_zero_size_request_plane1 = plane_state->dcc.independent_64b_blks_c;
722722
surface->dcc.plane0.pitch = plane_state->dcc.meta_pitch;
723723
surface->dcc.plane1.pitch = plane_state->dcc.meta_pitch_c;
724-
if (in_dc->ctx->dce_version < DCN_VERSION_4_01) {
725-
/* needed for N-1 testing */
724+
725+
// Update swizzle / array mode based on the gfx_format
726+
switch (plane_state->tiling_info.gfxversion) {
727+
case DcGfxVersion7:
728+
case DcGfxVersion8:
729+
// Placeholder for programming the array_mode
730+
break;
731+
case DcGfxVersion9:
732+
case DcGfxVersion10:
733+
case DcGfxVersion11:
726734
surface->tiling = gfx9_to_dml2_swizzle_mode(plane_state->tiling_info.gfx9.swizzle);
727-
} else {
735+
break;
736+
case DcGfxAddr3:
728737
surface->tiling = gfx_addr3_to_dml2_swizzle_mode(plane_state->tiling_info.gfx_addr3.swizzle);
738+
break;
729739
}
730740
}
731741

drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,13 @@ static bool dcn35_validate_bandwidth(struct dc *dc,
17521752
return out;
17531753
}
17541754

1755+
enum dc_status dcn35_patch_unknown_plane_state(struct dc_plane_state *plane_state)
1756+
{
1757+
plane_state->tiling_info.gfxversion = DcGfxVersion9;
1758+
dcn20_patch_unknown_plane_state(plane_state);
1759+
return DC_OK;
1760+
}
1761+
17551762

17561763
static struct resource_funcs dcn35_res_pool_funcs = {
17571764
.destroy = dcn35_destroy_resource_pool,
@@ -1775,7 +1782,7 @@ static struct resource_funcs dcn35_res_pool_funcs = {
17751782
.acquire_post_bldn_3dlut = dcn30_acquire_post_bldn_3dlut,
17761783
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
17771784
.update_bw_bounding_box = dcn35_update_bw_bounding_box_fpu,
1778-
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
1785+
.patch_unknown_plane_state = dcn35_patch_unknown_plane_state,
17791786
.get_panel_config_defaults = dcn35_get_panel_config_defaults,
17801787
.get_preferred_eng_id_dpia = dcn35_get_preferred_eng_id_dpia,
17811788
.get_det_buffer_size = dcn31_get_det_buffer_size,

drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
extern struct _vcs_dpi_ip_params_st dcn3_5_ip;
3737
extern struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc;
38+
enum dc_status dcn35_patch_unknown_plane_state(struct dc_plane_state *plane_state);
3839

3940
struct dcn35_resource_pool {
4041
struct resource_pool base;

drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ static struct resource_funcs dcn351_res_pool_funcs = {
17541754
.acquire_post_bldn_3dlut = dcn30_acquire_post_bldn_3dlut,
17551755
.release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
17561756
.update_bw_bounding_box = dcn351_update_bw_bounding_box_fpu,
1757-
.patch_unknown_plane_state = dcn20_patch_unknown_plane_state,
1757+
.patch_unknown_plane_state = dcn35_patch_unknown_plane_state,
17581758
.get_panel_config_defaults = dcn35_get_panel_config_defaults,
17591759
.get_preferred_eng_id_dpia = dcn351_get_preferred_eng_id_dpia,
17601760
.get_det_buffer_size = dcn31_get_det_buffer_size,

drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ static void dcn401_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *b
16091609

16101610
enum dc_status dcn401_patch_unknown_plane_state(struct dc_plane_state *plane_state)
16111611
{
1612+
plane_state->tiling_info.gfxversion = DcGfxAddr3;
16121613
plane_state->tiling_info.gfx_addr3.swizzle = DC_ADDR3_SW_64KB_2D;
16131614
return DC_OK;
16141615
}

0 commit comments

Comments
 (0)