aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-05-04 00:21:15 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-05-24 02:56:18 -0400
commit4c193d254ee94da02857b9670e815b1765a9579b (patch)
tree954c01429fce95bea8c418c7d68e6188eb61d6b3 /drivers/gpu
parentd1b167e168bdac0b6af11e7a8c601773639fc419 (diff)
drm/nv84/ttm: use crypto engine for async buffer copies
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 6e78b1aaa74d..f596354f399a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -562,6 +562,24 @@ nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
562} 562}
563 563
564static int 564static int
565nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
566 struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem)
567{
568 struct nouveau_mem *node = old_mem->mm_node;
569 int ret = RING_SPACE(chan, 7);
570 if (ret == 0) {
571 BEGIN_NV04(chan, NvSubCopy, 0x0304, 6);
572 OUT_RING (chan, new_mem->num_pages << PAGE_SHIFT);
573 OUT_RING (chan, upper_32_bits(node->vma[0].offset));
574 OUT_RING (chan, lower_32_bits(node->vma[0].offset));
575 OUT_RING (chan, upper_32_bits(node->vma[1].offset));
576 OUT_RING (chan, lower_32_bits(node->vma[1].offset));
577 OUT_RING (chan, 0x00000000 /* MODE_COPY, QUERY_NONE */);
578 }
579 return ret;
580}
581
582static int
565nv50_bo_move_init(struct nouveau_channel *chan, u32 handle) 583nv50_bo_move_init(struct nouveau_channel *chan, u32 handle)
566{ 584{
567 int ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfe0, 0x1000, 585 int ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfe0, 0x1000,
@@ -821,6 +839,7 @@ nouveau_bo_move_init(struct nouveau_channel *chan)
821 } _methods[] = { 839 } _methods[] = {
822 { "COPY", 0xa0b5, nve0_bo_move_copy, nvc0_bo_move_init }, 840 { "COPY", 0xa0b5, nve0_bo_move_copy, nvc0_bo_move_init },
823 { "M2MF", 0x9039, nvc0_bo_move_m2mf, nvc0_bo_move_init }, 841 { "M2MF", 0x9039, nvc0_bo_move_m2mf, nvc0_bo_move_init },
842 { "CRYPT", 0x74c1, nv84_bo_move_exec, nv50_bo_move_init },
824 { "M2MF", 0x5039, nv50_bo_move_m2mf, nv50_bo_move_init }, 843 { "M2MF", 0x5039, nv50_bo_move_m2mf, nv50_bo_move_init },
825 { "M2MF", 0x0039, nv04_bo_move_m2mf, nv04_bo_move_init }, 844 { "M2MF", 0x0039, nv04_bo_move_m2mf, nv04_bo_move_init },
826 {} 845 {}