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

Kevin Brace kevinbrace at kemper.freedesktop.org
Mon Jun 26 05:24:57 UTC 2017


 configure.ac     |    2 
 src/via_driver.c |  171 ++++++++++++++++++++++++++-----------------------------
 2 files changed, 83 insertions(+), 90 deletions(-)

New commits:
commit cee91919ace9d8188fbbbb4cb6da65c6a8fd12a4
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Jun 26 00:23:58 2017 -0500

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

diff --git a/configure.ac b/configure.ac
index f909674..15f2f64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.6.139],
+        [0.6.140],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 39893eba233e9c860335a2b58b0b68bbf3fc91e6
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Jun 26 00:22:16 2017 -0500

    Removed VideoRAM option
    
    This is no longer needed since the frame buffer size can be determined
    accurately.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index adc6725..e11b7ca 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -176,7 +176,6 @@ typedef enum
     OPTION_SHADOW_FB,
     OPTION_ROTATION_TYPE,
     OPTION_ROTATE,
-    OPTION_VIDEORAM,
     OPTION_I2CDEVICES,
     OPTION_CENTER,
     OPTION_TVDOTCRAWL,
@@ -206,7 +205,6 @@ static OptionInfoRec VIAOptions[] = {
     {OPTION_SHADOW_FB,           "ShadowFB",         OPTV_BOOLEAN, {0}, FALSE},
     {OPTION_ROTATION_TYPE,       "RotationType",     OPTV_ANYSTR,  {0}, FALSE},
     {OPTION_ROTATE,              "Rotate",           OPTV_ANYSTR,  {0}, FALSE},
-    {OPTION_VIDEORAM,            "VideoRAM",         OPTV_INTEGER, {0}, FALSE},
     {OPTION_TVDOTCRAWL,          "TVDotCrawl",       OPTV_BOOLEAN, {0}, FALSE},
     {OPTION_TVDEFLICKER,         "TVDeflicker",      OPTV_INTEGER, {0}, FALSE},
     {OPTION_TVTYPE,              "TVType",           OPTV_ANYSTR,  {0}, FALSE},
@@ -1184,10 +1182,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
 
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VIAOptions);
 
-    if (xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam))
-        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
-                   "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam);
-
     /* When rotating, switch shadow framebuffer on and acceleration off. */
     if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATION_TYPE))) {
         if (!xf86NameCmp(s, "SWRandR")) {
commit e8aa6fcd0bdf4f5fd24f3800db865d6b13d834ee
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 23:51:34 2017 -0500

    Moving up color map related initializations inside VIAPreInit
    
    Using XFree86 DDX Design document's sample code as a reference.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index 5fa5e52..adc6725 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -934,15 +934,83 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
     char *busId = NULL;
     drmVersionPtr drmVer;
 #endif
+    rgb defaultWeight = {0, 0, 0};
+    rgb defaultMask = {0, 0, 0};
+    Gamma defaultGamma = {0.0, 0.0, 0.0};
+    Bool status = FALSE;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered VIAPreInit.\n"));
 
-    if (pScrn->numEntities > 1)
-        return FALSE;
+    pScrn->monitor = pScrn->confScreen->monitor;
+
+    /*
+     * We support depths of 8, 16 and 24.
+     * We support bpp of 8, 16, and 32.
+     */
+    if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) {
+        goto exit;
+    } else {
+        switch (pScrn->depth) {
+        case 8:
+        case 16:
+        case 24:
+            /* OK */
+            break;
+        case 32:
+            /* OK */
+            pScrn->depth = 24;
+            break;
+        default:
+            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                        "Given depth (%d) is not supported by this driver!\n",
+                        pScrn->depth);
+            goto exit;
+            break;
+        }
+    }
+
+    pScrn->rgbBits = 8;
+
+    /* Print out the depth / bpp that was set. */
+    xf86PrintDepthBpp(pScrn);
+
+    if (pScrn->depth > 8) {
+        if (!xf86SetWeight(pScrn, defaultWeight, defaultMask)) {
+            goto exit;
+        } else {
+            /* TODO check weight returned is supported. */
+        }
+    }
+
+    if (!xf86SetDefaultVisual(pScrn, -1)) {
+        goto exit;
+    } else {
+        /* We don't currently support DirectColor at > 8bpp. */
+        if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
+            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                        "Given default visual (%s) is not supported "
+                        "at depth %d.\n",
+                        xf86GetVisualName(pScrn->defaultVisual),
+                                            pScrn->depth);
+            goto exit;
+        }
+    }
+
+    /* If the driver supports gamma correction, set the gamma. */
+    if (!xf86SetGamma(pScrn, defaultGamma)) {
+        goto exit;
+    }
+
+    /* This driver uses a programmable clock. */
+    pScrn->progClock = TRUE;
+
+    if (pScrn->numEntities > 1) {
+        goto exit;
+    }
 
     if (!VIAGetRec(pScrn)) {
-        return FALSE;
+        goto exit;
     }
 
     pVia = VIAPTR(pScrn);
@@ -1108,68 +1176,8 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
         return FALSE;
     }
 
