Lines Matching refs:bytes

186 static bool vmw_fifo_is_full(struct vmw_private *dev_priv, uint32_t bytes)
193 return ((max - next_cmd) + (stop - min) <= bytes);
197 uint32_t bytes, bool interruptible,
210 if (!vmw_fifo_is_full(dev_priv, bytes))
230 uint32_t bytes, bool interruptible,
235 if (likely(!vmw_fifo_is_full(dev_priv, bytes)))
240 return vmw_fifo_wait_noirq(dev_priv, bytes,
249 !vmw_fifo_is_full(dev_priv, bytes), timeout);
253 !vmw_fifo_is_full(dev_priv, bytes), timeout);
267 * Reserve @bytes number of bytes in the fifo.
270 * If it timeouts waiting for fifo space, or if @bytes is larger than the
277 uint32_t bytes)
292 if (unlikely(bytes >= (max - min)))
298 fifo_state->reserved_size = bytes;
306 if (likely((next_cmd + bytes < max ||
307 (next_cmd + bytes == max && stop > min))))
310 else if (vmw_fifo_is_full(dev_priv, bytes)) {
311 ret = vmw_fifo_wait(dev_priv, bytes,
320 if (likely((next_cmd + bytes < stop)))
323 ret = vmw_fifo_wait(dev_priv, bytes,
331 if (reserveable || bytes <= sizeof(uint32_t)) {
337 bytes);
347 if (bytes < fifo_state->static_buffer_size)
350 fifo_state->dynamic_buffer = vmalloc(bytes);
364 void *vmw_cmd_ctx_reserve(struct vmw_private *dev_priv, uint32_t bytes,
370 ret = vmw_cmdbuf_reserve(dev_priv->cman, bytes,
373 ret = vmw_local_fifo_reserve(dev_priv, bytes);
387 uint32_t max, uint32_t min, uint32_t bytes)
395 if (bytes < chunk_size)
396 chunk_size = bytes;
398 vmw_fifo_mem_write(vmw, SVGA_FIFO_RESERVED, bytes);
401 rest = bytes - chunk_size;
409 uint32_t max, uint32_t min, uint32_t bytes)
414 while (bytes > 0) {
422 bytes -= sizeof(uint32_t);
426 static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
434 BUG_ON((bytes & 3) != 0);
435 BUG_ON(bytes > fifo_state->reserved_size);
442 next_cmd, max, min, bytes);
445 next_cmd, max, min, bytes);
456 next_cmd += bytes;
471 void vmw_cmd_commit(struct vmw_private *dev_priv, uint32_t bytes)
474 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, false);
476 vmw_local_fifo_commit(dev_priv, bytes);
484 * @bytes: Number of bytes to commit.
486 void vmw_cmd_commit_flush(struct vmw_private *dev_priv, uint32_t bytes)
489 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, true);
491 vmw_local_fifo_commit(dev_priv, bytes);
516 uint32_t bytes = sizeof(u32) + sizeof(*cmd_fence);
518 fm = VMW_CMD_RESERVE(dev_priv, bytes);
545 vmw_cmd_commit_flush(dev_priv, bytes);