diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 7b80bae0731..58bd4b9e5a0 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -2057,14 +2057,17 @@ static int gfx9_compute_surface(struct ac_addrlib *addrlib, const struct radeon_ ac_modifier_fill_dcc_params(surf->modifier, surf, &AddrSurfInfoIn); } else if (!AddrSurfInfoIn.flags.depth && !AddrSurfInfoIn.flags.stencil) { /* Optimal values for the L2 cache. */ - if (info->chip_class == GFX9) { - surf->u.gfx9.color.dcc.independent_64B_blocks = 1; - surf->u.gfx9.color.dcc.independent_128B_blocks = 0; - surf->u.gfx9.color.dcc.max_compressed_block_size = V_028C78_MAX_BLOCK_SIZE_64B; - } else if (info->chip_class >= GFX10) { - surf->u.gfx9.color.dcc.independent_64B_blocks = 0; - surf->u.gfx9.color.dcc.independent_128B_blocks = 1; - surf->u.gfx9.color.dcc.max_compressed_block_size = V_028C78_MAX_BLOCK_SIZE_128B; + /* Don't change the DCC settings for imported buffers - they might differ. */ + if (!(surf->flags & RADEON_SURF_IMPORTED)) { + if (info->chip_class == GFX9) { + surf->u.gfx9.color.dcc.independent_64B_blocks = 1; + surf->u.gfx9.color.dcc.independent_128B_blocks = 0; + surf->u.gfx9.color.dcc.max_compressed_block_size = V_028C78_MAX_BLOCK_SIZE_64B; + } else if (info->chip_class >= GFX10) { + surf->u.gfx9.color.dcc.independent_64B_blocks = 0; + surf->u.gfx9.color.dcc.independent_128B_blocks = 1; + surf->u.gfx9.color.dcc.max_compressed_block_size = V_028C78_MAX_BLOCK_SIZE_128B; + } } if (AddrSurfInfoIn.flags.display) { @@ -2081,7 +2084,9 @@ static int gfx9_compute_surface(struct ac_addrlib *addrlib, const struct radeon_ } /* Adjust DCC settings to meet DCN requirements. */ - if (info->use_display_dcc_unaligned || info->use_display_dcc_with_retile_blit) { + /* Don't change the DCC settings for imported buffers - they might differ. */ + if (!(surf->flags & RADEON_SURF_IMPORTED) && + (info->use_display_dcc_unaligned || info->use_display_dcc_with_retile_blit)) { /* Only Navi12/14 support independent 64B blocks in L2, * but without DCC image stores. */