[Openchrome-devel] xf86-video-openchrome: 21 commits - configure.ac src/via_analog.c src/via_display.c src/via_lvds.c src/via_memcpy.c src/via_mode.h src/via_outputs.c src/via_tv.c src/via_ums.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Thu Aug 25 10:16:34 UTC 2016


 configure.ac      |    2 
 src/via_analog.c  |   78 ++-------
 src/via_display.c |   58 ++++---
 src/via_lvds.c    |  433 +++++++++++++++++++++++-------------------------------
 src/via_memcpy.c  |    1 
 src/via_mode.h    |   64 -------
 src/via_outputs.c |   34 ----
 src/via_tv.c      |   18 --
 src/via_ums.c     |    2 
 9 files changed, 254 insertions(+), 436 deletions(-)

New commits:
commit 60b8773e1d7a25ac0f62331d2238b90b0b88404e
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Aug 25 03:15:40 2016 -0700

    Version bumped to 0.5.139
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index ebf5b36..ad96eed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.5.138],
+        [0.5.139],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 433d2a06bd169e93ed38d1cd06552697752e7dc1
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 18:21:52 2016 -0700

    Removing ViaDisplayDisableDVO from via_tv.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tv.c b/src/via_tv.c
index 09ca4d2..56e943b 100644
--- a/src/via_tv.c
+++ b/src/via_tv.c
@@ -221,23 +221,6 @@ ViaDisplayEnableDVO(ScrnInfoPtr pScrn, int port)
 }
 
 static void
-ViaDisplayDisableDVO(ScrnInfoPtr pScrn, int port)
-{
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
-
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisplayDisableDVO, port: %d\n",
-                     port));
-    switch (port) {
-    case VIA_DI_PORT_DVP0:
-        ViaSeqMask(hwp, 0x1E, 0x00, 0xC0);
-        break;
-    case VIA_DI_PORT_DVP1:
-        ViaSeqMask(hwp, 0x1E, 0x00, 0x30);
-        break;
-    }
-}
-
-static void
 ViaDisplaySetStreamOnDVO(ScrnInfoPtr pScrn, int port, int iga)
 {
     vgaHWPtr hwp = VGAHWPTR(pScrn);
commit 90077cd187657b5207a98be1361878b842a36318
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 18:16:50 2016 -0700

    Moving ViaPrintMode from via_outputs.c to via_display.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index eac9e64..d982161 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -31,6 +31,41 @@
 
 #include "via_driver.h"
 
+
+static void
+ViaPrintMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+    xf86PrintModeline(pScrn->scrnIndex, mode);
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHDisplay: 0x%x\n",
+               mode->CrtcHDisplay);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankStart: 0x%x\n",
+               mode->CrtcHBlankStart);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncStart: 0x%x\n",
+               mode->CrtcHSyncStart);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncEnd: 0x%x\n",
+               mode->CrtcHSyncEnd);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankEnd: 0x%x\n",
+               mode->CrtcHBlankEnd);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHTotal: 0x%x\n",
+               mode->CrtcHTotal);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSkew: 0x%x\n",
+               mode->CrtcHSkew);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVDisplay: 0x%x\n",
+               mode->CrtcVDisplay);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankStart: 0x%x\n",
+               mode->CrtcVBlankStart);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncStart: 0x%x\n",
+               mode->CrtcVSyncStart);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncEnd: 0x%x\n",
+               mode->CrtcVSyncEnd);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankEnd: 0x%x\n",
+               mode->CrtcVBlankEnd);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVTotal: 0x%x\n",
+               mode->CrtcVTotal);
+
+}
+
 /*
  * Controls IGA1 DPMS State.
  */
@@ -3012,6 +3047,7 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     /* Disable IGA1 */
     ViaSeqMask(hwp, 0x59, 0x00, 0x80);
 
+    ViaPrintMode(pScrn, adjusted_mode);
     viaIGA1SetDisplayRegister(pScrn, adjusted_mode);
     ViaSetPrimaryFIFO(pScrn, adjusted_mode);
 
@@ -3440,6 +3476,7 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGA2Init(pScrn);
     ViaCRTCInit(pScrn);
 
+    ViaPrintMode(pScrn, adjusted_mode);
     viaIGA2SetDisplayRegister(pScrn, adjusted_mode);
     ViaSetSecondaryFIFO(pScrn, adjusted_mode);
     pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode);
diff --git a/src/via_outputs.c b/src/via_outputs.c
index ca85839..e6cc824 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -46,40 +46,6 @@
  */
 #include "via_mode.h"
 
