configure.ac     |    2 -
 src/via_driver.c |    6 ++--
 src/via_driver.h |   11 ++++----
 src/via_memmgr.c |   75 ++++++++++++++++++++++++++++++++++++-------------------
 4 files changed, 60 insertions(+), 34 deletions(-)

New commits:
commit 25740e5905ae2732f71c9e61b2c4a69b35973538
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Aug 24 09:57:30 2020 -0700

    Version bumped to 0.6.305
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/configure.ac b/configure.ac
index ead468d..1fc760c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-        [0.6.304],
+        [0.6.305],
         
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 07039553beed7c409f0a02f6f76d6291d64f4f61
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Aug 24 09:55:45 2020 -0700

    Remove the last remnant of xf86PciInfo.h
    
    Commit 8712490 (Remove no longer supported xf86PciInfo.h) appears
    to have completely removed xf86PciInfo.h, but commit 6f75bbc
    (XSERVER_LIBPCIACCESS is now decrepide . . .) brought it back.
    This commit will completely get rid of it for good.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/src/via_driver.h b/src/via_driver.h
index 250cc49..0c218c1 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -80,8 +80,6 @@
 
 #ifdef HAVE_PCIACCESS
 #include <pciaccess.h>
-#else
-#include "xf86PciInfo.h"
 #endif
 #include <errno.h>
 
commit d679df141e0f33f944c4903a4982286d9ce8a80d
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Aug 24 09:55:32 2020 -0700

    Rearrange memory (de)allocation / (un)map code
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 39b2ce5..7250197 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -204,8 +204,28 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
 #ifdef HAVE_DRI
     struct drm_openchrome_gem_map args;
     int ret;
+#endif /* HAVE_DRI */
 
