drm/nvd0/disp: fix dcb sor link matching in supervisor handler
authorBen Skeggs <bskeggs@redhat.com>
Sun, 11 Mar 2012 06:13:49 +0000 (16:13 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Mar 2012 07:15:05 +0000 (17:15 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvd0_display.c

index 1723733ad9faeb82705846d50134b9a2f22b13f8..3c2543190bb8cf2194b7e4dda56450ec0602a191 100644 (file)
@@ -1567,19 +1567,19 @@ static struct dcb_entry *
 lookup_dcb(struct drm_device *dev, int id, u32 mc)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
-       int type, or, i;
+       int type, or, i, link = -1;
 
        if (id < 4) {
                type = OUTPUT_ANALOG;
                or   = id;
        } else {
                switch (mc & 0x00000f00) {
-               case 0x00000000: type = OUTPUT_LVDS; break;
-               case 0x00000100: type = OUTPUT_TMDS; break;
-               case 0x00000200: type = OUTPUT_TMDS; break;
-               case 0x00000500: type = OUTPUT_TMDS; break;
-               case 0x00000800: type = OUTPUT_DP; break;
-               case 0x00000900: type = OUTPUT_DP; break;
+               case 0x00000000: link = 0; type = OUTPUT_LVDS; break;
+               case 0x00000100: link = 0; type = OUTPUT_TMDS; break;
+               case 0x00000200: link = 1; type = OUTPUT_TMDS; break;
+               case 0x00000500: link = 0; type = OUTPUT_TMDS; break;
+               case 0x00000800: link = 0; type = OUTPUT_DP; break;
+               case 0x00000900: link = 1; type = OUTPUT_DP; break;
                default:
                        NV_ERROR(dev, "PDISP: unknown SOR mc 0x%08x\n", mc);
                        return NULL;
@@ -1590,7 +1590,8 @@ lookup_dcb(struct drm_device *dev, int id, u32 mc)
 
        for (i = 0; i < dev_priv->vbios.dcb.entries; i++) {
                struct dcb_entry *dcb = &dev_priv->vbios.dcb.entry[i];
-               if (dcb->type == type && (dcb->or & (1 << or)))
+               if (dcb->type == type && (dcb->or & (1 << or)) &&
+                   (link < 0 || link == !(dcb->sorconf.link & 1)))
                        return dcb;
        }