xf86-video-r128: Branch 'master' - 2 commits

Kevin Brace kevinbrace at kemper.freedesktop.org
Wed Jul 18 14:01:10 UTC 2018


 src/r128_output.c |   86 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 46 insertions(+), 40 deletions(-)

New commits:
commit d87d1aac04415d74ab32e820e9e351432c66cfdb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jul 13 07:18:18 2018 -0700

    Fix for some RAGE 128 Pro causing out of range display error
    
    Due to faulty assumptions made by commit 2072d9a, many RAGE 128 Pro
    VGA display will be detected as DVI, and causes out of range display
    error with the attached monitor. While this commit is less than
    perfect and only works on x86 platform, it avoids causing out of
    range display error. With this fix, there is no longer the need to
    specify the supported frequency range of the monitor inside xorg.conf.
    The code was tested on RAGE 128 Pro Ultra 16 MB AGP.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_output.c b/src/r128_output.c
index f11acde..1d98fb9 100644
--- a/src/r128_output.c
+++ b/src/r128_output.c
@@ -413,40 +413,47 @@ static Bool R128I2CInit(xf86OutputPtr output, I2CBusPtr *bus_ptr, char *name)
     return TRUE;
 }
 
-void R128SetupGenericConnectors(ScrnInfoPtr pScrn, R128OutputType *otypes)
-{
-    R128InfoPtr info    = R128PTR(pScrn);
-    R128EntPtr pR128Ent = R128EntPriv(pScrn);
-
-    if (!pR128Ent->HasCRTC2 && !info->isDFP) {
-        otypes[0] = OUTPUT_VGA;
-        otypes[1] = OUTPUT_NONE;
-        return;
-    } else if (!pR128Ent->HasCRTC2) {
-        otypes[0] = OUTPUT_DVI;
-        otypes[1] = OUTPUT_NONE;
-        return;
-    }
-
-    otypes[0] = OUTPUT_LVDS;
-    otypes[1] = OUTPUT_VGA;
-}
-
 void R128GetConnectorInfoFromBIOS(ScrnInfoPtr pScrn, R128OutputType *otypes)
 {
     R128InfoPtr info = R128PTR(pScrn);
-    uint16_t bios_header;
-    int offset;
+    uint16_t bios_header, offset;
+    uint32_t i;
+
+    for (i = 0; i < R128_MAX_BIOS_CONNECTOR; i++) {
+        otypes[i] = OUTPUT_NONE;
+    }
 
-    /* XXX: Currently, this function only finds VGA ports misidentified as DVI. */
-    if (!info->VBIOS || otypes[0] != OUTPUT_DVI) return;
+    /* non-x86 platform */
+    if (!info->VBIOS) {
+        otypes[0] = OUTPUT_VGA;
+    }
 
     bios_header = R128_BIOS16(0x48);
-    offset = R128_BIOS16(bios_header + 0x60);
+    offset = R128_BIOS16(bios_header + 0x40);
+    if (offset) {
+        otypes[0] = OUTPUT_LVDS;
+        xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                    "Found FP table, assuming FP connector.\n");
+    } else {
+        bios_header = R128_BIOS16(0x48);
+        offset = R128_BIOS16(bios_header + 0x34);
+        if (offset) {
+            otypes[0] = OUTPUT_DVI;
+            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Found DVI table, assuming DVI connector.\n");
+        }
+    }
 
+    offset = R128_BIOS16(bios_header + 0x2e);
     if (offset) {
-        otypes[0] = OUTPUT_VGA;
-        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found CRT table, assuming VGA connector\n");
+        if (otypes[0] == OUTPUT_NONE) {
+            otypes[0] = OUTPUT_VGA;
+        } else {
+            otypes[1] = OUTPUT_VGA;
+        }
+
+        xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                    "Found CRT table, assuming VGA connector.\n");
     }
 }
 
@@ -461,7 +468,6 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn)
     int num_dvi = 0;
     int i;
 
-    R128SetupGenericConnectors(pScrn, otypes);
     R128GetConnectorInfoFromBIOS(pScrn, otypes);
 
     for (i = 0; i < R128_MAX_BIOS_CONNECTOR; i++) {
commit c857cc319809790a5414ee75fc299d835fe964a7
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 12 16:11:07 2018 -0700

    Convert tabs to white spaces for r128_output.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_output.c b/src/r128_output.c
index 41a2533..f11acde 100644
--- a/src/r128_output.c
+++ b/src/r128_output.c
@@ -280,10 +280,10 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output)
     if (r128_output->pI2CBus) {
         R128I2CBusPtr pR128I2CBus = &(r128_output->ddc_i2c);
 
-	/* XXX: Radeon does something here to appease old monitors. */
-	OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg)  |  mask1);
-	OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg)  & ~mask2);
-	*MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), r128_output->pI2CBus);
+        /* XXX: Radeon does something here to appease old monitors. */
+        OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg)  |  mask1);
+        OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg)  & ~mask2);
+        *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;
@@ -297,7 +297,7 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output)
                 MonType = MT_DFP;
             else
                 MonType = MT_CRT;
-	}
+        }
     }
 
     return MonType;
@@ -343,8 +343,8 @@ DisplayModePtr R128ProbeOutputModes(xf86OutputPtr output)
             }
         }
 
-	xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
-	if (mode->status == MODE_OK)
+        xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
+        if (mode->status == MODE_OK)
             mode->status = R128DoValidMode(output, mode, MODECHECK_FINAL);
     }
 
@@ -425,7 +425,7 @@ void R128SetupGenericConnectors(ScrnInfoPtr pScrn, R128OutputType *otypes)
     } else if (!pR128Ent->HasCRTC2) {
         otypes[0] = OUTPUT_DVI;
         otypes[1] = OUTPUT_NONE;
-	return;
+        return;
     }
 
     otypes[0] = OUTPUT_LVDS;
@@ -474,7 +474,7 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn)
     for (i = 0; i < R128_MAX_BIOS_CONNECTOR; i++) {
         if (otypes[i] == OUTPUT_NONE) continue;
 
-	R128I2CBusRec i2c;
+        R128I2CBusRec i2c;
         R128OutputPrivatePtr r128_output;
 
         r128_output = xnfcalloc(sizeof(R128OutputPrivateRec), 1);
@@ -496,11 +496,11 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn)
         output->interlaceAllowed = TRUE;
         output->doubleScanAllowed = TRUE;
         output->driver_private = r128_output;
-	output->possible_clones = 0;
-	if (otypes[i] == OUTPUT_LVDS || !pR128Ent->HasCRTC2)
-	    output->possible_crtcs = 1;
-	else
-	    output->possible_crtcs = 2;
+        output->possible_clones = 0;
+        if (otypes[i] == OUTPUT_LVDS || !pR128Ent->HasCRTC2)
+            output->possible_crtcs = 1;
+        else
+            output->possible_crtcs = 2;
 
         if (otypes[i] != OUTPUT_LVDS && info->DDC) {
             i2c.ddc_reg      = R128_GPIO_MONID;


More information about the xorg-commit mailing list