-static void
-ViaPrintMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
-    xf86PrintModeline(pScrn->scrnIndex, mode);
-
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHDisplay: 0x%x\n",
-               mode->CrtcHDisplay);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankStart: 0x%x\n",
-               mode->CrtcHBlankStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncStart: 0x%x\n",
-               mode->CrtcHSyncStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncEnd: 0x%x\n",
-               mode->CrtcHSyncEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankEnd: 0x%x\n",
-               mode->CrtcHBlankEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHTotal: 0x%x\n",
-               mode->CrtcHTotal);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSkew: 0x%x\n",
-               mode->CrtcHSkew);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVDisplay: 0x%x\n",
-               mode->CrtcVDisplay);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankStart: 0x%x\n",
-               mode->CrtcVBlankStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncStart: 0x%x\n",
-               mode->CrtcVSyncStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncEnd: 0x%x\n",
-               mode->CrtcVSyncEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankEnd: 0x%x\n",
-               mode->CrtcVBlankEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVTotal: 0x%x\n",
-               mode->CrtcVTotal);
-
-}
-
 /*
  * Sets IGA1 or IGA2 as the display output source for DVP0
  * (Digital Video Port) interface.
commit 28c2e12f89b81bf345d6ca3740a4c08197bdc3fb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 18:12:13 2016 -0700

    Removing ViaPrintMode from via_analog.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index ea82f7d..ed73194 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -41,40 +41,6 @@
 #include <unistd.h>
 
 
-static void
-ViaPrintMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
-    xf86PrintModeline(pScrn->scrnIndex, mode);
-
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHDisplay: 0x%x\n",
-               mode->CrtcHDisplay);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankStart: 0x%x\n",
-               mode->CrtcHBlankStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncStart: 0x%x\n",
-               mode->CrtcHSyncStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSyncEnd: 0x%x\n",
-               mode->CrtcHSyncEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHBlankEnd: 0x%x\n",
-               mode->CrtcHBlankEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHTotal: 0x%x\n",
-               mode->CrtcHTotal);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcHSkew: 0x%x\n",
-               mode->CrtcHSkew);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVDisplay: 0x%x\n",
-               mode->CrtcVDisplay);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankStart: 0x%x\n",
-               mode->CrtcVBlankStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncStart: 0x%x\n",
-               mode->CrtcVSyncStart);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVSyncEnd: 0x%x\n",
-               mode->CrtcVSyncEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVBlankEnd: 0x%x\n",
-               mode->CrtcVBlankEnd);
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CrtcVTotal: 0x%x\n",
-               mode->CrtcVTotal);
-
-}
-
 /*
  * Enables or disables analog VGA output by controlling DAC
  * (Digital to Analog Converter) output state.
commit e9b14c38ac4b36e62d2dbe66bee06cd9b3be9719
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:58:35 2016 -0700

    Discontinued ViaPanelLookUpModeIndex
    
    This function is located inside via_lvds.c.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index 0a1b750..fa81adb 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -886,23 +886,6 @@ viaSetLVDSOutput(ScrnInfoPtr pScrn)
                         "Exiting viaSetLVDSOutput.\n"));
 }
 
-static int
-ViaPanelLookUpModeIndex(int width, int height)
-{
-    int i, index = VIA_PANEL_INVALID;
-    int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec);
-
-
-    for (i = 0; i < length; i++) {
-        if (ViaPanelNativeModes[i].Width == width
-            && ViaPanelNativeModes[i].Height == height) {
-            index = i;
-            break;
-        }
-    }
-    return index;
-}
-
 static void
 via_lvds_create_resources(xf86OutputPtr output)
 {
commit 140a0c726aef13f3a7cb7354dca6499e3fdbd1ba
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:56:22 2016 -0700

    Removed a compilation warning from viaVidCopyInit
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_memcpy.c b/src/via_memcpy.c
index 8ef0e9f..85db0ef 100644
--- a/src/via_memcpy.c
+++ b/src/via_memcpy.c
@@ -528,7 +528,6 @@ viaVidCopyInit(char *copyType, ScreenPtr pScreen)
     McFuncData *curData;
     FILE *cpuInfoFile;
     double cpuFreq;
-    VIAPtr pVia = VIAPTR(pScrn);
 
     if (NULL == (cpuInfoFile = fopen("/proc/cpuinfo", "r"))) {
         return libc_YUV42X;
commit 4243c19abe933efe7abdfef979ae7eeece29c91a
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:53:32 2016 -0700

    Removed a compilation warning from via_tv_mode_valid
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tv.c b/src/via_tv.c
index 276543c..09ca4d2 100644
--- a/src/via_tv.c
+++ b/src/via_tv.c
@@ -176,7 +176,6 @@ static int
 via_tv_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
 {
     ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
     int ret = MODE_OK;
 
     if (!ViaModeDotClockTranslate(pScrn, pMode))
commit 1a680374b48c2b8914f028f2c7e06ed1c41b3387
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:45:34 2016 -0700

    Version bumped to 0.5.138
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index c5c0d1b..ebf5b36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.5.137],
+        [0.5.138],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit dd809da78fd302bf5c8095e6a7164052b6f170a1
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:43:58 2016 -0700

    Major rewriting of via_lvds_detect callback function
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index a6f1055..0a1b750 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -1070,85 +1070,52 @@ static xf86OutputStatus
 via_lvds_detect(xf86OutputPtr output)
 {
     xf86OutputStatus status = XF86OutputStatusDisconnected;
-    ViaPanelInfoPtr panel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
     vgaHWPtr hwp = VGAHWPTR(pScrn);
-    CARD8 cr3b = 0x00;
-    CARD8 cr3b_mask = 0x00;
+    VIAPtr pVia = VIAPTR(pScrn);
+    ViaPanelInfoPtr panel = output->driver_private;
+    CARD8 cr3b;
+    CARD8 cr3b_mask;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered via_lvds_detect.\n"));
 
-    /* Hardcode panel size for the XO */
+    /* Hardcode panel size for the OLPC XO-1.5. */
     if (pVia->IsOLPCXO15) {
+        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+                    "Setting up OLPC XO-1.5 flat panel.\n");
         panel->NativeWidth = 1200;
         panel->NativeHeight = 900;
         status = XF86OutputStatusConnected;
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                            "Setting up OLPC XO-1.5 flat panel.\n"));
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                            "Detected Flat Panel Screen Resolution: "
-                            "%dx%d\n",
-                            panel->NativeWidth, panel->NativeHeight));
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting via_lvds_detect.\n"));
-        return status;
+        goto exit;
     }
 
