From 6517d226acc8f07db7d730c727758e3a0f1e7cf8 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 1 Jul 2019 16:30:55 +0200 Subject: ac: compute the size of one DCC slice on GFX8 Addrlib doesn't provide this info. Because DCC is linear, at least on GFX8, it's easy to compute the size of one slice. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/common/ac_surface.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/amd/common/ac_surface.c') diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index f8b9d2b70f8..9e45bd44b72 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -302,6 +302,12 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib, surf_level->dcc_fast_clear_size = AddrDccOut->dccFastClearSize; else surf_level->dcc_fast_clear_size = 0; + + /* Compute the DCC slice size because addrlib doesn't + * provide this info. As DCC memory is linear (each + * slice is the same size) it's easy to compute. + */ + surf->dcc_slice_size = AddrDccOut->dccRamSize / config->info.array_size; } } -- cgit v1.2.3