iris: binder fixes
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 6 Apr 2018 23:31:01 +0000 (16:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_binder.c
src/gallium/drivers/iris/iris_state.c

index 5c54c0a13d95114e70813b53171ecadeddd4655e..ed059acad7aca00bba22b926334dfa33a2b26f65 100644 (file)
@@ -37,6 +37,9 @@ iris_binder_reserve(struct iris_binder *binder, unsigned size,
    assert(size > 0);
    assert(binder->insert_point + size <= BINDER_SIZE);
 
+   assert((binder->insert_point % 64) == 0);
+   *out_offset = binder->insert_point;
+
    binder->insert_point = align(binder->insert_point + size, 64);
 
    return binder->map + *out_offset;
@@ -48,6 +51,7 @@ iris_init_binder(struct iris_binder *binder, struct iris_bufmgr *bufmgr)
    binder->bo =
       iris_bo_alloc(bufmgr, "binder", BINDER_SIZE, IRIS_MEMZONE_BINDER);
    binder->map = iris_bo_map(NULL, binder->bo, MAP_WRITE);
+   binder->insert_point = 64; // XXX: avoid null pointer, it confuses tools
 }
 
 void
index 671b1e723f88c4ad3fb51d487635036056b9567b..d385b784ea0bc51233b4e684d1b16be437004e3c 100644 (file)
@@ -1968,6 +1968,7 @@ iris_upload_render_state(struct iris_context *ice,
       uint32_t *bt_map = NULL;
 
       if (prog_data->binding_table.size_bytes != 0) {
+         iris_use_pinned_bo(batch, ice->state.binder.bo, false);
          bt_map = iris_binder_reserve(&ice->state.binder,
                                       prog_data->binding_table.size_bytes,
                                       &bt_offset);