Lines Matching refs:bytes

179 static bool vmw_fifo_is_full(struct vmw_private *dev_priv, uint32_t bytes)  in vmw_fifo_is_full()  argument
186 return ((max - next_cmd) + (stop - min) <= bytes); in vmw_fifo_is_full()
190 uint32_t bytes, bool interruptible, in vmw_fifo_wait_noirq() argument
203 if (!vmw_fifo_is_full(dev_priv, bytes)) in vmw_fifo_wait_noirq()
223 uint32_t bytes, bool interruptible, in vmw_fifo_wait() argument
228 if (likely(!vmw_fifo_is_full(dev_priv, bytes))) in vmw_fifo_wait()
233 return vmw_fifo_wait_noirq(dev_priv, bytes, in vmw_fifo_wait()
242 !vmw_fifo_is_full(dev_priv, bytes), timeout); in vmw_fifo_wait()
246 !vmw_fifo_is_full(dev_priv, bytes), timeout); in vmw_fifo_wait()
270 uint32_t bytes) in vmw_local_fifo_reserve() argument
285 if (unlikely(bytes >= (max - min))) in vmw_local_fifo_reserve()
291 fifo_state->reserved_size = bytes; in vmw_local_fifo_reserve()
299 if (likely((next_cmd + bytes < max || in vmw_local_fifo_reserve()
300 (next_cmd + bytes == max && stop > min)))) in vmw_local_fifo_reserve()
303 else if (vmw_fifo_is_full(dev_priv, bytes)) { in vmw_local_fifo_reserve()
304 ret = vmw_fifo_wait(dev_priv, bytes, in vmw_local_fifo_reserve()
313 if (likely((next_cmd + bytes < stop))) in vmw_local_fifo_reserve()
316 ret = vmw_fifo_wait(dev_priv, bytes, in vmw_local_fifo_reserve()
324 if (reserveable || bytes <= sizeof(uint32_t)) { in vmw_local_fifo_reserve()
330 bytes); in vmw_local_fifo_reserve()
340 if (bytes < fifo_state->static_buffer_size) in vmw_local_fifo_reserve()
343 fifo_state->dynamic_buffer = vmalloc(bytes); in vmw_local_fifo_reserve()
357 void *vmw_cmd_ctx_reserve(struct vmw_private *dev_priv, uint32_t bytes, in vmw_cmd_ctx_reserve() argument
363 ret = vmw_cmdbuf_reserve(dev_priv->cman, bytes, in vmw_cmd_ctx_reserve()
366 ret = vmw_local_fifo_reserve(dev_priv, bytes); in vmw_cmd_ctx_reserve()
380 uint32_t max, uint32_t min, uint32_t bytes) in vmw_fifo_res_copy() argument
388 if (bytes < chunk_size) in vmw_fifo_res_copy()
389 chunk_size = bytes; in vmw_fifo_res_copy()
391 vmw_fifo_mem_write(vmw, SVGA_FIFO_RESERVED, bytes); in vmw_fifo_res_copy()
394 rest = bytes - chunk_size; in vmw_fifo_res_copy()
402 uint32_t max, uint32_t min, uint32_t bytes) in vmw_fifo_slow_copy() argument
407 while (bytes > 0) { in vmw_fifo_slow_copy()
415 bytes -= sizeof(uint32_t); in vmw_fifo_slow_copy()
419 static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes) in vmw_local_fifo_commit() argument
427 BUG_ON((bytes & 3) != 0); in vmw_local_fifo_commit()
428 BUG_ON(bytes > fifo_state->reserved_size); in vmw_local_fifo_commit()
435 next_cmd, max, min, bytes); in vmw_local_fifo_commit()
438 next_cmd, max, min, bytes); in vmw_local_fifo_commit()
449 next_cmd += bytes; in vmw_local_fifo_commit()
464 void vmw_cmd_commit(struct vmw_private *dev_priv, uint32_t bytes) in vmw_cmd_commit() argument
467 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, false); in vmw_cmd_commit()
469 vmw_local_fifo_commit(dev_priv, bytes); in vmw_cmd_commit()
479 void vmw_cmd_commit_flush(struct vmw_private *dev_priv, uint32_t bytes) in vmw_cmd_commit_flush() argument
482 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, true); in vmw_cmd_commit_flush()
484 vmw_local_fifo_commit(dev_priv, bytes); in vmw_cmd_commit_flush()
509 uint32_t bytes = sizeof(u32) + sizeof(*cmd_fence); in vmw_cmd_send_fence() local
511 fm = VMW_CMD_RESERVE(dev_priv, bytes); in vmw_cmd_send_fence()
538 vmw_cmd_commit_flush(dev_priv, bytes); in vmw_cmd_send_fence()