summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_blitter.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-01-02 11:04:16 -0500
committerRob Clark <[email protected]>2019-01-03 08:10:16 -0500
commit53b8eb78d5491a448830ff4628086a592c6f4fe3 (patch)
tree20282738a0aa160d25ae56695b239b5528fded42 /src/gallium/drivers/freedreno/freedreno_blitter.c
parent228eddd7eefbe6ac78a284fe7fc1d5c4b23b0f37 (diff)
freedreno: try blitter for fd_resource_copy_region()
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_blitter.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_blitter.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_blitter.c b/src/gallium/drivers/freedreno/freedreno_blitter.c
index 5c480757772..aaf39f4c4d2 100644
--- a/src/gallium/drivers/freedreno/freedreno_blitter.c
+++ b/src/gallium/drivers/freedreno/freedreno_blitter.c
@@ -173,6 +173,33 @@ fd_resource_copy_region(struct pipe_context *pctx,
{
struct fd_context *ctx = fd_context(pctx);
+ if (ctx->blit) {
+ struct pipe_blit_info info;
+
+ memset(&info, 0, sizeof info);
+ info.dst.resource = dst;
+ info.dst.level = dst_level;
+ info.dst.box.x = dstx;
+ info.dst.box.y = dsty;
+ info.dst.box.z = dstz;
+ info.dst.box.width = src_box->width;
+ info.dst.box.height = src_box->height;
+ assert(info.dst.box.width >= 0);
+ assert(info.dst.box.height >= 0);
+ info.dst.box.depth = 1;
+ info.dst.format = dst->format;
+ info.src.resource = src;
+ info.src.level = src_level;
+ info.src.box = *src_box;
+ info.src.format = src->format;
+ info.mask = util_format_get_mask(src->format);
+ info.filter = PIPE_TEX_FILTER_NEAREST;
+ info.scissor_enable = 0;
+
+ if (ctx->blit(ctx, &info))
+ return;
+ }
+
/* TODO if we have 2d core, or other DMA engine that could be used
* for simple copies and reasonably easily synchronized with the 3d
* core, this is where we'd plug it in..