-    if (!panel->NativeWidth || !panel->NativeHeight) {
-        int width, height;
-        Bool ret;
-
-        /* Disable reading off EDID from I2C bus 2 since it is often
-         * used by DVI as well. For now, this is how DVI and LVDS FP will
-         * coexist. */
+    /* Disable reading off EDID from I2C bus 2 since it is often
+     * used by DVI as well. For now, this is how DVI and LVDS FP will
+     * coexist. */
 /*
-        ret = ViaPanelGetSizeFromDDCv1(output, &width, &height);
+    if (ViaPanelGetSizeFromDDCv1(output, &width, &height)) {
 */
-        ret = FALSE;
-        if (ret) {
-            panel->NativeModeIndex = ViaPanelLookUpModeIndex(width, height);
-            DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                                "ViaPanelLookUpModeIndex: Width %d, "
-                                "Height %d, NativeModeIndex%d\n", 
-                                width, height, panel->NativeModeIndex));
-            if (panel->NativeModeIndex != VIA_PANEL_INVALID) {
-                panel->NativeWidth = width;
-                panel->NativeHeight = height;
-                status = XF86OutputStatusConnected;
-            }
+    if (FALSE) {
+        status = XF86OutputStatusConnected;
+    } else {
+        /* Apparently this is the way VIA Technologies passes */
+        /* the presence of a flat panel to the device driver */
+        /* via BIOS setup. */
+        if (pVia->Chipset == VIA_CLE266) {
+            cr3b_mask = 0x08;
         } else {
-            /* Apparently this is the way VIA Technologies passes */
-            /* the presence of a flat panel to the device driver */
-            /* via BIOS setup. */
-            if (pVia->Chipset == VIA_CLE266) {
-                cr3b_mask = 0x08;
-            } else {
-                cr3b_mask = 0x02;
-            }            
-
-            cr3b = hwp->readCrtc(hwp, 0x3B) & cr3b_mask;
-
-            if (cr3b) {
-                viaLVDSGetFPInfoFromScratchPad(output);
-
-                if (panel->NativeWidth && panel->NativeHeight) {
-                    status = XF86OutputStatusConnected;
-                }
-            }
+            cr3b_mask = 0x02;
         }
 
-        if (status == XF86OutputStatusConnected) {
-            DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                                "Detected Flat Panel Screen Resolution: "
-                                "%dx%d\n",
-                                panel->NativeWidth, panel->NativeHeight));
+        cr3b = hwp->readCrtc(hwp, 0x3B) & cr3b_mask;
+        if (cr3b) {
+            viaLVDSGetFPInfoFromScratchPad(output);
+            status = XF86OutputStatusConnected;
         }
-    } else {
-        status = XF86OutputStatusConnected;
     }
 
+exit:
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting via_lvds_detect.\n"));
     return status;
commit dc57b925d0b75bdd43635b07783d3af968650092
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:13:03 2016 -0700

    Added missing RANDR_13_INTERFACE conditional compilation
    
    It was added to via_analog_get_property callback function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index 12f26f6..ea82f7d 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -345,7 +345,9 @@ via_analog_set_property(xf86OutputPtr output, Atom property,
 {
     return TRUE;
 }
+#endif
 
+#ifdef RANDR_13_INTERFACE
 static Bool
 via_analog_get_property(xf86OutputPtr output, Atom property)
 {
commit f3ab6ae7e1e2803a9bca84f0bf9a6bb4db058a86
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:10:40 2016 -0700

    Rearranging code inside via_analog.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index 1ce1d98..12f26f6 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -171,21 +171,6 @@ via_analog_create_resources(xf86OutputPtr output)
 {
 }
 
-#ifdef RANDR_12_INTERFACE
-static Bool
-via_analog_set_property(xf86OutputPtr output, Atom property,
-                        RRPropertyValuePtr value)
-{
-    return TRUE;
-}
-
-static Bool
-via_analog_get_property(xf86OutputPtr output, Atom property)
-{
-    return FALSE;
-}
-#endif
-
 static void
 via_analog_dpms(xf86OutputPtr output, int mode)
 {
@@ -353,6 +338,21 @@ via_analog_detect(xf86OutputPtr output)
     return status;
 }
 
+#ifdef RANDR_12_INTERFACE
+static Bool
+via_analog_set_property(xf86OutputPtr output, Atom property,
+                        RRPropertyValuePtr value)
+{
+    return TRUE;
+}
+
+static Bool
+via_analog_get_property(xf86OutputPtr output, Atom property)
+{
+    return FALSE;
+}
+#endif
+
 static void
 via_analog_destroy(xf86OutputPtr output)
 {
@@ -360,12 +360,6 @@ via_analog_destroy(xf86OutputPtr output)
 
 static const xf86OutputFuncsRec via_analog_funcs = {
     .create_resources   = via_analog_create_resources,
-#ifdef RANDR_12_INTERFACE
-    .set_property       = via_analog_set_property,
-#endif
-#ifdef RANDR_13_INTERFACE
-    .get_property       = via_analog_get_property,
-#endif
     .dpms               = via_analog_dpms,
     .save               = via_analog_save,
     .restore            = via_analog_restore,
@@ -376,6 +370,12 @@ static const xf86OutputFuncsRec via_analog_funcs = {
     .mode_set           = via_analog_mode_set,
     .detect             = via_analog_detect,
     .get_modes          = xf86OutputGetEDIDModes,
+#ifdef RANDR_12_INTERFACE
+    .set_property       = via_analog_set_property,
+#endif
+#ifdef RANDR_13_INTERFACE
+    .get_property       = via_analog_get_property,
+#endif
     .destroy            = via_analog_destroy,
 };
 
commit fe530e16e79219024cc3dd08854de73be5443dc0
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 17:04:51 2016 -0700

    Removed more legacy panel table code
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index a4a1d1d..a6f1055 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -689,29 +689,6 @@ ViaPanelGetSizeFromDDCv1(xf86OutputPtr output, int *width, int *height)
     return TRUE;
 }
 
-static Bool
-ViaGetResolutionIndex(ScrnInfoPtr pScrn, ViaPanelInfoPtr Panel,
-                      DisplayModePtr mode)
-{
-    int i;
-
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                     "ViaGetResolutionIndex: Looking for %dx%d\n",
-                     mode->CrtcHDisplay, mode->CrtcVDisplay));
-    for (i = 0; ViaResolutionTable[i].Index != VIA_RES_INVALID; i++) {
-        if ((ViaResolutionTable[i].X == mode->CrtcHDisplay)
-            && (ViaResolutionTable[i].Y == mode->CrtcVDisplay)) {
-            Panel->ResolutionIndex = ViaResolutionTable[i].Index;
-            DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaGetResolutionIndex:"
-                             " %d\n", Panel->ResolutionIndex));
-            return TRUE;
-        }
-    }
-
-    Panel->ResolutionIndex = VIA_RES_INVALID;
-    return FALSE;
-}
-
 /*
  * Gets the native panel resolution from scratch pad registers.
  */
