diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_acpi.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_i2c.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv84_fifo.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_pm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvd0_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nve0_fifo.c | 37 |
7 files changed, 45 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index fc841e87b343..26ebffebe710 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
@@ -211,11 +211,6 @@ static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id, | |||
211 | return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state); | 211 | return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state); |
212 | } | 212 | } |
213 | 213 | ||
214 | static int nouveau_dsm_init(void) | ||
215 | { | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static int nouveau_dsm_get_client_id(struct pci_dev *pdev) | 214 | static int nouveau_dsm_get_client_id(struct pci_dev *pdev) |
220 | { | 215 | { |
221 | /* easy option one - intel vendor ID means Integrated */ | 216 | /* easy option one - intel vendor ID means Integrated */ |
@@ -232,7 +227,6 @@ static int nouveau_dsm_get_client_id(struct pci_dev *pdev) | |||
232 | static struct vga_switcheroo_handler nouveau_dsm_handler = { | 227 | static struct vga_switcheroo_handler nouveau_dsm_handler = { |
233 | .switchto = nouveau_dsm_switchto, | 228 | .switchto = nouveau_dsm_switchto, |
234 | .power_state = nouveau_dsm_power_state, | 229 | .power_state = nouveau_dsm_power_state, |
235 | .init = nouveau_dsm_init, | ||
236 | .get_client_id = nouveau_dsm_get_client_id, | 230 | .get_client_id = nouveau_dsm_get_client_id, |
237 | }; | 231 | }; |
238 | 232 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index 77e564667b5c..240cf962c999 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
@@ -229,7 +229,7 @@ nouveau_i2c_init(struct drm_device *dev) | |||
229 | } | 229 | } |
230 | break; | 230 | break; |
231 | case 6: /* NV50- DP AUX */ | 231 | case 6: /* NV50- DP AUX */ |
232 | port->drive = entry[0]; | 232 | port->drive = entry[0] & 0x0f; |
233 | port->sense = port->drive; | 233 | port->sense = port->drive; |
234 | port->adapter.algo = &nouveau_dp_i2c_algo; | 234 | port->adapter.algo = &nouveau_dp_i2c_algo; |
235 | break; | 235 | break; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 1cdfd6e757ce..1866dbb49979 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -731,7 +731,6 @@ nouveau_card_init(struct drm_device *dev) | |||
731 | case 0xa3: | 731 | case 0xa3: |
732 | case 0xa5: | 732 | case 0xa5: |
733 | case 0xa8: | 733 | case 0xa8: |
734 | case 0xaf: | ||
735 | nva3_copy_create(dev); | 734 | nva3_copy_create(dev); |
736 | break; | 735 | break; |
737 | } | 736 | } |
diff --git a/drivers/gpu/drm/nouveau/nv84_fifo.c b/drivers/gpu/drm/nouveau/nv84_fifo.c index cc82d799fc3b..c564c5e4c30a 100644 --- a/drivers/gpu/drm/nouveau/nv84_fifo.c +++ b/drivers/gpu/drm/nouveau/nv84_fifo.c | |||
@@ -117,17 +117,22 @@ nv84_fifo_context_del(struct nouveau_channel *chan, int engine) | |||
117 | struct drm_device *dev = chan->dev; | 117 | struct drm_device *dev = chan->dev; |
118 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 118 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
119 | unsigned long flags; | 119 | unsigned long flags; |
120 | u32 save; | ||
120 | 121 | ||
121 | /* remove channel from playlist, will context switch if active */ | 122 | /* remove channel from playlist, will context switch if active */ |
122 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | 123 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); |
123 | nv_mask(dev, 0x002600 + (chan->id * 4), 0x80000000, 0x00000000); | 124 | nv_mask(dev, 0x002600 + (chan->id * 4), 0x80000000, 0x00000000); |
124 | nv50_fifo_playlist_update(dev); | 125 | nv50_fifo_playlist_update(dev); |
125 | 126 | ||
127 | save = nv_mask(dev, 0x002520, 0x0000003f, 0x15); | ||
128 | |||
126 | /* tell any engines on this channel to unload their contexts */ | 129 | /* tell any engines on this channel to unload their contexts */ |
127 | nv_wr32(dev, 0x0032fc, chan->ramin->vinst >> 12); | 130 | nv_wr32(dev, 0x0032fc, chan->ramin->vinst >> 12); |
128 | if (!nv_wait_ne(dev, 0x0032fc, 0xffffffff, 0xffffffff)) | 131 | if (!nv_wait_ne(dev, 0x0032fc, 0xffffffff, 0xffffffff)) |
129 | NV_INFO(dev, "PFIFO: channel %d unload timeout\n", chan->id); | 132 | NV_INFO(dev, "PFIFO: channel %d unload timeout\n", chan->id); |
130 | 133 | ||
134 | nv_wr32(dev, 0x002520, save); | ||
135 | |||
131 | nv_wr32(dev, 0x002600 + (chan->id * 4), 0x00000000); | 136 | nv_wr32(dev, 0x002600 + (chan->id * 4), 0x00000000); |
132 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); | 137 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); |
133 | 138 | ||
@@ -184,10 +189,13 @@ nv84_fifo_fini(struct drm_device *dev, int engine, bool suspend) | |||
184 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 189 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
185 | struct nv84_fifo_priv *priv = nv_engine(dev, engine); | 190 | struct nv84_fifo_priv *priv = nv_engine(dev, engine); |
186 | int i; | 191 | int i; |
192 | u32 save; | ||
187 | 193 | ||
188 | /* set playlist length to zero, fifo will unload context */ | 194 | /* set playlist length to zero, fifo will unload context */ |
189 | nv_wr32(dev, 0x0032ec, 0); | 195 | nv_wr32(dev, 0x0032ec, 0); |
190 | 196 | ||
197 | save = nv_mask(dev, 0x002520, 0x0000003f, 0x15); | ||
198 | |||
191 | /* tell all connected engines to unload their contexts */ | 199 | /* tell all connected engines to unload their contexts */ |
192 | for (i = 0; i < priv->base.channels; i++) { | 200 | for (i = 0; i < priv->base.channels; i++) { |
193 | struct nouveau_channel *chan = dev_priv->channels.ptr[i]; | 201 | struct nouveau_channel *chan = dev_priv->channels.ptr[i]; |
@@ -199,6 +207,7 @@ nv84_fifo_fini(struct drm_device *dev, int engine, bool suspend) | |||
199 | } | 207 | } |
200 | } | 208 | } |
201 | 209 | ||
210 | nv_wr32(dev, 0x002520, save); | ||
202 | nv_wr32(dev, 0x002140, 0); | 211 | nv_wr32(dev, 0x002140, 0); |
203 | return 0; | 212 | return 0; |
204 | } | 213 | } |
diff --git a/drivers/gpu/drm/nouveau/nvc0_pm.c b/drivers/gpu/drm/nouveau/nvc0_pm.c index 7c95c44e2887..4e712b10ebdb 100644 --- a/drivers/gpu/drm/nouveau/nvc0_pm.c +++ b/drivers/gpu/drm/nouveau/nvc0_pm.c | |||
@@ -557,7 +557,7 @@ prog_mem(struct drm_device *dev, struct nvc0_pm_state *info) | |||
557 | nouveau_mem_exec(&exec, info->perflvl); | 557 | nouveau_mem_exec(&exec, info->perflvl); |
558 | 558 | ||
559 | if (dev_priv->chipset < 0xd0) | 559 | if (dev_priv->chipset < 0xd0) |
560 | nv_wr32(dev, 0x611200, 0x00003300); | 560 | nv_wr32(dev, 0x611200, 0x00003330); |
561 | else | 561 | else |
562 | nv_wr32(dev, 0x62c000, 0x03030300); | 562 | nv_wr32(dev, 0x62c000, 0x03030300); |
563 | } | 563 | } |
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c index d0d60e1e7f95..dac525b2994e 100644 --- a/drivers/gpu/drm/nouveau/nvd0_display.c +++ b/drivers/gpu/drm/nouveau/nvd0_display.c | |||
@@ -790,7 +790,7 @@ nvd0_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
790 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 790 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
791 | int ch = EVO_CURS(nv_crtc->index); | 791 | int ch = EVO_CURS(nv_crtc->index); |
792 | 792 | ||
793 | evo_piow(crtc->dev, ch, 0x0084, (y << 16) | x); | 793 | evo_piow(crtc->dev, ch, 0x0084, (y << 16) | (x & 0xffff)); |
794 | evo_piow(crtc->dev, ch, 0x0080, 0x00000000); | 794 | evo_piow(crtc->dev, ch, 0x0080, 0x00000000); |
795 | return 0; | 795 | return 0; |
796 | } | 796 | } |
diff --git a/drivers/gpu/drm/nouveau/nve0_fifo.c b/drivers/gpu/drm/nouveau/nve0_fifo.c index 1855ecbd843b..e98d144e6eb9 100644 --- a/drivers/gpu/drm/nouveau/nve0_fifo.c +++ b/drivers/gpu/drm/nouveau/nve0_fifo.c | |||
@@ -294,6 +294,25 @@ nve0_fifo_isr_vm_fault(struct drm_device *dev, int unit) | |||
294 | printk(" on channel 0x%010llx\n", (u64)inst << 12); | 294 | printk(" on channel 0x%010llx\n", (u64)inst << 12); |
295 | } | 295 | } |
296 | 296 | ||
297 | static int | ||
298 | nve0_fifo_page_flip(struct drm_device *dev, u32 chid) | ||
299 | { | ||
300 | struct nve0_fifo_priv *priv = nv_engine(dev, NVOBJ_ENGINE_FIFO); | ||
301 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
302 | struct nouveau_channel *chan = NULL; | ||
303 | unsigned long flags; | ||
304 | int ret = -EINVAL; | ||
305 | |||
306 | spin_lock_irqsave(&dev_priv->channels.lock, flags); | ||
307 | if (likely(chid >= 0 && chid < priv->base.channels)) { | ||
308 | chan = dev_priv->channels.ptr[chid]; | ||
309 | if (likely(chan)) | ||
310 | ret = nouveau_finish_page_flip(chan, NULL); | ||
311 | } | ||
312 | spin_unlock_irqrestore(&dev_priv->channels.lock, flags); | ||
313 | return ret; | ||
314 | } | ||
315 | |||
297 | static void | 316 | static void |
298 | nve0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit) | 317 | nve0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit) |
299 | { | 318 | { |
@@ -303,11 +322,21 @@ nve0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit) | |||
303 | u32 chid = nv_rd32(dev, 0x040120 + (unit * 0x2000)) & 0x7f; | 322 | u32 chid = nv_rd32(dev, 0x040120 + (unit * 0x2000)) & 0x7f; |
304 | u32 subc = (addr & 0x00070000); | 323 | u32 subc = (addr & 0x00070000); |
305 | u32 mthd = (addr & 0x00003ffc); | 324 | u32 mthd = (addr & 0x00003ffc); |
325 | u32 show = stat; | ||
326 | |||
327 | if (stat & 0x00200000) { | ||
328 | if (mthd == 0x0054) { | ||
329 | if (!nve0_fifo_page_flip(dev, chid)) | ||
330 | show &= ~0x00200000; | ||
331 | } | ||
332 | } | ||
306 | 333 | ||
307 | NV_INFO(dev, "PSUBFIFO %d:", unit); | 334 | if (show) { |
308 | nouveau_bitfield_print(nve0_fifo_subfifo_intr, stat); | 335 | NV_INFO(dev, "PFIFO%d:", unit); |
309 | NV_INFO(dev, "PSUBFIFO %d: ch %d subc %d mthd 0x%04x data 0x%08x\n", | 336 | nouveau_bitfield_print(nve0_fifo_subfifo_intr, show); |
310 | unit, chid, subc, mthd, data); | 337 | NV_INFO(dev, "PFIFO%d: ch %d subc %d mthd 0x%04x data 0x%08x\n", |
338 | unit, chid, subc, mthd, data); | ||
339 | } | ||
311 | 340 | ||
312 | nv_wr32(dev, 0x0400c0 + (unit * 0x2000), 0x80600008); | 341 | nv_wr32(dev, 0x0400c0 + (unit * 0x2000), 0x80600008); |
313 | nv_wr32(dev, 0x040108 + (unit * 0x2000), stat); | 342 | nv_wr32(dev, 0x040108 + (unit * 0x2000), stat); |