Commit 43da7dd3 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Handle transfer_unmap appropriately

parent 9be44a52
......@@ -1729,14 +1729,21 @@ panfrost_transfer_map(struct pipe_context *pctx,
struct panfrost_resource *rsrc = (struct panfrost_resource *) resource;
struct pipe_transfer *transfer = CALLOC_STRUCT(pipe_transfer);
transfer->resource = resource;
transfer->level = level;
transfer->usage = usage;
transfer->box = *box;
transfer->stride = rsrc->stride;
assert(!transfer->box.z);
#ifdef HAVE_DRI3
pipe_resource_reference(&transfer->resource, resource);
#else
transfer->resource = resource;
#endif
*out_transfer = transfer;
assert(!transfer->box.z);
/* If non-zero level, it's a mipmapped resource and needs to be treated as such */
rsrc->is_mipmap |= transfer->level;
......@@ -2057,8 +2064,14 @@ panfrost_transfer_unmap(struct pipe_context *pctx,
panfrost_tile_texture(ctx, (struct panfrost_resource *) transfer->resource, transfer->level);
}
}
/* XXX */
//free(transfer);
#ifdef HAVE_DRI3
/* Derefence the resource */
pipe_resource_reference(&transfer->resource, NULL);
#endif
/* Transfer itself is CALLOCed at the moment */
free(transfer);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment