diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-02-25 21:02:54 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-03-03 20:46:13 -0500 |
commit | 67f9718b084ea7100cefa39b02863fcb14102f8c (patch) | |
tree | 30a5f8ce78f0c76b66b4cb47c89316b530b28c77 | |
parent | f6853faa85793bf23b46787e4039824d275453c2 (diff) |
drm/nv84: fix regression in page flipping
Need to emit the semaphore ctxdma before trying to use the semaphore
operations.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index a6237c9cbbc3..e26caf63db0c 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -512,11 +512,11 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
512 | 512 | ||
513 | /* synchronise with the rendering channel, if necessary */ | 513 | /* synchronise with the rendering channel, if necessary */ |
514 | if (likely(chan)) { | 514 | if (likely(chan)) { |
515 | ret = RING_SPACE(chan, 10); | ||
516 | if (ret) | ||
517 | return ret; | ||
518 | |||
519 | if (nv_mclass(chan->object) < NV84_CHANNEL_IND_CLASS) { | 515 | if (nv_mclass(chan->object) < NV84_CHANNEL_IND_CLASS) { |
516 | ret = RING_SPACE(chan, 8); | ||
517 | if (ret) | ||
518 | return ret; | ||
519 | |||
520 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 2); | 520 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 2); |
521 | OUT_RING (chan, NvEvoSema0 + nv_crtc->index); | 521 | OUT_RING (chan, NvEvoSema0 + nv_crtc->index); |
522 | OUT_RING (chan, sync->sem.offset); | 522 | OUT_RING (chan, sync->sem.offset); |
@@ -525,13 +525,17 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
525 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_OFFSET, 2); | 525 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_SEMAPHORE_OFFSET, 2); |
526 | OUT_RING (chan, sync->sem.offset ^ 0x10); | 526 | OUT_RING (chan, sync->sem.offset ^ 0x10); |
527 | OUT_RING (chan, 0x74b1e000); | 527 | OUT_RING (chan, 0x74b1e000); |
528 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1); | ||
529 | OUT_RING (chan, NvSema); | ||
530 | } else | 528 | } else |
531 | if (nv_mclass(chan->object) < NVC0_CHANNEL_IND_CLASS) { | 529 | if (nv_mclass(chan->object) < NVC0_CHANNEL_IND_CLASS) { |
532 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); | 530 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); |
533 | offset += sync->sem.offset; | 531 | offset += sync->sem.offset; |
534 | 532 | ||
533 | ret = RING_SPACE(chan, 12); | ||
534 | if (ret) | ||
535 | return ret; | ||
536 | |||
537 | BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1); | ||
538 | OUT_RING (chan, chan->vram); | ||
535 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | 539 | BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); |
536 | OUT_RING (chan, upper_32_bits(offset)); | 540 | OUT_RING (chan, upper_32_bits(offset)); |
537 | OUT_RING (chan, lower_32_bits(offset)); | 541 | OUT_RING (chan, lower_32_bits(offset)); |
@@ -546,6 +550,10 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
546 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); | 550 | u64 offset = nv84_fence_crtc(chan, nv_crtc->index); |
547 | offset += sync->sem.offset; | 551 | offset += sync->sem.offset; |
548 | 552 | ||
553 | ret = RING_SPACE(chan, 10); | ||
554 | if (ret) | ||
555 | return ret; | ||
556 | |||
549 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); | 557 | BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); |
550 | OUT_RING (chan, upper_32_bits(offset)); | 558 | OUT_RING (chan, upper_32_bits(offset)); |
551 | OUT_RING (chan, lower_32_bits(offset)); | 559 | OUT_RING (chan, lower_32_bits(offset)); |