<div dir="ltr"><div>So, I think I'm going to end up doing a fairly significant rework of resolves over the course of the next couple of weeks.  Carry on with the branch as is and I'll figure out how to rebase it on top of whatever changes I do later.  But it'll probably be significant.  Just a heads up.<br><br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 2:38 AM, Daniel Stone <span dir="ltr"><<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
<br>
In the foreseeable future it doesn't seem to make sense to have multiple<br>
resolve flags. What does make sense is to have the caller give an<br>
indication to the lower layers what it things should be done for<br>
resolve. The enum change distinguishes this binary selection.<br>
<br>
v2: Make setting the hint more concise (Topi)<br>
<br>
Signed-off-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
Acked-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
Signed-off-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>blorp.c         |  8 ++++----<br>
 src/mesa/drivers/dri/i965/brw_<wbr>context.c       | 13 +++++++------<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 12 ++++++------<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 13 ++++++++-----<br>
 4 files changed, 25 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
index b69cb4fc7b..938600875e 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -210,12 +210,12 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
             surf->aux_usage = ISL_AUX_USAGE_NONE;<br>
          }<br>
       } else if (!(safe_aux_usage & (1 << surf->aux_usage))) {<br>
-         uint32_t flags = 0;<br>
-         if (safe_aux_usage & (1 << ISL_AUX_USAGE_CCS_E))<br>
-            flags |= INTEL_MIPTREE_IGNORE_CCS_E;<br>
+         const enum intel_resolve_hint hint =<br>
+            safe_aux_usage & (1 << ISL_AUX_USAGE_CCS_E) ?<br>
+            INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E : 0;<br>
<br>
          intel_miptree_resolve_color(<wbr>brw, mt,<br>
-                                     *level, start_layer, num_layers, flags);<br>
+                                     *level, start_layer, num_layers, hint);<br>
<br>
          assert(!intel_miptree_has_<wbr>color_unresolved(mt, *level, 1,<br>
                                                     start_layer, num_layers));<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.c b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
index f0e08b9874..5e446abb1f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
@@ -259,9 +259,10 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)<br>
       /* Sampling engine understands lossless compression and resolving<br>
        * those surfaces should be skipped for performance reasons.<br>
        */<br>
-      const int flags = intel_texture_view_requires_<wbr>resolve(brw, tex_obj) ?<br>
-                           0 : INTEL_MIPTREE_IGNORE_CCS_E;<br>
-      intel_miptree_all_slices_<wbr>resolve_color(brw, tex_obj->mt, flags);<br>
+      const enum intel_resolve_hint hint =<br>
+         intel_texture_view_requires_<wbr>resolve(brw, tex_obj) ? 0 :<br>
+         INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E;<br>
+      intel_miptree_all_slices_<wbr>resolve_color(brw, tex_obj->mt, hint);<br>
       brw_render_cache_set_check_<wbr>flush(brw, tex_obj->mt->bo);<br>
<br>
       if (tex_obj->base.StencilSampling ||<br>
@@ -313,9 +314,9 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)<br>
             intel_renderbuffer(fb->_<wbr>ColorDrawBuffers[i]);<br>