diff --git a/src/via_mode.h b/src/via_mode.h
index f0c6a78..5e18266 100644
--- a/src/via_mode.h
+++ b/src/via_mode.h
@@ -132,70 +132,6 @@ static struct ViaDotClock {
 #define VIA_RES_1200X900   23
 #define VIA_RES_INVALID  0xFF
 
-/*
- * simple lookuptable for PanelIndex selection
- */
-
-static struct {
-    int Index;
-    int PanelIndex;
-    int X;
-    int Y;
-} ViaResolutionTable[] = {
-    {VIA_RES_640X480,   VIA_PANEL6X4,       640,  480},
-    {VIA_RES_800X600,   VIA_PANEL8X6,       800,  600},
-    {VIA_RES_1024X768,  VIA_PANEL10X7,     1024,  768},
-    {VIA_RES_1152X864,  VIA_PANEL_INVALID, 1152,  864},
-    {VIA_RES_1280X1024, VIA_PANEL12X10,    1280, 1024},
-    {VIA_RES_1600X1200, VIA_PANEL16X12,    1600, 1200},
-    {VIA_RES_1440X1050, VIA_PANEL_INVALID, 1440, 1050},
-    {VIA_RES_1280X768,  VIA_PANEL12X7,     1280,  768},
-    {VIA_RES_1280X800,  VIA_PANEL12X8,     1280,  800},
-    {VIA_RES_1280X960,  VIA_PANEL_INVALID, 1280,  960},
- /* {VIA_RES_1920X1440, VIA_PANEL_INVALID, 1920, 1140}, */
-    {VIA_RES_848X480,   VIA_PANEL_INVALID,  848,  480},
-    {VIA_RES_1400X1050, VIA_PANEL14X10,    1400, 1050},
-    {VIA_RES_720X480,   VIA_PANEL_INVALID,  720,  480},
-    {VIA_RES_720X576,   VIA_PANEL_INVALID,  720,  576},
-    {VIA_RES_1024X512,  VIA_PANEL_INVALID, 1024,  512},
-    {VIA_RES_856X480,   VIA_PANEL_INVALID,  856,  480},
-    {VIA_RES_1024X576,  VIA_PANEL_INVALID, 1024,  576},
-    {VIA_RES_800X480,   VIA_PANEL8X4,	    800,  480},
-    {VIA_RES_1200X900,  VIA_PANEL12X9,     1200,  900},
-    {VIA_RES_INVALID,   VIA_PANEL_INVALID,    0,    0}
-};
-
-static struct {
-    CARD16 Width;
-    CARD16 Height;
-    CARD8  mode_8b;
-    CARD8  mode_16b;
-    CARD8  mode_32b;
-} ViaVesaModes[] = {
-    {  400,  300, 0x22, 0x23, 0x24 },
-    {  512,  384, 0x25, 0x26, 0x27 },
-    {  640,  400, 0x30, 0x2E, 0x2F },
-    {  640,  480, 0x31, 0x33, 0x34 },
-    {  800,  600, 0x36, 0x38, 0x39 },
-    { 1024,  768, 0x3B, 0x3D, 0x3E },
-    { 1152,  864, 0x40, 0x42, 0x43 },
-    { 1280, 1024, 0x45, 0x47, 0x48 },
-    { 1600, 1200, 0x4A, 0x4C, 0x4D },
-    { 1440, 1050, 0x50, 0x52, 0x53 },
-    { 1280,  768, 0x54, 0x56, 0x57 },
-    { 1280,  960, 0x58, 0x5A, 0x5B },
-    {  320,  200, 0x5C, 0x5D, 0x5E },
-    { 1920, 1440, 0x60, 0x61, 0x62 },
-    {  848,  480, 0x63, 0x64, 0x65 },
-    { 1400, 1050, 0x66, 0x67, 0x68 },
-    {  720,  480, 0x70, 0x71, 0x72 },
-    {  720,  576, 0x73, 0x74, 0x75 },
-    { 1024,  512, 0x76, 0x77, 0x78 },
-    {  856,  480, 0x79, 0x7A, 0x7B },
-    {  320,  240, 0x7C, 0x7D, 0x7E },
-    {    0,    0,    0,    0,    0 },
-};
-
 #define     VIA_BIOS_REG_LCD_MAX_NUM        48
 #define     VIA_BIOS_NUM_LCD_SUPPORT_MASK   8
 #define     VIA_BIOS_NUM_PANEL              7
commit 37147d9e42cc6a2a8935e36b7f52ee85b60e51db
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 16:39:51 2016 -0700

    Removing a compilation warning from via_ums.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.c b/src/via_ums.c
index 4820c3c..95b9e5b 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -186,7 +186,7 @@ viaMapMMIO(ScrnInfoPtr pScrn)
 
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                "Mapping the frame buffer at address 0x%lX with "
-               "size %u KB.\n",
+               "size %lu KB.\n",
                pVia->FrameBufferBase, pVia->videoRambytes / 1024);
 
 #ifdef HAVE_PCIACCESS
