From 580b2e85e48dbb82d168192c9f085d1c70355795 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 5 Jan 2016 13:53:05 -0800 Subject: [PATCH] isl/device: Add a flag for bit 6 swizzling --- src/isl/isl.c | 4 +++- src/isl/isl.h | 4 +++- src/vulkan/anv_device.c | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/isl/isl.c b/src/isl/isl.c index 015b14ea3d2..bb3d59576e0 100644 --- a/src/isl/isl.c +++ b/src/isl/isl.c @@ -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 diff --git a/src/isl/isl.h b/src/isl/isl.h index 9e07b2ff63c..2194818d7b7 100644 --- a/src/isl/isl.h +++ b/src/isl/isl.h @@ -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) diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index abc9ed66dd0..ddf5f4bed29 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -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; -- 2.30.2