[Mesa-dev] [PATCH v2 06/34] isl/state: Add support for OffsetX/Y in surface state

Jason Ekstrand jason at jlekstrand.net
Thu Jun 23 21:00:05 UTC 2016


Reviewed-by: Chad Versace <chad.versace at intel.com>
---
 src/intel/isl/isl.h               |  3 +++
 src/intel/isl/isl_surface_state.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 3bf7469..f2128d8 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -822,6 +822,9 @@ struct isl_surf_fill_state_info {
     * Valid values depend on hardware generation.
     */
    union isl_color_value clear_color;
+
+   /* Intra-tile offset */
+   uint16_t x_offset, y_offset;
 };
 
 struct isl_buffer_fill_state_info {
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index dd3a425..21b057e 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -394,6 +394,18 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
    s.MOCS = info->mocs;
 #endif
 
+#if GEN_GEN > 4 || GEN_IS_G4X
+   const unsigned x_div = 4;
+   const unsigned y_div = GEN_GEN >= 8 ? 4 : 2;
+   assert(info->x_offset % x_div == 0);
+   assert(info->y_offset % y_div == 0);
+   s.XOffset = info->x_offset / x_div;
+   s.YOffset = info->y_offset / y_div;
+#else
+   assert(info->x_offset == 0);
+   assert(info->y_offset == 0);
+#endif
+
 #if GEN_GEN >= 8
    s.AuxiliarySurfaceMode = AUX_NONE;
 #elif GEN_GEN >= 7
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list