ilo: ignore prefer_linear_threshold when zero
authorChia-I Wu <olvaffe@gmail.com>
Fri, 16 Oct 2015 08:19:30 +0000 (16:19 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 18 Oct 2015 13:04:52 +0000 (21:04 +0800)
This was the intended behavior but it did not work as intended until now.

src/gallium/drivers/ilo/core/ilo_image.c
src/gallium/drivers/ilo/core/ilo_image.h

index fa547ac..6eefc8f 100644 (file)
@@ -286,8 +286,8 @@ image_get_gen6_tiling(const struct ilo_dev *dev,
                                  info->bind_surface_dp_typed))
          return GEN6_TILING_NONE;
 
-      if (estimated_size <= 64 ||
-          estimated_size > info->prefer_linear_threshold)
+      if (estimated_size <= 64 || (info->prefer_linear_threshold &&
+               estimated_size > info->prefer_linear_threshold))
          return GEN6_TILING_NONE;
 
       if (estimated_size <= 2048)
index 646ed6f..546e0ff 100644 (file)
@@ -102,7 +102,7 @@ struct ilo_image_info {
 
    /*
     * prefer GEN6_TILING_NONE when the (estimated) image size exceeds the
-    * threshold
+    * threshold; ignored when zero
     */
    uint32_t prefer_linear_threshold;