Lines Matching refs:vbva_ctx

29 static void vbva_buffer_place_data_at(struct vbva_buf_ctx *vbva_ctx,  in vbva_buffer_place_data_at()  argument
32 struct vbva_buffer *vbva = vbva_ctx->vbva; in vbva_buffer_place_data_at()
61 bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, in vbva_write() argument
68 vbva = vbva_ctx->vbva; in vbva_write()
69 record = vbva_ctx->record; in vbva_write()
71 if (!vbva || vbva_ctx->buffer_overflow || in vbva_write()
87 vbva_ctx->buffer_overflow = true; in vbva_write()
93 vbva_buffer_place_data_at(vbva_ctx, p, chunk, in vbva_write()
107 static bool vbva_inform_host(struct vbva_buf_ctx *vbva_ctx, in vbva_inform_host() argument
118 p->base.offset = vbva_ctx->buffer_offset; in vbva_inform_host()
137 bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, in vbva_enable() argument
144 vbva->data_len = vbva_ctx->buffer_length - sizeof(struct vbva_buffer); in vbva_enable()
145 vbva_ctx->vbva = vbva; in vbva_enable()
147 ret = vbva_inform_host(vbva_ctx, ctx, screen, true); in vbva_enable()
149 vbva_disable(vbva_ctx, ctx, screen); in vbva_enable()
154 void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, in vbva_disable() argument
157 vbva_ctx->buffer_overflow = false; in vbva_disable()
158 vbva_ctx->record = NULL; in vbva_disable()
159 vbva_ctx->vbva = NULL; in vbva_disable()
161 vbva_inform_host(vbva_ctx, ctx, screen, false); in vbva_disable()
164 bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx, in vbva_buffer_begin_update() argument
170 if (!vbva_ctx->vbva || in vbva_buffer_begin_update()
171 !(vbva_ctx->vbva->host_flags.host_events & VBVA_F_MODE_ENABLED)) in vbva_buffer_begin_update()
174 WARN_ON(vbva_ctx->buffer_overflow || vbva_ctx->record); in vbva_buffer_begin_update()
176 next = (vbva_ctx->vbva->record_free_index + 1) % VBVA_MAX_RECORDS; in vbva_buffer_begin_update()
179 if (next == vbva_ctx->vbva->record_first_index) in vbva_buffer_begin_update()
183 if (next == vbva_ctx->vbva->record_first_index) in vbva_buffer_begin_update()
186 record = &vbva_ctx->vbva->records[vbva_ctx->vbva->record_free_index]; in vbva_buffer_begin_update()
188 vbva_ctx->vbva->record_free_index = next; in vbva_buffer_begin_update()
190 vbva_ctx->record = record; in vbva_buffer_begin_update()
195 void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx) in vbva_buffer_end_update() argument
197 struct vbva_record *record = vbva_ctx->record; in vbva_buffer_end_update()
199 WARN_ON(!vbva_ctx->vbva || !record || in vbva_buffer_end_update()
205 vbva_ctx->buffer_overflow = false; in vbva_buffer_end_update()
206 vbva_ctx->record = NULL; in vbva_buffer_end_update()
209 void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx, in vbva_setup_buffer_context() argument
212 vbva_ctx->buffer_offset = buffer_offset; in vbva_setup_buffer_context()
213 vbva_ctx->buffer_length = buffer_length; in vbva_setup_buffer_context()