intel/isl: Fix up asserts in calc_phys_level0_extent_sa
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 2 Sep 2016 02:52:38 +0000 (19:52 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 3 Oct 2016 21:53:01 +0000 (14:53 -0700)
The assertion that a format is uncompressed in the multisample layouts
isn't quite right.  What we really want to assert is that the format
supports multisampling which is a bit more complicated query.  We also want
to assert that it has a block size of 1x1 since we do nothing with the
block size in the phys_level0_sa assignment.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/intel/isl/isl.c

index b6e88ad03e601229813a0ba74104bed87ba4ba1e..18e94d3a92a708bea966a0c0e48d021524ebdecf 100644 (file)
@@ -580,7 +580,8 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       case ISL_MSAA_LAYOUT_ARRAY:
          assert(info->depth == 1);
          assert(info->levels == 1);
-         assert(!isl_format_is_compressed(info->format));
+         assert(isl_format_supports_multisampling(dev->info, info->format));
+         assert(fmtl->bw == 1 && fmtl->bh == 1);
 
          *phys_level0_sa = (struct isl_extent4d) {
             .w = info->width,
@@ -593,7 +594,8 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       case ISL_MSAA_LAYOUT_INTERLEAVED:
          assert(info->depth == 1);
          assert(info->levels == 1);
-         assert(!isl_format_is_compressed(info->format));
+         assert(isl_format_supports_multisampling(dev->info, info->format));
+         assert(fmtl->bw == 1 && fmtl->bh == 1);
 
          *phys_level0_sa = (struct isl_extent4d) {
             .w = info->width,