summaryrefslogtreecommitdiffstats
path: root/src/intel/isl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-09-19 22:04:40 -0700
committerJason Ekstrand <[email protected]>2016-11-16 10:10:26 -0800
commitb3bc8068550d2efc98c49d7d82a6aa40154f76fe (patch)
treee4591cae1e83cd0d8ec2b1395fa3023714c1c0a9 /src/intel/isl
parentba349e106ec2aa48798676dd33edcf643d168b8e (diff)
intel/isl: Add some basic info about RENDER_SURFACE_STATE to isl_device
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r--src/intel/isl/isl.c19
-rw-r--r--src/intel/isl/isl.h11
2 files changed, 30 insertions, 0 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 32463b12982..658650ba6f3 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -46,6 +46,20 @@ __isl_finishme(const char *file, int line, const char *fmt, ...)
fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buf);
}
+static const struct {
+ uint8_t size;
+ uint8_t align;
+ uint8_t addr_offset;
+ uint8_t aux_addr_offset;
+} ss_infos[] = {
+ [4] = {24, 32, 4},
+ [5] = {24, 32, 4},
+ [6] = {24, 32, 4},
+ [7] = {32, 32, 4, 24},
+ [8] = {52, 64, 32, 40},
+ [9] = {64, 64, 32, 40},
+};
+
void
isl_device_init(struct isl_device *dev,
const struct gen_device_info *info,
@@ -67,6 +81,11 @@ isl_device_init(struct isl_device *dev,
assert(info->has_hiz_and_separate_stencil);
if (info->must_use_separate_stencil)
assert(ISL_DEV_USE_SEPARATE_STENCIL(dev));
+
+ dev->ss.size = ss_infos[ISL_DEV_GEN(dev)].size;
+ dev->ss.align = ss_infos[ISL_DEV_GEN(dev)].align;
+ dev->ss.addr_offset = ss_infos[ISL_DEV_GEN(dev)].addr_offset;
+ dev->ss.aux_addr_offset = ss_infos[ISL_DEV_GEN(dev)].aux_addr_offset;
}
/**
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 11ad8919e64..07368f9bcf5 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -671,6 +671,17 @@ struct isl_device {
const struct gen_device_info *info;
bool use_separate_stencil;
bool has_bit6_swizzling;
+
+ /**
+ * Describes the layout of a RENDER_SURFACE_STATE structure for the
+ * current gen.
+ */
+ struct {
+ uint8_t size;
+ uint8_t align;
+ uint8_t addr_offset;
+ uint8_t aux_addr_offset;
+ } ss;
};
struct isl_extent2d {