summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_resource.c
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-02-26 11:54:56 -0500
committerRob Clark <[email protected]>2019-02-27 18:46:28 +0000
commit61e31886339b167bc85c48521664e456f0cfcf8e (patch)
tree123c1ba3e2ccdbc7926a3d9ab79ed01065c4e58c /src/gallium/drivers/freedreno/freedreno_resource.c
parente3591b03393402321d24e10b93ec5a827a4b9b6a (diff)
freedreno: catch failing fd_blit and fallback to software blit
Fixes cases where the fd_blit fails and never happens (ex: blit to etc1) Signed-off-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 144d725fdec..5635d8ffde7 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -126,10 +126,7 @@ do_blit(struct fd_context *ctx, const struct pipe_blit_info *blit, bool fallback
struct pipe_context *pctx = &ctx->base;
/* TODO size threshold too?? */
- if (!fallback) {
- /* do blit on gpu: */
- pctx->blit(pctx, blit);
- } else {
+ if (fallback || !fd_blit(pctx, blit)) {
/* do blit on cpu: */
util_resource_copy_region(pctx,
blit->dst.resource, blit->dst.level, blit->dst.box.x,
@@ -1255,6 +1252,13 @@ fd_get_sample_position(struct pipe_context *context,
pos_out[1] = ptr[sample_index][1] / 16.0f;
}
+static void
+fd_blit_pipe(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
+{
+ /* wrap fd_blit to return void */
+ fd_blit(pctx, blit_info);
+}
+
void
fd_resource_context_init(struct pipe_context *pctx)
{
@@ -1266,7 +1270,7 @@ fd_resource_context_init(struct pipe_context *pctx)
pctx->create_surface = fd_create_surface;
pctx->surface_destroy = fd_surface_destroy;
pctx->resource_copy_region = fd_resource_copy_region;
- pctx->blit = fd_blit;
+ pctx->blit = fd_blit_pipe;
pctx->flush_resource = fd_flush_resource;
pctx->invalidate_resource = fd_invalidate_resource;
pctx->get_sample_position = fd_get_sample_position;