-static void
-panfrost_clear_sfbd(struct panfrost_job *job)
-{
- struct panfrost_context *ctx = job->ctx;
- struct mali_single_framebuffer *sfbd = &ctx->fragment_sfbd;
-
- if (job->clear & PIPE_CLEAR_COLOR) {
- sfbd->clear_color_1 = job->clear_color;
- sfbd->clear_color_2 = job->clear_color;
- sfbd->clear_color_3 = job->clear_color;
- sfbd->clear_color_4 = job->clear_color;
- }
-
- if (job->clear & PIPE_CLEAR_DEPTH) {
- sfbd->clear_depth_1 = job->clear_depth;
- sfbd->clear_depth_2 = job->clear_depth;
- sfbd->clear_depth_3 = job->clear_depth;
- sfbd->clear_depth_4 = job->clear_depth;
-
- sfbd->depth_buffer = ctx->depth_stencil_buffer.gpu;
- sfbd->depth_buffer_enable = MALI_DEPTH_STENCIL_ENABLE;
- }
-
- if (job->clear & PIPE_CLEAR_STENCIL) {
- sfbd->clear_stencil = job->clear_stencil;
-
- sfbd->stencil_buffer = ctx->depth_stencil_buffer.gpu;
- sfbd->stencil_buffer_enable = MALI_DEPTH_STENCIL_ENABLE;
- }
-
- /* Set flags based on what has been cleared, for the SFBD case */
- /* XXX: What do these flags mean? */
- int clear_flags = 0x101100;
-
- if (!(job->clear & ~(PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {
- /* On a tiler like this, it's fastest to clear all three buffers at once */
-
- clear_flags |= MALI_CLEAR_FAST;
- } else {
- clear_flags |= MALI_CLEAR_SLOW;
-
- if (job->clear & PIPE_CLEAR_STENCIL)
- clear_flags |= MALI_CLEAR_SLOW_STENCIL;
- }
-
- sfbd->clear_flags = clear_flags;
-}
-
-static void
-panfrost_clear_mfbd(struct panfrost_job *job)
-{
- struct panfrost_context *ctx = job->ctx;
- struct bifrost_render_target *buffer_color = &ctx->fragment_rts[0];
- struct bifrost_framebuffer *buffer_ds = &ctx->fragment_mfbd;
-
- if (job->clear & PIPE_CLEAR_COLOR) {
- buffer_color->clear_color_1 = job->clear_color;
- buffer_color->clear_color_2 = job->clear_color;
- buffer_color->clear_color_3 = job->clear_color;
- buffer_color->clear_color_4 = job->clear_color;
- }
-
- if (job->clear & PIPE_CLEAR_DEPTH) {
- buffer_ds->clear_depth = job->clear_depth;
- }
-
- if (job->clear & PIPE_CLEAR_STENCIL) {
- buffer_ds->clear_stencil = job->clear_stencil;
- }
-
- if (job->clear & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) {
- /* Setup combined 24/8 depth/stencil */
- ctx->fragment_mfbd.unk3 |= MALI_MFBD_EXTRA;
- ctx->fragment_extra.unk = 0x405;
- ctx->fragment_extra.ds_linear.depth = ctx->depth_stencil_buffer.gpu;
- ctx->fragment_extra.ds_linear.depth_stride = ctx->pipe_framebuffer.width * 4;
- }
-}
-