ilo: define ILO_IMAGE_MAX_LEVEL_COUNT
authorChia-I Wu <olvaffe@gmail.com>
Fri, 26 Jun 2015 03:38:46 +0000 (11:38 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 26 Jun 2015 05:45:28 +0000 (13:45 +0800)
Define ILO_IMAGE_MAX_LEVEL_COUNT for ilo_image and remove unnecessary header
includes.

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

index d95a80aabd39790f8444064933a0a365b1cc8673..da7db90a54bca8ca25fe6c59f7b1b3de1bf0ce16 100644 (file)
 #define ILO_CORE_H
 
 #include "pipe/p_compiler.h"
-#include "pipe/p_defines.h"
 
 #include "util/u_debug.h"
-#include "util/list.h"
-#include "util/u_inlines.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
-#include "util/u_pointer.h"
 
 #endif /* ILO_CORE_H */
index 7a1100288d3e941b191664ad88cbe8576b3db80d..3209674154b1aa939a84cd4d856d681737d234cc 100644 (file)
@@ -1029,8 +1029,8 @@ img_calculate_hiz_size(struct ilo_image *img,
       break;
    case ILO_IMAGE_WALK_LOD:
       {
-         unsigned lod_tx[PIPE_MAX_TEXTURE_LEVELS];
-         unsigned lod_ty[PIPE_MAX_TEXTURE_LEVELS];
+         unsigned lod_tx[ILO_IMAGE_MAX_LEVEL_COUNT];
+         unsigned lod_ty[ILO_IMAGE_MAX_LEVEL_COUNT];
          unsigned cur_tx, cur_ty;
 
          /* figure out the tile offsets of LODs */
index 0fe0d4da75a59fb9006a5f74ce65289cb0e92947..cfe18b9e8d10689c454b37f0e9f395a5a2be81f6 100644 (file)
 #include "ilo_core.h"
 #include "ilo_dev.h"
 
+/*
+ * From the Ivy Bridge PRM, volume 4 part 1, page 75:
+ *
+ *     "(MIP Count / LOD) representing [1,15] MIP levels"
+ */
+#define ILO_IMAGE_MAX_LEVEL_COUNT 15
+
 enum ilo_image_aux_type {
    ILO_IMAGE_AUX_NONE,
    ILO_IMAGE_AUX_HIZ,
@@ -154,7 +161,7 @@ struct ilo_image {
    unsigned align_i;
    unsigned align_j;
 
-   struct ilo_image_lod lods[PIPE_MAX_TEXTURE_LEVELS];
+   struct ilo_image_lod lods[ILO_IMAGE_MAX_LEVEL_COUNT];
 
    /* physical layer height for ILO_IMAGE_WALK_LAYER */
    unsigned walk_layer_height;
@@ -173,7 +180,7 @@ struct ilo_image {
       unsigned enables;
 
       /* LOD offsets for ILO_IMAGE_WALK_LOD */
-      unsigned walk_lod_offsets[PIPE_MAX_TEXTURE_LEVELS];
+      unsigned walk_lod_offsets[ILO_IMAGE_MAX_LEVEL_COUNT];
 
       unsigned walk_layer_height;
       unsigned bo_stride;
index 4d6604b29b255e2fab4061db810cd1607986be32..3dbe79fb872335becdbb390704113da131b22023 100644 (file)
 #define ILO_COMMON_H
 
 #include "pipe/p_format.h"
+#include "pipe/p_defines.h"
+
+#include "util/list.h"
 #include "util/u_format.h"
+#include "util/u_inlines.h"
+#include "util/u_pointer.h"
 
 #include "core/ilo_core.h"
 #include "core/ilo_debug.h"