diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-11-23 19:26:24 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-21 02:17:34 -0500 |
commit | 96545299d7405d4c0f44b727718e263653fc11aa (patch) | |
tree | d5c9ffd220778e11e026dab5cabbf74ae8a7cf2d /drivers/gpu/drm/nouveau/nouveau_channel.c | |
parent | 5216782bf8c195de3befe0742a877c987dd3c4fd (diff) |
drm/nvc0: fix channel dma init paths
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_channel.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c index 6f37995aee2d..e37977d02463 100644 --- a/drivers/gpu/drm/nouveau/nouveau_channel.c +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c | |||
@@ -38,9 +38,14 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan) | |||
38 | int ret; | 38 | int ret; |
39 | 39 | ||
40 | if (dev_priv->card_type >= NV_50) { | 40 | if (dev_priv->card_type >= NV_50) { |
41 | ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY, 0, | 41 | if (dev_priv->card_type < NV_C0) { |
42 | (1ULL << 40), NV_MEM_ACCESS_RO, | 42 | ret = nouveau_gpuobj_dma_new(chan, |
43 | NV_MEM_TARGET_VM, &pushbuf); | 43 | NV_CLASS_DMA_IN_MEMORY, 0, |
44 | (1ULL << 40), | ||
45 | NV_MEM_ACCESS_RO, | ||
46 | NV_MEM_TARGET_VM, | ||
47 | &pushbuf); | ||
48 | } | ||
44 | chan->pushbuf_base = pb->bo.offset; | 49 | chan->pushbuf_base = pb->bo.offset; |
45 | } else | 50 | } else |
46 | if (pb->bo.mem.mem_type == TTM_PL_TT) { | 51 | if (pb->bo.mem.mem_type == TTM_PL_TT) { |
@@ -71,7 +76,7 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan) | |||
71 | 76 | ||
72 | nouveau_gpuobj_ref(pushbuf, &chan->pushbuf); | 77 | nouveau_gpuobj_ref(pushbuf, &chan->pushbuf); |
73 | nouveau_gpuobj_ref(NULL, &pushbuf); | 78 | nouveau_gpuobj_ref(NULL, &pushbuf); |
74 | return 0; | 79 | return ret; |
75 | } | 80 | } |
76 | 81 | ||
77 | static struct nouveau_bo * | 82 | static struct nouveau_bo * |
@@ -99,6 +104,13 @@ nouveau_channel_user_pushbuf_alloc(struct drm_device *dev) | |||
99 | return NULL; | 104 | return NULL; |
100 | } | 105 | } |
101 | 106 | ||
107 | ret = nouveau_bo_map(pushbuf); | ||
108 | if (ret) { | ||
109 | nouveau_bo_unpin(pushbuf); | ||
110 | nouveau_bo_ref(NULL, &pushbuf); | ||
111 | return NULL; | ||
112 | } | ||
113 | |||
102 | return pushbuf; | 114 | return pushbuf; |
103 | } | 115 | } |
104 | 116 | ||