Mesa (master): panfrost: Load from tiled images
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 15:24:07 UTC 2019
Module: Mesa
Branch: master
Commit: 546236e27ff7d5be1b8442a62f669926bd244a95
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=546236e27ff7d5be1b8442a62f669926bd244a95
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Tue Jun 18 10:48:43 2019 -0700
panfrost: Load from tiled images
Now that we have lima tiling code available, use it to load from a tiled
source.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
src/gallium/drivers/panfrost/pan_resource.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 5b84daf3a3f..a99840e4a52 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -506,9 +506,22 @@ panfrost_transfer_map(struct pipe_context *pctx,
transfer->base.stride = box->width * bytes_per_pixel;
transfer->base.layer_stride = transfer->base.stride * box->height;
-
- /* TODO: Reads */
transfer->map = rzalloc_size(transfer, transfer->base.layer_stride * box->depth);
+ assert(box->depth == 1);
+
+ if (usage & PIPE_TRANSFER_READ) {
+ if (bo->layout == PAN_AFBC) {
+ DBG("Unimplemented: reads from AFBC");
+ } else if (bo->layout == PAN_TILED) {
+ panfrost_load_tiled_image(
+ transfer->map,
+ bo->cpu + bo->slices[level].offset,
+ box,
+ transfer->base.stride,
+ bo->slices[level].stride,
+ util_format_get_blocksize(resource->format));
+ }
+ }
return transfer->map;
} else {
More information about the mesa-commit
mailing list