summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-13 15:59:33 -0700
committerJason Ekstrand <[email protected]>2016-07-15 15:53:47 -0700
commit2c6ca658e788e0a91bcc993892cc8a8d07f931a9 (patch)
treeae0139c1cf9d679732f0f71e85b55cfa45293421 /src/intel/isl/isl.c
parent593731ea3cc1aa9385e43ebc18c67574f181e1c3 (diff)
isl: Fix the bs assertion in isl_tiling_get_info
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/isl/isl.c')
-rw-r--r--src/intel/isl/isl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 75b81189788..435cffd8a65 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -113,21 +113,23 @@ isl_tiling_get_info(const struct isl_device *dev,
const uint32_t bs = format_bpb / 8;
struct isl_extent2d logical_el, phys_B;
- assert(bs > 0);
- assert(tiling == ISL_TILING_LINEAR || isl_is_pow2(bs));
+ assert(tiling == ISL_TILING_LINEAR || isl_is_pow2(format_bpb));
switch (tiling) {
case ISL_TILING_LINEAR:
+ assert(bs > 0);
logical_el = isl_extent2d(1, 1);
phys_B = isl_extent2d(bs, 1);
break;
case ISL_TILING_X:
+ assert(bs > 0);
logical_el = isl_extent2d(512 / bs, 8);
phys_B = isl_extent2d(512, 8);
break;
case ISL_TILING_Y0:
+ assert(bs > 0);
logical_el = isl_extent2d(128 / bs, 32);
phys_B = isl_extent2d(128, 32);
break;
@@ -159,6 +161,7 @@ isl_tiling_get_info(const struct isl_device *dev,
bool is_Ys = tiling == ISL_TILING_Ys;
+ assert(bs > 0);
unsigned width = 1 << (6 + (ffs(bs) / 2) + (2 * is_Ys));
unsigned height = 1 << (6 - (ffs(bs) / 2) + (2 * is_Ys));