commit 24d8ddc7ea1639250bbea0d15969726ba1ab0c15
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 16:23:45 2016 -0700

    Version bumped to 0.5.137
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index c62e027..c5c0d1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.5.136],
+        [0.5.137],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 6b66a9ec3c0c3caf75e804f0abe19871df014c4b
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 16:21:22 2016 -0700

    Fixing FP (Flat Panel) display controller to IGA2
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index 891d4c0..a4a1d1d 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -1330,10 +1330,12 @@ via_lvds_init(ScrnInfoPtr pScrn)
     if (output)  {
         output->driver_private = Panel;
 
-        if (pVia->Chipset == VIA_VX900)
-            output->possible_crtcs = 0x3;
-        else
-            output->possible_crtcs = 0x2;
+        /* While there are two (2) display controllers registered with the
+         * X.Org Server, it is often desirable to fix FP (Flat Panel) to
+         * IGA2 since only IGA2 contains panel resolution scaling
+         * functionality. IGA1 does not have this. */
+        output->possible_crtcs = 1 << 1;
+
         output->possible_clones = 0;
         output->interlaceAllowed = FALSE;
         output->doubleScanAllowed = FALSE;
commit 87319d7d54fa548ab48b1b156a43caa3e588a0e9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 16:15:22 2016 -0700

    Removed unused variable and comment warning from via_lvds.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index ed8f463..891d4c0 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -118,7 +118,7 @@ viaLVDS1SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaLVDS1SetDisplaySource.\n"));
 
-    /* Set LVDS1 integrated LVDS transmitter display output source.
+    /* Set LVDS1 integrated LVDS transmitter display output source. */
     /* 3X5.99[4] - LVDS Channel 1 Data Source Selection
      *             0: Primary Display
      *             1: Secondary Display */
@@ -145,7 +145,7 @@ viaLVDS2SetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaLVDS2SetDisplaySource.\n"));
 
-    /* Set LVDS2 integrated LVDS transmitter display output source.
+    /* Set LVDS2 integrated LVDS transmitter display output source. */
     /* 3X5.97[4] - LVDS Channel 2 Data Source Selection
      *             0: Primary Display
      *             1: Secondary Display */
@@ -170,7 +170,7 @@ viaLVDS2SetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaLVDS2SetDelayTap.\n"));
 
-    /* Set LVDS2 delay tap.
+    /* Set LVDS2 delay tap. */
     /* 3X5.97[3:0] - LVDS2 Delay Tap */
     ViaCrtcMask(hwp, 0x97, delayTap, 0x0F);
 
@@ -195,7 +195,7 @@ viaDFPLowSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaDFPLowSetDisplaySource.\n"));
 
-    /* Set DFP Low display output source.
+    /* Set DFP Low display output source. */
     /* 3X5.99[4] - DFP Low Data Source Selection
      *             0: Primary Display
      *             1: Secondary Display */
@@ -221,7 +221,7 @@ viaDFPHighSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaDFPHighSetDisplaySource.\n"));
 
-    /* Set DFP High display output source.
+    /* Set DFP High display output source. */
     /* 3X5.97[4] - DFP High Data Source Selection
      *             0: Primary Display
      *             1: Secondary Display */
@@ -245,7 +245,7 @@ viaDFPLowSetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaDFPLowSetDelayTap.\n"));
 
-    /* Set DFP Low interface delay tap.
+    /* Set DFP Low interface delay tap. */
     /* 3X5.99[3:0] - DFP Low Delay Tap */
     ViaCrtcMask(hwp, 0x99, delayTap, 0x0F);
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -267,7 +267,7 @@ viaDFPHighSetDelayTap(ScrnInfoPtr pScrn, CARD8 delayTap)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaDFPHighSetDelayTap.\n"));
 
-    /* Set DFP High interface delay tap.
+    /* Set DFP High interface delay tap. */
     /* 3X5.97[3:0] - DFP High Delay Tap */
     ViaCrtcMask(hwp, 0x97, delayTap, 0x0F);
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -983,8 +983,6 @@ static int
 via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
 {
     ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-
     ViaPanelInfoPtr Panel = output->driver_private;
 
     if (Panel->NativeWidth < pMode->HDisplay ||
@@ -1291,7 +1289,6 @@ via_lvds_init(ScrnInfoPtr pScrn)
     ViaPanelInfoPtr Panel = (ViaPanelInfoPtr) xnfcalloc(sizeof(ViaPanelInfoRec), 1);
     OptionInfoPtr  Options = xnfalloc(sizeof(ViaPanelOptions));
     MessageType from = X_DEFAULT;
-    const char *s = NULL;
     VIAPtr pVia = VIAPTR(pScrn);
     xf86OutputPtr output = NULL;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
commit d6ea17c6a701c31cdb263a595ec9e09c9e59a21d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 15:40:59 2016 -0700

    Removed the last known compilation warnings from via_display.c.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index 0d1a8de..eac9e64 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3046,7 +3046,6 @@ iga1_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
     ScrnInfoPtr pScrn = crtc->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
     VIAPtr pVia = VIAPTR(pScrn);
-    int SR1A, SR1B, CR67, CR6A;
     LOCO colors[size];
     int i;
 
@@ -3071,12 +3070,6 @@ iga1_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
         VIALoadRgbLut(pScrn, 0, size, colors);
 
     } else {
-
-        SR1A = hwp->readSeq(hwp, 0x1A);
-        SR1B = hwp->readSeq(hwp, 0x1B);
-        CR67 = hwp->readCrtc(hwp, 0x67);
-        CR6A = hwp->readCrtc(hwp, 0x6A);
-
         for (i = 0; i < size; i++) {
             hwp->writeDacWriteAddr(hwp, i);
             hwp->writeDacData(hwp, colors[i].red);
commit 95f23d34819debb6beb008ce4e67af752614450c
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Aug 24 15:18:10 2016 -0700

    Removed most compilation warnings inside via_display.c
    
    A few more remain.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index 4a25cbf..0d1a8de 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -2832,8 +2832,6 @@ static void
 iga1_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-    VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_dpms.\n"));
@@ -2871,7 +2869,6 @@ iga1_crtc_save(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
-    VIAPtr pVia = VIAPTR(pScrn);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_save.\n"));
@@ -2891,8 +2888,6 @@ iga1_crtc_restore(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
-    VIAPtr pVia = VIAPTR(pScrn);
-    CARD8 tmp;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_restore.\n"));
@@ -2972,7 +2967,6 @@ static void
 iga1_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_set_origin.\n"));
@@ -3305,8 +3299,6 @@ static void
 iga2_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-    VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga2_crtc_dpms.\n"));
@@ -3337,8 +3329,6 @@ static void
 iga2_crtc_save(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
-    VIAPtr pVia = VIAPTR(pScrn);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga2_crtc_save.\n"));
@@ -3353,9 +3343,6 @@ static void
 iga2_crtc_restore(xf86CrtcPtr crtc)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
-    VIAPtr pVia = VIAPTR(pScrn);
-    CARD8 tmp;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga2_crtc_restore.\n"));
@@ -3422,7 +3409,6 @@ static void
 iga2_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga2_crtc_set_origin.\n"));
commit 490bb555517cb045a126a4b1eab7d29ac61cdf88
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Aug 23 16:51:57 2016 -0700

    Set LVDS2 output format from via_lvds_mode_set
    
    Rather than setting LVDS2 output format from viaSetLVDSOutput
    function, it will now be set from via_lvds_mode_set callback
    function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index 3914060..ed8f463 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -902,9 +902,6 @@ viaSetLVDSOutput(ScrnInfoPtr pScrn)
         /* Do not power down LVDS Channel 2. */
         /* For now, use OPENLDI mode for LVDS Channel 2. */
         ViaCrtcMask(hwp, 0xD2, 0x01, 0x41);
-
-        /* Sequential mode for LVDS Channel 2 output format. */
-        ViaCrtcMask(hwp, 0xD4, 0x80, 0x80);
         break;
     }
 
@@ -1084,6 +1081,9 @@ via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 
             /* Set LVDS2 output color dithering. */
             viaLVDS2SetDithering(pScrn, Panel->useDithering ? TRUE : FALSE);
+
+            /* Set LVDS2 output format to sequential mode. */
+            viaLVDS2SetOutputFormat(pScrn, 0x01);
             break;
         default:
             break;
commit 941098ae9afae311a5ecc1ed589636ce9de03657
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Aug 23 16:20:01 2016 -0700

    Added viaLVDS2SetOutputFormat
    
    viaLVDS2SetOutputFormat function sets output format of LVDS2
    (LVDS Channel 2) integrated LVDS transmitter to rotation or
    sequential mode. This function is located inside via_lvds.c.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index 4286641..3914060 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -304,6 +304,31 @@ viaLVDS2SetDithering(ScrnInfoPtr pScrn, CARD8 ditheringStatus)
                         "Exiting viaLVDS2SetDithering.\n"));
 }
 
+/*
+ * Sets output format of LVDS2 to rotation or sequential mode.
+ */
+static void
+viaLVDS2SetOutputFormat(ScrnInfoPtr pScrn, CARD8 outputFormat)
+{
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered viaLVDS2SetOutputFormat.\n"));
+
+    /* Set LVDS2 output format. */
+    /* 3X5.D4[7] - LVDS Channel 2 Output Format
+     *             0: Rotation
+     *             1: Sequential */
+    ViaCrtcMask(hwp, 0xD4, outputFormat ? 0x80 : 0x00, 0x80);
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "LVDS2 Output Format: %s\n",
+                outputFormat ? "Sequential" : "Rotation");
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting viaLVDS2SetOutputFormat.\n"));
+}
+
 static void
 ViaLVDSSoftwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on)
 {
commit 79860b7e95218dbfe19bdc6634042d4d4809b999
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Aug 23 11:58:45 2016 -0700

    Reorganizing via_lvds.c
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_lvds.c b/src/via_lvds.c
index 3966a64..4286641 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -491,26 +491,6 @@ ViaLVDSPower(ScrnInfoPtr pScrn, Bool Power_On)
 }
 
 static void
-via_lvds_create_resources(xf86OutputPtr output)
-{
-}
-
-#ifdef RANDR_12_INTERFACE
-static Bool
-via_lvds_set_property(xf86OutputPtr output, Atom property,
-						RRPropertyValuePtr value)
-{
-    return FALSE;
-}
-
-static Bool
-via_lvds_get_property(xf86OutputPtr output, Atom property)
-{
-    return FALSE;
-}
-#endif
-
-static void
 ViaLCDPowerSequence(vgaHWPtr hwp, VIALCDPowerSeqRec Sequence)
 {
     int i;
@@ -574,54 +554,6 @@ ViaLCDPower(xf86OutputPtr output, Bool Power_On)
                         "Exiting ViaLCDPower.\n"));
 }
 
