radv: remove dependency on addrlib gfx9_enum.h
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 19 Nov 2018 17:23:40 +0000 (18:23 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 29 Nov 2018 12:18:23 +0000 (13:18 +0100)
v2:
- use SI_CONTEXT_REG_OFFSET

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/sid.h
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c

index 35782046dd5df034e5d3c34f224dc0d72e4895b4..49683f1aa5a568855e1f661ed1beba9a00602546 100644 (file)
 #define   S_008F30_FILTER_MODE(x)                                     (((unsigned)(x) & 0x03) << 29)
 #define   G_008F30_FILTER_MODE(x)                                     (((x) >> 29) & 0x03)
 #define   C_008F30_FILTER_MODE                                        0x9FFFFFFF
+#define     V_008F30_SQ_IMG_FILTER_MODE_BLEND                       0x00
+#define     V_008F30_SQ_IMG_FILTER_MODE_MIN                         0x01
+#define     V_008F30_SQ_IMG_FILTER_MODE_MAX                         0x02
 /* VI */
 #define   S_008F30_COMPAT_MODE(x)                                     (((unsigned)(x) & 0x1) << 31)
 #define   G_008F30_COMPAT_MODE(x)                                     (((x) >> 31) & 0x1)
index a3b3d0a6f2038e9b488f6175ff36738dab448580..ccf762ead466f741862654487370f6b393dfe666 100644 (file)
@@ -37,8 +37,6 @@
 
 #include "ac_debug.h"
 
-#include "addrlib/gfx9/chip/gfx9_enum.h"
-
 enum {
        RADV_PREFETCH_VBO_DESCRIPTORS   = (1 << 0),
        RADV_PREFETCH_VS                = (1 << 1),
@@ -1320,7 +1318,7 @@ radv_load_ds_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
                radeon_emit(cs, PKT3(PKT3_LOAD_CONTEXT_REG, 3, 0));
                radeon_emit(cs, va);
                radeon_emit(cs, va >> 32);
-               radeon_emit(cs, (reg >> 2) - CONTEXT_SPACE_START);
+               radeon_emit(cs, (reg - SI_CONTEXT_REG_OFFSET) >> 2);
                radeon_emit(cs, reg_count);
        } else {
                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
@@ -1457,7 +1455,7 @@ radv_load_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
                radeon_emit(cs, PKT3(PKT3_LOAD_CONTEXT_REG, 3, cmd_buffer->state.predicating));
                radeon_emit(cs, va);
                radeon_emit(cs, va >> 32);
-               radeon_emit(cs, (reg >> 2) - CONTEXT_SPACE_START);
+               radeon_emit(cs, (reg - SI_CONTEXT_REG_OFFSET) >> 2);
                radeon_emit(cs, 2);
        } else {
                /* TODO: Figure out how to use LOAD_CONTEXT_REG on SI/CIK. */
index 70084a2b6056d1aad3f03d18187ebb5d67e7ca1d..ad057a875090935f59b8c1e7cb59c53df621c622 100644 (file)
@@ -45,7 +45,6 @@
 #include "sid.h"
 #include "git_sha1.h"
 #include "gfx9d.h"
-#include "addrlib/gfx9/chip/gfx9_enum.h"
 #include "util/build_id.h"
 #include "util/debug.h"
 #include "util/mesa-sha1.h"
@@ -4526,11 +4525,11 @@ radv_tex_filter_mode(VkSamplerReductionModeEXT mode)
 {
        switch (mode) {
        case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT:
-               return SQ_IMG_FILTER_MODE_BLEND;
+               return V_008F30_SQ_IMG_FILTER_MODE_BLEND;
        case VK_SAMPLER_REDUCTION_MODE_MIN_EXT:
-               return SQ_IMG_FILTER_MODE_MIN;
+               return V_008F30_SQ_IMG_FILTER_MODE_MIN;
        case VK_SAMPLER_REDUCTION_MODE_MAX_EXT:
-               return SQ_IMG_FILTER_MODE_MAX;
+               return V_008F30_SQ_IMG_FILTER_MODE_MAX;
        default:
                break;
        }
@@ -4559,7 +4558,7 @@ radv_init_sampler(struct radv_device *device,
        uint32_t max_aniso = radv_get_max_anisotropy(device, pCreateInfo);
        uint32_t max_aniso_ratio = radv_tex_aniso_filter(max_aniso);
        bool is_vi = (device->physical_device->rad_info.chip_class >= VI);
-       unsigned filter_mode = SQ_IMG_FILTER_MODE_BLEND;
+       unsigned filter_mode = V_008F30_SQ_IMG_FILTER_MODE_BLEND;
 
        const struct VkSamplerReductionModeCreateInfoEXT *sampler_reduction =
                vk_find_struct_const(pCreateInfo->pNext,