aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-03-04 01:25:59 -0500
committerBen Skeggs <bskeggs@redhat.com>2012-03-13 03:15:00 -0400
commit7c5f6a87b2337cc81fb6d16e848501e2dbe00a3d (patch)
tree6beb0845847f7d4b9494322de020d95d77afd08e /drivers/gpu/drm/nouveau
parent29181d2f7bec0f51273ceab8c565410d52ef1eb0 (diff)
drm/nvd0/disp: attempt to handle more than 2 crtcs if possible
Theoretically handles CRTC2/CRTC3, should any GF119 out there actually have them enabled. The room is there for the regs etc, so why not :) Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c
index d2ba2f07400b..296f205249fc 100644
--- a/drivers/gpu/drm/nouveau/nvd0_display.c
+++ b/drivers/gpu/drm/nouveau/nvd0_display.c
@@ -1548,7 +1548,7 @@ nvd0_display_bh(unsigned long data)
1548{ 1548{
1549 struct drm_device *dev = (struct drm_device *)data; 1549 struct drm_device *dev = (struct drm_device *)data;
1550 struct nvd0_display *disp = nvd0_display(dev); 1550 struct nvd0_display *disp = nvd0_display(dev);
1551 u32 mask, crtc; 1551 u32 mask = 0, crtc = ~0;
1552 int i; 1552 int i;
1553 1553
1554 if (drm_debug & (DRM_UT_DRIVER | DRM_UT_KMS)) { 1554 if (drm_debug & (DRM_UT_DRIVER | DRM_UT_KMS)) {
@@ -1564,12 +1564,8 @@ nvd0_display_bh(unsigned long data)
1564 } 1564 }
1565 } 1565 }
1566 1566
1567 mask = nv_rd32(dev, 0x6101d4); 1567 while (!mask && ++crtc < dev->mode_config.num_crtc)
1568 crtc = 0; 1568 mask = nv_rd32(dev, 0x6101d4 + (crtc * 0x800));
1569 if (!mask) {
1570 mask = nv_rd32(dev, 0x6109d4);
1571 crtc = 1;
1572 }
1573 1569
1574 if (disp->modeset & 0x00000001) 1570 if (disp->modeset & 0x00000001)
1575 nvd0_display_unk1_handler(dev, crtc, mask); 1571 nvd0_display_unk1_handler(dev, crtc, mask);
@@ -1584,6 +1580,7 @@ nvd0_display_intr(struct drm_device *dev)
1584{ 1580{
1585 struct nvd0_display *disp = nvd0_display(dev); 1581 struct nvd0_display *disp = nvd0_display(dev);
1586 u32 intr = nv_rd32(dev, 0x610088); 1582 u32 intr = nv_rd32(dev, 0x610088);
1583 int i;
1587 1584
1588 if (intr & 0x00000001) { 1585 if (intr & 0x00000001) {
1589 u32 stat = nv_rd32(dev, 0x61008c); 1586 u32 stat = nv_rd32(dev, 0x61008c);
@@ -1628,16 +1625,13 @@ nvd0_display_intr(struct drm_device *dev)
1628 intr &= ~0x00100000; 1625 intr &= ~0x00100000;
1629 } 1626 }
1630 1627
1631 if (intr & 0x01000000) { 1628 for (i = 0; i < dev->mode_config.num_crtc; i++) {
1632 u32 stat = nv_rd32(dev, 0x6100bc); 1629 u32 mask = 0x01000000 << i;
1633 nv_wr32(dev, 0x6100bc, stat); 1630 if (intr & mask) {
1634 intr &= ~0x01000000; 1631 u32 stat = nv_rd32(dev, 0x6100bc + (i * 0x800));
1635 } 1632 nv_wr32(dev, 0x6100bc + (i * 0x800), stat);
1636 1633 intr &= ~mask;
1637 if (intr & 0x02000000) { 1634 }
1638 u32 stat = nv_rd32(dev, 0x6108bc);
1639 nv_wr32(dev, 0x6108bc, stat);
1640 intr &= ~0x02000000;
1641 } 1635 }
1642 1636
1643 if (intr) 1637 if (intr)
@@ -1774,7 +1768,7 @@ nvd0_display_create(struct drm_device *dev)
1774 struct pci_dev *pdev = dev->pdev; 1768 struct pci_dev *pdev = dev->pdev;
1775 struct nvd0_display *disp; 1769 struct nvd0_display *disp;
1776 struct dcb_entry *dcbe; 1770 struct dcb_entry *dcbe;
1777 int ret, i; 1771 int crtcs, ret, i;
1778 1772
1779 disp = kzalloc(sizeof(*disp), GFP_KERNEL); 1773 disp = kzalloc(sizeof(*disp), GFP_KERNEL);
1780 if (!disp) 1774 if (!disp)
@@ -1782,7 +1776,8 @@ nvd0_display_create(struct drm_device *dev)
1782 dev_priv->engine.display.priv = disp; 1776 dev_priv->engine.display.priv = disp;
1783 1777
1784 /* create crtc objects to represent the hw heads */ 1778 /* create crtc objects to represent the hw heads */
1785 for (i = 0; i < 2; i++) { 1779 crtcs = nv_rd32(dev, 0x022448);
1780 for (i = 0; i < crtcs; i++) {
1786 ret = nvd0_crtc_create(dev, i); 1781 ret = nvd0_crtc_create(dev, i);
1787 if (ret) 1782 if (ret)
1788 goto out; 1783 goto out;