-static void
-via_lvds_dpms(xf86OutputPtr output, int mode)
-{
-    ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-
-    switch (mode) {
-    case DPMSModeOn:
-        switch (pVia->Chipset) {
-        case VIA_P4M900:
-        case VIA_CX700:
-        case VIA_VX800:
-        case VIA_VX855:
-        case VIA_VX900:
-            ViaLVDSPower(pScrn, TRUE);
-            break;
-        }
-        ViaLCDPower(output, TRUE);
-        break;
-
-    case DPMSModeStandby:
-    case DPMSModeSuspend:
-    case DPMSModeOff:
-        switch (pVia->Chipset) {
-        case VIA_P4M900:
-        case VIA_CX700:
-        case VIA_VX800:
-        case VIA_VX855:
-        case VIA_VX900:
-            ViaLVDSPower(pScrn, FALSE);
-            break;
-        }
-        ViaLCDPower(output, FALSE);
-        break;
-    }
-}
-
-static void
-via_lvds_save(xf86OutputPtr output)
-{
-}
-
-static void
-via_lvds_restore(xf86OutputPtr output)
-{
-    ViaLCDPower(output, TRUE);
-}
-
 /*
  * Try to interpret EDID ourselves.
  */
@@ -795,28 +727,6 @@ viaLVDSGetFPInfoFromScratchPad(xf86OutputPtr output)
                      "Exiting viaLVDSGetFPInfoFromScratchPad.\n"));
 }
 
