#include "nvk_cmd_buffer.h"
+#include "nvk_buffer.h"
#include "nvk_device.h"
+#include "nvk_device_memory.h"
#include "nvk_physical_device.h"
+#include "nouveau_bo.h"
#include "nouveau_push.h"
+#include "classes/cla0b5.h"
+#include "push906f.h"
+
static void
nvk_destroy_cmd_buffer(struct nvk_cmd_buffer *cmd_buffer)
{
}
VKAPI_ATTR void VKAPI_CALL
+nvk_CmdCopyBuffer(VkCommandBuffer commandBuffer,
+ VkBuffer srcBuffer, VkBuffer dstBuffer,
+ uint32_t regionCount, const VkBufferCopy* pRegions)
+{
+ VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
+ VK_FROM_HANDLE(nvk_buffer, src, srcBuffer);
+ VK_FROM_HANDLE(nvk_buffer, dst, dstBuffer);
+ struct nouveau_ws_push *push = cmd->push;
+
+ nouveau_ws_push_ref(push, src->mem->bo, NOUVEAU_WS_BO_RD);
+ nouveau_ws_push_ref(push, dst->mem->bo, NOUVEAU_WS_BO_WR);
+
+ for (unsigned r = 0; r < regionCount; r++) {
+ const VkBufferCopy *region = &pRegions[r];
+ VkDeviceSize dstoff = dst->mem->bo->offset + dst->offset + region->dstOffset;
+ VkDeviceSize srcoff = src->mem->bo->offset + src->offset + region->srcOffset;
+ VkDeviceSize size = region->size;
+
+ while (size) {
+ unsigned bytes = MIN2(size, 1 << 17);
+
+ PUSH_MTHD(push, NVA0B5, OFFSET_IN_UPPER,
+ NVVAL(NVA0B5, OFFSET_IN_UPPER, UPPER, srcoff >> 32),
+ OFFSET_IN_LOWER, srcoff & 0xffffffff,
+
+ OFFSET_OUT_UPPER,
+ NVVAL(NVA0B5, OFFSET_OUT_UPPER, UPPER, dstoff >> 32),
+ OFFSET_OUT_LOWER, dstoff & 0xffffffff);
+
+ PUSH_MTHD(push, NVA0B5, LINE_LENGTH_IN, bytes,
+ LINE_COUNT, 1);
+
+ PUSH_IMMD(push, NVA0B5, LAUNCH_DMA,
+ NVDEF(NVA0B5, LAUNCH_DMA, DATA_TRANSFER_TYPE, NON_PIPELINED) |
+ NVDEF(NVA0B5, LAUNCH_DMA, FLUSH_ENABLE, TRUE) |
+ NVDEF(NVA0B5, LAUNCH_DMA, SRC_MEMORY_LAYOUT, PITCH) |
+ NVDEF(NVA0B5, LAUNCH_DMA, DST_MEMORY_LAYOUT, PITCH));
+
+ srcoff += bytes;
+ dstoff += bytes;
+ size -= bytes;
+ }
+ }
+}
+
+
+VKAPI_ATTR void VKAPI_CALL
nvk_CmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo *pDependencyInfo) {
}