diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-07-07 21:39:18 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-12 20:13:41 -0400 |
commit | 631872155f35b907ae3950016d9e72a308449d69 (patch) | |
tree | b75acbc33e97a3c811a240fccc16b3f17cb0ed83 /drivers/gpu/drm/nouveau/nouveau_sgdma.c | |
parent | f56cb86f9abd229418f894a8ffedfb9ff465c181 (diff) |
drm/nv50: move tlb flushing to a helper function
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_sgdma.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_sgdma.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index 1b2ab5a714ce..491767fe4fcf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c | |||
@@ -118,21 +118,8 @@ nouveau_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) | |||
118 | dev_priv->engine.instmem.flush(nvbe->dev); | 118 | dev_priv->engine.instmem.flush(nvbe->dev); |
119 | 119 | ||
120 | if (dev_priv->card_type == NV_50) { | 120 | if (dev_priv->card_type == NV_50) { |
121 | nv_wr32(dev, 0x100c80, 0x00050001); | 121 | nv50_vm_flush(dev, 5); /* PGRAPH */ |
122 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | 122 | nv50_vm_flush(dev, 0); /* PFIFO */ |
123 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n"); | ||
124 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", | ||
125 | nv_rd32(dev, 0x100c80)); | ||
126 | return -EBUSY; | ||
127 | } | ||
128 | |||
129 | nv_wr32(dev, 0x100c80, 0x00000001); | ||
130 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | ||
131 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n"); | ||
132 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", | ||
133 | nv_rd32(dev, 0x100c80)); | ||
134 | return -EBUSY; | ||
135 | } | ||
136 | } | 123 | } |
137 | 124 | ||
138 | nvbe->bound = true; | 125 | nvbe->bound = true; |
@@ -171,21 +158,8 @@ nouveau_sgdma_unbind(struct ttm_backend *be) | |||
171 | dev_priv->engine.instmem.flush(nvbe->dev); | 158 | dev_priv->engine.instmem.flush(nvbe->dev); |
172 | 159 | ||
173 | if (dev_priv->card_type == NV_50) { | 160 | if (dev_priv->card_type == NV_50) { |
174 | nv_wr32(dev, 0x100c80, 0x00050001); | 161 | nv50_vm_flush(dev, 5); |
175 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | 162 | nv50_vm_flush(dev, 0); |
176 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n"); | ||
177 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", | ||
178 | nv_rd32(dev, 0x100c80)); | ||
179 | return -EBUSY; | ||
180 | } | ||
181 | |||
182 | nv_wr32(dev, 0x100c80, 0x00000001); | ||
183 | if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { | ||
184 | NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n"); | ||
185 | NV_ERROR(dev, "0x100c80 = 0x%08x\n", | ||
186 | nv_rd32(dev, 0x100c80)); | ||
187 | return -EBUSY; | ||
188 | } | ||
189 | } | 163 | } |
190 | 164 | ||
191 | nvbe->bound = false; | 165 | nvbe->bound = false; |