| .. | .. |
|---|
| 21 | 21 | * |
|---|
| 22 | 22 | * Authors: Ben Skeggs |
|---|
| 23 | 23 | */ |
|---|
| 24 | | - |
|---|
| 25 | 24 | #include "nouveau_drv.h" |
|---|
| 26 | 25 | #include "nouveau_dma.h" |
|---|
| 27 | 26 | #include "nouveau_fence.h" |
|---|
| 28 | 27 | |
|---|
| 29 | 28 | #include "nv50_display.h" |
|---|
| 30 | 29 | |
|---|
| 30 | +#include <nvif/push906f.h> |
|---|
| 31 | + |
|---|
| 32 | +#include <nvhw/class/cl906f.h> |
|---|
| 33 | + |
|---|
| 31 | 34 | static int |
|---|
| 32 | 35 | nvc0_fence_emit32(struct nouveau_channel *chan, u64 virtual, u32 sequence) |
|---|
| 33 | 36 | { |
|---|
| 34 | | - int ret = RING_SPACE(chan, 6); |
|---|
| 37 | + struct nvif_push *push = chan->chan.push; |
|---|
| 38 | + int ret = PUSH_WAIT(push, 6); |
|---|
| 35 | 39 | if (ret == 0) { |
|---|
| 36 | | - BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 5); |
|---|
| 37 | | - OUT_RING (chan, upper_32_bits(virtual)); |
|---|
| 38 | | - OUT_RING (chan, lower_32_bits(virtual)); |
|---|
| 39 | | - OUT_RING (chan, sequence); |
|---|
| 40 | | - OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG); |
|---|
| 41 | | - OUT_RING (chan, 0x00000000); |
|---|
| 42 | | - FIRE_RING (chan); |
|---|
| 40 | + PUSH_MTHD(push, NV906F, SEMAPHOREA, |
|---|
| 41 | + NVVAL(NV906F, SEMAPHOREA, OFFSET_UPPER, upper_32_bits(virtual)), |
|---|
| 42 | + |
|---|
| 43 | + SEMAPHOREB, lower_32_bits(virtual), |
|---|
| 44 | + SEMAPHOREC, sequence, |
|---|
| 45 | + |
|---|
| 46 | + SEMAPHORED, |
|---|
| 47 | + NVDEF(NV906F, SEMAPHORED, OPERATION, RELEASE) | |
|---|
| 48 | + NVDEF(NV906F, SEMAPHORED, RELEASE_WFI, EN) | |
|---|
| 49 | + NVDEF(NV906F, SEMAPHORED, RELEASE_SIZE, 16BYTE), |
|---|
| 50 | + |
|---|
| 51 | + NON_STALL_INTERRUPT, 0); |
|---|
| 52 | + PUSH_KICK(push); |
|---|
| 43 | 53 | } |
|---|
| 44 | 54 | return ret; |
|---|
| 45 | 55 | } |
|---|
| .. | .. |
|---|
| 47 | 57 | static int |
|---|
| 48 | 58 | nvc0_fence_sync32(struct nouveau_channel *chan, u64 virtual, u32 sequence) |
|---|
| 49 | 59 | { |
|---|
| 50 | | - int ret = RING_SPACE(chan, 5); |
|---|
| 60 | + struct nvif_push *push = chan->chan.push; |
|---|
| 61 | + int ret = PUSH_WAIT(push, 5); |
|---|
| 51 | 62 | if (ret == 0) { |
|---|
| 52 | | - BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4); |
|---|
| 53 | | - OUT_RING (chan, upper_32_bits(virtual)); |
|---|
| 54 | | - OUT_RING (chan, lower_32_bits(virtual)); |
|---|
| 55 | | - OUT_RING (chan, sequence); |
|---|
| 56 | | - OUT_RING (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL | |
|---|
| 57 | | - NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD); |
|---|
| 58 | | - FIRE_RING (chan); |
|---|
| 63 | + PUSH_MTHD(push, NV906F, SEMAPHOREA, |
|---|
| 64 | + NVVAL(NV906F, SEMAPHOREA, OFFSET_UPPER, upper_32_bits(virtual)), |
|---|
| 65 | + |
|---|
| 66 | + SEMAPHOREB, lower_32_bits(virtual), |
|---|
| 67 | + SEMAPHOREC, sequence, |
|---|
| 68 | + |
|---|
| 69 | + SEMAPHORED, |
|---|
| 70 | + NVDEF(NV906F, SEMAPHORED, OPERATION, ACQ_GEQ) | |
|---|
| 71 | + NVDEF(NV906F, SEMAPHORED, ACQUIRE_SWITCH, ENABLED)); |
|---|
| 72 | + PUSH_KICK(push); |
|---|
| 59 | 73 | } |
|---|
| 60 | 74 | return ret; |
|---|
| 61 | 75 | } |
|---|