diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-05-04 00:34:16 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-05-24 02:56:19 -0400 |
commit | 5490e5dfb9e9d654b0ed06c2989a73402496adf6 (patch) | |
tree | 7d6a2080d05cbf6a79e7e0c1bd03d4c9e7629160 /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 4c193d254ee94da02857b9670e815b1765a9579b (diff) |
drm/nv98/ttm: add in a (disabled) crypto engine buffer copy method
Disabled for the moment until some performance issues are sorted out, code
committed as a reference point.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index f596354f399a..771ce371c4ba 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 | ||
564 | static int | 564 | static int |
565 | nv98_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, 0x0320, 6); | ||
572 | OUT_RING (chan, upper_32_bits(node->vma[0].offset)); | ||
573 | OUT_RING (chan, lower_32_bits(node->vma[0].offset)); | ||
574 | OUT_RING (chan, upper_32_bits(node->vma[1].offset)); | ||
575 | OUT_RING (chan, lower_32_bits(node->vma[1].offset)); | ||
576 | OUT_RING (chan, 0x00000000 /* COPY */); | ||
577 | OUT_RING (chan, new_mem->num_pages << PAGE_SHIFT); | ||
578 | } | ||
579 | return ret; | ||
580 | } | ||
581 | |||
582 | static int | ||
565 | nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | 583 | nv84_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) | 584 | struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem) |
567 | { | 585 | { |
@@ -842,7 +860,8 @@ nouveau_bo_move_init(struct nouveau_channel *chan) | |||
842 | { "CRYPT", 0x74c1, nv84_bo_move_exec, nv50_bo_move_init }, | 860 | { "CRYPT", 0x74c1, nv84_bo_move_exec, nv50_bo_move_init }, |
843 | { "M2MF", 0x5039, nv50_bo_move_m2mf, nv50_bo_move_init }, | 861 | { "M2MF", 0x5039, nv50_bo_move_m2mf, nv50_bo_move_init }, |
844 | { "M2MF", 0x0039, nv04_bo_move_m2mf, nv04_bo_move_init }, | 862 | { "M2MF", 0x0039, nv04_bo_move_m2mf, nv04_bo_move_init }, |
845 | {} | 863 | {}, |
864 | { "CRYPT", 0x88b4, nv98_bo_move_exec, nv50_bo_move_init }, | ||
846 | }, *mthd = _methods; | 865 | }, *mthd = _methods; |
847 | const char *name = "CPU"; | 866 | const char *name = "CPU"; |
848 | int ret; | 867 | int ret; |