Lines Matching full:bytes
187 static bool vmw_fifo_is_full(struct vmw_private *dev_priv, uint32_t bytes) in vmw_fifo_is_full() argument
194 return ((max - next_cmd) + (stop - min) <= bytes); in vmw_fifo_is_full()
198 uint32_t bytes, bool interruptible, in vmw_fifo_wait_noirq() argument
211 if (!vmw_fifo_is_full(dev_priv, bytes)) in vmw_fifo_wait_noirq()
231 uint32_t bytes, bool interruptible, in vmw_fifo_wait() argument
236 if (likely(!vmw_fifo_is_full(dev_priv, bytes))) in vmw_fifo_wait()
241 return vmw_fifo_wait_noirq(dev_priv, bytes, in vmw_fifo_wait()
250 !vmw_fifo_is_full(dev_priv, bytes), timeout); in vmw_fifo_wait()
254 !vmw_fifo_is_full(dev_priv, bytes), timeout); in vmw_fifo_wait()
268 * Reserve @bytes number of bytes in the fifo.
271 * If it timeouts waiting for fifo space, or if @bytes is larger than the
278 uint32_t bytes) in vmw_local_fifo_reserve() argument
293 if (unlikely(bytes >= (max - min))) in vmw_local_fifo_reserve()
299 fifo_state->reserved_size = bytes; in vmw_local_fifo_reserve()
307 if (likely((next_cmd + bytes < max || in vmw_local_fifo_reserve()
308 (next_cmd + bytes == max && stop > min)))) in vmw_local_fifo_reserve()
311 else if (vmw_fifo_is_full(dev_priv, bytes)) { in vmw_local_fifo_reserve()
312 ret = vmw_fifo_wait(dev_priv, bytes, in vmw_local_fifo_reserve()
321 if (likely((next_cmd + bytes < stop))) in vmw_local_fifo_reserve()
324 ret = vmw_fifo_wait(dev_priv, bytes, in vmw_local_fifo_reserve()
332 if (reserveable || bytes <= sizeof(uint32_t)) { in vmw_local_fifo_reserve()
338 bytes); in vmw_local_fifo_reserve()
348 if (bytes < fifo_state->static_buffer_size) in vmw_local_fifo_reserve()
351 fifo_state->dynamic_buffer = vmalloc(bytes); in vmw_local_fifo_reserve()
365 void *vmw_cmd_ctx_reserve(struct vmw_private *dev_priv, uint32_t bytes, in vmw_cmd_ctx_reserve() argument
371 ret = vmw_cmdbuf_reserve(dev_priv->cman, bytes, in vmw_cmd_ctx_reserve()
374 ret = vmw_local_fifo_reserve(dev_priv, bytes); in vmw_cmd_ctx_reserve()
388 uint32_t max, uint32_t min, uint32_t bytes) in vmw_fifo_res_copy() argument
396 if (bytes < chunk_size) in vmw_fifo_res_copy()
397 chunk_size = bytes; in vmw_fifo_res_copy()
399 vmw_fifo_mem_write(vmw, SVGA_FIFO_RESERVED, bytes); in vmw_fifo_res_copy()
402 rest = bytes - chunk_size; in vmw_fifo_res_copy()
410 uint32_t max, uint32_t min, uint32_t bytes) in vmw_fifo_slow_copy() argument
415 while (bytes > 0) { in vmw_fifo_slow_copy()
423 bytes -= sizeof(uint32_t); in vmw_fifo_slow_copy()
427 static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes) in vmw_local_fifo_commit() argument
435 BUG_ON((bytes & 3) != 0); in vmw_local_fifo_commit()
436 BUG_ON(bytes > fifo_state->reserved_size); in vmw_local_fifo_commit()
443 next_cmd, max, min, bytes); in vmw_local_fifo_commit()
446 next_cmd, max, min, bytes); in vmw_local_fifo_commit()
457 next_cmd += bytes; in vmw_local_fifo_commit()
472 void vmw_cmd_commit(struct vmw_private *dev_priv, uint32_t bytes) in vmw_cmd_commit() argument
475 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, false); in vmw_cmd_commit()
477 vmw_local_fifo_commit(dev_priv, bytes); in vmw_cmd_commit()
485 * @bytes: Number of bytes to commit.
487 void vmw_cmd_commit_flush(struct vmw_private *dev_priv, uint32_t bytes) in vmw_cmd_commit_flush() argument
490 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, true); in vmw_cmd_commit_flush()
492 vmw_local_fifo_commit(dev_priv, bytes); in vmw_cmd_commit_flush()
517 uint32_t bytes = sizeof(u32) + sizeof(*cmd_fence); in vmw_cmd_send_fence() local
519 fm = VMW_CMD_RESERVE(dev_priv, bytes); in vmw_cmd_send_fence()
546 vmw_cmd_commit_flush(dev_priv, bytes); in vmw_cmd_send_fence()