summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-12-13 09:15:33 -0500
committerRob Clark <robdclark@gmail.com>2018-12-13 15:51:01 -0500
commit0ac5acaeaaa651d850d77ebab094fa851a7ee06d (patch)
treed7a7bd0c36deb86dd35996a93c103aff60d60414 /src/gallium/drivers/freedreno
parent4ec2f6129b9283d81b5dc8d95d304b243ec5145c (diff)
freedreno/a6xx: fix resource_copy_region()
pctx->resource_copy_region() needs to fall back to sw copy for non-renderable formats. But previously for things that we could not use the blitter for, would fall back to 3d. Which won't work if 3d can't render to the dst format either. Instead rework things to fallback to fd_resource_copy_region(), which will try 3d core and then fall back to memcpy(). Fixes (for example) dEQP-GLES3.functional.texture.format.sized.2d.rgb9_e5_pot Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_blitter.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
index 4be57c0f75a..97e015d19eb 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
@@ -512,18 +512,11 @@ emit_blit_texture(struct fd_ringbuffer *ring, const struct pipe_blit_info *info)
}
static void
-fd6_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
+emit_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
{
struct fd_context *ctx = fd_context(pctx);
struct fd_batch *batch;
- if (!can_do_blit(info)) {
- fd_blitter_pipe_begin(ctx, info->render_condition_enable, false, FD_STAGE_BLIT);
- fd_blitter_blit(ctx, info);
- fd_blitter_pipe_end(ctx);
- return;
- }
-
fd_fence_ref(pctx->screen, &ctx->last_fence, NULL);
batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
@@ -564,6 +557,21 @@ fd6_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
}
static void
+fd6_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
+{
+ struct fd_context *ctx = fd_context(pctx);
+
+ if (!can_do_blit(info)) {
+ fd_blitter_pipe_begin(ctx, info->render_condition_enable, false, FD_STAGE_BLIT);
+ fd_blitter_blit(ctx, info);
+ fd_blitter_pipe_end(ctx);
+ return;
+ }
+
+ emit_blit(pctx, info);
+}
+
+static void
fd6_resource_copy_region(struct pipe_context *pctx,
struct pipe_resource *dst,
unsigned dst_level,
@@ -596,7 +604,14 @@ fd6_resource_copy_region(struct pipe_context *pctx,
info.filter = PIPE_TEX_FILTER_NEAREST;
info.scissor_enable = 0;
- fd6_blit(pctx, &info);
+ if (!can_do_blit(&info)) {
+ fd_resource_copy_region(pctx,
+ dst, dst_level, dstx, dsty, dstz,
+ src, src_level, src_box);
+ return;
+ }
+
+ emit_blit(pctx, &info);
}
void