i965: Move the hiz_op enum to blorp
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Aug 2016 10:15:41 +0000 (03:15 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 29 Aug 2016 19:17:34 +0000 (12:17 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
13 files changed:
src/mesa/drivers/dri/i965/blorp.c
src/mesa/drivers/dri/i965/blorp.h
src/mesa/drivers/dri/i965/blorp_priv.h
src/mesa/drivers/dri/i965/brw_blorp.c
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen8_depth_state.c
src/mesa/drivers/dri/i965/genX_blorp_exec.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h
src/mesa/drivers/dri/i965/intel_resolve_map.c
src/mesa/drivers/dri/i965/intel_resolve_map.h

index 20477dd..16ccd34 100644 (file)
@@ -144,7 +144,6 @@ void
 brw_blorp_params_init(struct brw_blorp_params *params)
 {
    memset(params, 0, sizeof(*params));
-   params->hiz_op = GEN6_HIZ_OP_NONE;
    params->num_draw_buffers = 1;
    params->num_layers = 1;
 }
@@ -238,7 +237,7 @@ brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir
 void
 blorp_gen6_hiz_op(struct blorp_batch *batch,
                   struct brw_blorp_surf *surf, unsigned level, unsigned layer,
-                  enum gen6_hiz_op op)
+                  enum blorp_hiz_op op)
 {
    struct brw_blorp_params params;
    brw_blorp_params_init(&params);
index 8786777..27f22c9 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdbool.h>
 
 #include "isl/isl.h"
-#include "intel_resolve_map.h" /* needed for enum gen6_hiz_op */
 
 struct brw_context;
 struct brw_wm_prog_key;
@@ -128,10 +127,27 @@ void
 brw_blorp_ccs_resolve(struct blorp_batch *batch,
                       struct brw_blorp_surf *surf, enum isl_format format);
 
+/**
+ * For an overview of the HiZ operations, see the following sections of the
+ * Sandy Bridge PRM, Volume 1, Part2:
+ *   - 7.5.3.1 Depth Buffer Clear
+ *   - 7.5.3.2 Depth Buffer Resolve
+ *   - 7.5.3.3 Hierarchical Depth Buffer Resolve
+ *
+ * Of these, two get entered in the resolve map as needing to be done to the
+ * buffer: depth resolve and hiz resolve.
+ */
+enum blorp_hiz_op {
+   BLORP_HIZ_OP_NONE,
+   BLORP_HIZ_OP_DEPTH_CLEAR,
+   BLORP_HIZ_OP_DEPTH_RESOLVE,
+   BLORP_HIZ_OP_HIZ_RESOLVE,
+};
+
 void
 blorp_gen6_hiz_op(struct blorp_batch *batch,
                   struct brw_blorp_surf *surf, unsigned level, unsigned layer,
-                  enum gen6_hiz_op op);
+                  enum blorp_hiz_op op);
 
 #ifdef __cplusplus
 } /* end extern "C" */
index 36ff637..a25291b 100644 (file)
@@ -174,7 +174,7 @@ struct brw_blorp_params
    uint32_t depth_format;
    struct brw_blorp_surface_info src;
    struct brw_blorp_surface_info dst;
-   enum gen6_hiz_op hiz_op;
+   enum blorp_hiz_op hiz_op;
    enum blorp_fast_clear_op fast_clear_op;
    bool color_write_disable[4];
    struct brw_blorp_wm_inputs wm_inputs;
index e59c26e..b2b3f01 100644 (file)
@@ -839,7 +839,7 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt)
 
 static void
 gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-                    unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+                    unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
    intel_miptree_check_level_layer(mt, level, layer);
    intel_miptree_used_for_rendering(mt);
@@ -867,21 +867,21 @@ gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
  */
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
    const char *opname = NULL;
 
    switch (op) {
-   case GEN6_HIZ_OP_DEPTH_RESOLVE:
+   case BLORP_HIZ_OP_DEPTH_RESOLVE:
       opname = "depth resolve";
       break;
-   case GEN6_HIZ_OP_HIZ_RESOLVE:
+   case BLORP_HIZ_OP_HIZ_RESOLVE:
       opname = "hiz ambiguate";
       break;
-   case GEN6_HIZ_OP_DEPTH_CLEAR:
+   case BLORP_HIZ_OP_DEPTH_CLEAR:
       opname = "depth clear";
       break;
-   case GEN6_HIZ_OP_NONE:
+   case BLORP_HIZ_OP_NONE:
       opname = "noop?";
       break;
    }
