Like radeonsi; replace with radeon_surf::num_dcc_levels.
Reviewed-by: Dave Airlie <airlied@redhat.com>
!(device->debug_flags & RADV_DEBUG_NO_FAST_CLEARS))
cb->cb_color_info |= S_028C70_FAST_CLEAR(1);
- if (iview->image->surface.dcc_size && level_info->dcc_enabled)
+ if (iview->image->surface.dcc_size && iview->base_mip < surf->num_dcc_levels)
cb->cb_color_info |= S_028C70_DCC_ENABLE(1);
if (device->physical_device->rad_info.chip_class >= VI) {
is_stencil));
state[4] |= S_008F20_PITCH_GFX6(pitch - 1);
- if (image->surface.dcc_size && image->surface.level[first_level].dcc_enabled) {
+ if (image->surface.dcc_size && first_level < image->surface.num_dcc_levels) {
state[6] |= S_008F28_COMPRESSION_EN(1);
state[7] = (gpu_address +
image->dcc_offset +
{
if (dest_image->surface.micro_tile_mode != src_image->surface.micro_tile_mode) {
- if (dest_image->surface.level[0].dcc_enabled)
+ if (dest_image->surface.num_dcc_levels > 0)
*method = RESOLVE_FRAGMENT;
else
*method = RESOLVE_COMPUTE;
uint32_t nblk_y;
uint32_t nblk_z;
uint32_t mode;
- bool dcc_enabled;
uint64_t dcc_offset;
uint64_t dcc_fast_clear_size;
};
uint32_t bpe;
uint32_t flags;
+ unsigned num_dcc_levels:4;
+
/* These are return values. Some of them can be set by the caller, but
* they will be treated as hints (e.g. bankw, bankh) and might be
* changed by the calculator.
/* Clear DCC fields at the beginning. */
surf_level->dcc_offset = 0;
- surf_level->dcc_enabled = false;
/* The previous level's flag tells us if we can use DCC for this level. */
if (AddrSurfInfoIn->flags.dccCompatible &&
if (ret == ADDR_OK) {
surf_level->dcc_offset = surf->dcc_size;
surf_level->dcc_fast_clear_size = AddrDccOut->dccFastClearSize;
- surf_level->dcc_enabled = true;
+ surf->num_dcc_levels = level + 1;
surf->dcc_size = surf_level->dcc_offset + AddrDccOut->dccRamSize;
surf->dcc_alignment = MAX2(surf->dcc_alignment, AddrDccOut->dccRamBaseAlign);
}
}
surf->bo_size = 0;
+ surf->num_dcc_levels = 0;
surf->dcc_size = 0;
surf->dcc_alignment = 1;
surf->htile_size = surf->htile_slice_size = 0;