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

Kevin Brace kevinbrace at kemper.freedesktop.org
Thu Nov 3 04:04:07 UTC 2016


 configure.ac      |    2 -
 src/via_display.c |   94 ++++++++++++++++++++++++++++++++----------------------
 2 files changed, 57 insertions(+), 39 deletions(-)

New commits:
commit af80fba649c30a0b5011cf34a572b8bbf9b452bb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Nov 2 21:03:11 2016 -0700

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

diff --git a/configure.ac b/configure.ac
index 2e742a1..26cc033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.5.168],
+        [0.5.169],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 56960c27ca176e6eff1844a418bfad077aeb75e6
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Nov 2 21:02:05 2016 -0700

    Removing code that will reinitialize VGA registers from IGA2
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index 563859c..60f5c4b 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -4292,12 +4292,6 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     /* Disable IGA2 display channel. */
     viaIGA2DisplayChannel(pScrn, FALSE);
 
-//  if (!vgaHWInit(pScrn, adjusted_mode)) {
-//      DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-//                          "vgaHWInit failed.\n"));
-//      goto exit;
-//  }
-
     viaIGAInitCommon(pScrn);
     viaIGA2Init(pScrn);
 
@@ -4318,7 +4312,6 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGA2SetFBStartingAddress(crtc, x, y);
     VIAVidAdjustFrame(pScrn, x, y);
 
-exit:
     /* Enable IGA2 display channel. */
     viaIGA2DisplayChannel(pScrn, TRUE);
 
commit 8c51f6779b91978919183a6cacdc3252cc4cb744
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Nov 2 17:16:38 2016 -0700

    Setting IGA2 color depth atomically
    
    Removed the code that sets IGA2 color depth (i.e., 8-bit, 16-bit, or
    32-bit) from viaIGA2SetDisplayRegister function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index dcbe6ab..563859c 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -473,6 +473,56 @@ viaIGA2DisplayChannel(ScrnInfoPtr pScrn, Bool channelState)
 }
 
 /*
+ * Sets IGA2 color depth.
+ */
+static void
+viaIGA2SetColorDepth(ScrnInfoPtr pScrn, CARD8 bitsPerPixel)
+{
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered viaIGA2SetColorDepth.\n"));
+
+    /* Set the color depth for IGA2. */
+    switch (pScrn->bitsPerPixel) {
+        case 8:
+            /* 3X5.67[7:6] - Display Color Depth Select
+             *               00: 8bpp
+             *               01: 16bpp
+             *               10: 30bpp
+             *               11: 32bpp */
+            ViaCrtcMask(hwp, 0x67, 0x00, 0xC0);
+            break;
+        case 16:
+            ViaCrtcMask(hwp, 0x67, 0x40, 0xC0);
+            break;
+        case 24:
+        case 32:
+            ViaCrtcMask(hwp, 0x67, 0xC0, 0xC0);
+            break;
+        default:
+            break;
+    }
+
+    if ((bitsPerPixel == 8)
+        || (bitsPerPixel == 16)
+        || (bitsPerPixel == 24)
+        || (bitsPerPixel == 32)) {
+
+        xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                    "IGA2 Color Depth: %d bit\n",
+                    bitsPerPixel);
+    } else {
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                    "Unsupported IGA2 Color Depth: %d bit\n",
+                    bitsPerPixel);
+    }
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting viaIGA2SetColorDepth.\n"));
+}
+
+/*
  * Sets IGA2 palette LUT resolution. (6-bit or 8-bit)
  */
 static void
@@ -2783,37 +2833,6 @@ viaIGA2SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                 "Requested Screen Mode: %s\n", mode->name);
 
-    /* Set the color depth for IGA2. */
-    switch (pScrn->bitsPerPixel) {
-        case 8:
-            /* Only CLE266.AX uses 6-bit LUT. */
-            if (pVia->Chipset == VIA_CLE266 && pVia->ChipRev < 15) {
-                /* 6-bit LUT */
-                /* 3X5.6A[5] - Second Display 8/6 Bits LUT
-                 *             0: 6-bit
-                 *             1: 8-bit */
-                ViaCrtcMask(hwp, 0x6A, 0x00, 0x20);
-            } else {
-                /* Set IGA2 display LUT to 8-bit */
-                ViaCrtcMask(hwp, 0x6A, 0x20, 0x20);
-            }
-
-            ViaCrtcMask(hwp, 0x67, 0x00, 0xC0);
-            break;
-        case 16:
-            ViaCrtcMask(hwp, 0x67, 0x40, 0xC0);
-            break;
-        case 24:
-        case 32:
-            ViaCrtcMask(hwp, 0x67, 0xC0, 0xC0);
-            break;
-        default:
-            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                        "Unsupported color depth: %d\n",
-                        pScrn->bitsPerPixel);
-            break;
-    }
-
     /* LVDS Channel 1 and 2 should be controlled by PMS
      * (Power Management Status). */
     ViaSeqMask(hwp, 0x2A, 0x0F, 0x0F);
@@ -4283,7 +4302,13 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGA2Init(pScrn);
 
     ViaPrintMode(pScrn, adjusted_mode);
+
+    /* Set color depth. */
+    viaIGA2SetColorDepth(pScrn, pScrn->bitsPerPixel);
+
+    /* Set display controller screen parameters. */
     viaIGA2SetDisplayRegister(pScrn, adjusted_mode);
+
     ViaSetSecondaryFIFO(pScrn, adjusted_mode);
     pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, adjusted_mode);
     pBIOSInfo->ClockExternal = FALSE;


More information about the Openchrome-devel mailing list