ilo: fix "Render Cache Read Write Mode"
authorChia-I Wu <olvaffe@gmail.com>
Fri, 15 May 2015 02:39:05 +0000 (10:39 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 14 Jun 2015 07:43:20 +0000 (15:43 +0800)
It needs be set to R/W only when using certain messages via DP render cache.
Since we only use RT wrties with the render cache, we never need to set it.

src/gallium/drivers/ilo/core/ilo_builder_3d_top.h
src/gallium/drivers/ilo/core/ilo_state_3d.h
src/gallium/drivers/ilo/core/ilo_state_3d_top.c
src/gallium/drivers/ilo/ilo_render_surface.c
src/gallium/drivers/ilo/ilo_state.c

index 05dbce7c905133c7284416a0a49335250fbd0b5e..f9275b64d0e1daa7d6b7237f3f601dd5f99a02dd 100644 (file)
@@ -1711,7 +1711,7 @@ gen6_so_SURFACE_STATE(struct ilo_builder *builder,
    }
 
    ilo_gpe_init_view_surface_for_buffer(builder->dev, buf, bo_offset,
-         so->buffer_size, struct_size, elem_format, false, true, &surf);
+         so->buffer_size, struct_size, elem_format, false, &surf);
 
    return gen6_SURFACE_STATE(builder, &surf, false);
 }
index fdce445f733ad411dfda127874d76a4a1dd8f393..04d00756e09dd32be146c38f289e5c0e7fd6fc39 100644 (file)
@@ -380,7 +380,7 @@ ilo_gpe_init_view_surface_for_buffer(const struct ilo_dev *dev,
                                      unsigned offset, unsigned size,
                                      unsigned struct_size,
                                      enum pipe_format elem_format,
-                                     bool is_rt, bool render_cache_rw,
+                                     bool is_rt,
                                      struct ilo_view_surface *surf);
 
 void
