[Openchrome-devel] xf86-video-openchrome: 3 commits - configure.ac src/via_fp.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Wed May 24 00:19:34 UTC 2017


 configure.ac |    2 
 src/via_fp.c |  120 +++++++++++++++++++++++------------------------------------
 2 files changed, 49 insertions(+), 73 deletions(-)

New commits:
commit be5a9f9a69ec3a98c7056a7940668eeb4edeef1b
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue May 23 17:18:51 2017 -0700

    Version bumped to 0.6.120
    
    This version regained the ability for FP to obtain EDID via I2C bus in
    order to determine the supported screen resolution. This functionality
    has been disabled since Version 0.6.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index a2cb667..d7c71a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.6.119],
+        [0.6.120],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 66cc6e4185c18923d0dd71ce8a1f11a04fa62ae9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue May 23 17:14:25 2017 -0700

    Removing ViaPanelGetSizeFromDDCv1
    
    This function is no longer needed.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_fp.c b/src/via_fp.c
index a251b1f..311916f 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -986,65 +986,6 @@ ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon,
     return FALSE;
 }
 
-static Bool
-ViaPanelGetSizeFromDDCv1(xf86OutputPtr output, int *width, int *height)
-{
-    ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-    xf86MonPtr pMon;
-
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered VIAGetPanelSizeFromDDCv1.\n"));
-
-    if (!pVia->pI2CBus2) {
-        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                    "I2C Bus 2 does not exist.\n");
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting VIAGetPanelSizeFromDDCv1.\n"));
-        return FALSE;
-    }
-
-    if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) {
-        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                    "I2C device on I2C Bus 2 does not support EDID.\n");
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting VIAGetPanelSizeFromDDCv1.\n"));
-        return FALSE;
-    }
-
-    /* Probe I2C Bus 2 to see if a flat panel is connected. */
-    xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                "Probing for a flat panel on I2C Bus 2.\n");
-    pMon = xf86OutputGetEDID(output, pVia->pI2CBus2);
-    if (pMon && DIGITAL(pMon->features.input_type)) {
-        xf86OutputSetEDID(output, pMon);
-        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                    "Detected a flat panel on I2C Bus 2.\n");
-    } else {
-        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                    "Did not detect a flat panel on I2C Bus 2.\n");
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting VIAGetPanelSizeFromDDCv1.\n"));
-        return FALSE;
-
-    }
-
-    if (!ViaPanelGetSizeFromEDID(pScrn, pMon, width, height)) {
-        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                    "Unable to obtain panel size from EDID information.\n");
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting VIAGetPanelSizeFromDDCv1.\n"));
-        return FALSE;
-    }
-
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "VIAGetPanelSizeFromDDCv1: (%d X %d)\n",
-                        *width, *height));
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting VIAGetPanelSizeFromDDCv1.\n"));
-    return TRUE;
-}
-
 /*
  * Gets the native panel resolution from scratch pad registers.
  */
commit 92814b8acbc2f1946cbcc70a8136f5bf9afd6fef
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue May 23 16:56:59 2017 -0700

    Replaced via_lvds_detect with via_fp_detect
    
    Regained the ability for FP to obtain EDID in order to determine the
    supported screen resolution. This functionality has been disabled
    since commit bfb41b507b9f7766e677966ca711b134d084498a.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_fp.c b/src/via_fp.c
index 8e9c0ef..a251b1f 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -1421,15 +1421,17 @@ via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 }
 
 static xf86OutputStatus
-via_lvds_detect(xf86OutputPtr output)
+via_fp_detect(xf86OutputPtr output)
 {
-    xf86OutputStatus status = XF86OutputStatusDisconnected;
     ScrnInfoPtr pScrn = output->scrn;
+    xf86MonPtr pMon;
+    xf86OutputStatus status = XF86OutputStatusDisconnected;
+    I2CBusPtr pI2CBus;
     VIAPtr pVia = VIAPTR(pScrn);
-    VIAFPPtr pVIAFP = output->driver_private;
+    VIAFPPtr pVIAFP = (VIAFPPtr) output->driver_private;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered via_lvds_detect.\n"));
+                        "Entered via_fp_detect.\n"));
 
     /* Hardcode panel size for the OLPC XO-1.5. */
     if (pVia->IsOLPCXO15) {
@@ -1441,17 +1443,50 @@ via_lvds_detect(xf86OutputPtr output)
         goto exit;
     }
 
-    /* For now, FP detection code will not scan the I2C bus
-     * in order to obtain EDID since it is often used by DVI
-     * as well. Hence, reading off the CRTC scratch pad register
-     * supplied by the VGA BIOS is the only method available
-     * to figure out the FP native screen resolution. */
-    viaLVDSGetFPInfoFromScratchPad(output);
-    status = XF86OutputStatusConnected;
+    if (pVIAFP->i2cBus & VIA_I2C_BUS2) {
+        pI2CBus = pVia->pI2CBus2;
+    } else if (pVIAFP->i2cBus & VIA_I2C_BUS3) {
+        pI2CBus = pVia->pI2CBus3;
+    } else {
+        pI2CBus = NULL;
+    }
+
+    if (pI2CBus) {
+        pMon = xf86OutputGetEDID(output, pI2CBus);
+        if (pMon && DIGITAL(pMon->features.input_type)) {
+            xf86OutputSetEDID(output, pMon);
+            xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+                        "Detected a flat panel.\n");
+            if (!ViaPanelGetSizeFromEDID(pScrn, pMon, &pVIAFP->NativeWidth, &pVIAFP->NativeHeight)) {
+                xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                            "Unable to obtain panel size from EDID.\n");
+                goto exit;
+            }
+
+            status = XF86OutputStatusConnected;
+        } else {
+            xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+                        "Could not obtain EDID from a flat "
+                        "panel, but will obtain flat panel "
+                        "information from scratch pad register.\n");
+
+            /* For FP without I2C bus connection, CRTC scratch pad
+             * register supplied by the VGA BIOS is the only method
+             * available to figure out the FP native screen resolution. */
+            viaLVDSGetFPInfoFromScratchPad(output);
+            status = XF86OutputStatusConnected;
+        }
+    } else {
+        /* For FP without I2C bus connection, CRTC scratch pad
+         * register supplied by the VGA BIOS is the only method
+         * available to figure out the FP native screen resolution. */
+        viaLVDSGetFPInfoFromScratchPad(output);
+        status = XF86OutputStatusConnected;
+    }
 
 exit:
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting via_lvds_detect.\n"));
+                        "Exiting via_fp_detect.\n"));
     return status;
 }
 
@@ -1549,7 +1584,7 @@ static const xf86OutputFuncsRec via_fp_funcs = {
     .prepare            = via_lvds_prepare,
     .commit             = via_lvds_commit,
     .mode_set           = via_lvds_mode_set,
-    .detect             = via_lvds_detect,
+    .detect             = via_fp_detect,
     .get_modes          = via_lvds_get_modes,
 #ifdef RANDR_12_INTERFACE
     .set_property       = via_lvds_set_property,


More information about the Openchrome-devel mailing list