summaryrefslogtreecommitdiffstats
path: root/src/isl/isl.h
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-01-05 14:30:23 -0800
committerChad Versace <[email protected]>2016-01-06 09:38:57 -0800
commite05b3079429a9e5446194d2a9f3fcea2004a5c8c (patch)
tree7612faab4e5e5249e8c37ad3a8cdc13b1041a49b /src/isl/isl.h
parentc1e890541ee5b4077841542eacfca371c815ab18 (diff)
isl: Add isl_surf_get_array_pitch_el()
Will be needed to program SurfaceQPitch for Skylake 1D arrays.
Diffstat (limited to 'src/isl/isl.h')
-rw-r--r--src/isl/isl.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/isl/isl.h b/src/isl/isl.h
index 15cfd0f4c56..9e07b2ff63c 100644
--- a/src/isl/isl.h
+++ b/src/isl/isl.h
@@ -968,6 +968,27 @@ isl_surf_get_image_alignment_sa(const struct isl_surf *surf)
}
/**
+ * Pitch between vertically adjacent surface elements, in bytes.
+ */
+static inline uint32_t
+isl_surf_get_row_pitch(const struct isl_surf *surf)
+{
+ return surf->row_pitch;
+}
+
+/**
+ * Pitch between vertically adjacent surface elements, in units of surface elements.
+ */
+static inline uint32_t
+isl_surf_get_row_pitch_el(const struct isl_surf *surf)
+{
+ const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format);
+
+ assert(surf->row_pitch % fmtl->bs == 0);
+ return surf->row_pitch / fmtl->bs;
+}
+
+/**
* Pitch between physical array slices, in rows of surface elements.
*/
static inline uint32_t
@@ -977,6 +998,16 @@ isl_surf_get_array_pitch_el_rows(const struct isl_surf *surf)
}
/**
+ * Pitch between physical array slices, in units of surface elements.
+ */
+static inline uint32_t
+isl_surf_get_array_pitch_el(const struct isl_surf *surf)
+{
+ return isl_surf_get_array_pitch_el_rows(surf) *
+ isl_surf_get_row_pitch_el(surf);
+}
+
+/**
* Pitch between physical array slices, in rows of surface samples.
*/
static inline uint32_t