turnip: remove extra gmem alignment
authorJonathan Marek <jonathan@marek.ca>
Thu, 18 Jun 2020 03:42:48 +0000 (23:42 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 24 Jul 2020 13:44:42 +0000 (13:44 +0000)
Now that we clear the PITCHALIGN" field when filling GMEM input attachment
descriptors, we can get rid of the extra tile width alignment on a630/a640.

With the "block_align_shift" value change, this brings down the default
gmem_align from 16k to 4k on a630/a640 and down from 24k to 12k on a650,
to match the gallium driver.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5528>

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_pass.c

index 5ba6b01be9e9d60251d6b69cd8d07635f55ec3cd..10eaf65698fd8b0dbff74c8c3a676591ba221ddf 100644 (file)
@@ -265,7 +265,7 @@ tu_physical_device_init(struct tu_physical_device *device,
    case 618:
       device->ccu_offset_gmem = 0x7c000; /* 0x7e000 in some cases? */
       device->ccu_offset_bypass = 0x10000;
-      device->tile_align_w = 64;
+      device->tile_align_w = 32;
       device->magic.PC_UNKNOWN_9805 = 0x0;
       device->magic.SP_UNKNOWN_A0F8 = 0x0;
       break;
@@ -273,7 +273,7 @@ tu_physical_device_init(struct tu_physical_device *device,
    case 640:
       device->ccu_offset_gmem = 0xf8000;
       device->ccu_offset_bypass = 0x20000;
-      device->tile_align_w = 64;
+      device->tile_align_w = 32;
       device->magic.PC_UNKNOWN_9805 = 0x1;
       device->magic.SP_UNKNOWN_A0F8 = 0x1;
       break;
index d5c3c82559b2cc719a6af3b63173373bd2740a79..4b1ec4c80b64f9d5d3a09e5ee2bb12f82e2691dd 100644 (file)
@@ -289,7 +289,7 @@ static void
 tu_render_pass_gmem_config(struct tu_render_pass *pass,
                            const struct tu_physical_device *phys_dev)
 {
-   uint32_t block_align_shift = 4; /* log2(gmem_align/(tile_align_w*tile_align_h)) */
+   uint32_t block_align_shift = 3; /* log2(gmem_align/(tile_align_w*tile_align_h)) */
    uint32_t tile_align_w = phys_dev->tile_align_w;
    uint32_t gmem_align = (1 << block_align_shift) * tile_align_w * TILE_ALIGN_H;