<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED --- - [r128] Changes needed for RandR support"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75629#c28">Comment # 28</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED --- - [r128] Changes needed for RandR support"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75629">bug 75629</a>
from <span class="vcard"><a class="email" href="mailto:agd5f@yahoo.com" title="Alex Deucher <agd5f@yahoo.com>"> <span class="fn">Alex Deucher</span></a>
</span></b>
<pre>+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;
+}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>