<br>
          if (irb &&<br>
-             intel_miptree_resolve_color(<br>
-                brw, irb->mt, irb->mt_level, irb->mt_layer, irb->layer_count,<br>
-                INTEL_MIPTREE_IGNORE_CCS_E))<br>
+             intel_miptree_resolve_color(<wbr>brw, irb->mt, irb->mt_level,<br>
+                                         irb->mt_layer, irb->layer_count,<br>
+                                         INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E))<br>
             brw_render_cache_set_check_<wbr>flush(brw, irb->mt->bo);<br>
       }<br>
    }<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index b33afdeb3f..8a33010543 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -2234,7 +2234,7 @@ intel_miptree_used_for_<wbr>rendering(const struct brw_context *brw,<br>
 static bool<br>
 intel_miptree_needs_color_<wbr>resolve(const struct brw_context *brw,<br>
                                   const struct intel_mipmap_tree *mt,<br>
-                                  int flags)<br>
+                                  enum intel_resolve_hint hint)<br>
 {<br>
    if (mt->aux_disable & INTEL_AUX_DISABLE_CCS)<br>
       return false;<br>
@@ -2246,7 +2246,7 @@ intel_miptree_needs_color_<wbr>resolve(const struct brw_context *brw,<br>
     * surfaces called "lossless compressed". These don't need to be always<br>
     * resolved.<br>
     */<br>
-   if ((flags & INTEL_MIPTREE_IGNORE_CCS_E) && is_lossless_compressed)<br>
+   if ((hint == INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E) && is_lossless_compressed)<br>
       return false;<br>
<br>
    /* Fast color clear resolves only make sense for non-MSAA buffers. */<br>
@@ -2260,11 +2260,11 @@ bool<br>
 intel_miptree_resolve_color(<wbr>struct brw_context *brw,<br>
                             struct intel_mipmap_tree *mt, unsigned level,<br>
                             unsigned start_layer, unsigned num_layers,<br>
-                            int flags)<br>
+                            enum intel_resolve_hint hint)<br>
 {<br>
    intel_miptree_check_color_<wbr>resolve(brw, mt, level, start_layer);<br>
<br>
-   if (!intel_miptree_needs_color_<wbr>resolve(brw, mt, flags))<br>
+   if (!intel_miptree_needs_color_<wbr>resolve(brw, mt, hint))<br>
       return false;<br>
<br>
    /* Arrayed fast clear is only supported for gen8+. */<br>
@@ -2293,9 +2293,9 @@ intel_miptree_resolve_color(<wbr>struct brw_context *brw,<br>
 void<br>
 intel_miptree_all_slices_<wbr>resolve_color(struct brw_context *brw,<br>
                                        struct intel_mipmap_tree *mt,<br>
-                                       int flags)<br>
+                                       enum intel_resolve_hint hint)<br>
 {<br>
-   if (!intel_miptree_needs_color_<wbr>resolve(brw, mt, flags))<br>
+   if (!intel_miptree_needs_color_<wbr>resolve(brw, mt, hint))<br>
       return;<br>
<br>
    foreach_list_typed_safe(struct intel_resolve_map, map, link,<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
index c1a7ad450a..9e15e6e6e6 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
@@ -933,21 +933,24 @@ intel_miptree_used_for_<wbr>rendering(const struct brw_context *brw,<br>
  * Flag values telling color resolve pass which special types of buffers<br>
  * can be ignored.<br>
  *<br>
- * INTEL_MIPTREE_IGNORE_CCS_E:   Lossless compressed (single-sample<br>
- *                               compression scheme since gen9)<br>
+ * INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E:   Lossless compressed (single-sample<br>
+ *                                    compression scheme since gen9)<br>
  */<br>
-#define INTEL_MIPTREE_IGNORE_CCS_E (1 << 0)<br>
+enum intel_resolve_hint {<br>
+   INTEL_RESOLVE_HINT_NO_HINT = 0,<br>
+   INTEL_RESOLVE_HINT_IGNORE_CCS_<wbr>E<br>
+};<br>
<br>
 bool<br>
 intel_miptree_resolve_color(<wbr>struct brw_context *brw,<br>
                             struct intel_mipmap_tree *mt, unsigned level,<br>
                             unsigned start_layer, unsigned num_layers,<br>
-                            int flags);<br>
+                            enum intel_resolve_hint);<br>
<br>
 void<br>
 intel_miptree_all_slices_<wbr>resolve_color(struct brw_context *brw,<br>
                                        struct intel_mipmap_tree *mt,<br>
-                                       int flags);<br>
+                                       enum intel_resolve_hint hint);<br>
<br>
 void<br>
 intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>