panfrost: Import streamout data structures

Pretty much copypasted from v3d to jumpstart us.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-08-06 16:43:28 -07:00
parent c82672c9c1
commit 5ff7973560
2 changed files with 24 additions and 1 deletions

View File

@ -1,5 +1,6 @@
/*
* © Copyright 2018 Alyssa Rosenzweig
* Copyright © 2014-2017 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -2670,7 +2671,22 @@ panfrost_set_stream_output_targets(struct pipe_context *pctx,
struct pipe_stream_output_target **targets,
const unsigned *offsets)
{
/* STUB */
struct panfrost_context *ctx = pan_context(pctx);
struct panfrost_streamout *so = &ctx->streamout;
assert(num_targets <= ARRAY_SIZE(so->targets));
for (unsigned i = 0; i < num_targets; i++) {
if (offsets[i] != -1)
so->offsets[i] = offsets[i];
pipe_so_target_reference(&so->targets[i], targets[i]);
}
for (unsigned i = 0; i < so->num_targets; i++)
pipe_so_target_reference(&so->targets[i], NULL);
so->num_targets = num_targets;
}
static void

View File

@ -88,6 +88,12 @@ struct panfrost_fence {
int fd;
};
struct panfrost_streamout {
struct pipe_stream_output_target *targets[PIPE_MAX_SO_BUFFERS];
uint32_t offsets[PIPE_MAX_SO_BUFFERS];
unsigned num_targets;
};
struct panfrost_context {
/* Gallium context */
struct pipe_context base;
@ -106,6 +112,7 @@ struct panfrost_context {
unsigned draw_modes;
struct pipe_framebuffer_state pipe_framebuffer;
struct panfrost_streamout streamout;
struct panfrost_memory cmdstream_persistent;
struct panfrost_memory scratchpad;