diff --git a/src/panfrost/lib/pan_cs.c b/src/panfrost/lib/pan_cs.c index 4ec1b4c09e0..34a20808365 100644 --- a/src/panfrost/lib/pan_cs.c +++ b/src/panfrost/lib/pan_cs.c @@ -913,3 +913,25 @@ pan_emit_bifrost_tiler(const struct panfrost_device *dev, tiler.sample_pattern = pan_sample_pattern(nr_samples); } } + +void +pan_emit_fragment_job(const struct panfrost_device *dev, + const struct pan_fb_info *fb, + mali_ptr fbd, + void *out) +{ + pan_section_pack(out, FRAGMENT_JOB, HEADER, header) { + header.type = MALI_JOB_TYPE_FRAGMENT; + header.index = 1; + } + + pan_section_pack(out, FRAGMENT_JOB, PAYLOAD, payload) { + payload.bound_min_x = fb->extent.minx >> MALI_TILE_SHIFT; + payload.bound_min_y = fb->extent.miny >> MALI_TILE_SHIFT; + + /* Batch max values are inclusive, we need to subtract 1. */ + payload.bound_max_x = fb->extent.maxx >> MALI_TILE_SHIFT; + payload.bound_max_y = fb->extent.maxy >> MALI_TILE_SHIFT; + payload.framebuffer = fbd; + } +} diff --git a/src/panfrost/lib/pan_cs.h b/src/panfrost/lib/pan_cs.h index 22eaf3ef1ce..f013a2a943f 100644 --- a/src/panfrost/lib/pan_cs.h +++ b/src/panfrost/lib/pan_cs.h @@ -136,4 +136,10 @@ pan_emit_bifrost_tiler(const struct panfrost_device *dev, mali_ptr heap, void *out); +void +pan_emit_fragment_job(const struct panfrost_device *dev, + const struct pan_fb_info *fb, + mali_ptr fbd, + void *out); + #endif