Skip to content

Instantly share code, notes, and snippets.

@anarsoul
Created August 21, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarsoul/d7e7ec57c18c038b7ce1d9c79d4e0632 to your computer and use it in GitHub Desktop.
Save anarsoul/d7e7ec57c18c038b7ce1d9c79d4e0632 to your computer and use it in GitHub Desktop.
diff --git a/src/gallium/drivers/lima/lima_context.h b/src/gallium/drivers/lima/lima_context.h
index 0b232d72d1d..ec732bbf227 100644
--- a/src/gallium/drivers/lima/lima_context.h
+++ b/src/gallium/drivers/lima/lima_context.h
@@ -129,6 +129,7 @@ enum lima_ctx_buff {
lima_ctx_buff_pp_uniform_array,
lima_ctx_buff_pp_uniform,
lima_ctx_buff_pp_tex_desc,
+ lima_ctx_buff_pp_stack,
lima_ctx_buff_num,
};
diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c
index 87eeb0e795b..bdde253698c 100644
--- a/src/gallium/drivers/lima/lima_draw.c
+++ b/src/gallium/drivers/lima/lima_draw.c
@@ -1623,16 +1623,23 @@ _lima_flush(struct lima_context *ctx, bool end_of_frame)
}
}
+
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};
lima_pack_pp_frame_reg(ctx, pp_frame.frame, pp_frame.wb);
pp_frame.num_pp = screen->num_pp;
+#define pp_stack_pp_size 0x400
+ uint32_t pp_stack_va = 0x0;
+ if (ctx->fs->stack_size) {
+ lima_ctx_buff_alloc(ctx, lima_ctx_buff_pp_stack, ctx->fs->stack_size * pp_stack_pp_size * screen->num_pp, true);
+ pp_stack_va = lima_ctx_buff_va(ctx, lima_ctx_buff_pp_stack, LIMA_CTX_BUFF_SUBMIT_PP);
+ }
for (int i = 0; i < screen->num_pp; i++) {
pp_frame.plbu_array_address[i] = ps->bo->va + ps->bo_offset + ps->offset[i];
- pp_frame.fragment_stack_address[i] = screen->pp_buffer->va +
- pp_stack_offset + pp_stack_pp_size * i;
+ pp_frame.fragment_stack_address[i] = va;
+ va += pp_stack_pp_size * ctx->fs->stack_size;
}
lima_dump_command_stream_print(
diff --git a/src/gallium/drivers/lima/lima_screen.h b/src/gallium/drivers/lima/lima_screen.h
index 29693168828..547d083ecd0 100644
--- a/src/gallium/drivers/lima/lima_screen.h
+++ b/src/gallium/drivers/lima/lima_screen.h
@@ -73,10 +73,7 @@ struct lima_screen {
#define pp_reload_program_offset 0x0080
#define pp_shared_index_offset 0x00c0
#define pp_clear_gl_pos_offset 0x0100
- #define pp_stack_offset 0x1000
- #define pp_stack_pp_size 0x400 /* per pp, up to 8 pp */
- #define pp_stack_offset_end 0x3000
- #define pp_buffer_size 0x3000
+ #define pp_buffer_size 0x1000
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment