[Mesa-dev] [PATCH] i965/gen8: Expose auxiliary mode resolver

Topi Pohjolainen topi.pohjolainen at intel.com
Fri May 6 07:47:19 UTC 2016


Also use the opportunity to drop the unused surface type argument.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
---
 src/mesa/drivers/dri/i965/brw_state.h          | 2 ++
 src/mesa/drivers/dri/i965/gen8_surface_state.c | 9 ++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index e89b388..5c971d1 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -336,6 +336,8 @@ uint32_t *gen8_allocate_surface_state(struct brw_context *brw,
 void gen8_emit_fast_clear_color(const struct brw_context *brw,
                                 const struct intel_mipmap_tree *mt,
                                 uint32_t *surf);
+uint32_t gen8_get_aux_mode(const struct brw_context *brw,
+                           const struct intel_mipmap_tree *mt);
 
 /* brw_sampler_state.c */
 void brw_emit_sampler_state(struct brw_context *brw,
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index 5161d2b..4f9a6e9 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -198,10 +198,9 @@ gen8_emit_fast_clear_color(const struct brw_context *brw,
       surf[7] |= mt->fast_clear_color_value;
 }
 
-static uint32_t
+uint32_t
 gen8_get_aux_mode(const struct brw_context *brw,
-                  const struct intel_mipmap_tree *mt,
-                  uint32_t surf_type)
+                  const struct intel_mipmap_tree *mt)
 {
    if (mt->mcs_mt == NULL)
       return GEN8_SURFACE_AUX_MODE_NONE;
@@ -237,7 +236,7 @@ gen8_emit_texture_surface_state(struct brw_context *brw,
    unsigned tiling_mode, pitch;
    const unsigned tr_mode = surface_tiling_resource_mode(mt->tr_mode);
    const uint32_t surf_type = translate_tex_target(target);
-   uint32_t aux_mode = gen8_get_aux_mode(brw, mt, surf_type);
+   uint32_t aux_mode = gen8_get_aux_mode(brw, mt);
 
    if (mt->format == MESA_FORMAT_S_UINT8) {
       tiling_mode = GEN8_SURFACE_TILING_W;
@@ -484,7 +483,7 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
    }
 
    struct intel_mipmap_tree *aux_mt = mt->mcs_mt;
-   const uint32_t aux_mode = gen8_get_aux_mode(brw, mt, surf_type);
+   const uint32_t aux_mode = gen8_get_aux_mode(brw, mt);
 
    uint32_t *surf = gen8_allocate_surface_state(brw, &offset, surf_index);
 
-- 
2.5.5



More information about the mesa-dev mailing list