Lines Matching refs:bytes

206 static bool vmw_fifo_is_full(struct vmw_private *dev_priv, uint32_t bytes)
214 return ((max - next_cmd) + (stop - min) <= bytes);
218 uint32_t bytes, bool interruptible,
231 if (!vmw_fifo_is_full(dev_priv, bytes))
251 uint32_t bytes, bool interruptible,
256 if (likely(!vmw_fifo_is_full(dev_priv, bytes)))
261 return vmw_fifo_wait_noirq(dev_priv, bytes,
270 !vmw_fifo_is_full(dev_priv, bytes), timeout);
274 !vmw_fifo_is_full(dev_priv, bytes), timeout);
288 * Reserve @bytes number of bytes in the fifo.
291 * If it timeouts waiting for fifo space, or if @bytes is larger than the
298 uint32_t bytes)
313 if (unlikely(bytes >= (max - min)))
319 fifo_state->reserved_size = bytes;
327 if (likely((next_cmd + bytes < max ||
328 (next_cmd + bytes == max && stop > min))))
331 else if (vmw_fifo_is_full(dev_priv, bytes)) {
332 ret = vmw_fifo_wait(dev_priv, bytes,
341 if (likely((next_cmd + bytes < stop)))
344 ret = vmw_fifo_wait(dev_priv, bytes,
352 if (reserveable || bytes <= sizeof(uint32_t)) {
356 vmw_mmio_write(bytes, fifo_mem +
367 if (bytes < fifo_state->static_buffer_size)
370 fifo_state->dynamic_buffer = vmalloc(bytes);
384 void *vmw_fifo_reserve_dx(struct vmw_private *dev_priv, uint32_t bytes,
390 ret = vmw_cmdbuf_reserve(dev_priv->cman, bytes,
393 ret = vmw_local_fifo_reserve(dev_priv, bytes);
407 uint32_t max, uint32_t min, uint32_t bytes)
414 if (bytes < chunk_size)
415 chunk_size = bytes;
417 vmw_mmio_write(bytes, fifo_mem + SVGA_FIFO_RESERVED);
420 rest = bytes - chunk_size;
428 uint32_t max, uint32_t min, uint32_t bytes)
433 while (bytes > 0) {
441 bytes -= sizeof(uint32_t);
445 static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
455 bytes += sizeof(struct vmw_temp_set_context);
458 BUG_ON((bytes & 3) != 0);
459 BUG_ON(bytes > fifo_state->reserved_size);
466 next_cmd, max, min, bytes);
469 next_cmd, max, min, bytes);
480 next_cmd += bytes;
495 void vmw_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
498 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, false);
500 vmw_local_fifo_commit(dev_priv, bytes);
508 * @bytes: Number of bytes to commit.
510 void vmw_fifo_commit_flush(struct vmw_private *dev_priv, uint32_t bytes)
513 vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, true);
515 vmw_local_fifo_commit(dev_priv, bytes);
541 uint32_t bytes = sizeof(u32) + sizeof(*cmd_fence);
543 fm = VMW_FIFO_RESERVE(dev_priv, bytes);
570 vmw_fifo_commit_flush(dev_priv, bytes);