diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-08-06 09:38:25 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-10-03 03:13:02 (GMT) |
commit | 49981046e3dc2f934663548a270d4bf1a4534bb9 (patch) | |
tree | 52212de378b9e740dfdde94387b16acb7a5c4bc7 /drivers/gpu/drm/nouveau/nouveau_drm.c | |
parent | 4f32656dc786b402944dbdd7c5b74ed061468895 (diff) | |
download | linux-fsl-qoriq-49981046e3dc2f934663548a270d4bf1a4534bb9.tar.xz |
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.c | 22 |
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 8b508ce..4dfc40e3d 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) { nouveau_gpuobj_ref(NULL, &drm->notify); nouveau_channel_del(&drm->channel); + nouveau_channel_del(&drm->cechan); if (drm->fence) nouveau_fence(drm)->dtor(drm); } @@ -118,6 +119,7 @@ nouveau_accel_init(struct nouveau_drm *drm) { struct nouveau_device *device = nv_device(drm->device); struct nouveau_object *object; + u32 arg0, arg1; int ret; if (nouveau_noaccel) @@ -134,8 +136,24 @@ nouveau_accel_init(struct nouveau_drm *drm) return; } + if (device->card_type >= NV_E0) { + ret = nouveau_channel_new(drm, &drm->client, NVDRM_DEVICE, + NVDRM_CHAN + 1, + NVE0_CHANNEL_IND_ENGINE_CE0 | + NVE0_CHANNEL_IND_ENGINE_CE1, 0, + &drm->cechan); + if (ret) + NV_ERROR(drm, "failed to create ce channel, %d\n", ret); + + arg0 = NVE0_CHANNEL_IND_ENGINE_GR; + arg1 = 0; + } else { + arg0 = NvDmaFB; + arg1 = NvDmaTT; + } + ret = nouveau_channel_new(drm, &drm->client, NVDRM_DEVICE, NVDRM_CHAN, - NvDmaFB, NvDmaTT, &drm->channel); + arg0, arg1, &drm->channel); if (ret) { NV_ERROR(drm, "failed to create kernel channel, %d\n", ret); nouveau_accel_fini(drm); @@ -167,7 +185,7 @@ nouveau_accel_init(struct nouveau_drm *drm) } - nouveau_bo_move_init(drm->channel); + nouveau_bo_move_init(drm); } static int __devinit |