const struct isl_extent4d *phys_level0_sa,
enum isl_array_pitch_span array_pitch_span,
uint32_t *array_pitch_el_rows,
- struct isl_extent2d *total_extent_el)
+ struct isl_extent4d *phys_total_el)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
image_align_sa, phys_level0_sa,
array_pitch_span,
&phys_slice0_sa);
- *total_extent_el = (struct isl_extent2d) {
+ *phys_total_el = (struct isl_extent4d) {
.w = isl_align_div_npot(phys_slice0_sa.w, fmtl->bw),
.h = *array_pitch_el_rows * (phys_level0_sa->array_len - 1) +
isl_align_div_npot(phys_slice0_sa.h, fmtl->bh),
+ .d = 1,
+ .a = 1,
};
}
const struct isl_extent3d *image_align_sa,
const struct isl_extent4d *phys_level0_sa,
uint32_t *array_pitch_el_rows,
- struct isl_extent2d *phys_total_el)
+ struct isl_extent4d *phys_total_el)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
*/
*array_pitch_el_rows =
isl_align_npot(phys_level0_sa->h, image_align_sa->h) / fmtl->bw;
- *phys_total_el = (struct isl_extent2d) {
+ *phys_total_el = (struct isl_extent4d) {
.w = isl_assert_div(total_w, fmtl->bw),
.h = isl_assert_div(total_h, fmtl->bh),
+ .d = 1,
+ .a = 1,
};
}
const struct isl_extent3d *image_align_sa,
const struct isl_extent4d *phys_level0_sa,
uint32_t *array_pitch_el_rows,
- struct isl_extent2d *phys_total_el)
+ struct isl_extent4d *phys_total_el)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
*array_pitch_el_rows =
isl_assert_div(isl_align(H0, image_align_sa->h), fmtl->bh);
- *phys_total_el = (struct isl_extent2d) {
+ *phys_total_el = (struct isl_extent4d) {
.w = isl_assert_div(MAX(total_top_w, total_bottom_w), fmtl->bw),
.h = isl_assert_div(total_h, fmtl->bh),
+ .d = 1,
+ .a = 1,
};
}
const struct isl_extent3d *image_align_sa,
const struct isl_extent4d *phys_level0_sa,
uint32_t *array_pitch_el_rows,
- struct isl_extent2d *phys_total_el)
+ struct isl_extent4d *phys_total_el)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
}
*array_pitch_el_rows = 1;
- *phys_total_el = (struct isl_extent2d) {
+ *phys_total_el = (struct isl_extent4d) {
.w = isl_assert_div(slice_w, fmtl->bw),
.h = phys_level0_sa->array_len,
+ .d = 1,
+ .a = 1,
};
}
const struct isl_extent4d *phys_level0_sa,
enum isl_array_pitch_span array_pitch_span,
uint32_t *array_pitch_el_rows,
- struct isl_extent2d *total_extent_el)
+ struct isl_extent4d *phys_total_el)
{
switch (dim_layout) {
case ISL_DIM_LAYOUT_GFX9_1D:
isl_calc_phys_total_extent_el_gfx9_1d(dev, info,
image_align_sa, phys_level0_sa,
array_pitch_el_rows,
- total_extent_el);
+ phys_total_el);
return;
case ISL_DIM_LAYOUT_GFX4_2D:
isl_calc_phys_total_extent_el_gfx4_2d(dev, info, tile_info, msaa_layout,
image_align_sa, phys_level0_sa,
array_pitch_span,
array_pitch_el_rows,
- total_extent_el);
+ phys_total_el);
return;
case ISL_DIM_LAYOUT_GFX6_STENCIL_HIZ:
assert(array_pitch_span == ISL_ARRAY_PITCH_SPAN_COMPACT);
image_align_sa,
phys_level0_sa,
array_pitch_el_rows,
- total_extent_el);
+ phys_total_el);
return;
case ISL_DIM_LAYOUT_GFX4_3D:
assert(array_pitch_span == ISL_ARRAY_PITCH_SPAN_COMPACT);
isl_calc_phys_total_extent_el_gfx4_3d(dev, info,
image_align_sa, phys_level0_sa,
array_pitch_el_rows,
- total_extent_el);
+ phys_total_el);
return;
}
static uint32_t
isl_calc_linear_min_row_pitch(const struct isl_device *dev,
const struct isl_surf_init_info *info,
- const struct isl_extent2d *phys_total_el,
+ const struct isl_extent4d *phys_total_el,
uint32_t alignment_B)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
isl_calc_tiled_min_row_pitch(const struct isl_device *dev,
const struct isl_surf_init_info *surf_info,
const struct isl_tile_info *tile_info,
- const struct isl_extent2d *phys_total_el,
+ const struct isl_extent4d *phys_total_el,
uint32_t alignment_B)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(surf_info->format);
isl_calc_min_row_pitch(const struct isl_device *dev,
const struct isl_surf_init_info *surf_info,
const struct isl_tile_info *tile_info,
- const struct isl_extent2d *phys_total_el,
+ const struct isl_extent4d *phys_total_el,
uint32_t alignment_B)
{
if (tile_info->tiling == ISL_TILING_LINEAR) {
const struct isl_surf_init_info *surf_info,
const struct isl_tile_info *tile_info,
enum isl_dim_layout dim_layout,
- const struct isl_extent2d *phys_total_el,
+ const struct isl_extent4d *phys_total_el,
uint32_t *out_row_pitch_B)
{
uint32_t alignment_B =
isl_choose_array_pitch_span(dev, info, dim_layout, &phys_level0_sa);
uint32_t array_pitch_el_rows;
- struct isl_extent2d phys_total_el;
+ struct isl_extent4d phys_total_el;
isl_calc_phys_total_extent_el(dev, info, &tile_info,
dim_layout, msaa_layout,
&image_align_sa, &phys_level0_sa,
uint32_t base_alignment_B;
uint64_t size_B;
if (tiling == ISL_TILING_LINEAR) {
+ /* LINEAR tiling has no concept of intra-tile arrays */
+ assert(phys_total_el.d == 1 && phys_total_el.a == 1);
+
size_B = (uint64_t) row_pitch_B * phys_total_el.h;
/* From the Broadwell PRM Vol 2d, RENDER_SURFACE_STATE::SurfaceBaseAddress:
if (isl_surf_usage_is_display(info->usage))
base_alignment_B = MAX(base_alignment_B, 64);
} else {
+ /* Pitches must make sense with the tiling */
+ assert(row_pitch_B % tile_info.phys_extent_B.width == 0);
+
+ uint32_t array_slices, array_pitch_tl_rows;
+ if (phys_total_el.d > 1) {
+ assert(phys_total_el.a == 1);
+ array_pitch_tl_rows = isl_assert_div(array_pitch_el_rows,
+ tile_info.logical_extent_el.h);
+ array_slices = isl_align_div(phys_total_el.d,
+ tile_info.logical_extent_el.d);
+ } else if (phys_total_el.a > 1) {
+ assert(phys_total_el.d == 1);
+ array_pitch_tl_rows = isl_assert_div(array_pitch_el_rows,
+ tile_info.logical_extent_el.h);
+ array_slices = isl_align_div(phys_total_el.a,
+ tile_info.logical_extent_el.a);
+ assert(array_pitch_el_rows % tile_info.logical_extent_el.h == 0);
+ } else {
+ assert(phys_total_el.d == 1 && phys_total_el.a == 1);
+ array_pitch_tl_rows = 0;
+ array_slices = 1;
+ }
+
const uint32_t total_h_tl =
+ (array_slices - 1) * array_pitch_tl_rows +
isl_align_div(phys_total_el.h, tile_info.logical_extent_el.height);
size_B = (uint64_t) total_h_tl * tile_info.phys_extent_B.height * row_pitch_B;