[Bug 75629] [r128] Changes needed for RandR support

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 28 09:38:46 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75629

--- Comment #28 from Alex Deucher <agd5f at yahoo.com> ---
+static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    R128InfoPtr info = R128PTR(pScrn);
+    unsigned char *R128MMIO = info->MMIO;
+    R128OutputPrivatePtr r128_output = output->driver_private;
+
+    R128MonitorType MonType = MT_NONE;
+    xf86MonPtr *MonInfo = &output->MonInfo;
+    CARD32 mask1, mask2;
+
+    if (r128_output->type == OUTPUT_LVDS) {
+        return MT_LCD;
+    } else if (r128_output->type == OUTPUT_VGA) {
+        mask1 = R128_GPIO_MONID_MASK_1 | R128_GPIO_MONID_MASK_3;
+    mask2 = R128_GPIO_MONID_A_1    | R128_GPIO_MONID_A_3;
+    } else {
+        mask1 = R128_GPIO_MONID_MASK_0 | R128_GPIO_MONID_MASK_3;
+    mask2 = R128_GPIO_MONID_A_0    | R128_GPIO_MONID_A_3;
+    }
+
+    if (r128_output->pI2CBus) {
+    /* XXX: Radeon does something here to appease old monitors. */
+    OUTREG(info->DDCReg, INREG(info->DDCReg)  |  mask1);
+    OUTREG(info->DDCReg, INREG(info->DDCReg)  & ~mask2);

Maybe store the ddc reg for each output type in the R128I2CBus structure as
well in case there are other configurations.  Probably not a big deal though.

+    *MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), r128_output->pI2CBus);
+    } else {
+        xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DDC2/I2C is not properly
initialized\n");
+        return MT_NONE;
+    }
+
+    if (*MonInfo) {
+        if ((*MonInfo)->rawData[0x14] & 0x80) {
+            if (INREG(R128_FP_GEN_CNTL) & R128_FP_TDMS_EN)
+                MonType = MT_DFP;
+            else
+                MonType = MT_LCD;
+    } else {
+            MonType = MT_CRT;
+        }
+    }

I think this part is should be restructured.  I think something like the
following makes more sense:

if (*MonInfo) {
    if (r128_output->type == OUTPUT_VGA) {
        MonType = MT_CRT;
    } else {
        if ((*MonInfo)->rawData[0x14] & 0x80)
            MonType = MT_DFP;
        else
            MonType = MT_CRT;
    }
}

MT_LCD is only for LVDS so there's no chance of that showing up on a DVI or VGA
connector.  Additionally, FP_GEN_CNTL.FP_TDMS_EN will only be set if the output
was previously enabled (by the driver or vbios).  If not, that bit won't be
set.  All you should need is the digital bit in the EDID which should always be
set for digital DVI displays.  I don't know whether there are any boards with
DVI-I connectors (analog and digital encoders wired to the same connector), but
this should be fine either way.

+
+    return MonType;
+}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-driver-ati/attachments/20140528/ffab1578/attachment.html>


More information about the xorg-driver-ati mailing list