index 1aa1952..53a732e 100644 (file)
@@ -58,7 +58,7 @@ brw_blorp_resolve_color(struct brw_context *brw,
 
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 void gen6_blorp_exec(struct blorp_batch *batch,
                      const struct brw_blorp_params *params);
index 18b8fcb..0d64d89 100644 (file)
@@ -187,11 +187,11 @@ brw_fast_clear_depth(struct gl_context *ctx)
       for (unsigned layer = 0; layer < depth_irb->layer_count; layer++) {
          intel_hiz_exec(brw, mt, depth_irb->mt_level,
                         depth_irb->mt_layer + layer,
-                        GEN6_HIZ_OP_DEPTH_CLEAR);
+                        BLORP_HIZ_OP_DEPTH_CLEAR);
       }
    } else {
       intel_hiz_exec(brw, mt, depth_irb->mt_level, depth_irb->mt_layer,
-                     GEN6_HIZ_OP_DEPTH_CLEAR);
+                     BLORP_HIZ_OP_DEPTH_CLEAR);
    }
 
    if (brw->gen == 6) {
index da80e34..a76b25f 100644 (file)
@@ -1848,7 +1848,7 @@ gen8_emit_depth_stencil_hiz(struct brw_context *brw,
                             uint32_t tile_x, uint32_t tile_y);
 
 void gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-                   unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+                   unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 uint32_t get_hw_prim_for_gl_prim(int mode);
 
index a780da6..4930991 100644 (file)
@@ -398,9 +398,9 @@ const struct brw_tracked_state gen8_pma_fix = {
  */
 void
 gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
-   if (op == GEN6_HIZ_OP_NONE)
+   if (op == BLORP_HIZ_OP_NONE)
       return;
 
    /* Disable the PMA stall fix since we're about to do a HiZ operation. */
@@ -468,16 +468,16 @@ gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
    uint32_t dw1 = 0;
 
    switch (op) {
-   case GEN6_HIZ_OP_DEPTH_RESOLVE:
+   case BLORP_HIZ_OP_DEPTH_RESOLVE:
       dw1 |= GEN8_WM_HZ_DEPTH_RESOLVE;
       break;
-   case GEN6_HIZ_OP_HIZ_RESOLVE:
+   case BLORP_HIZ_OP_HIZ_RESOLVE:
       dw1 |= GEN8_WM_HZ_HIZ_RESOLVE;
       break;
-   case GEN6_HIZ_OP_DEPTH_CLEAR:
+   case BLORP_HIZ_OP_DEPTH_CLEAR:
       dw1 |= GEN8_WM_HZ_DEPTH_CLEAR;
       break;
-   case GEN6_HIZ_OP_NONE:
+   case BLORP_HIZ_OP_NONE:
       unreachable("Should not get here.");
    }
 
index 7ef6a1d..649c3db 100644 (file)
@@ -566,16 +566,16 @@ blorp_emit_ps_config(struct blorp_batch *batch,
 
    blorp_emit(batch, GENX(3DSTATE_WM), wm) {
       switch (params->hiz_op) {
-      case GEN6_HIZ_OP_DEPTH_CLEAR:
+      case BLORP_HIZ_OP_DEPTH_CLEAR:
          wm.DepthBufferClear = true;
          break;
-      case GEN6_HIZ_OP_DEPTH_RESOLVE:
+      case BLORP_HIZ_OP_DEPTH_RESOLVE:
          wm.DepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_HIZ_RESOLVE:
+      case BLORP_HIZ_OP_HIZ_RESOLVE:
          wm.HierarchicalDepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_NONE:
+      case BLORP_HIZ_OP_NONE:
          break;
       default:
          unreachable("not reached");
@@ -651,16 +651,16 @@ blorp_emit_ps_config(struct blorp_batch *batch,
          batch->blorp->isl_dev->info->max_wm_threads - 1;
 
       switch (params->hiz_op) {
-      case GEN6_HIZ_OP_DEPTH_CLEAR:
+      case BLORP_HIZ_OP_DEPTH_CLEAR:
          wm.DepthBufferClear = true;
          break;
-      case GEN6_HIZ_OP_DEPTH_RESOLVE:
+      case BLORP_HIZ_OP_DEPTH_RESOLVE:
          wm.DepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_HIZ_RESOLVE:
+      case BLORP_HIZ_OP_HIZ_RESOLVE:
          wm.HierarchicalDepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_NONE:
+      case BLORP_HIZ_OP_NONE:
          break;
       default:
          unreachable("not reached");
@@ -850,7 +850,7 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch,
       .DepthBufferWriteEnable = true,
    };
 
-   if (params->hiz_op == GEN6_HIZ_OP_DEPTH_RESOLVE) {
+   if (params->hiz_op == BLORP_HIZ_OP_DEPTH_RESOLVE) {
       ds.DepthTestEnable = true;
       ds.DepthTestFunction = COMPAREFUNCTION_NEVER;
    }
index c33d8fc..08beea8 100644 (file)
@@ -2004,7 +2004,7 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
          exec_node_init(&m->link);
          m->level = level;
          m->layer = layer;
-         m->need = GEN6_HIZ_OP_HIZ_RESOLVE;
+         m->need = BLORP_HIZ_OP_HIZ_RESOLVE;
 
          exec_list_push_tail(&mt->hiz_map, &m->link);
       }
@@ -2032,7 +2032,7 @@ intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
+                        level, layer, BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 
@@ -2045,7 +2045,7 @@ intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
+                        level, layer, BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 void
@@ -2065,7 +2065,7 @@ intel_miptree_slice_resolve(struct brw_context *brw,
                            struct intel_mipmap_tree *mt,
                            uint32_t level,
                            uint32_t layer,
-                           enum gen6_hiz_op need)
+                           enum blorp_hiz_op need)
 {
    intel_miptree_check_level_layer(mt, level, layer);
 
@@ -2087,7 +2087,7 @@ intel_miptree_slice_resolve_hiz(struct brw_context *brw,
                                uint32_t layer)
 {
    return intel_miptree_slice_resolve(brw, mt, level, layer,
-                                     GEN6_HIZ_OP_HIZ_RESOLVE);
+                                     BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 bool
@@ -2097,13 +2097,13 @@ intel_miptree_slice_resolve_depth(struct brw_context *brw,
                                  uint32_t layer)
 {
    return intel_miptree_slice_resolve(brw, mt, level, layer,
-                                     GEN6_HIZ_OP_DEPTH_RESOLVE);
+                                     BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 static bool
 intel_miptree_all_slices_resolve(struct brw_context *brw,
                                 struct intel_mipmap_tree *mt,
-                                enum gen6_hiz_op need)
+                                enum blorp_hiz_op need)
 {
    bool did_resolve = false;
 
@@ -2124,7 +2124,7 @@ intel_miptree_all_slices_resolve_hiz(struct brw_context *brw,
                                     struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(brw, mt,
-                                          GEN6_HIZ_OP_HIZ_RESOLVE);
+                                          BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 bool
@@ -2132,7 +2132,7 @@ intel_miptree_all_slices_resolve_depth(struct brw_context *brw,
                                       struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(brw, mt,
-                                          GEN6_HIZ_OP_DEPTH_RESOLVE);
+                                          BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 
index e7d4de0..27dbfa4 100644 (file)
@@ -1022,7 +1022,7 @@ intel_miptree_unmap(struct brw_context *brw,
 
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 #ifdef __cplusplus
 }
index 3df4b88..26eac8b 100644 (file)
@@ -35,7 +35,7 @@ void
 intel_resolve_map_set(struct exec_list *resolve_map,
                      uint32_t level,
                      uint32_t layer,
-                     enum gen6_hiz_op need)
+                     enum blorp_hiz_op need)
 {
    foreach_list_typed(struct intel_resolve_map, map, link, resolve_map) {
       if (map->level == level && map->layer == layer) {
index 726b287..672a4aa 100644 (file)
@@ -24,6 +24,7 @@
 #pragma once
 
 #include <stdint.h>
+#include "blorp.h"
 #include "compiler/glsl/list.h"
 
 #ifdef __cplusplus
@@ -31,23 +32,6 @@ extern "C" {
 #endif
 
 /**
- * For an overview of the HiZ operations, see the following sections of the
- * Sandy Bridge PRM, Volume 1, Part2:
- *   - 7.5.3.1 Depth Buffer Clear
- *   - 7.5.3.2 Depth Buffer Resolve
- *   - 7.5.3.3 Hierarchical Depth Buffer Resolve
- *
- * Of these, two get entered in the resolve map as needing to be done to the
- * buffer: depth resolve and hiz resolve.
- */
-enum gen6_hiz_op {
-   GEN6_HIZ_OP_DEPTH_CLEAR,
-   GEN6_HIZ_OP_DEPTH_RESOLVE,
-   GEN6_HIZ_OP_HIZ_RESOLVE,
-   GEN6_HIZ_OP_NONE,
-};
-
-/**
  * \brief Map of miptree slices to needed resolves.
  *
  * The map is implemented as a linear doubly-linked list.
@@ -78,14 +62,14 @@ struct intel_resolve_map {
 
    uint32_t level;
    uint32_t layer;
-   enum gen6_hiz_op need;
+   enum blorp_hiz_op need;
 };
 
 void
 intel_resolve_map_set(struct exec_list *resolve_map,
                      uint32_t level,
                      uint32_t layer,
-                     enum gen6_hiz_op need);
+                     enum blorp_hiz_op need);
 
 struct intel_resolve_map *
 intel_resolve_map_get(struct exec_list *resolve_map,