[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_dri.c src/via_driver.c src/via_exa.c src/via_memcpy.c src/via_memmgr.c src/via_memmgr.h src/via_ums.c src/via_xvmc.c src/via_xv_overlay.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Tue Oct 27 23:43:06 UTC 2020


 configure.ac         |    2 +-
 src/via_dri.c        |    2 +-
 src/via_driver.c     |    8 ++++----
 src/via_exa.c        |    8 ++++----
 src/via_memcpy.c     |    2 +-
 src/via_memmgr.c     |   20 ++++++++++----------
 src/via_memmgr.h     |    8 +++++---
 src/via_ums.c        |    4 ++--
 src/via_xv_overlay.c |    4 ++--
 src/via_xvmc.c       |    4 ++--
 10 files changed, 32 insertions(+), 30 deletions(-)

New commits:
commit 5dbad06436b6e3226abece328371cf5c734f45a0
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Oct 27 16:17:37 2020 -0700

    Version bumped to 0.6.400
    
    Starting with this version, KMS support will require OpenChrome DRM
    Version 3.4.0 or later.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index f01f828..611da07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-        [0.6.316],
+        [0.6.400],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 0c15bf7446e283c8884789bb35c85333c7973e07
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Oct 27 16:11:00 2020 -0700

    Update TTM placement type macros passed to OpenChrome DRM
    
    TTM discontinued TTM_PL_FLAG_SYSTEM, TTM_PL_FLAG_TT, and
    TTM_PL_FLAG_VRAM placement flag macros starting with drm-next code
    for Linux 5.10.  Since OpenChrome DDX was passing them to OpenChrome
    DRM, there is now a uAPI breakage.  Instead, pass TTM placement
    macros.  OpenChrome DDX will now require OpenChrome DRM Version
    3.4.0 or later for KMS support.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_dri.c b/src/via_dri.c
index 15287a4..f55c158 100644
--- a/src/via_dri.c
+++ b/src/via_dri.c
@@ -724,7 +724,7 @@ VIADRIFinishScreenInit(ScreenPtr pScreen)
                    "[drm] the frame buffer memory area in the BIOS.\n");
     }
 
-    pVia->driOffScreenMem = drm_bo_alloc(pScrn, pVia->driSize, 16, TTM_PL_FLAG_VRAM);
+    pVia->driOffScreenMem = drm_bo_alloc(pScrn, pVia->driSize, 16, TTM_PL_VRAM);
 
     DRIFinishScreenInit(pScreen);
 
diff --git a/src/via_driver.c b/src/via_driver.c
index 086cce4..35debb6 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -65,7 +65,7 @@
 #ifdef OPENCHROMEDRI
 static const ViaDRMVersion drmVIADRMExpected = { 1, 3, 0 };
 static const ViaDRMVersion drmVIADRMCompat = { 3, 0, 0 };
-static const ViaDRMVersion drmOpenChromeDRMVersion = { 3, 3, 0 };
+static const ViaDRMVersion drmOpenChromeDRMVersion = { 3, 4, 0 };
 #endif /* OPENCHROMEDRI */
 
 /* Prototypes. */
@@ -717,7 +717,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
     alignedPitch = ALIGN_TO(alignedPitch, 16);
     drmmode->front_bo = drm_bo_alloc(scrn,
                                         alignedPitch * height,
-                                        16, TTM_PL_FLAG_VRAM);
+                                        16, TTM_PL_VRAM);
     if (!drmmode->front_bo) {
         goto fail;
     }
@@ -1596,7 +1596,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
          * Set cursor location in frame buffer.
          */
         bo = drm_bo_alloc(pScrn, cursorSize, alignment,
-                            TTM_PL_FLAG_VRAM);
+                            TTM_PL_VRAM);
         if (!bo) {
             return FALSE;
         }
@@ -1626,7 +1626,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
     pVia->drmmode.front_bo = drm_bo_alloc(pScrn,
                                             alignedPitch *
                                             pScrn->virtualY,
-                                            16, TTM_PL_FLAG_VRAM);
+                                            16, TTM_PL_VRAM);
     if (!pVia->drmmode.front_bo)
         return FALSE;
 
diff --git a/src/via_exa.c b/src/via_exa.c
index 88cd974..bcc824a 100644
--- a/src/via_exa.c
+++ b/src/via_exa.c
@@ -807,7 +807,7 @@ viaEXAOffscreenAlloc(ScrnInfoPtr pScrn, struct buffer_object *obj,
 
     obj->offset = pArea->offset;
     obj->handle = (unsigned long) pArea;
-    obj->domain = TTM_PL_FLAG_VRAM;
+    obj->domain = TTM_PL_VRAM;
     obj->size = newSize;
 
 exit:
@@ -1009,7 +1009,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
             if (pVia->exaDriverPtr->UploadToScreen == viaExaTexUploadToScreen) {
                 size = VIA_AGP_UPL_SIZE * 2;
 
-                pVia->texAGPBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_TT);
+                pVia->texAGPBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_TT);
                 if (pVia->texAGPBuffer) {
                     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                                "Allocated %u kiB of AGP memory for "
@@ -1020,7 +1020,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
             }
 
             size = pVia->exaScratchSize * 1024;
