summaryrefslogtreecommitdiff
path: root/src/freedreno/vulkan/tu_device.c
diff options
context:
space:
mode:
authorJonathan Marek <jonathan@marek.ca>2021-05-19 22:46:16 -0400
committerMarge Bot <eric+marge@anholt.net>2021-07-14 01:58:00 +0000
commit1a6dd7f9b1c1a43d9e1b66637e13af1de3f2c3cc (patch)
tree940117a9a147bfcea97be49ced834b3640434851 /src/freedreno/vulkan/tu_device.c
parenta37460e7ece9dd8f11e9e044af28bab81a3882fa (diff)
freedreno/common: unhardcode CCU color cache offset
Replace it with a calculation which works for all current GPUs. Duplicated the calculation in both drivers because freedreno_dev_info isn't meant for derived parameters (and drivers might want to just calculate on the fly instead). Signed-off-by: Jonathan Marek <jonathan@marek.ca> Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
Diffstat (limited to 'src/freedreno/vulkan/tu_device.c')
-rw-r--r--src/freedreno/vulkan/tu_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index 6c183487de1..c8e24496c86 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -202,6 +202,9 @@ tu_physical_device_init(struct tu_physical_device *device,
case 640:
case 650:
freedreno_dev_info_init(&device->info, device->gpu_id);
+ device->ccu_offset_bypass = device->info.num_ccu * A6XX_CCU_DEPTH_SIZE;
+ device->ccu_offset_gmem = (device->gmem_size -
+ device->info.num_ccu * A6XX_CCU_GMEM_COLOR_SIZE);
break;
default:
result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,