Lines Matching refs:stream
53 etna_cmd_stream_priv(struct etna_cmd_stream *stream)
55 return (struct etna_cmd_stream_priv *)stream;
60 void (*reset_notify)(struct etna_cmd_stream *stream, void *priv),
63 struct etna_cmd_stream_priv *stream = NULL;
70 stream = calloc(1, sizeof(*stream));
71 if (!stream) {
79 stream->base.buffer = malloc(size * sizeof(uint32_t));
80 if (!stream->base.buffer) {
85 stream->base.size = size;
86 stream->pipe = pipe;
87 stream->reset_notify = reset_notify;
88 stream->reset_notify_priv = priv;
90 return &stream->base;
93 if (stream)
94 etna_cmd_stream_del(&stream->base);
99 drm_public void etna_cmd_stream_del(struct etna_cmd_stream *stream)
101 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
103 free(stream->buffer);
109 static void reset_buffer(struct etna_cmd_stream *stream)
111 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
113 stream->offset = 0;
120 priv->reset_notify(stream, priv->reset_notify_priv);
123 drm_public uint32_t etna_cmd_stream_timestamp(struct etna_cmd_stream *stream)
125 return etna_cmd_stream_priv(stream)->last_timestamp;
128 static uint32_t append_bo(struct etna_cmd_stream *stream, struct etna_bo *bo)
130 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
145 static uint32_t bo2idx(struct etna_cmd_stream *stream, struct etna_bo *bo,
148 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
153 if (bo->current_stream == stream) {
162 idx = append_bo(stream, bo);
164 bo->current_stream = stream;
177 static void flush(struct etna_cmd_stream *stream, int in_fence_fd,
180 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
193 .stream = VOID2U64(stream->buffer),
194 .stream_size = stream->offset * 4, /* in bytes */
224 drm_public void etna_cmd_stream_flush(struct etna_cmd_stream *stream)
226 flush(stream, -1, NULL);
227 reset_buffer(stream);
230 drm_public void etna_cmd_stream_flush2(struct etna_cmd_stream *stream,
234 flush(stream, in_fence_fd, out_fence_fd);
235 reset_buffer(stream);
238 drm_public void etna_cmd_stream_finish(struct etna_cmd_stream *stream)
240 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
242 flush(stream, -1, NULL);
244 reset_buffer(stream);
247 drm_public void etna_cmd_stream_reloc(struct etna_cmd_stream *stream,
250 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
257 reloc->reloc_idx = bo2idx(stream, r->bo, r->flags);
259 reloc->submit_offset = stream->offset * 4; /* in bytes */
262 etna_cmd_stream_emit(stream, addr);
265 drm_public void etna_cmd_stream_perf(struct etna_cmd_stream *stream, const struct etna_perf *p)
267 struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream);
276 pmr->read_idx = bo2idx(stream, p->bo, ETNA_SUBMIT_BO_READ | ETNA_SUBMIT_BO_WRITE);