[Mesa-dev] [PATCH 01/11] intel/isl: Remove the device parameter from isl_tiling_get_info
Jason Ekstrand
jason at jlekstrand.net
Wed May 31 00:55:10 UTC 2017
We were only using it for validating that we don't use Ys/Yf on gen8 and
earlier. Removing it from isl_tiling_get_info lets us remove it from a
bunch of other things that had no business needing a hardware
generation.
---
src/intel/blorp/blorp_blit.c | 4 ++--
src/intel/isl/isl.c | 29 +++++++++--------------------
src/intel/isl/isl.h | 11 ++++-------
src/intel/isl/isl_surface_state.c | 2 +-
src/mesa/drivers/dri/i965/intel_blit.c | 3 +--
5 files changed, 17 insertions(+), 32 deletions(-)
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 42e7703..2f7761b 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1406,7 +1406,7 @@ blorp_surf_convert_to_single_slice(const struct isl_device *isl_dev,
layer, z, &x_offset_sa, &y_offset_sa);
uint32_t byte_offset;
- isl_tiling_get_intratile_offset_sa(isl_dev, info->surf.tiling,
+ isl_tiling_get_intratile_offset_sa(info->surf.tiling,
info->surf.format, info->surf.row_pitch,
x_offset_sa, y_offset_sa,
&byte_offset,
@@ -1915,7 +1915,7 @@ 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;
- isl_tiling_get_intratile_offset_sa(dev, info->surf.tiling,
+ isl_tiling_get_intratile_offset_sa(info->surf.tiling,
info->surf.format, info->surf.row_pitch,
x_offset_sa, y_offset_sa,
&byte_offset,
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 321850e..f0e948a 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -145,9 +145,8 @@ isl_device_get_sample_counts(struct isl_device *dev)
/**
* @param[out] info is written only on success
*/
-static bool
-isl_tiling_get_info(const struct isl_device *dev,
- enum isl_tiling tiling,
+static void
+isl_tiling_get_info(enum isl_tiling tiling,
uint32_t format_bpb,
struct isl_tile_info *tile_info)
{
@@ -162,7 +161,8 @@ isl_tiling_get_info(const struct isl_device *dev,
*/
assert(tiling == ISL_TILING_X || tiling == ISL_TILING_Y0);
assert(bs % 3 == 0 && isl_is_pow2(format_bpb / 3));
- return isl_tiling_get_info(dev, tiling, format_bpb / 3, tile_info);
+ isl_tiling_get_info(tiling, format_bpb / 3, tile_info);
+ return;
}
switch (tiling) {
@@ -203,12 +203,6 @@ isl_tiling_get_info(const struct isl_device *dev,
case ISL_TILING_Yf:
case ISL_TILING_Ys: {
- if (ISL_DEV_GEN(dev) < 9)
- return false;
-
- if (!isl_is_pow2(bs))
- return false;
-
bool is_Ys = tiling == ISL_TILING_Ys;
assert(bs > 0);
@@ -263,8 +257,6 @@ isl_tiling_get_info(const struct isl_device *dev,
.logical_extent_el = logical_el,
.phys_extent_B = phys_B,
};
-
- return true;
}
/**
@@ -1312,8 +1304,7 @@ isl_surf_init_s(const struct isl_device *dev,
return false;
struct isl_tile_info tile_info;
- if (!isl_tiling_get_info(dev, tiling, fmtl->bpb, &tile_info))
- return false;
+ isl_tiling_get_info(tiling, fmtl->bpb, &tile_info);
const enum isl_dim_layout dim_layout =
isl_surf_choose_dim_layout(dev, info->dim, tiling);
@@ -1422,12 +1413,11 @@ isl_surf_init_s(const struct isl_device *dev,
}
void
-isl_surf_get_tile_info(const struct isl_device *dev,
- const struct isl_surf *surf,
+isl_surf_get_tile_info(const struct isl_surf *surf,
struct isl_tile_info *tile_info)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format);
- isl_tiling_get_info(dev, surf->tiling, fmtl->bpb, tile_info);
+ isl_tiling_get_info(surf->tiling, fmtl->bpb, tile_info);
}
bool
@@ -1976,8 +1966,7 @@ isl_surf_get_image_offset_el(const struct isl_surf *surf,
}
void
-isl_tiling_get_intratile_offset_el(const struct isl_device *dev,
- enum isl_tiling tiling,
+isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
uint8_t bs,
uint32_t row_pitch,
uint32_t total_x_offset_el,
@@ -1997,7 +1986,7 @@ isl_tiling_get_intratile_offset_el(const struct isl_device *dev,
const uint32_t bpb = bs * 8;
struct isl_tile_info tile_info;
- isl_tiling_get_info(dev, tiling, bpb, &tile_info);
+ isl_tiling_get_info(tiling, bpb, &tile_info);
assert(row_pitch % tile_info.phys_extent_B.width == 0);
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index acc9e77..008ab5e 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -1380,8 +1380,7 @@ isl_surf_init_s(const struct isl_device *dev,
const struct isl_surf_init_info *restrict info);
void
-isl_surf_get_tile_info(const struct isl_device *dev,
- const struct isl_surf *surf,
+isl_surf_get_tile_info(const struct isl_surf *surf,
struct isl_tile_info *tile_info);
bool
@@ -1561,8 +1560,7 @@ isl_surf_get_image_offset_el(const struct isl_surf *surf,
* surface's tiling format.
*/
void
-isl_tiling_get_intratile_offset_el(const struct isl_device *dev,
- enum isl_tiling tiling,
+isl_tiling_get_intratile_offset_el(enum isl_tiling tiling,
uint8_t bs,
uint32_t row_pitch,
uint32_t total_x_offset_el,
@@ -1572,8 +1570,7 @@ isl_tiling_get_intratile_offset_el(const struct isl_device *dev,
uint32_t *y_offset_el);
static inline void
-isl_tiling_get_intratile_offset_sa(const struct isl_device *dev,
- enum isl_tiling tiling,
+isl_tiling_get_intratile_offset_sa(enum isl_tiling tiling,
enum isl_format format,
uint32_t row_pitch,
uint32_t total_x_offset_sa,
@@ -1595,7 +1592,7 @@ isl_tiling_get_intratile_offset_sa(const struct isl_device *dev,
const uint32_t total_x_offset = total_x_offset_sa / fmtl->bw;
const uint32_t total_y_offset = total_y_offset_sa / fmtl->bh;
- isl_tiling_get_intratile_offset_el(dev, tiling, fmtl->bpb / 8, row_pitch,
+ isl_tiling_get_intratile_offset_el(tiling, fmtl->bpb / 8, row_pitch,
total_x_offset, total_y_offset,
base_address_offset,
x_offset_sa, y_offset_sa);
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index d63b245..1620c93 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -550,7 +550,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
assert(!(info->view->usage & ISL_SURF_USAGE_STORAGE_BIT));
struct isl_tile_info tile_info;
- isl_surf_get_tile_info(dev, info->aux_surf, &tile_info);
+ isl_surf_get_tile_info(info->aux_surf, &tile_info);
uint32_t pitch_in_tiles =
info->aux_surf->row_pitch / tile_info.phys_extent_B.width;
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 2925fc2..21f0271 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -172,8 +172,7 @@ get_blit_intratile_offset_el(const struct brw_context *brw,
uint32_t *y_offset_el)
{
enum isl_tiling tiling = intel_miptree_get_isl_tiling(mt);
- isl_tiling_get_intratile_offset_el(&brw->isl_dev,
- tiling, mt->cpp, mt->pitch,
+ isl_tiling_get_intratile_offset_el(tiling, mt->cpp, mt->pitch,
total_x_offset_el, total_y_offset_el,
base_address_offset,
x_offset_el, y_offset_el);
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list