0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "nouveau_bo.h"
0030 #include "nouveau_dma.h"
0031 #include "nouveau_mem.h"
0032
0033 #include <nvif/push906f.h>
0034
0035 #include <nvhw/class/cla0b5.h>
0036
0037 int
0038 nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
0039 struct ttm_resource *old_reg, struct ttm_resource *new_reg)
0040 {
0041 struct nouveau_mem *mem = nouveau_mem(old_reg);
0042 struct nvif_push *push = chan->chan.push;
0043 int ret;
0044
0045 ret = PUSH_WAIT(push, 10);
0046 if (ret)
0047 return ret;
0048
0049 PUSH_MTHD(push, NVA0B5, OFFSET_IN_UPPER,
0050 NVVAL(NVA0B5, OFFSET_IN_UPPER, UPPER, upper_32_bits(mem->vma[0].addr)),
0051
0052 OFFSET_IN_LOWER, lower_32_bits(mem->vma[0].addr),
0053
0054 OFFSET_OUT_UPPER,
0055 NVVAL(NVA0B5, OFFSET_OUT_UPPER, UPPER, upper_32_bits(mem->vma[1].addr)),
0056
0057 OFFSET_OUT_LOWER, lower_32_bits(mem->vma[1].addr),
0058 PITCH_IN, PAGE_SIZE,
0059 PITCH_OUT, PAGE_SIZE,
0060 LINE_LENGTH_IN, PAGE_SIZE,
0061 LINE_COUNT, new_reg->num_pages);
0062
0063 PUSH_IMMD(push, NVA0B5, LAUNCH_DMA,
0064 NVDEF(NVA0B5, LAUNCH_DMA, DATA_TRANSFER_TYPE, NON_PIPELINED) |
0065 NVDEF(NVA0B5, LAUNCH_DMA, FLUSH_ENABLE, TRUE) |
0066 NVDEF(NVA0B5, LAUNCH_DMA, SEMAPHORE_TYPE, NONE) |
0067 NVDEF(NVA0B5, LAUNCH_DMA, INTERRUPT_TYPE, NONE) |
0068 NVDEF(NVA0B5, LAUNCH_DMA, SRC_MEMORY_LAYOUT, PITCH) |
0069 NVDEF(NVA0B5, LAUNCH_DMA, DST_MEMORY_LAYOUT, PITCH) |
0070 NVDEF(NVA0B5, LAUNCH_DMA, MULTI_LINE_ENABLE, TRUE) |
0071 NVDEF(NVA0B5, LAUNCH_DMA, REMAP_ENABLE, FALSE) |
0072 NVDEF(NVA0B5, LAUNCH_DMA, BYPASS_L2, USE_PTE_SETTING) |
0073 NVDEF(NVA0B5, LAUNCH_DMA, SRC_TYPE, VIRTUAL) |
0074 NVDEF(NVA0B5, LAUNCH_DMA, DST_TYPE, VIRTUAL));
0075 return 0;
0076 }
0077
0078 int
0079 nve0_bo_move_init(struct nouveau_channel *chan, u32 handle)
0080 {
0081 struct nvif_push *push = chan->chan.push;
0082 int ret;
0083
0084 ret = PUSH_WAIT(push, 2);
0085 if (ret)
0086 return ret;
0087
0088 PUSH_NVSQ(push, NVA0B5, 0x0000, handle & 0x0000ffff);
0089 return 0;
0090 }