isl: Don't filter tiling flags if a specific tiling bit is set
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 2 Mar 2016 01:32:14 +0000 (17:32 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 3 Mar 2016 19:23:40 +0000 (11:23 -0800)
If a specific bit is set, the intention to create a surface with a
specific tiling format should be respected.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/intel/isl/isl.c

index 7fd9eeac5151ff4041d8a4af498f7844a2d52015..a36638071d5927014fde2515a5adb4fcc3f58a32 100644 (file)
@@ -184,11 +184,14 @@ isl_surf_choose_tiling(const struct isl_device *dev,
 {
    isl_tiling_flags_t tiling_flags = info->tiling_flags;
 
-   if (ISL_DEV_GEN(dev) >= 7) {
-      gen7_filter_tiling(dev, info, &tiling_flags);
-   } else {
-      isl_finishme("%s: gen%u", __func__, ISL_DEV_GEN(dev));
-      gen7_filter_tiling(dev, info, &tiling_flags);
+   /* Filter if multiple tiling options are given */
+   if (!isl_is_pow2(tiling_flags)) {
+      if (ISL_DEV_GEN(dev) >= 7) {
+         gen7_filter_tiling(dev, info, &tiling_flags);
+      } else {
+         isl_finishme("%s: gen%u", __func__, ISL_DEV_GEN(dev));
+         gen7_filter_tiling(dev, info, &tiling_flags);
+      }
    }
 
    #define CHOOSE(__tiling) \