[Mesa-dev] [PATCH 07/21] intel/isl: Take a dim and sample count in isl_tiling_get_info
Jason Ekstrand
jason at jlekstrand.net
Fri Feb 23 07:06:47 UTC 2018
The layout of Yf and Ys tiles are dependent on these parameters.
---
src/intel/blorp/blorp_blit.c | 5 +++--
src/intel/isl/isl.c | 15 ++++++++++-----
src/intel/isl/isl.h | 8 ++++++--
src/mesa/drivers/dri/i965/intel_blit.c | 5 +++--
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 46cfc37..876498d 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1928,8 +1928,9 @@ shrink_surface_params(const struct isl_device *dev,
x_offset_sa = (uint32_t)*x0 * px_size_sa.w + info->tile_x_sa;
y_offset_sa = (uint32_t)*y0 * px_size_sa.h + info->tile_y_sa;
uint32_t tile_z_sa, tile_a;
- isl_tiling_get_intratile_offset_sa(info->surf.tiling,
- info->surf.format, info->surf.row_pitch,
+ isl_tiling_get_intratile_offset_sa(info->surf.tiling, info->surf.dim,
+ info->surf.format, info->surf.samples,
+ info->surf.row_pitch,
info->surf.array_pitch_el_rows,
x_offset_sa, y_offset_sa, 0, 0,
&byte_offset,
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 95c1271..aa56a3c 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -173,7 +173,8 @@ isl_tiling_get_info(enum isl_tiling tiling,
*/
assert(tiling == ISL_TILING_X || tiling == ISL_TILING_Y0);
assert(bs % 3 == 0 && isl_is_pow2(format_bpb / 3));
- isl_tiling_get_info(tiling, format_bpb / 3, tile_info);
+ assert(samples == 1);
+ isl_tiling_get_info(tiling, dim, format_bpb / 3, samples, tile_info);
return;
}
@@ -1430,7 +1431,7 @@ isl_surf_init_s(const struct isl_device *dev,
return false;
struct isl_tile_info tile_info;
- isl_tiling_get_info(tiling, fmtl->bpb, &tile_info);
+ isl_tiling_get_info(tiling, info->dim, fmtl->bpb, info->samples, &tile_info);
const enum isl_dim_layout dim_layout =
isl_surf_choose_dim_layout(dev, info->dim, tiling, info->usage);
@@ -2037,7 +2038,7 @@ get_image_offset_sa_gen6_stencil_hiz(const struct isl_surf *surf,
isl_surf_get_image_alignment_sa(surf);
struct isl_tile_info tile_info;
- isl_tiling_get_info(surf->tiling, fmtl->bpb, &tile_info);
+ isl_surf_get_tile_info(surf, &tile_info);
const struct isl_extent2d tile_extent_sa = {
.w = tile_info.logical_extent_el.w * fmtl->bw,
.h = tile_info.logical_extent_el.h * fmtl->bh,
@@ -2253,7 +2254,8 @@ isl_surf_get_image_offset_B_tile_el(const struct isl_surf *surf,
&total_array_offset);
uint32_t z_offset_el, array_offset;
- isl_tiling_get_intratile_offset_el(surf->tiling, fmtl->bpb,
+ isl_tiling_get_intratile_offset_el(surf->tiling, surf->dim,
+ fmtl->bpb, surf->samples,
surf->row_pitch,
surf->array_pitch_el_rows,
total_x_offset_el,
@@ -2312,7 +2314,9 @@ isl_surf_get_image_surf(const struct isl_device *dev,
void
isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
+ enum isl_surf_dim dim,
uint32_t bpb,
+ uint32_t samples,
uint32_t row_pitch_B,
uint32_t array_pitch_el_rows,
uint32_t total_x_offset_el,
@@ -2327,6 +2331,7 @@ isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
{
if (tiling == ISL_TILING_LINEAR) {
assert(bpb % 8 == 0);
+ assert(samples == 1);
assert(total_z_offset_el == 0 && total_array_offset == 0);
*base_address_offset = total_y_offset_el * row_pitch_B +
total_x_offset_el * (bpb / 8);
@@ -2338,7 +2343,7 @@ isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
}
struct isl_tile_info tile_info;
- isl_tiling_get_info(tiling, bpb, &tile_info);
+ isl_tiling_get_info(tiling, dim, bpb, samples, &tile_info);
/* Pitches must make sense with the tiling */
assert(row_pitch_B % tile_info.phys_extent_B.width == 0);
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index aa5bfed..8333a8c 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -1969,7 +1969,9 @@ isl_surf_get_image_surf(const struct isl_device *dev,
*/
void
isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
+ enum isl_surf_dim dim,
uint32_t bpb,
+ uint32_t samples,
uint32_t row_pitch,
uint32_t array_pitch_el_rows,
uint32_t total_x_offset_el,
@@ -1984,7 +1986,9 @@ isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
static inline void
isl_tiling_get_intratile_offset_sa(enum isl_tiling tiling,
+ enum isl_surf_dim dim,
enum isl_format format,
+ uint32_t samples,
uint32_t row_pitch,
uint32_t array_pitch_el_rows,
uint32_t total_x_offset_sa,
@@ -2009,8 +2013,8 @@ isl_tiling_get_intratile_offset_sa(enum isl_tiling tiling,
const uint32_t total_y_offset_el = total_y_offset_sa / fmtl->bh;
const uint32_t total_z_offset_el = total_z_offset_sa / fmtl->bd;
- isl_tiling_get_intratile_offset_el(tiling, fmtl->bpb, row_pitch,
- array_pitch_el_rows,
+ isl_tiling_get_intratile_offset_el(tiling, dim, fmtl->bpb, samples,
+ row_pitch, array_pitch_el_rows,
total_x_offset_el,
total_y_offset_el,
total_z_offset_el,
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index b93db1c..7d44e7c 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -178,8 +178,9 @@ get_blit_intratile_offset_el(const struct brw_context *brw,
uint32_t *y_offset_el)
{
uint32_t z_offset_el, array_offset;
- isl_tiling_get_intratile_offset_el(mt->surf.tiling,
- mt->cpp * 8, mt->surf.row_pitch,
+ isl_tiling_get_intratile_offset_el(mt->surf.tiling, mt->surf.dim,
+ mt->cpp * 8, mt->surf.samples,
+ mt->surf.row_pitch,
mt->surf.array_pitch_el_rows,
total_x_offset_el, total_y_offset_el,
0, 0,
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list