diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_sgdma.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_sgdma.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index 0843ebc910d4..a4d22e5eb176 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c | |||
@@ -31,16 +31,17 @@ nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem) | |||
31 | { | 31 | { |
32 | struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; | 32 | struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; |
33 | struct nouveau_mem *node = mem->mm_node; | 33 | struct nouveau_mem *node = mem->mm_node; |
34 | u64 size = mem->num_pages << 12; | ||
35 | 34 | ||
36 | if (ttm->sg) { | 35 | if (ttm->sg) { |
37 | node->sg = ttm->sg; | 36 | node->sg = ttm->sg; |
38 | nouveau_vm_map_sg_table(&node->vma[0], 0, size, node); | 37 | node->pages = NULL; |
39 | } else { | 38 | } else { |
39 | node->sg = NULL; | ||
40 | node->pages = nvbe->ttm.dma_address; | 40 | node->pages = nvbe->ttm.dma_address; |
41 | nouveau_vm_map_sg(&node->vma[0], 0, size, node); | ||
42 | } | 41 | } |
42 | node->size = (mem->num_pages << PAGE_SHIFT) >> 12; | ||
43 | 43 | ||
44 | nouveau_vm_map(&node->vma[0], node); | ||
44 | nvbe->node = node; | 45 | nvbe->node = node; |
45 | return 0; | 46 | return 0; |
46 | } | 47 | } |
@@ -67,9 +68,13 @@ nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem) | |||
67 | 68 | ||
68 | /* noop: bound in move_notify() */ | 69 | /* noop: bound in move_notify() */ |
69 | if (ttm->sg) { | 70 | if (ttm->sg) { |
70 | node->sg = ttm->sg; | 71 | node->sg = ttm->sg; |
71 | } else | 72 | node->pages = NULL; |
73 | } else { | ||
74 | node->sg = NULL; | ||
72 | node->pages = nvbe->ttm.dma_address; | 75 | node->pages = nvbe->ttm.dma_address; |
76 | } | ||
77 | node->size = (mem->num_pages << PAGE_SHIFT) >> 12; | ||
73 | return 0; | 78 | return 0; |
74 | } | 79 | } |
75 | 80 | ||