ilo: decode INTERFACE_DESCRIPTOR_DATA
authorChia-I Wu <olvaffe@gmail.com>
Fri, 7 Nov 2014 07:45:25 +0000 (15:45 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 7 Nov 2014 15:33:21 +0000 (23:33 +0800)
This is at least much better than decoding as blobs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_builder.h
src/gallium/drivers/ilo/ilo_builder_decode.c
src/gallium/drivers/ilo/ilo_builder_media.h

index 102f11a1853b145be46944870a6d601b1aa5915b..c11dba2d616292471a28b2254b766909d7e7d1aa 100644 (file)
@@ -49,6 +49,7 @@ enum ilo_builder_item_type {
    ILO_BUILDER_ITEM_DEPTH_STENCIL,
    ILO_BUILDER_ITEM_BLEND,
    ILO_BUILDER_ITEM_SAMPLER,
+   ILO_BUILDER_ITEM_INTERFACE_DESCRIPTOR,
 
    /* for surface buffer */
    ILO_BUILDER_ITEM_SURFACE,
index 3a9ae248d1d36839ade81ce64d9e861b29d7c543..05afe12862719b22f8be080592d6474210fd259e 100644 (file)
@@ -392,6 +392,45 @@ writer_decode_sampler(const struct ilo_builder *builder,
    }
 }
 
+static void
+writer_decode_interface_descriptor(const struct ilo_builder *builder,
+                                   enum ilo_builder_writer_type which,
+                                   const struct ilo_builder_item *item)
+{
+   const unsigned state_size = sizeof(uint32_t) * 8;
+   const unsigned count = item->size / state_size;
+   unsigned offset = item->offset;
+   unsigned i;
+
+   for (i = 0; i < count; i++) {
+      writer_dw(builder, which, offset, 0, "IDRT[%d]", i);
+      ilo_printf("kernel\n");
+
+      writer_dw(builder, which, offset, 1, "IDRT[%d]", i);
+      ilo_printf("spf, fp mode\n");
+
+      writer_dw(builder, which, offset, 2, "IDRT[%d]", i);
+      ilo_printf("sampler\n");
+
+      writer_dw(builder, which, offset, 3, "IDRT[%d]", i);
+      ilo_printf("binding table\n");
+
+      writer_dw(builder, which, offset, 4, "IDRT[%d]", i);
+      ilo_printf("curbe read len\n");
+
+      writer_dw(builder, which, offset, 5, "IDRT[%d]", i);
+      ilo_printf("rounding mode, slm size\n");
+
+      writer_dw(builder, which, offset, 6, "IDRT[%d]", i);
+      ilo_printf("cross-thread curbe read len\n");
+
+      writer_dw(builder, which, offset, 7, "IDRT[%d]", i);
+      ilo_printf("mbz\n");
+
+      offset += state_size;
+   }
+}
+
 static void
 writer_decode_surface_gen7(const struct ilo_builder *builder,
                            enum ilo_builder_writer_type which,
@@ -526,6 +565,7 @@ static const struct {
    [ILO_BUILDER_ITEM_DEPTH_STENCIL]       = { writer_decode_depth_stencil },
    [ILO_BUILDER_ITEM_BLEND]               = { writer_decode_blend },
    [ILO_BUILDER_ITEM_SAMPLER]             = { writer_decode_sampler },
+   [ILO_BUILDER_ITEM_INTERFACE_DESCRIPTOR] = { writer_decode_interface_descriptor },
    [ILO_BUILDER_ITEM_SURFACE]             = { writer_decode_surface },
    [ILO_BUILDER_ITEM_BINDING_TABLE]       = { writer_decode_binding_table },
    [ILO_BUILDER_ITEM_KERNEL]              = { writer_decode_kernel },
index bae329b7e7f4db9ac1c51412ba535217ea9bce21..f5d634f28e1399416a7ddeeaca5efd56127d465c 100644 (file)
@@ -217,7 +217,7 @@ gen6_INTERFACE_DESCRIPTOR_DATA(struct ilo_builder *builder,
    ILO_DEV_ASSERT(builder->dev, 7, 7.5);
 
    state_offset = ilo_builder_dynamic_pointer(builder,
-         ILO_BUILDER_ITEM_BLOB, state_align, state_len, &dw);
+         ILO_BUILDER_ITEM_INTERFACE_DESCRIPTOR, state_align, state_len, &dw);
 
    for (i = 0; i < idrt_count; i++) {
       const struct gen6_idrt_data *idrt = &data[i];