etnaviv: GC7000: No RS align when using BLT
[mesa.git] / src / gallium / drivers / etnaviv / etnaviv_surface.c
index 4b95f6575a4517b35b8028a931d148b5d20a17c3..442957380082f8b1d1c8e192e4679f2a3e952188 100644 (file)
@@ -116,26 +116,29 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
       surf->ts_reloc.offset = surf->surf.ts_offset;
       surf->ts_reloc.flags = 0;
 
-      /* This (ab)uses the RS as a plain buffer memset().
-       * Currently uses a fixed row size of 64 bytes. Some benchmarking with
-       * different sizes may be in order. */
-      struct etna_bo *ts_bo = etna_resource(surf->base.texture)->ts_bo;
-      etna_compile_rs_state(ctx, &surf->clear_command, &(struct rs_state) {
-         .source_format = RS_FORMAT_A8R8G8B8,
-         .dest_format = RS_FORMAT_A8R8G8B8,
-         .dest = ts_bo,
-         .dest_offset = surf->surf.ts_offset,
-         .dest_stride = 0x40,
-         .dest_tiling = ETNA_LAYOUT_TILED,
-         .dither = {0xffffffff, 0xffffffff},
-         .width = 16,
-         .height = etna_align_up(surf->surf.ts_size / 0x40, 4),
-         .clear_value = {ctx->specs.ts_clear_value},
-         .clear_mode = VIVS_RS_CLEAR_CONTROL_MODE_ENABLED1,
-         .clear_bits = 0xffff
-      });
+      if (!ctx->specs.use_blt) {
+         /* This (ab)uses the RS as a plain buffer memset().
+          * Currently uses a fixed row size of 64 bytes. Some benchmarking with
+          * different sizes may be in order. */
+         struct etna_bo *ts_bo = etna_resource(surf->base.texture)->ts_bo;
+         etna_compile_rs_state(ctx, &surf->clear_command, &(struct rs_state) {
+            .source_format = RS_FORMAT_A8R8G8B8,
+            .dest_format = RS_FORMAT_A8R8G8B8,
+            .dest = ts_bo,
+            .dest_offset = surf->surf.ts_offset,
+            .dest_stride = 0x40,
+            .dest_tiling = ETNA_LAYOUT_TILED,
+            .dither = {0xffffffff, 0xffffffff},
+            .width = 16,
+            .height = etna_align_up(surf->surf.ts_size / 0x40, 4),
+            .clear_value = {ctx->specs.ts_clear_value},
+            .clear_mode = VIVS_RS_CLEAR_CONTROL_MODE_ENABLED1,
+            .clear_bits = 0xffff
+         });
+      }
    } else {
-      etna_rs_gen_clear_surface(ctx, surf, surf->level->clear_value);
+      if (!ctx->specs.use_blt)
+         etna_rs_gen_clear_surface(ctx, surf, surf->level->clear_value);
    }
 
    return &surf->base;