amd/common/radv/radeonsi: use register defines for dcc block sizes.
authorDave Airlie <airlied@redhat.com>
Tue, 26 Dec 2017 21:56:12 +0000 (07:56 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 27 Dec 2017 01:10:35 +0000 (11:10 +1000)
These are just taken from amdvlk, we probably knew these already,
but may as well port them now.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/sid.h
src/amd/vulkan/radv_device.c
src/gallium/drivers/radeonsi/si_state.c

index 59a7e2a06e69852dea514aa781e278acf12b1369..3588d39d62b44cb1619a306afb4001a4ba4fff86 100644 (file)
 #define   S_028C78_MAX_UNCOMPRESSED_BLOCK_SIZE(x)                     (((unsigned)(x) & 0x03) << 2)
 #define   G_028C78_MAX_UNCOMPRESSED_BLOCK_SIZE(x)                     (((x) >> 2) & 0x03)
 #define   C_028C78_MAX_UNCOMPRESSED_BLOCK_SIZE                        0xFFFFFFF3
+#define     V_028C78_MAX_BLOCK_SIZE_64B                               0
+#define     V_028C78_MAX_BLOCK_SIZE_128B                              1
+#define     V_028C78_MAX_BLOCK_SIZE_256B                              2
+
 #define   S_028C78_MIN_COMPRESSED_BLOCK_SIZE(x)                       (((unsigned)(x) & 0x1) << 4)
 #define   G_028C78_MIN_COMPRESSED_BLOCK_SIZE(x)                       (((x) >> 4) & 0x1)
 #define   C_028C78_MIN_COMPRESSED_BLOCK_SIZE                          0xFFFFFFEF
+#define     V_028C78_MIN_BLOCK_SIZE_32B                               0
+#define     V_028C78_MIN_BLOCK_SIZE_64B                               1
 #define   S_028C78_MAX_COMPRESSED_BLOCK_SIZE(x)                       (((unsigned)(x) & 0x03) << 5)
 #define   G_028C78_MAX_COMPRESSED_BLOCK_SIZE(x)                       (((x) >> 5) & 0x03)
 #define   C_028C78_MAX_COMPRESSED_BLOCK_SIZE                          0xFFFFFF9F
index 3056122593c1b1dd7fe86bfb79f4fb22b70ab3ce..5c8d51dedc7a65d9b5c6a6442886b98ef003366d 100644 (file)
@@ -3161,12 +3161,12 @@ radv_initialise_color_surface(struct radv_device *device,
                cb->cb_color_info |= S_028C70_DCC_ENABLE(1);
 
        if (device->physical_device->rad_info.chip_class >= VI) {
-               unsigned max_uncompressed_block_size = 2;
+               unsigned max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_256B;
                if (iview->image->info.samples > 1) {
                        if (iview->image->surface.bpe == 1)
-                               max_uncompressed_block_size = 0;
+                               max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_64B;
                        else if (iview->image->surface.bpe == 2)
-                               max_uncompressed_block_size = 1;
+                               max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_128B;
                }
 
                cb->cb_dcc_control = S_028C78_MAX_UNCOMPRESSED_BLOCK_SIZE(max_uncompressed_block_size) |
index 7cf3896a5c75d685e333f08f4b630eef48d381b1..d2d5dd70ecfedd52a28511028496a548443d0dcd 100644 (file)
@@ -2450,13 +2450,13 @@ static void si_initialize_color_surface(struct si_context *sctx,
        }
 
        if (sctx->b.chip_class >= VI) {
-               unsigned max_uncompressed_block_size = 2;
+               unsigned max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_256B;
 
                if (rtex->resource.b.b.nr_samples > 1) {
                        if (rtex->surface.bpe == 1)
-                               max_uncompressed_block_size = 0;
+                               max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_64B;
                        else if (rtex->surface.bpe == 2)
-                               max_uncompressed_block_size = 1;
+                               max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_128B;
                }
 
                surf->cb_dcc_control = S_028C78_MAX_UNCOMPRESSED_BLOCK_SIZE(max_uncompressed_block_size) |