isl: Stop multiplying height by block size
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 8 Jul 2016 21:57:19 +0000 (14:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 13 Jul 2016 18:47:37 +0000 (11:47 -0700)
The row pitch already specifies the size of a row of elements.
Multiplying by the block height simply causes us to allocate as muc as 12
times more memory than needed for compressed textures.

Reviewed-by: Chad Versace <chad.versace@intel.com>
src/intel/isl/isl.c

index 72b681ed215cbc8a478b115634a1e48094b3d2c0..decba3d3e87efd50dd4789fee50c2e8e7b21c867 100644 (file)
@@ -1113,8 +1113,8 @@ isl_surf_init_s(const struct isl_device *dev,
                                phys_level0_sa.array_len, row_pitch,
                                array_pitch_el_rows);
 
-   const uint32_t total_h_sa = total_h_el * fmtl->bh;
-   const uint32_t size = row_pitch * isl_align(total_h_sa, tile_info.height);
+   const uint32_t size =
+      row_pitch * isl_align(total_h_el, tile_info.height);
 
    /* Alignment of surface base address, in bytes */
    uint32_t base_alignment = MAX(1, info->min_alignment);