-    pScrn->monitor = pScrn->confScreen->monitor;
-
-    /*
-     * We support depths of 8, 16 and 24.
-     * We support bpp of 8, 16, and 32.
-     */
-
-    if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) {
-        goto fail;
-    } else {
-        switch (pScrn->depth) {
-            case 8:
-            case 16:
-            case 24:
-            case 32:
-                /* OK */
-                break;
-            default:
-                xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                           "Given depth (%d) is not supported by this driver\n",
-                           pScrn->depth);
-                goto fail;
-        }
-    }
-
-    xf86PrintDepthBpp(pScrn);
-
-    if (pScrn->depth == 32) {
-        pScrn->depth = 24;
-    }
-
-    if (pScrn->depth > 8) {
-        rgb zeros = { 0, 0, 0 };
-
-        if (!xf86SetWeight(pScrn, zeros, zeros)) {
-            goto fail;
-        } else {
-            /* TODO check weight returned is supported */
-        }
-    }
-
-    if (!xf86SetDefaultVisual(pScrn, -1)) {
-        goto fail;
-    } else {
-        /* We don't currently support DirectColor at > 8bpp */
-        if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) {
-            xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual"
-                       " (%s) is not supported at depth %d.\n",
-                       xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
-            goto fail;
-        }
-    }
-
-    /* We use a programmable clock */
-    pScrn->progClock = TRUE;
-
     xf86CollectOptions(pScrn, option);
 
-    /* Set the bits per RGB for 8bpp mode */
-    if (pScrn->depth == 8)
-        pScrn->rgbBits = 6;
-
     if (!VIASetupDefaultOptions(pScrn)) {
         goto fail;
     }
@@ -1523,12 +1531,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
         goto fail;
     }
 
-    /* Initialize the colormap */
-    Gamma zeros = { 0.0, 0.0, 0.0 };
-    if (!xf86SetGamma(pScrn, zeros)) {
-        goto fail;
-    }
-
     /* Set up screen parameters. */
     pVia->Bpp = pScrn->bitsPerPixel >> 3;
     pVia->Bpl = pScrn->virtualX * pVia->Bpp;
@@ -1563,17 +1565,15 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
         }
     }
 
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered VIAPreInit.\n"));
-    return TRUE;
-
+    status = TRUE;
+    goto exit;
 fail:
     viaUnmapMMIO(pScrn);
     VIAFreeRec(pScrn);
-
+exit:
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered VIAPreInit.\n"));
-    return FALSE;
+                        "Exiting VIAPreInit.\n"));
+    return status;
 }
 
 static void
commit 380257dedce2bb5ca882208613368242062a059f
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 20:41:11 2017 -0500

    Remove unnecessary probing of PROBE_DETECT bit from VIAPreInit
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index 8af2a5d..5fa5e52 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -941,9 +941,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
     if (pScrn->numEntities > 1)
         return FALSE;
 
-    if (flags & PROBE_DETECT)
-        return FALSE;
-
     if (!VIAGetRec(pScrn)) {
         return FALSE;
     }
@@ -1111,10 +1108,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
         return FALSE;
     }
 
-	/* Now handle the Display */
-    if (flags & PROBE_DETECT)
-        return TRUE;
-
     pScrn->monitor = pScrn->confScreen->monitor;
 
     /*
commit afdb85793de01ad07b829283e3100e1188a4fd70
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 20:38:18 2017 -0500

    Renamed viaPreInit to VIAPreInit
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index 883abab..8af2a5d 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -79,7 +79,7 @@ static Bool VIAProbe(DriverPtr drv, int flags);
 #endif
 
 static Bool VIASetupDefaultOptions(ScrnInfoPtr pScrn);
-static Bool viaPreInit(ScrnInfoPtr pScrn, int flags);
+static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags);
 static Bool VIAScreenInit(SCREEN_INIT_ARGS_DECL);
 static const OptionInfoRec *VIAAvailableOptions(int chipid, int busid);
 
@@ -469,7 +469,7 @@ via_pci_probe(DriverPtr driver, int entity_num,
 
         entity = xf86GetEntityInfo(entity_num);
 
-        scrn->PreInit = viaPreInit;
+        scrn->PreInit = VIAPreInit;
         scrn->ScreenInit = VIAScreenInit;
         scrn->SwitchMode = VIASwitchMode;
         scrn->AdjustFrame = VIAAdjustFrame;
@@ -541,7 +541,7 @@ VIAProbe(DriverPtr drv, int flags)
 				pScrn->driverName = DRIVER_NAME;
 				pScrn->name = "CHROME";
 				pScrn->Probe = VIAProbe;
-				pScrn->PreInit = viaPreInit;
+				pScrn->PreInit = VIAPreInit;
 				pScrn->ScreenInit = VIAScreenInit;
 				pScrn->SwitchMode = VIASwitchMode;
 				pScrn->AdjustFrame = VIAAdjustFrame;
@@ -922,7 +922,7 @@ xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = {
 };
 
 static Bool
-viaPreInit(ScrnInfoPtr pScrn, int flags)
+VIAPreInit(ScrnInfoPtr pScrn, int flags)
 {
     XF86OptionPtr option = xf86NewOption("MigrationHeuristic", "greedy");
     EntityInfoPtr pEnt;
@@ -935,7 +935,8 @@ viaPreInit(ScrnInfoPtr pScrn, int flags)
     drmVersionPtr drmVer;
 #endif
 
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "viaPreInit\n"));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered VIAPreInit.\n"));
 
     if (pScrn->numEntities > 1)
         return FALSE;
@@ -1569,11 +1570,16 @@ viaPreInit(ScrnInfoPtr pScrn, int flags)
         }
     }
 
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered VIAPreInit.\n"));
     return TRUE;
 
 fail:
     viaUnmapMMIO(pScrn);
     VIAFreeRec(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered VIAPreInit.\n"));
     return FALSE;
 }
 


More information about the Openchrome-devel mailing list