diff options
author | Dave Airlie <airlied@redhat.com> | 2012-03-22 14:44:06 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-03-22 14:44:06 +0000 |
commit | 1898f4426b3863216a9041389b34a3b995883027 (patch) | |
tree | 1f1fa81d13ab229c3efea589e79135912b5260e6 /drivers/gpu/drm/nouveau/nvc0_fifo.c | |
parent | 5466c7b1683a23dbbcfb7ee4a71c4f23886001c7 (diff) | |
parent | 6544599249086ce50f216a6cedbea56514ffefc6 (diff) |
Merge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-next
* 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6:
drm/nouveau/dp: support version 4.0 of DP table
drm/nve0/disp: nvidia randomly decided to move the dithering method
drm/nve0: initial modesetting support for kepler chipsets
drm/nouveau: add bios connector type for dms59
drm/nouveau: move out of staging drivers
drm/nouveau: bump version to 1.0.0
drm/nvd0/disp: ignore clock set if no pclk
drm/nouveau: oops, increase channel dispc_vma to 4
drm/nouveau: inform userspace of new kernel subchannel requirements
drm/nouveau: remove m2mf creation on userspace channels
drm/nvc0-/disp: reimplement flip completion method as fifo method
drm/nouveau: move fence sequence check to start of loop
drm/nouveau: remove subchannel names from places where it doesn't matter
drm/nouveau/ttm: always do buffer moves on kernel channel
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_fifo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_fifo.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_fifo.c b/drivers/gpu/drm/nouveau/nvc0_fifo.c index dcbe0d5d024..50d68a7a137 100644 --- a/drivers/gpu/drm/nouveau/nvc0_fifo.c +++ b/drivers/gpu/drm/nouveau/nvc0_fifo.c @@ -436,6 +436,24 @@ nvc0_fifo_isr_vm_fault(struct drm_device *dev, int unit) printk(" on channel 0x%010llx\n", (u64)inst << 12); } +static int +nvc0_fifo_page_flip(struct drm_device *dev, u32 chid) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_channel *chan = NULL; + unsigned long flags; + int ret = -EINVAL; + + spin_lock_irqsave(&dev_priv->channels.lock, flags); + if (likely(chid >= 0 && chid < dev_priv->engine.fifo.channels)) { + chan = dev_priv->channels.ptr[chid]; + if (likely(chan)) + ret = nouveau_finish_page_flip(chan, NULL); + } + spin_unlock_irqrestore(&dev_priv->channels.lock, flags); + return ret; +} + static void nvc0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit) { @@ -445,11 +463,21 @@ nvc0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit) u32 chid = nv_rd32(dev, 0x040120 + (unit * 0x2000)) & 0x7f; u32 subc = (addr & 0x00070000); u32 mthd = (addr & 0x00003ffc); + u32 show = stat; - NV_INFO(dev, "PSUBFIFO %d:", unit); - nouveau_bitfield_print(nvc0_fifo_subfifo_intr, stat); - NV_INFO(dev, "PSUBFIFO %d: ch %d subc %d mthd 0x%04x data 0x%08x\n", - unit, chid, subc, mthd, data); + if (stat & 0x00200000) { + if (mthd == 0x0054) { + if (!nvc0_fifo_page_flip(dev, chid)) + show &= ~0x00200000; + } + } + + if (show) { + NV_INFO(dev, "PFIFO%d:", unit); + nouveau_bitfield_print(nvc0_fifo_subfifo_intr, show); + NV_INFO(dev, "PFIFO%d: ch %d subc %d mthd 0x%04x data 0x%08x\n", + unit, chid, subc, mthd, data); + } nv_wr32(dev, 0x0400c0 + (unit * 0x2000), 0x80600008); nv_wr32(dev, 0x040108 + (unit * 0x2000), stat); |