summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/lima
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2019-10-09 19:20:02 -0700
committerVasily Khoruzhick <anarsoul@gmail.com>2020-01-05 00:16:33 -0800
commit83abdf8e4518a40dc0c74f7c85d7e9a6d76ce7a5 (patch)
treefd702dd72f231e3524283dd5cccd628f4ad899e5 /src/gallium/drivers/lima
parent7ad1896ab8a0ec07b9cc54f7316291a3e476f431 (diff)
lima: postpone PP stream generation
This commit postpones PP stream generation till job is submitted. Doing that this late allows us to skip reloading and redrawing tiles that were not updated. Reviewed-by: Qiang Yu <yuq825@gmail.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Diffstat (limited to 'src/gallium/drivers/lima')
-rw-r--r--src/gallium/drivers/lima/lima_draw.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c
index 5fb846c7b7a..4fb2e12cd12 100644
--- a/src/gallium/drivers/lima/lima_draw.c
+++ b/src/gallium/drivers/lima/lima_draw.c
@@ -460,7 +460,7 @@ inside_damage_region(int x, int y, struct lima_damage_region *ds)
}
static void
-lima_update_pp_stream(struct lima_context *ctx, int off_x, int off_y,
+lima_generate_pp_stream(struct lima_context *ctx, int off_x, int off_y,
int tiled_w, int tiled_h)
{
struct lima_pp_stream_state *ps = &ctx->pp_stream;
@@ -539,7 +539,7 @@ lima_update_damage_pp_stream(struct lima_context *ctx)
ctx->pp_stream.bo = res->bo;
ctx->pp_stream.bo_offset = offset;
- lima_update_pp_stream(ctx, bound->minx, bound->miny, tiled_w, tiled_h);
+ lima_generate_pp_stream(ctx, bound->minx, bound->miny, tiled_w, tiled_h);
lima_submit_add_bo(ctx->pp_submit, res->bo, LIMA_SUBMIT_BO_READ);
pipe_resource_reference(&pres, NULL);
@@ -575,13 +575,25 @@ lima_update_full_pp_stream(struct lima_context *ctx)
ctx->pp_stream.bo_offset = 0;
memcpy(ctx->pp_stream.offset, s->offset, sizeof(s->offset));
- lima_update_pp_stream(ctx, 0, 0, fb->tiled_w, fb->tiled_h);
+ lima_generate_pp_stream(ctx, 0, 0, fb->tiled_w, fb->tiled_h);
}
lima_submit_add_bo(ctx->pp_submit, s->bo, LIMA_SUBMIT_BO_READ);
}
static void
+lima_update_pp_stream(struct lima_context *ctx)
+{
+ struct lima_damage_region *damage = lima_ctx_get_damage(ctx);
+ if (damage && damage->region)
+ lima_update_damage_pp_stream(ctx);
+ else if (ctx->plb_pp_stream)
+ lima_update_full_pp_stream(ctx);
+ else
+ ctx->pp_stream.bo = NULL;
+}
+
+static void
lima_update_submit_bo(struct lima_context *ctx)
{
if (lima_ctx_dirty(ctx))
@@ -597,14 +609,6 @@ lima_update_submit_bo(struct lima_context *ctx)
ctx->plb_gp_size, false, "gp plb stream at va %x\n",
ctx->plb_gp_stream->va + ctx->plb_index * ctx->plb_gp_size);
- struct lima_damage_region *damage = lima_ctx_get_damage(ctx);
- if (damage && damage->region)
- lima_update_damage_pp_stream(ctx);
- else if (ctx->plb_pp_stream)
- lima_update_full_pp_stream(ctx);
- else
- ctx->pp_stream.bo = NULL;
-
if (ctx->framebuffer.base.nr_cbufs) {
struct lima_resource *res = lima_resource(ctx->framebuffer.base.cbufs[0]->texture);
lima_submit_add_bo(ctx->pp_submit, res->bo, LIMA_SUBMIT_BO_WRITE);
@@ -1644,6 +1648,8 @@ _lima_flush(struct lima_context *ctx, bool end_of_frame)
LIMA_CTX_BUFF_SUBMIT_PP);
}
+ lima_update_pp_stream(ctx);
+
struct lima_pp_stream_state *ps = &ctx->pp_stream;
if (screen->gpu_type == DRM_LIMA_PARAM_GPU_ID_MALI400) {
struct drm_lima_m400_pp_frame pp_frame = {0};