-static int
-via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
-{
-    ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-
-    ViaPanelInfoPtr Panel = output->driver_private;
-
-    if (Panel->NativeWidth < pMode->HDisplay ||
-        Panel->NativeHeight < pMode->VDisplay)
-        return MODE_PANEL;
-
-    if (!Panel->Scale && Panel->NativeHeight != pMode->VDisplay &&
-         Panel->NativeWidth != pMode->HDisplay)
-        return MODE_PANEL;
-
-    if (!ViaModeDotClockTranslate(pScrn, pMode))
-        return MODE_NOCLOCK;
-
-    return MODE_OK;
-}
-
 static void
 ViaPanelCenterMode(DisplayModePtr mode, DisplayModePtr adjusted_mode)
 {
@@ -848,35 +758,6 @@ ViaPanelCenterMode(DisplayModePtr mode, DisplayModePtr adjusted_mode)
     adjusted_mode->CrtcVSyncEnd = adjusted_mode->VSyncEnd;
 }
 
-static Bool
-via_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
-					DisplayModePtr adjusted_mode)
-{
-    ViaPanelInfoPtr Panel = output->driver_private;
-
-    xf86SetModeCrtc(adjusted_mode, 0);
-    if (!Panel->Center && (mode->HDisplay < Panel->NativeWidth ||
-        mode->VDisplay < Panel->NativeHeight)) {
-        Panel->Scale = TRUE;
-    } else {
-        Panel->Scale = FALSE;
-        ViaPanelCenterMode(mode, adjusted_mode);
-    }
-    return TRUE;
-}
-
-static void
-via_lvds_prepare(xf86OutputPtr output)
-{
-    via_lvds_dpms(output, DPMSModeOff);
-}
-
-static void
-via_lvds_commit(xf86OutputPtr output)
-{
-    via_lvds_dpms(output, DPMSModeOn);
-}
-
 static void
 ViaPanelScale(ScrnInfoPtr pScrn, int resWidth, int resHeight,
               int panelWidth, int panelHeight)
@@ -1006,9 +887,130 @@ viaSetLVDSOutput(ScrnInfoPtr pScrn)
                         "Exiting viaSetLVDSOutput.\n"));
 }
 
