diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-11-15 22:16:51 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-11-28 18:57:56 -0500 |
commit | ed5085a589fbc784d25f2fe54b3239bce2c86d3d (patch) | |
tree | 5debfa1227d8654a4c3660b5b623ab36fa83e39e /drivers/gpu/drm/nouveau | |
parent | 419e8dc0afa4e0b2746f39dbef287f0c4befbbf2 (diff) |
drm/nvd0/disp: implement support for older DISP_SYNC classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvd0_display.c | 64 |
1 files changed, 44 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c index daf3e668212..b979e3c99f2 100644 --- a/drivers/gpu/drm/nouveau/nvd0_display.c +++ b/drivers/gpu/drm/nouveau/nvd0_display.c | |||
@@ -390,7 +390,6 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
390 | struct nvd0_disp *disp = nvd0_disp(crtc->dev); | 390 | struct nvd0_disp *disp = nvd0_disp(crtc->dev); |
391 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 391 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
392 | struct nvd0_sync *sync = nvd0_sync(crtc); | 392 | struct nvd0_sync *sync = nvd0_sync(crtc); |
393 | u64 offset; | ||
394 | u32 *push; | 393 | u32 *push; |
395 | int ret; | 394 | int ret; |
396 | 395 | ||
@@ -408,20 +407,36 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
408 | if (ret) | 407 | if (ret) |
409 | return ret; | 408 | return ret; |
410 | 409 | ||
410 | if (nv_mclass(chan->object) < NVC0_CHANNEL_IND_CLASS) { | ||
411 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 2); | ||
412 | OUT_RING (chan, NvEvoSema0 + nv_crtc->index); | ||
413 | OUT_RING (chan, sync->sem.offset); | ||
414 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_RELEASE, 1); | ||
415 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | ||
416 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_OFFSET, 2); | ||
417 | OUT_RING (chan, sync->sem.offset ^ 0x10); | ||
418 | OUT_RING (chan, 0x74b1e000); | ||
419 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1); | ||
420 | if (nv_mclass(chan->object) < NV84_CHANNEL_DMA_CLASS) | ||
421 | OUT_RING (chan, NvSema); | ||
422 | else | ||
423 | OUT_RING (chan, chan->vram); | ||
424 | } else { | ||
425 | u64 offset = nvc0_fence_crtc(chan, nv_crtc->index); | ||
426 | offset += sync->sem.offset; | ||
427 | |||
428 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
429 | OUT_RING (chan, upper_32_bits(offset)); | ||
430 | OUT_RING (chan, lower_32_bits(offset)); | ||
431 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | ||
432 | OUT_RING (chan, 0x1002); | ||
433 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
434 | OUT_RING (chan, upper_32_bits(offset)); | ||
435 | OUT_RING (chan, lower_32_bits(offset ^ 0x10)); | ||
436 | OUT_RING (chan, 0x74b1e000); | ||
437 | OUT_RING (chan, 0x1001); | ||
438 | } | ||
411 | 439 | ||
412 | offset = nvc0_fence_crtc(chan, nv_crtc->index); | ||
413 | offset += sync->sem.offset; | ||
414 | |||
415 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
416 | OUT_RING (chan, upper_32_bits(offset)); | ||
417 | OUT_RING (chan, lower_32_bits(offset)); | ||
418 | OUT_RING (chan, 0xf00d0000 | sync->sem.value); | ||
419 | OUT_RING (chan, 0x1002); | ||
420 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | ||
421 | OUT_RING (chan, upper_32_bits(offset)); | ||
422 | OUT_RING (chan, lower_32_bits(offset ^ 0x10)); | ||
423 | OUT_RING (chan, 0x74b1e000); | ||
424 | OUT_RING (chan, 0x1001); | ||
425 | FIRE_RING (chan); | 440 | FIRE_RING (chan); |
426 | } else { | 441 | } else { |
427 | nouveau_bo_wr32(disp->sync, sync->sem.offset / 4, | 442 | nouveau_bo_wr32(disp->sync, sync->sem.offset / 4, |
@@ -451,12 +466,21 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
451 | evo_mthd(push, 0x0110, 2); | 466 | evo_mthd(push, 0x0110, 2); |
452 | evo_data(push, 0x00000000); | 467 | evo_data(push, 0x00000000); |
453 | evo_data(push, 0x00000000); | 468 | evo_data(push, 0x00000000); |
454 | evo_mthd(push, 0x0400, 5); | 469 | if (nvd0_vers(sync) < NVD0_DISP_SYNC_CLASS) { |
455 | evo_data(push, nv_fb->nvbo->bo.offset >> 8); | 470 | evo_mthd(push, 0x0800, 5); |
456 | evo_data(push, 0); | 471 | evo_data(push, nv_fb->nvbo->bo.offset >> 8); |
457 | evo_data(push, (fb->height << 16) | fb->width); | 472 | evo_data(push, 0); |
458 | evo_data(push, nv_fb->r_pitch); | 473 | evo_data(push, (fb->height << 16) | fb->width); |
459 | evo_data(push, nv_fb->r_format); | 474 | evo_data(push, nv_fb->r_pitch); |
475 | evo_data(push, nv_fb->r_format); | ||
476 | } else { | ||
477 | evo_mthd(push, 0x0400, 5); | ||
478 | evo_data(push, nv_fb->nvbo->bo.offset >> 8); | ||
479 | evo_data(push, 0); | ||
480 | evo_data(push, (fb->height << 16) | fb->width); | ||
481 | evo_data(push, nv_fb->r_pitch); | ||
482 | evo_data(push, nv_fb->r_format); | ||
483 | } | ||
460 | evo_mthd(push, 0x0080, 1); | 484 | evo_mthd(push, 0x0080, 1); |
461 | evo_data(push, 0x00000000); | 485 | evo_data(push, 0x00000000); |
462 | evo_kick(push, sync); | 486 | evo_kick(push, sync); |