panfrost: Pass the sample position array through pan_fb_info

Part of the attempt to make pan_desc.{c,h} panfrost_device-agnostic.
Let the caller pass the sample position array through pan_fb_info
instead of extracting it from panfrost_device.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-07 15:36:38 +01:00
committed by Marge Bot
parent 8b8942d4dc
commit 00d4a7c7fd
4 changed files with 15 additions and 4 deletions

View File

@@ -2484,7 +2484,7 @@ emit_tls(struct panfrost_batch *batch)
}
static void
emit_fbd(struct panfrost_batch *batch, const struct pan_fb_info *fb)
emit_fbd(struct panfrost_batch *batch, struct pan_fb_info *fb)
{
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
struct panfrost_bo *tls_bo =
@@ -2500,6 +2500,11 @@ emit_fbd(struct panfrost_batch *batch, const struct pan_fb_info *fb)
},
};
#if PAN_ARCH >= 6
fb->sample_positions =
panfrost_sample_positions(dev, pan_sample_pattern(fb->nr_samples));
#endif
batch->framebuffer.gpu |= GENX(pan_emit_fbd)(
dev, fb, &tls, &batch->tiler_ctx, batch->framebuffer.cpu);
}

View File

@@ -708,8 +708,7 @@ GENX(pan_emit_fbd)(const struct panfrost_device *dev,
#if PAN_ARCH >= 6
bool force_clean_write = pan_force_clean_write(fb, tile_size);
cfg.sample_locations =
panfrost_sample_positions(dev, pan_sample_pattern(fb->nr_samples));
cfg.sample_locations = fb->sample_positions;
cfg.pre_frame_0 = pan_fix_frame_shader_mode(fb->bifrost.pre_post.modes[0],
force_clean_write);
cfg.pre_frame_1 = pan_fix_frame_shader_mode(fb->bifrost.pre_post.modes[1],

View File

@@ -128,6 +128,9 @@ struct pan_fb_info {
/* Optimal tile buffer size. */
unsigned tile_buf_budget;
/* Sample position array. */
mali_ptr sample_positions;
/* Only used on Valhall */
bool sprite_coord_origin;
bool first_provoking_vertex;

View File

@@ -72,7 +72,7 @@ panvk_per_arch(cmd_close_batch)(struct panvk_cmd_buffer *cmdbuf)
if (!batch)
return;
const struct pan_fb_info *fbinfo = &cmdbuf->state.fb.info;
struct pan_fb_info *fbinfo = &cmdbuf->state.fb.info;
assert(batch);
@@ -132,6 +132,10 @@ panvk_per_arch(cmd_close_batch)(struct panvk_cmd_buffer *cmdbuf)
GENX(pan_emit_tls)(&batch->tlsinfo, batch->tls.cpu);
if (batch->fb.desc.cpu) {
fbinfo->sample_positions =
panfrost_sample_positions(&cmdbuf->device->physical_device->pdev,
pan_sample_pattern(fbinfo->nr_samples));
batch->fb.desc.gpu |=
GENX(pan_emit_fbd)(pdev, &cmdbuf->state.fb.info, &batch->tlsinfo,
&batch->tiler.ctx, batch->fb.desc.cpu);