diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-11-12 19:58:51 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-13 23:56:43 -0500 |
commit | 69a6146d1e06b50d070ea40064fccd910371b3b0 (patch) | |
tree | ef7da4fbab4f34fb06a12b19b649d20e5d506708 /drivers/gpu | |
parent | eae389f9b1e08a6e6e8da68937706d89517b1796 (diff) |
drm/nv10-: we no longer need to create nvsw object on user channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_chan.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.h | 1 |
4 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index 3621e7f23477..6828d81ed7b9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c | |||
@@ -298,7 +298,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) | |||
298 | else | 298 | else |
299 | init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART; | 299 | init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART; |
300 | 300 | ||
301 | if (device->card_type < NV_C0) { | 301 | if (device->card_type < NV_10) { |
302 | init->subchan[0].handle = 0x00000000; | 302 | init->subchan[0].handle = 0x00000000; |
303 | init->subchan[0].grclass = 0x0000; | 303 | init->subchan[0].grclass = 0x0000; |
304 | init->subchan[1].handle = NvSw; | 304 | init->subchan[1].handle = NvSw; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index e84f4c32331b..cc5152be2cf1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c | |||
@@ -346,22 +346,17 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) | |||
346 | for (i = 0; i < NOUVEAU_DMA_SKIPS; i++) | 346 | for (i = 0; i < NOUVEAU_DMA_SKIPS; i++) |
347 | OUT_RING(chan, 0x00000000); | 347 | OUT_RING(chan, 0x00000000); |
348 | 348 | ||
349 | /* allocate software object class (used for fences on <= nv05, and | 349 | /* allocate software object class (used for fences on <= nv05) */ |
350 | * to signal flip completion), bind it to a subchannel. | 350 | if (device->card_type < NV_10) { |
351 | */ | ||
352 | if ((device->card_type < NV_E0) || gart /* nve0: want_nvsw */) { | ||
353 | ret = nouveau_object_new(nv_object(client), chan->handle, | 351 | ret = nouveau_object_new(nv_object(client), chan->handle, |
354 | NvSw, nouveau_abi16_swclass(chan->drm), | 352 | NvSw, 0x006e, NULL, 0, &object); |
355 | NULL, 0, &object); | ||
356 | if (ret) | 353 | if (ret) |
357 | return ret; | 354 | return ret; |
358 | 355 | ||
359 | swch = (void *)object->parent; | 356 | swch = (void *)object->parent; |
360 | swch->flip = nouveau_flip_complete; | 357 | swch->flip = nouveau_flip_complete; |
361 | swch->flip_data = chan; | 358 | swch->flip_data = chan; |
362 | } | ||
363 | 359 | ||
364 | if (device->card_type < NV_C0) { | ||
365 | ret = RING_SPACE(chan, 2); | 360 | ret = RING_SPACE(chan, 2); |
366 | if (ret) | 361 | if (ret) |
367 | return ret; | 362 | return ret; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 2418b0de589e..7a3759f1c41a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <engine/device.h> | 37 | #include <engine/device.h> |
38 | #include <engine/disp.h> | 38 | #include <engine/disp.h> |
39 | #include <engine/fifo.h> | 39 | #include <engine/fifo.h> |
40 | #include <engine/software.h> | ||
40 | 41 | ||
41 | #include <subdev/vm.h> | 42 | #include <subdev/vm.h> |
42 | 43 | ||
@@ -191,6 +192,32 @@ nouveau_accel_init(struct nouveau_drm *drm) | |||
191 | return; | 192 | return; |
192 | } | 193 | } |
193 | 194 | ||
195 | ret = nouveau_object_new(nv_object(drm), NVDRM_CHAN, NVDRM_NVSW, | ||
196 | nouveau_abi16_swclass(drm), NULL, 0, &object); | ||
197 | if (ret == 0) { | ||
198 | struct nouveau_software_chan *swch = (void *)object->parent; | ||
199 | ret = RING_SPACE(drm->channel, 2); | ||
200 | if (ret == 0) { | ||
201 | if (device->card_type < NV_C0) { | ||
202 | BEGIN_NV04(drm->channel, NvSubSw, 0, 1); | ||
203 | OUT_RING (drm->channel, NVDRM_NVSW); | ||
204 | } else | ||
205 | if (device->card_type < NV_E0) { | ||
206 | BEGIN_NVC0(drm->channel, FermiSw, 0, 1); | ||
207 | OUT_RING (drm->channel, 0x001f0000); | ||
208 | } | ||
209 | } | ||
210 | swch = (void *)object->parent; | ||
211 | swch->flip = nouveau_flip_complete; | ||
212 | swch->flip_data = drm->channel; | ||
213 | } | ||
214 | |||
215 | if (ret) { | ||
216 | NV_ERROR(drm, "failed to allocate software object, %d\n", ret); | ||
217 | nouveau_accel_fini(drm); | ||
218 | return; | ||
219 | } | ||
220 | |||
194 | if (device->card_type < NV_C0) { | 221 | if (device->card_type < NV_C0) { |
195 | ret = nouveau_gpuobj_new(drm->device, NULL, 32, 0, 0, | 222 | ret = nouveau_gpuobj_new(drm->device, NULL, 32, 0, 0, |
196 | &drm->notify); | 223 | &drm->notify); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h index 71ed2dadae61..4b0fb6c66be9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.h +++ b/drivers/gpu/drm/nouveau/nouveau_drm.h | |||
@@ -56,6 +56,7 @@ enum nouveau_drm_handle { | |||
56 | NVDRM_CONTROL = 0xdddddddc, | 56 | NVDRM_CONTROL = 0xdddddddc, |
57 | NVDRM_PUSH = 0xbbbb0000, /* |= client chid */ | 57 | NVDRM_PUSH = 0xbbbb0000, /* |= client chid */ |
58 | NVDRM_CHAN = 0xcccc0000, /* |= client chid */ | 58 | NVDRM_CHAN = 0xcccc0000, /* |= client chid */ |
59 | NVDRM_NVSW = 0x55550000, | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | struct nouveau_cli { | 62 | struct nouveau_cli { |