isl/device: Add a flag for bit 6 swizzling
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Jan 2016 21:53:05 +0000 (13:53 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 19 Jan 2016 01:21:05 +0000 (17:21 -0800)
src/isl/isl.c
src/isl/isl.h
src/vulkan/anv_device.c

index 015b14ea3d2148d2de9954117fdfbd4de42c5188..bb3d59576e0cb135db91839092022b61e7a0d448 100644 (file)
@@ -46,10 +46,12 @@ __isl_finishme(const char *file, int line, const char *fmt, ...)
 
 void
 isl_device_init(struct isl_device *dev,
-                const struct brw_device_info *info)
+                const struct brw_device_info *info,
+                bool has_bit6_swizzling)
 {
    dev->info = info;
    dev->use_separate_stencil = ISL_DEV_GEN(dev) >= 6;
+   dev->has_bit6_swizzling = has_bit6_swizzling;
 
    /* The ISL_DEV macros may be defined in the CFLAGS, thus hardcoding some
     * device properties at buildtime. Verify that the macros with the device
index 9e07b2ff63cbf395585acad2988f0135daca1de0..2194818d7b73aeb9df2b1ea1885283cd6eb989cd 100644 (file)
@@ -608,6 +608,7 @@ enum isl_msaa_layout {
 struct isl_device {
    const struct brw_device_info *info;
    bool use_separate_stencil;
+   bool has_bit6_swizzling;
 };
 
 struct isl_extent2d {
@@ -766,7 +767,8 @@ extern const struct isl_format_layout isl_format_layouts[];
 
 void
 isl_device_init(struct isl_device *dev,
-                const struct brw_device_info *info);
+                const struct brw_device_info *info,
+                bool has_bit6_swizzling);
 
 static inline const struct isl_format_layout * ATTRIBUTE_CONST
 isl_format_get_layout(enum isl_format fmt)
index abc9ed66dd07cf541e7e2a01f9ce59fb7bb61619..ddf5f4bed2998d6db9c9cfa1e1db9548b53575ed 100644 (file)
@@ -123,6 +123,8 @@ anv_physical_device_init(struct anv_physical_device *device,
       goto fail;
    }
 
+   bool swizzled = anv_gem_get_bit6_swizzle(fd, I915_TILING_X);
+
    close(fd);
 
    brw_process_intel_debug_variable();
@@ -135,7 +137,8 @@ anv_physical_device_init(struct anv_physical_device *device,
    device->compiler->shader_debug_log = compiler_debug_log;
    device->compiler->shader_perf_log = compiler_perf_log;
 
-   isl_device_init(&device->isl_dev, device->info);
+   /* XXX: Actually detect bit6 swizzling */
+   isl_device_init(&device->isl_dev, device->info, swizzled);
 
    return VK_SUCCESS;