i965: Replace intel_need_resolve with the hiz ops it maps to.
authorEric Anholt <eric@anholt.net>
Mon, 21 May 2012 16:52:46 +0000 (09:52 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 23 May 2012 17:18:27 +0000 (10:18 -0700)
Having this enum separate caused us to need a bunch of helper
functions to translate to the op to be executed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_resolve_map.c
src/mesa/drivers/dri/intel/intel_resolve_map.h

index 99f42303006b445df2132c4184ee1d4df94f307c..2042afd76ec5b63100b26b82d17282ac2c192f73 100644 (file)
@@ -572,7 +572,7 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
 
         head->level = level;
         head->layer = layer;
-        head->need = INTEL_NEED_HIZ_RESOLVE;
+        head->need = GEN6_HIZ_OP_HIZ_RESOLVE;
       }
    }
 
@@ -590,7 +590,7 @@ intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, INTEL_NEED_HIZ_RESOLVE);
+                        level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
 }
 
 
@@ -605,7 +605,7 @@ intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, INTEL_NEED_DEPTH_RESOLVE);
+                        level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
 }
 
 typedef void (*resolve_func_t)(struct intel_context *intel,
@@ -618,7 +618,7 @@ intel_miptree_slice_resolve(struct intel_context *intel,
                            struct intel_mipmap_tree *mt,
                            uint32_t level,
                            uint32_t layer,
-                           enum intel_need_resolve need,
+                           enum gen6_hiz_op need,
                            resolve_func_t func)
 {
    intel_miptree_check_level_layer(mt, level, layer);
@@ -641,7 +641,7 @@ intel_miptree_slice_resolve_hiz(struct intel_context *intel,
                                uint32_t layer)
 {
    return intel_miptree_slice_resolve(intel, mt, level, layer,
-                                     INTEL_NEED_HIZ_RESOLVE,
+                                     GEN6_HIZ_OP_HIZ_RESOLVE,
                                      intel->vtbl.resolve_hiz_slice);
 }
 
@@ -652,14 +652,14 @@ intel_miptree_slice_resolve_depth(struct intel_context *intel,
                                  uint32_t layer)
 {
    return intel_miptree_slice_resolve(intel, mt, level, layer,
-                                     INTEL_NEED_DEPTH_RESOLVE,
+                                     GEN6_HIZ_OP_DEPTH_RESOLVE,
                                      intel->vtbl.resolve_depth_slice);
 }
 
 static bool
 intel_miptree_all_slices_resolve(struct intel_context *intel,
                                 struct intel_mipmap_tree *mt,
-                                enum intel_need_resolve need,
+                                enum gen6_hiz_op need,
                                 resolve_func_t func)
 {
    bool did_resolve = false;
@@ -682,7 +682,7 @@ intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
                                     struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(intel, mt,
-                                          INTEL_NEED_HIZ_RESOLVE,
+                                          GEN6_HIZ_OP_HIZ_RESOLVE,
                                           intel->vtbl.resolve_hiz_slice);
 }
 
@@ -691,7 +691,7 @@ intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
                                       struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(intel, mt,
-                                          INTEL_NEED_DEPTH_RESOLVE,
+                                          GEN6_HIZ_OP_DEPTH_RESOLVE,
                                           intel->vtbl.resolve_depth_slice);
 }
 
index e7d82faee11108b78c7bd359394b3b86155538c2..471988d3fc2807d4248837ef4dc4bb34e3d8e28a 100644 (file)
@@ -36,7 +36,7 @@ void
 intel_resolve_map_set(struct intel_resolve_map *head,
                      uint32_t level,
                      uint32_t layer,
-                     enum intel_need_resolve need)
+                     enum gen6_hiz_op need)
 {
    struct intel_resolve_map **tail = &head->next;
    struct intel_resolve_map *prev = head;
index 0f31ca801175641c0437b12ba1485e0dba72f389..8504271f5cbd61424bcb6d7640e9ca305a98b2e1 100644 (file)
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * For an overview of the HiZ operations, see the following sections of the
  * Sandy Bridge PRM, Volume 1, Part2:
@@ -42,11 +46,6 @@ enum gen6_hiz_op {
    GEN6_HIZ_OP_NONE,
 };
 
-enum intel_need_resolve {
-   INTEL_NEED_HIZ_RESOLVE,
-   INTEL_NEED_DEPTH_RESOLVE,
-};
-
 /**
  * \brief Map of miptree slices to needed resolves.
  *
@@ -76,7 +75,7 @@ enum intel_need_resolve {
 struct intel_resolve_map {
    uint32_t level;
    uint32_t layer;
-   enum intel_need_resolve need;
+   enum gen6_hiz_op need;
 
    struct intel_resolve_map *next;
    struct intel_resolve_map *prev;
@@ -86,7 +85,7 @@ void
 intel_resolve_map_set(struct intel_resolve_map *head,
                      uint32_t level,
                      uint32_t layer,
-                     enum intel_need_resolve need);
+                     enum gen6_hiz_op need);
 
 struct intel_resolve_map*
 intel_resolve_map_get(struct intel_resolve_map *head,
@@ -98,3 +97,8 @@ intel_resolve_map_remove(struct intel_resolve_map *elem);
 
 void
 intel_resolve_map_clear(struct intel_resolve_map *head);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+