index c17957fb704ebc64129d9302940116c45873aff5..c498a8462a9bf9b477f6125b6d4bd1ed4cfea35b 100644 (file)
@@ -469,8 +469,7 @@ view_init_for_buffer_gen6(const struct ilo_dev *dev,
                           unsigned offset, unsigned size,
                           unsigned struct_size,
                           enum pipe_format elem_format,
-                          bool is_rt, bool render_cache_rw,
-                          struct ilo_view_surface *surf)
+                          bool is_rt, struct ilo_view_surface *surf)
 {
    const int elem_size = util_format_get_blocksize(elem_format);
    int width, height, depth, pitch;
@@ -539,8 +538,6 @@ view_init_for_buffer_gen6(const struct ilo_dev *dev,
 
    dw[0] = GEN6_SURFTYPE_BUFFER << GEN6_SURFACE_DW0_TYPE__SHIFT |
            surface_format << GEN6_SURFACE_DW0_FORMAT__SHIFT;
-   if (render_cache_rw)
-      dw[0] |= GEN6_SURFACE_DW0_RENDER_CACHE_RW;
 
    dw[1] = offset;
 
@@ -691,9 +688,6 @@ view_init_for_image_gen6(const struct ilo_dev *dev,
                GEN6_SURFACE_DW0_CUBE_FACE_ENABLES__MASK;
    }
 
-   if (is_rt)
-      dw[0] |= GEN6_SURFACE_DW0_RENDER_CACHE_RW;
-
    dw[1] = 0;
 
    dw[2] = (height - 1) << GEN6_SURFACE_DW2_HEIGHT__SHIFT |
@@ -795,8 +789,7 @@ view_init_for_buffer_gen7(const struct ilo_dev *dev,
                           unsigned offset, unsigned size,
                           unsigned struct_size,
                           enum pipe_format elem_format,
-                          bool is_rt, bool render_cache_rw,
-                          struct ilo_view_surface *surf)
+                          bool is_rt, struct ilo_view_surface *surf)
 {
    const bool typed = (elem_format != PIPE_FORMAT_NONE);
    const bool structured = (!typed && struct_size > 1);
@@ -886,8 +879,6 @@ view_init_for_buffer_gen7(const struct ilo_dev *dev,
 
    dw[0] = surface_type << GEN7_SURFACE_DW0_TYPE__SHIFT |
            surface_format << GEN7_SURFACE_DW0_FORMAT__SHIFT;
-   if (render_cache_rw)
-      dw[0] |= GEN7_SURFACE_DW0_RENDER_CACHE_RW;
 
    if (ilo_dev_gen(dev) >= ILO_GEN(8)) {
       dw[8] = offset;
@@ -1117,9 +1108,6 @@ view_init_for_image_gen7(const struct ilo_dev *dev,
          dw[0] |= GEN7_SURFACE_DW0_ARYSPC_FULL;
    }
 
-   if (is_rt)
-      dw[0] |= GEN7_SURFACE_DW0_RENDER_CACHE_RW;
-
    if (surface_type == GEN6_SURFTYPE_CUBE && !is_rt)
       dw[0] |= GEN7_SURFACE_DW0_CUBE_FACE_ENABLES__MASK;
 
@@ -1213,15 +1201,15 @@ ilo_gpe_init_view_surface_for_buffer(const struct ilo_dev *dev,
                                      unsigned offset, unsigned size,
                                      unsigned struct_size,
                                      enum pipe_format elem_format,
-                                     bool is_rt, bool render_cache_rw,
+                                     bool is_rt,
                                      struct ilo_view_surface *surf)
 {
    if (ilo_dev_gen(dev) >= ILO_GEN(7)) {
       view_init_for_buffer_gen7(dev, buf, offset, size,
-            struct_size, elem_format, is_rt, render_cache_rw, surf);
+            struct_size, elem_format, is_rt, surf);
    } else {
       view_init_for_buffer_gen6(dev, buf, offset, size,
-            struct_size, elem_format, is_rt, render_cache_rw, surf);
+            struct_size, elem_format, is_rt, surf);
    }
 
    /* do not increment reference count */
index b345dfb4fc4ca5dfd8968d6441f2b4a1f5913182..52b1cb42c061556291b833119e2ff2d9bbd24b76 100644 (file)
@@ -437,7 +437,7 @@ gen6_emit_launch_grid_surface_const(struct ilo_render *r,
          session->input->buffer_offset,
          session->input->buffer_size,
          1, PIPE_FORMAT_NONE,
-         false, false, &view);
+         false, &view);
 
    assert(count == 1 && session->input->buffer);
    surface_state[base] = gen6_SURFACE_STATE(r->builder, &view, false);
@@ -488,7 +488,7 @@ gen6_emit_launch_grid_surface_global(struct ilo_render *r,
          assert(bindings[i].resource->target == PIPE_BUFFER);
 
          ilo_gpe_init_view_surface_for_buffer(r->dev, buf, 0, buf->bo_size,
-               1, PIPE_FORMAT_NONE, true, true, &view);
+               1, PIPE_FORMAT_NONE, true, &view);
          surface_state[i] =
             gen6_SURFACE_STATE(r->builder, &view, true);
       } else {
index b1bd49a0b6c5e66dc4aef649c1842429bbe10d56..7627fcf7c96863e657a15719d2f5a8b23d11c604 100644 (file)
@@ -112,7 +112,7 @@ finalize_cbuf_state(struct ilo_context *ilo,
             ilo_buffer(cbuf->cso[i].resource),
             offset, cbuf->cso[i].user_buffer_size,
             util_format_get_blocksize(elem_format), elem_format,
-            false, false, &cbuf->cso[i].surface);
+            false, &cbuf->cso[i].surface);
 
       ilo->state_vector.dirty |= ILO_DIRTY_CBUF;
    }
@@ -683,7 +683,7 @@ ilo_set_constant_buffer(struct pipe_context *pipe,
                   ilo_buffer(buf[i].buffer),
                   buf[i].buffer_offset, buf[i].buffer_size,
                   util_format_get_blocksize(elem_format), elem_format,
-                  false, false, &cso->surface);
+                  false, &cso->surface);
 
             cso->user_buffer = NULL;
             cso->user_buffer_size = 0;
@@ -1007,7 +1007,7 @@ ilo_create_sampler_view(struct pipe_context *pipe,
 
       ilo_gpe_init_view_surface_for_buffer(dev, ilo_buffer(res),
             first_elem * elem_size, num_elems * elem_size,
-            elem_size, templ->format, false, false, &view->surface);
+            elem_size, templ->format, false, &view->surface);
    }
    else {
       struct ilo_texture *tex = ilo_texture(res);
@@ -1066,10 +1066,6 @@ ilo_create_surface(struct pipe_context *pipe,
       /* relax this? */
       assert(tex->base.target != PIPE_BUFFER);
 
-      /*
-       * classic i965 sets render_cache_rw for constant buffers and sol
-       * surfaces but not render buffers.  Why?
-       */
       ilo_gpe_init_view_surface_for_image(dev,
             &tex->image, tex->base.target,
             templ->format, templ->u.tex.level, 1,