Mesa (master): isl: Fix assert on raw buffer surface state size

Nanley Chery nchery at kemper.freedesktop.org
Fri Jul 15 17:38:09 UTC 2016


Module: Mesa
Branch: master
Commit: 028f6d8317f00a94b09df81e8f2cb944077e64a7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=028f6d8317f00a94b09df81e8f2cb944077e64a7

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Wed Jul  6 11:13:15 2016 -0700

isl: Fix assert on raw buffer surface state size

See inline PRM reference.

Cc: 12.0 <mesa-stable at lists.freedesktop.org>
Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/isl/isl_surface_state.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index fc7e1ba..58e9af5 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -460,8 +460,15 @@ isl_genX(buffer_fill_state_s)(void *state,
    uint32_t num_elements = info->size / info->stride;
 
    if (GEN_GEN >= 7) {
+      /* From the IVB PRM, SURFACE_STATE::Height,
+       *
+       *    For typed buffer and structured buffer surfaces, the number
+       *    of entries in the buffer ranges from 1 to 2^27. For raw buffer
+       *    surfaces, the number of entries in the buffer is the number of bytes
+       *    which can range from 1 to 2^30.
+       */
       if (info->format == ISL_FORMAT_RAW) {
-         assert(num_elements <= (1ull << 31));
+         assert(num_elements <= (1ull << 30));
          assert((num_elements & 3) == 0);
       } else {
          assert(num_elements <= (1ull << 27));




More information about the mesa-commit mailing list