-            pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_TT);
+            pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_TT);
             if (pVia->scratchBuffer) {
                 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                            "Allocated %u kiB of AGP memory for "
@@ -1034,7 +1034,7 @@ viaFinishInitAccel(ScreenPtr pScreen)
 #endif /* OPENCHROMEDRI */
     if (!pVia->scratchAddr && pVia->useEXA) {
         size = pVia->exaScratchSize * 1024 + 32;
-        pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_FLAG_SYSTEM);
+        pVia->scratchBuffer = drm_bo_alloc(pScrn, size, 32, TTM_PL_SYSTEM);
 
         if (pVia->scratchBuffer) {
             xf86DrvMsg(pScrn->scrnIndex, X_INFO,
diff --git a/src/via_memcpy.c b/src/via_memcpy.c
index d2f1d94..7df19e8 100644
--- a/src/via_memcpy.c
+++ b/src/via_memcpy.c
@@ -566,7 +566,7 @@ viaVidCopyInit(const char *copyType, ScreenPtr pScreen)
      * Allocate an area of offscreen FB memory, (buf1), a simulated video
      * player buffer (buf2) and a pool of uninitialized "video" data (buf3).
      */
-    tmpFbBuffer = drm_bo_alloc(pScrn, alignSize, 32, TTM_PL_FLAG_VRAM);
+    tmpFbBuffer = drm_bo_alloc(pScrn, alignSize, 32, TTM_PL_VRAM);
     if (!tmpFbBuffer)
         return libc_YUV42X;
     if (NULL == (buf2 = (unsigned char *)malloc(testSize))) {
diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 3435070..ea1ba86 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -66,7 +66,7 @@ viaOffScreenLinear(ScrnInfoPtr pScrn, struct buffer_object *obj,
 
     obj->offset = linear->offset * depth;
     obj->handle = (unsigned long) linear;
-    obj->domain = TTM_PL_FLAG_VRAM;
+    obj->domain = TTM_PL_VRAM;
     obj->size = size;
 
 exit:
@@ -90,8 +90,8 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
     }
 
     switch (domain) {
-    case TTM_PL_FLAG_TT:
-    case TTM_PL_FLAG_VRAM:
+    case TTM_PL_TT:
+    case TTM_PL_VRAM:
         if (pVia->directRenderingType == DRI_NONE) {
             if (!pVia->useEXA) {
                 ret = viaOffScreenLinear(pScrn, obj,
@@ -131,11 +131,11 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
             size = ALIGN_TO(size, alignment);
             drm.context = DRIGetContext(pScrn->pScreen);
             drm.size = size;
-            drm.type = (domain == TTM_PL_FLAG_TT ? VIA_MEM_AGP : VIA_MEM_VIDEO);
+            drm.type = (domain == TTM_PL_TT ? VIA_MEM_AGP : VIA_MEM_VIDEO);
             ret = drmCommandWriteRead(pVia->drmmode.fd, DRM_VIA_ALLOCMEM,
                                         &drm, sizeof(drm_via_mem_t));
             if (!ret && (size == drm.size)) {
-                if (domain == TTM_PL_FLAG_VRAM)
+                if (domain == TTM_PL_VRAM)
                     drm.offset -= pVia->FBFreeStart;
                 obj->offset = ALIGN_TO(drm.offset, alignment);
                 obj->handle = drm.index;
@@ -178,7 +178,7 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
         }
         break;
 
-    case TTM_PL_FLAG_SYSTEM:
+    case TTM_PL_SYSTEM:
     default:
         ret = -ENXIO;
         break;
@@ -213,11 +213,11 @@ drm_bo_map(ScrnInfoPtr pScrn, struct buffer_object *obj)
     ) {
         switch (obj->domain) {
 #ifdef OPENCHROMEDRI
-        case TTM_PL_FLAG_TT:
+        case TTM_PL_TT:
             obj->ptr = (uint8_t*)pVia->agpMappedAddr + obj->offset;
             break;
 #endif /* OPENCHROMEDRI */
-        case TTM_PL_FLAG_VRAM:
+        case TTM_PL_VRAM:
             obj->ptr = pVia->FBBase + obj->offset;
             break;
         default:
@@ -296,8 +296,8 @@ drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj)
     if (obj) {
         DEBUG(ErrorF("Freed %lu (pool %d)\n", obj->offset, obj->domain));
         switch (obj->domain) {
-        case TTM_PL_FLAG_VRAM:
-        case TTM_PL_FLAG_TT:
+        case TTM_PL_VRAM:
+        case TTM_PL_TT:
             if (pVia->directRenderingType == DRI_NONE) {
                 if (!pVia->useEXA) {
                     FBLinearPtr linear = (FBLinearPtr) obj->handle;
diff --git a/src/via_memmgr.h b/src/via_memmgr.h
index aab7f78..42f714d 100644
--- a/src/via_memmgr.h
+++ b/src/via_memmgr.h
@@ -26,9 +26,11 @@
 
 #include "xf86.h"
 
-#define TTM_PL_FLAG_SYSTEM	1
-#define TTM_PL_FLAG_TT		2
-#define TTM_PL_FLAG_VRAM	4
+
+#define TTM_PL_SYSTEM           0
+#define TTM_PL_TT               1
+#define TTM_PL_VRAM             2
+#define TTM_PL_PRIV             3
 
 struct buffer_object {
     void            *ptr;
diff --git a/src/via_ums.c b/src/via_ums.c
index 681d480..9f1a216 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -662,7 +662,7 @@ viaUMSAccelInit(ScrnInfoPtr pScrn)
                         "Entered %s.\n", __func__));
 
     pVia->VQStart = 0;
-    pVia->vq_bo = drm_bo_alloc(pScrn, VIA_VQ_SIZE, 16, TTM_PL_FLAG_VRAM);
+    pVia->vq_bo = drm_bo_alloc(pScrn, VIA_VQ_SIZE, 16, TTM_PL_VRAM);
     if (!pVia->vq_bo)
         goto err;
 
@@ -678,7 +678,7 @@ viaUMSAccelInit(ScrnInfoPtr pScrn)
     viaInitialize3DEngine(pScrn);
 
     /* Sync marker space. */
-    pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_FLAG_VRAM);
+    pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_VRAM);
     if (!pVia->exa_sync_bo)
         goto err;
 
diff --git a/src/via_xv_overlay.c b/src/via_xv_overlay.c
index 1dc650e..a9d844e 100644
--- a/src/via_xv_overlay.c
+++ b/src/via_xv_overlay.c
@@ -1148,7 +1148,7 @@ AddHQVSurface(ScrnInfoPtr pScrn, unsigned int numbuf, CARD32 fourcc)
     pitch = pVia->swov.SWDevice.dwPitch;
     fbsize = pitch * height * (isplanar ? 2 : 1);
 
-    pVia->swov.HQVMem = drm_bo_alloc(pScrn, fbsize * numbuf, 1, TTM_PL_FLAG_VRAM);
+    pVia->swov.HQVMem = drm_bo_alloc(pScrn, fbsize * numbuf, 1, TTM_PL_VRAM);
     if (!pVia->swov.HQVMem)
         return BadAlloc;
     addr = pVia->swov.HQVMem->offset;
@@ -1201,7 +1201,7 @@ CreateSurface(ScrnInfoPtr pScrn, CARD32 FourCC, CARD16 Width,
     }
 
     if (doalloc) {
-        pVia->swov.SWfbMem = drm_bo_alloc(pScrn, fbsize * 2, 1, TTM_PL_FLAG_VRAM);
+        pVia->swov.SWfbMem = drm_bo_alloc(pScrn, fbsize * 2, 1, TTM_PL_VRAM);
         if (!pVia->swov.SWfbMem)
             return BadAlloc;
         addr = pVia->swov.SWfbMem->offset;
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index da7b75d..f4e269e 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -586,7 +586,7 @@ ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf,
     ctx = pSurf->context;
     bufSize = size_yuv420(ctx->width, ctx->height);
     sPriv->memory_ref = drm_bo_alloc(pScrn, numBuffers * bufSize,
-                                    32, TTM_PL_FLAG_VRAM);
+                                    32, TTM_PL_VRAM);
     if (!sPriv->memory_ref) {
         free(*priv);
         free(sPriv);
@@ -663,7 +663,7 @@ ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp,
 
     ctx = pSubp->context;
     bufSize = size_xx44(ctx->width, ctx->height);
-    sPriv->memory_ref = drm_bo_alloc(pScrn, 1 * bufSize, 32, TTM_PL_FLAG_VRAM);
+    sPriv->memory_ref = drm_bo_alloc(pScrn, 1 * bufSize, 32, TTM_PL_VRAM);
     if (!sPriv->memory_ref) {
         free(*priv);
         free(sPriv);


More information about the openchrome-devel mailing list