+static int
+ViaPanelLookUpModeIndex(int width, int height)
+{
+    int i, index = VIA_PANEL_INVALID;
+    int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec);
+
+
+    for (i = 0; i < length; i++) {
+        if (ViaPanelNativeModes[i].Width == width
+            && ViaPanelNativeModes[i].Height == height) {
+            index = i;
+            break;
+        }
+    }
+    return index;
+}
+
+static void
+via_lvds_create_resources(xf86OutputPtr output)
+{
+}
+
+static void
+via_lvds_dpms(xf86OutputPtr output, int mode)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    VIAPtr pVia = VIAPTR(pScrn);
+
+    switch (mode) {
+    case DPMSModeOn:
+        switch (pVia->Chipset) {
+        case VIA_P4M900:
+        case VIA_CX700:
+        case VIA_VX800:
+        case VIA_VX855:
+        case VIA_VX900:
+            ViaLVDSPower(pScrn, TRUE);
+            break;
+        }
+        ViaLCDPower(output, TRUE);
+        break;
+
+    case DPMSModeStandby:
+    case DPMSModeSuspend:
+    case DPMSModeOff:
+        switch (pVia->Chipset) {
+        case VIA_P4M900:
+        case VIA_CX700:
+        case VIA_VX800:
+        case VIA_VX855:
+        case VIA_VX900:
+            ViaLVDSPower(pScrn, FALSE);
+            break;
+        }
+        ViaLCDPower(output, FALSE);
+        break;
+    }
+}
+
+static void
+via_lvds_save(xf86OutputPtr output)
+{
+}
+
+static void
+via_lvds_restore(xf86OutputPtr output)
+{
+    ViaLCDPower(output, TRUE);
+}
+
+static int
+via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    VIAPtr pVia = VIAPTR(pScrn);
+
+    ViaPanelInfoPtr Panel = output->driver_private;
+
+    if (Panel->NativeWidth < pMode->HDisplay ||
+        Panel->NativeHeight < pMode->VDisplay)
+        return MODE_PANEL;
+
+    if (!Panel->Scale && Panel->NativeHeight != pMode->VDisplay &&
+         Panel->NativeWidth != pMode->HDisplay)
+        return MODE_PANEL;
+
+    if (!ViaModeDotClockTranslate(pScrn, pMode))
+        return MODE_NOCLOCK;
+
+    return MODE_OK;
+}
+
+static Bool
+via_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
+                    DisplayModePtr adjusted_mode)
+{
+    ViaPanelInfoPtr Panel = output->driver_private;
+
+    xf86SetModeCrtc(adjusted_mode, 0);
+    if (!Panel->Center && (mode->HDisplay < Panel->NativeWidth ||
+        mode->VDisplay < Panel->NativeHeight)) {
+        Panel->Scale = TRUE;
+    } else {
+        Panel->Scale = FALSE;
+        ViaPanelCenterMode(mode, adjusted_mode);
+    }
+    return TRUE;
+}
+
+static void
+via_lvds_prepare(xf86OutputPtr output)
+{
+    via_lvds_dpms(output, DPMSModeOff);
+}
+
+static void
+via_lvds_commit(xf86OutputPtr output)
+{
+    via_lvds_dpms(output, DPMSModeOn);
+}
+
 static void
 via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
-					DisplayModePtr adjusted_mode)
+                    DisplayModePtr adjusted_mode)
 {
     ViaPanelInfoPtr Panel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
@@ -1064,23 +1066,6 @@ via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
     }
 }
 
-static int
-ViaPanelLookUpModeIndex(int width, int height)
-{
-    int i, index = VIA_PANEL_INVALID;
-    int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec);
-
-
-    for (i = 0; i < length; i++) {
-        if (ViaPanelNativeModes[i].Width == width
-            && ViaPanelNativeModes[i].Height == height) {
-            index = i;
-            break;
-        }
-    }
-    return index;
-}
-
 static xf86OutputStatus
 via_lvds_detect(xf86OutputPtr output)
 {
@@ -1230,6 +1215,21 @@ via_lvds_get_modes(xf86OutputPtr output)
     return pDisplay_Mode;
 }
 
+#ifdef RANDR_12_INTERFACE
+static Bool
+via_lvds_set_property(xf86OutputPtr output, Atom property,
+                        RRPropertyValuePtr value)
+{
+    return FALSE;
+}
+
+static Bool
+via_lvds_get_property(xf86OutputPtr output, Atom property)
+{
+    return FALSE;
+}
+#endif
+
 static void
 via_lvds_destroy(xf86OutputPtr output)
 {
@@ -1240,12 +1240,6 @@ via_lvds_destroy(xf86OutputPtr output)
 
 static const xf86OutputFuncsRec via_lvds_funcs = {
     .create_resources   = via_lvds_create_resources,
-#ifdef RANDR_12_INTERFACE
-    .set_property       = via_lvds_set_property,
-#endif
-#ifdef RANDR_13_INTERFACE
-    .get_property       = via_lvds_get_property,
-#endif
     .dpms               = via_lvds_dpms,
     .save               = via_lvds_save,
     .restore            = via_lvds_restore,
@@ -1256,7 +1250,13 @@ static const xf86OutputFuncsRec via_lvds_funcs = {
     .mode_set           = via_lvds_mode_set,
     .detect             = via_lvds_detect,
     .get_modes          = via_lvds_get_modes,
-    .destroy            = via_lvds_destroy,
+#ifdef RANDR_12_INTERFACE
+    .set_property       = via_lvds_set_property,
+#endif
+#ifdef RANDR_13_INTERFACE
+    .get_property       = via_lvds_get_property,
+#endif
+    .destroy            = via_lvds_destroy
 };
 
 


More information about the Openchrome-devel mailing list