intel/isl: Remove the device parameter from isl_tiling_get_info
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 May 2017 03:32:26 +0000 (20:32 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 1 Jun 2017 22:33:31 +0000 (15:33 -0700)
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.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/blorp/blorp_blit.c
src/intel/isl/isl.c
src/intel/isl/isl.h
src/intel/isl/isl_surface_state.c
src/mesa/drivers/dri/i965/intel_blit.c

index 42e770367df9df23738da7d3da01c8a87d7e7265..2f7761bff7469361b69641d69745b242d639ba8c 100644 (file)
@@ -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,
index 321850e9823a1e0517efb54d98ed72e128b58d7f..f0e948a1c9648eeef88aed1f26f528225c82f211 100644 (file)
@@ -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);
 
index acc9e77d3e7be58a860cc96882b3b225e769c2e0..008ab5e819bc289f35c8e9b07c6f49c9b0e86e47 100644 (file)
@@ -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);
index d63b245ef23a54d1f9d3ddf1c9f0d38bcf5689a6..1620c93cef107e22edaf45e5bd6f6da10a7945cd 100644 (file)
@@ -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;
 
index 2925fc2c14fac8af22ea6b0f6d8c0a1da0c4b8ad..21f0271a04ba2e9b00052d84882028052c443097 100644 (file)
@@ -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);