-    if (pVia->directRenderingType == DRI_2) {
+    if ((pVia->directRenderingType == DRI_NONE)
+#ifdef HAVE_DRI
+        || (pVia->directRenderingType == DRI_1)
+#endif /* HAVE_DRI */
+    ) {
+        switch (obj->domain) {
+#ifdef HAVE_DRI
+        case TTM_PL_FLAG_TT:
+            obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
+            break;
+#endif /* HAVE_DRI */
+        case TTM_PL_FLAG_VRAM:
+            obj->ptr = pVia->FBBase + obj->offset;
+            break;
+        default:
+            obj->ptr = NULL;
+            break;
+        }
+#ifdef HAVE_DRI
+    } else if (pVia->directRenderingType == DRI_2) {
         memset(&args, 0, sizeof(args));
         args.handle = obj->handle;
         ret = drmCommandWriteRead(pVia->drmmode.fd,
@@ -223,22 +243,7 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
             DEBUG(ErrorF("mmap failed with error %d\n", -errno));
             obj->ptr = NULL;
         }
-    } else
 #endif /* HAVE_DRI */
-    {
-        switch (obj->domain) {
-#ifdef HAVE_DRI
-        case TTM_PL_FLAG_TT:
-            obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
-            break;
-#endif /* HAVE_DRI */
-        case TTM_PL_FLAG_VRAM:
-            obj->ptr = pVia->FBBase + obj->offset;
-            break;
-        default:
-            obj->ptr = NULL;
-            break;
-        }
     }
 
 #ifdef HAVE_DRI
@@ -250,12 +255,19 @@ exit:
 void
 drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
 {
-#ifdef HAVE_DRI
     VIAPtr pVia = VIAPTR(pScrn);
+#ifdef HAVE_DRI
     struct drm_openchrome_gem_unmap args;
     int ret;
+#endif /* HAVE_DRI */
 
-    if (pVia->directRenderingType == DRI_2) {
+    if ((pVia->directRenderingType == DRI_NONE)
+#ifdef HAVE_DRI
+        || (pVia->directRenderingType == DRI_1)
+#endif /* HAVE_DRI */
+    ) {
+#ifdef HAVE_DRI
+    } else if (pVia->directRenderingType == DRI_2) {
         munmap(obj->ptr, obj->size);
 
         memset(&args, 0, sizeof(struct drm_openchrome_gem_unmap));
@@ -267,9 +279,10 @@ drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
         if (ret) {
             goto exit;
         }
-
+#endif /* HAVE_DRI */
     }
 
+#ifdef HAVE_DRI
 exit:
 #endif /* HAVE_DRI */
     obj->ptr = NULL;
commit f1e4ca01e07a5e62abfcfe502cc3e7a252726e1b
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Aug 24 09:55:15 2020 -0700

    Hide OpenChrome DRM uAPI access code behind HAVE_DRI macro
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 84b3ca4..39b2ce5 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -201,11 +201,11 @@ void*
 drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
 {
     VIAPtr pVia = VIAPTR(pScrn);
+#ifdef HAVE_DRI
+    struct drm_openchrome_gem_map args;
     int ret;
 
     if (pVia->directRenderingType == DRI_2) {
-        struct drm_openchrome_gem_map args;
-
         memset(&args, 0, sizeof(args));
         args.handle = obj->handle;
         ret = drmCommandWriteRead(pVia->drmmode.fd,
@@ -223,13 +223,15 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
             DEBUG(ErrorF("mmap failed with error %d\n", -errno));
             obj->ptr = NULL;
         }
-    } else {
+    } else
+#endif /* HAVE_DRI */
+    {
         switch (obj->domain) {
 #ifdef HAVE_DRI
         case TTM_PL_FLAG_TT:
             obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
             break;
-#endif
+#endif /* HAVE_DRI */
         case TTM_PL_FLAG_VRAM:
             obj->ptr = pVia->FBBase + obj->offset;
             break;
@@ -239,28 +241,38 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
         }
     }
 
+#ifdef HAVE_DRI
 exit:
+#endif /* HAVE_DRI */
     return obj->ptr;
 }
 
 void
 drm_bo_unmap(ScrnInfoPtr pScrn, struct buffer_object *obj)
 {
+#ifdef HAVE_DRI
     VIAPtr pVia = VIAPTR(pScrn);
     struct drm_openchrome_gem_unmap args;
+    int ret;
 
     if (pVia->directRenderingType == DRI_2) {
         munmap(obj->ptr, obj->size);
+
+        memset(&args, 0, sizeof(struct drm_openchrome_gem_unmap));
+        args.handle = obj->handle;
+        ret = drmCommandRead(pVia->drmmode.fd,
+                        DRM_OPENCHROME_GEM_UNMAP,
+                        &args,
+                        sizeof(struct drm_openchrome_gem_unmap));
+        if (ret) {
+            goto exit;
+        }
+
     }
 
+exit:
+#endif /* HAVE_DRI */
     obj->ptr = NULL;
-
-    memset(&args, 0, sizeof(struct drm_openchrome_gem_unmap));
-    args.handle = obj->handle;
-    drmCommandRead(pVia->drmmode.fd,
-                    DRM_OPENCHROME_GEM_UNMAP,
-                    &args,
-                    sizeof(struct drm_openchrome_gem_unmap));
 }
 
 void
commit c8b364a006adf22753b0d693333eab4c2820d15b
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Mon Aug 24 09:55:05 2020 -0700

    Change the name used to identify DDX in the Xorg.X.log log file
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index 9c50714..180c5eb 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -110,7 +110,7 @@ static const struct pci_id_match via_device_match[] = {
 
 _X_EXPORT DriverRec VIA = {
     VIA_VERSION,
-    DRIVER_NAME,
+    VIA_DRIVER_NAME,
     VIAIdentify,
 #ifdef HAVE_PCIACCESS
     NULL,
@@ -430,8 +430,8 @@ via_pci_probe(DriverPtr driver, int entity_num,
 
     if (scrn != NULL) {
         scrn->driverVersion = VIA_VERSION;
-        scrn->driverName = DRIVER_NAME;
-        scrn->name = "CHROME";
+        scrn->driverName = VIA_DRIVER_NAME;
+        scrn->name = VIA_NAME;
         scrn->Probe = NULL;
 
         scrn->PreInit = VIAPreInit;
diff --git a/src/via_driver.h b/src/via_driver.h
index 3d9ddb1..250cc49 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -88,6 +88,12 @@
 #include "via_vt1632.h"
 
 #include "compat-api.h"
+
+
+#define VIA_NAME            "OpenChrome"
+#define VIA_DRIVER_NAME     "openchrome"
+#define VIA_VERSION         ((VIA_MAJOR_VERSION << 24) | (VIA_MINOR_VERSION << 
16) | VIA_PATCHLEVEL)
+
 #define VIA_AGP_UPL_SIZE    (1024*128)
 #define VIA_DMA_DL_SIZE     (1024*128)
 #define VIA_SCRATCH_SIZE    (4*1024*1024)
@@ -105,9 +111,6 @@
 #define AGP_PAGES 8192
 #define AGP_SIZE (AGP_PAGE_SIZE * AGP_PAGES)
 
-#define DRIVER_NAME     "openchrome"
-#define VIA_VERSION     ((VIA_MAJOR_VERSION << 24) | (VIA_MINOR_VERSION << 16) 
| VIA_PATCHLEVEL)
-
 #define VIA_VQ_SIZE     (256 * 1024)
 
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
_______________________________________________
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to