isl: Add function to get intratile offsets from x/y offsets
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 26 Feb 2016 22:49:51 +0000 (14:49 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 3 Mar 2016 18:56:15 +0000 (10:56 -0800)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/intel/isl/isl.c
src/intel/isl/isl.h

index f7b4c70184143f981012f362265f05470de493ae..7fd9eeac5151ff4041d8a4af498f7844a2d52015 100644 (file)
@@ -1414,11 +1414,10 @@ isl_surf_get_image_offset_el(const struct isl_surf *surf,
 }
 
 void
-isl_surf_get_image_intratile_offset_el(const struct isl_device *dev,
+isl_surf_get_image_intratile_offset_el_xy(const struct isl_device *dev,
                                        const struct isl_surf *surf,
-                                       uint32_t level,
-                                       uint32_t logical_array_layer,
-                                       uint32_t logical_z_offset,
+                                       uint32_t total_x_offset_el,
+                                       uint32_t total_y_offset_el,
                                        uint32_t *base_address_offset,
                                        uint32_t *x_offset_el,
                                        uint32_t *y_offset_el)
@@ -1428,14 +1427,6 @@ isl_surf_get_image_intratile_offset_el(const struct isl_device *dev,
    struct isl_tile_info tile_info;
    isl_surf_get_tile_info(dev, surf, &tile_info);
 
-   uint32_t total_x_offset_el;
-   uint32_t total_y_offset_el;
-   isl_surf_get_image_offset_el(surf, level,
-                                logical_array_layer,
-                                logical_z_offset,
-                                &total_x_offset_el,
-                                &total_y_offset_el);
-
    uint32_t small_y_offset_el = total_y_offset_el % tile_info.height;
    uint32_t big_y_offset_el = total_y_offset_el - small_y_offset_el;
    uint32_t big_y_offset_B = big_y_offset_el * surf->row_pitch;
@@ -1448,6 +1439,34 @@ isl_surf_get_image_intratile_offset_el(const struct isl_device *dev,
    *base_address_offset = big_y_offset_B + big_x_offset_B;
    *x_offset_el = small_x_offset_el;
    *y_offset_el = small_y_offset_el;
+
+
+}
+
+void
+isl_surf_get_image_intratile_offset_el(const struct isl_device *dev,
+                                       const struct isl_surf *surf,
+                                       uint32_t level,
+                                       uint32_t logical_array_layer,
+                                       uint32_t logical_z_offset,
+                                       uint32_t *base_address_offset,
+                                       uint32_t *x_offset_el,
+                                       uint32_t *y_offset_el)
+{
+   uint32_t total_x_offset_el;
+   uint32_t total_y_offset_el;
+   isl_surf_get_image_offset_el(surf, level,
+                                logical_array_layer,
+                                logical_z_offset,
+                                &total_x_offset_el,
+                                &total_y_offset_el);
+
+   isl_surf_get_image_intratile_offset_el_xy(dev, surf,
+                                total_x_offset_el,
+                                total_y_offset_el,
+                                base_address_offset,
+                                x_offset_el,
+                                y_offset_el);
 }
 
 uint32_t
index 7456975014bfea6ba539b23164857c409a18160d..5a48bce6c64c2a0ef1144112e1b6bdc766df009e 100644 (file)
@@ -1161,6 +1161,18 @@ isl_surf_get_image_intratile_offset_el(const struct isl_device *dev,
                                        uint32_t *x_offset_el,
                                        uint32_t *y_offset_el);
 
+/**
+ * See above.
+ */
+void
+isl_surf_get_image_intratile_offset_el_xy(const struct isl_device *dev,
+                                       const struct isl_surf *surf,
+                                       uint32_t total_x_offset_el,
+                                       uint32_t total_y_offset_el,
+                                       uint32_t *base_address_offset,
+                                       uint32_t *x_offset_el,
+                                       uint32_t *y_offset_el);
+
 /**
  * @brief Get value of 3DSTATE_DEPTH_BUFFER.SurfaceFormat
  *