aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-08-06 05:38:25 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-02 23:13:02 -0400
commit49981046e3dc2f934663548a270d4bf1a4534bb9 (patch)
tree52212de378b9e740dfdde94387b16acb7a5c4bc7 /drivers/gpu/drm/nouveau/nouveau_drm.c
parent4f32656dc786b402944dbdd7c5b74ed061468895 (diff)
drm/nve0: use async copy engine for ttm buffer moves if available
Kepler PFIFO lost the ability to address multiple engines from a single channel, so we need a separate one for the copy engine. v2: Marcin Slusarz <marcin.slusarz@gmail.com> - regression fix: restore hw accelerated buffer copies Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 8b508cec65a2..4dfc40e3dabe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -109,6 +109,7 @@ nouveau_accel_fini(struct nouveau_drm *drm)
109{ 109{
110 nouveau_gpuobj_ref(NULL, &drm->notify); 110 nouveau_gpuobj_ref(NULL, &drm->notify);
111 nouveau_channel_del(&drm->channel); 111 nouveau_channel_del(&drm->channel);
112 nouveau_channel_del(&drm->cechan);
112 if (drm->fence) 113 if (drm->fence)
113 nouveau_fence(drm)->dtor(drm); 114 nouveau_fence(drm)->dtor(drm);
114} 115}
@@ -118,6 +119,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
118{ 119{
119 struct nouveau_device *device = nv_device(drm->device); 120 struct nouveau_device *device = nv_device(drm->device);
120 struct nouveau_object *object; 121 struct nouveau_object *object;
122 u32 arg0, arg1;
121 int ret; 123 int ret;
122 124
123 if (nouveau_noaccel) 125 if (nouveau_noaccel)
@@ -134,8 +136,24 @@ nouveau_accel_init(struct nouveau_drm *drm)
134 return; 136 return;
135 } 137 }
136 138
139 if (device->card_type >= NV_E0) {
140 ret = nouveau_channel_new(drm, &drm->client, NVDRM_DEVICE,
141 NVDRM_CHAN + 1,
142 NVE0_CHANNEL_IND_ENGINE_CE0 |
143 NVE0_CHANNEL_IND_ENGINE_CE1, 0,
144 &drm->cechan);
145 if (ret)
146 NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
147
148 arg0 = NVE0_CHANNEL_IND_ENGINE_GR;
149 arg1 = 0;
150 } else {
151 arg0 = NvDmaFB;
152 arg1 = NvDmaTT;
153 }
154
137 ret = nouveau_channel_new(drm, &drm->client, NVDRM_DEVICE, NVDRM_CHAN, 155 ret = nouveau_channel_new(drm, &drm->client, NVDRM_DEVICE, NVDRM_CHAN,
138 NvDmaFB, NvDmaTT, &drm->channel); 156 arg0, arg1, &drm->channel);
139 if (ret) { 157 if (ret) {
140 NV_ERROR(drm, "failed to create kernel channel, %d\n", ret); 158 NV_ERROR(drm, "failed to create kernel channel, %d\n", ret);
141 nouveau_accel_fini(drm); 159 nouveau_accel_fini(drm);
@@ -167,7 +185,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
167 } 185 }
168 186
169 187
170 nouveau_bo_move_init(drm->channel); 188 nouveau_bo_move_init(drm);
171} 189}
172 190
173static int __devinit 191static int __devinit