summaryrefslogtreecommitdiffstats
path: root/src/intel/isl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-08 22:11:06 -0700
committerJason Ekstrand <[email protected]>2016-07-13 11:47:37 -0700
commitfc3650a0a9eca29a9498f663d489ab729f55f65f (patch)
tree58d4b157cbc50708ba85cf59fe759a9730559b9b /src/intel/isl
parent1f0433f07575b797f6073c0b421adbc5658e1107 (diff)
isl: Kill off isl_format_layout::bs
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r--src/intel/isl/gen_format_layout.py1
-rw-r--r--src/intel/isl/isl.c11
-rw-r--r--src/intel/isl/isl.h5
-rw-r--r--src/intel/isl/isl_gen9.c14
-rw-r--r--src/intel/isl/isl_storage_image.c4
5 files changed, 17 insertions, 18 deletions
diff --git a/src/intel/isl/gen_format_layout.py b/src/intel/isl/gen_format_layout.py
index 803967ec490..c9163fed194 100644
--- a/src/intel/isl/gen_format_layout.py
+++ b/src/intel/isl/gen_format_layout.py
@@ -68,7 +68,6 @@ TEMPLATE = template.Template(
.format = ISL_FORMAT_${format.name},
.name = "ISL_FORMAT_${format.name}",
.bpb = ${format.bpb},
- .bs = ${format.bpb // 8},
.bw = ${format.bw},
.bh = ${format.bh},
.bd = ${format.bd},
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index f6c9200674c..aaf4d1c8c77 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -904,7 +904,8 @@ isl_calc_linear_row_pitch(const struct isl_device *dev,
* being used to determine whether additional pages need to be defined.
*/
assert(phys_slice0_sa->w % fmtl->bw == 0);
- row_pitch = MAX(row_pitch, fmtl->bs * (phys_slice0_sa->w / fmtl->bw));
+ const uint32_t bs = fmtl->bpb / 8;
+ row_pitch = MAX(row_pitch, bs * (phys_slice0_sa->w / fmtl->bw));
/* From the Broadwel PRM >> Volume 2d: Command Reference: Structures >>
* RENDER_SURFACE_STATE Surface Pitch (p349):
@@ -922,9 +923,9 @@ isl_calc_linear_row_pitch(const struct isl_device *dev,
*/
if (info->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT) {
if (isl_format_is_yuv(info->format)) {
- row_pitch = isl_align_npot(row_pitch, 2 * fmtl->bs);
+ row_pitch = isl_align_npot(row_pitch, 2 * bs);
} else {
- row_pitch = isl_align_npot(row_pitch, fmtl->bs);
+ row_pitch = isl_align_npot(row_pitch, bs);
}
}
@@ -1120,9 +1121,9 @@ isl_surf_init_s(const struct isl_device *dev,
base_alignment = MAX(1, info->min_alignment);
if (info->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT) {
if (isl_format_is_yuv(info->format)) {
- base_alignment = MAX(base_alignment, 2 * fmtl->bs);
+ base_alignment = MAX(base_alignment, fmtl->bpb / 4);
} else {
- base_alignment = MAX(base_alignment, fmtl->bs);
+ base_alignment = MAX(base_alignment, fmtl->bpb / 8);
}
}
} else {
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 5c697a64d5e..a86688c91bc 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -640,7 +640,6 @@ struct isl_format_layout {
const char *name;
uint16_t bpb; /**< Bits per block */
- uint8_t bs; /**< Block size, in bytes, rounded towards 0 */
uint8_t bw; /**< Block width, in pixels */
uint8_t bh; /**< Block height, in pixels */
uint8_t bd; /**< Block depth, in pixels */
@@ -1203,8 +1202,8 @@ isl_surf_get_row_pitch_el(const struct isl_surf *surf)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format);
- assert(surf->row_pitch % fmtl->bs == 0);
- return surf->row_pitch / fmtl->bs;
+ assert(surf->row_pitch % (fmtl->bpb / 8) == 0);
+ return surf->row_pitch / (fmtl->bpb / 8);
}
/**
diff --git a/src/intel/isl/isl_gen9.c b/src/intel/isl/isl_gen9.c
index aa290aa1c35..39f409245cd 100644
--- a/src/intel/isl/isl_gen9.c
+++ b/src/intel/isl/isl_gen9.c
@@ -40,7 +40,7 @@ gen9_calc_std_image_alignment_sa(const struct isl_device *dev,
assert(isl_tiling_is_std_y(tiling));
- const uint32_t bs = fmtl->bs;
+ const uint32_t bpb = fmtl->bpb;
const uint32_t is_Ys = tiling == ISL_TILING_Ys;
switch (info->dim) {
@@ -49,7 +49,7 @@ gen9_calc_std_image_alignment_sa(const struct isl_device *dev,
* Layout and Tiling > 1D Surfaces > 1D Alignment Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (12 - (ffs(bs) - 1) + (4 * is_Ys)),
+ .w = 1 << (12 - (ffs(bpb) - 4) + (4 * is_Ys)),
.h = 1,
.d = 1,
};
@@ -60,8 +60,8 @@ gen9_calc_std_image_alignment_sa(const struct isl_device *dev,
* Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (6 - ((ffs(bs) - 1) / 2) + (4 * is_Ys)),
- .h = 1 << (6 - ((ffs(bs) - 0) / 2) + (4 * is_Ys)),
+ .w = 1 << (6 - ((ffs(bpb) - 4) / 2) + (4 * is_Ys)),
+ .h = 1 << (6 - ((ffs(bpb) - 3) / 2) + (4 * is_Ys)),
.d = 1,
};
@@ -86,9 +86,9 @@ gen9_calc_std_image_alignment_sa(const struct isl_device *dev,
* Layout and Tiling > 1D Surfaces > 1D Alignment Requirements.
*/
*align_sa = (struct isl_extent3d) {
- .w = 1 << (4 - ((ffs(bs) + 1) / 3) + (4 * is_Ys)),
- .h = 1 << (4 - ((ffs(bs) - 1) / 3) + (2 * is_Ys)),
- .d = 1 << (4 - ((ffs(bs) - 0) / 3) + (2 * is_Ys)),
+ .w = 1 << (4 - ((ffs(bpb) - 2) / 3) + (4 * is_Ys)),
+ .h = 1 << (4 - ((ffs(bpb) - 4) / 3) + (2 * is_Ys)),
+ .d = 1 << (4 - ((ffs(bpb) - 3) / 3) + (2 * is_Ys)),
};
return;
}
diff --git a/src/intel/isl/isl_storage_image.c b/src/intel/isl/isl_storage_image.c
index 2617eb0eaff..01d388180d6 100644
--- a/src/intel/isl/isl_storage_image.c
+++ b/src/intel/isl/isl_storage_image.c
@@ -229,7 +229,7 @@ isl_surf_fill_image_param(const struct isl_device *dev,
isl_surf_get_image_offset_el(surf, view->base_level, view->base_array_layer,
0, &param->offset[0], &param->offset[1]);
- const int cpp = isl_format_get_layout(surf->format)->bs;
+ const int cpp = isl_format_get_layout(surf->format)->bpb / 8;
param->stride[0] = cpp;
param->stride[1] = surf->row_pitch / cpp;
@@ -301,6 +301,6 @@ isl_buffer_fill_image_param(const struct isl_device *dev,
{
*param = image_param_defaults;
- param->stride[0] = isl_format_layouts[format].bs;
+ param->stride[0] = isl_format_layouts[format].bpb / 8;
param->size[0] = size / param->stride[0];
}