[openchrome-devel] xf86-video-openchrome: Branch 'main' - 7 commits - configure.ac src/via_3d.c src/via_3d.h src/via_dmabuffer.h src/via_exa.c src/via_exa_h2.c src/via_exa_h6.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Wed Mar 22 21:45:56 UTC 2023


 configure.ac        |    2 -
 src/via_3d.c        |   14 +++++---
 src/via_3d.h        |   37 ++++++++++++----------
 src/via_dmabuffer.h |   86 +++++++++++++++++++++++++++-------------------------
 src/via_exa.c       |   26 +++++----------
 src/via_exa_h2.c    |   14 ++++----
 src/via_exa_h6.c    |    8 ++--
 7 files changed, 96 insertions(+), 91 deletions(-)

New commits:
commit 40a341dc8aaeba1150f8bde43e4e33e506baf75d
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:41:42 2023 -0700

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

diff --git a/configure.ac b/configure.ac
index 7c1156d..e9b6288 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-        [0.6.603],
+        [0.6.604],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit a9db260ea45f0e9cb32cb9b1b4bb0f5c273916fb
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:40:57 2023 -0700

    Remove ScrnInfoPtr pScrn from ViaCommandBuffer{}
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_3d.c b/src/via_3d.c
index e2d04ff..65afd5a 100644
--- a/src/via_3d.c
+++ b/src/via_3d.c
@@ -277,8 +277,9 @@ via3DOpSupported(CARD8 op)
 }
 
 static void
-via3DEmitQuad(Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY,
-              int src0X, int src0Y, int src1X, int src1Y, int w, int h)
+via3DEmitQuad(VIAPtr pVia,
+                Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY,
+                int src0X, int src0Y, int src1X, int src1Y, int w, int h)
 {
     CARD32 acmd;
     float dx1, dx2, dy1, dy2, sx1[2], sx2[2], sy1[2], sy2[2], wf;
@@ -384,7 +385,9 @@ via3DEmitQuad(Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY,
 }
 
 static void
-via3DEmitState(Via3DState * v3d, ViaCommandBuffer * cb, Bool forceUpload)
+via3DEmitState(VIAPtr pVia,
+                Via3DState * v3d, ViaCommandBuffer * cb,
+                Bool forceUpload)
 {
     int i;
     Bool saveHas3dState;
@@ -532,8 +535,9 @@ via3DEmitState(Via3DState * v3d, ViaCommandBuffer * cb, Bool forceUpload)
  * has3dState flag afterwards.
  */
 static void
-via3DEmitClipRect(Via3DState * v3d, ViaCommandBuffer * cb, int x, int y,
-                  int w, int h)
+via3DEmitClipRect(VIAPtr pVia,
+                    Via3DState * v3d, ViaCommandBuffer * cb,
+                    int x, int y, int w, int h)
 {
     Bool saveHas3dState;
 
diff --git a/src/via_3d.h b/src/via_3d.h
index 0e87e66..f0a5c68 100644
--- a/src/via_3d.h
+++ b/src/via_3d.h
@@ -30,6 +30,8 @@
 
 #define VIA_NUM_TEXUNITS 2
 
+typedef struct _VIA VIARec, *VIAPtr;
+
 typedef enum
 {
     via_single,
@@ -106,12 +108,15 @@ typedef struct _Via3DState
         CARD32 color);
     void (*setCompositeOperator) (struct _Via3DState * v3d, CARD8 op);
         Bool(*opSupported) (CARD8 op);
-    void (*emitQuad) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
-        int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w,
-        int h);
-    void (*emitState) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
+    void (*emitQuad) (VIAPtr pVia,
+        struct _Via3DState * v3d, ViaCommandBuffer * cb,
+        int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y,
+        int w, int h);
+    void (*emitState) (VIAPtr pVia,
+        struct _Via3DState * v3d, ViaCommandBuffer * cb,
         Bool forceUpload);
-    void (*emitClipRect) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
+    void (*emitClipRect) (VIAPtr pVia,
+        struct _Via3DState * v3d, ViaCommandBuffer * cb,
         int x, int y, int w, int h);
     Bool(*dstSupported) (int format);
     Bool(*texSupported) (int format);
diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index 92106c8..2f3a640 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -26,9 +26,10 @@
 
 #include "via_3d_reg.h"
 
+typedef struct _VIA VIARec, *VIAPtr;
+
 typedef struct _ViaCommandBuffer
 {
-    ScrnInfoPtr pScrn;
     CARD32 *buf;
     CARD32 waitFlags;
     unsigned pos;
@@ -37,7 +38,7 @@ typedef struct _ViaCommandBuffer
     int header_start;
     int rindex;
     Bool has3dState;
-    void (*flushFunc) (struct _ViaCommandBuffer * cb);
+    void (*flushFunc) (VIAPtr pVia, struct _ViaCommandBuffer * cb);
 } ViaCommandBuffer;
 
 #define VIA_DMASIZE 16384
@@ -46,7 +47,7 @@ typedef struct _ViaCommandBuffer
     ViaCommandBuffer *cb = &pVia->cb
 
 #define ADVANCE_RING    \
-    cb->flushFunc(cb)
+    cb->flushFunc(pVia, cb)
 
 #define WAITFLAGS(flags)    \
     (cb)->waitFlags |= (flags)
@@ -74,7 +75,7 @@ typedef struct _ViaCommandBuffer
 #define BEGIN_RING(size)                                            \
     do {                                                            \
         if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {    \
-            cb->flushFunc(cb);                                      \
+            cb->flushFunc(pVia, cb);                                      \
         }                                                           \
     } while(0)
 
diff --git a/src/via_exa.c b/src/via_exa.c
index 55a7daf..eac4a57 100644
--- a/src/via_exa.c
+++ b/src/via_exa.c
@@ -40,7 +40,7 @@
 #include "via_dmabuffer.h"
 
 static void
-viaFlushPCI(ViaCommandBuffer *cb)
+viaFlushPCI(VIAPtr pVia, ViaCommandBuffer *cb)
 {
     register CARD32 *bp = cb->buf;
     CARD32 transSetting;
@@ -48,7 +48,6 @@ viaFlushPCI(ViaCommandBuffer *cb)
     unsigned loop = 0;
     register CARD32 offset = 0;
     register CARD32 value;
-    VIAPtr pVia = VIAPTR(cb->pScrn);
 
     while (bp < endp) {
         if (*bp == HALCYON_HEADER2) {
@@ -136,10 +135,8 @@ viaDumpDMA(ViaCommandBuffer *cb)
  * the DRM command verifier will lose track of the 3D engine state.
  */
 static void
-viaFlushDRIEnabled(ViaCommandBuffer *cb)
+viaFlushDRIEnabled(VIAPtr pVia, ViaCommandBuffer *cb)
 {
-    ScrnInfoPtr pScrn = cb->pScrn;
-    VIAPtr pVia = VIAPTR(pScrn);
     char *tmp = (char *)cb->buf;
     int tmpSize;
     drm_via_cmdbuffer_t b;
@@ -170,7 +167,7 @@ viaFlushDRIEnabled(ViaCommandBuffer *cb)
         }
         cb->pos = 0;
     } else {
-        viaFlushPCI(cb);
+        viaFlushPCI(pVia, cb);
     }
 }
 #endif
@@ -180,13 +177,8 @@ viaFlushDRIEnabled(ViaCommandBuffer *cb)
  * are intended for Unichrome Pro group A video commands.
  */
 static int
-viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size)
+viaSetupCBuffer(VIAPtr pVia, ViaCommandBuffer *cb, unsigned size)
 {
-#ifdef OPENCHROMEDRI
-    VIAPtr pVia = VIAPTR(pScrn);
-#endif
-
-    cb->pScrn = pScrn;
     cb->bufSize = ((size == 0) ? VIA_DMASIZE : size) >> 2;
     cb->buf = (CARD32 *) calloc(cb->bufSize, sizeof(CARD32));
     if (!cb->buf)
@@ -744,8 +736,8 @@ viaExaTexUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
                          via_single, via_single, via_src, TRUE))
         return FALSE;
 
-    v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
-    v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width,
+    v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+    v3d->emitClipRect(pVia, v3d, &pVia->cb, 0, 0, pDst->drawable.width,
                       pDst->drawable.height);
 
     buf = 1;
@@ -767,8 +759,8 @@ viaExaTexUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
             src += src_pitch;
         }
 
-        v3d->emitQuad(v3d, &pVia->cb, x, y + yOffs, 0, (buf) ? height : 0, 0,
-                      0, w, bufH);
+        v3d->emitQuad(pVia, v3d, &pVia->cb, x, y + yOffs,
+                        0, (buf) ? height : 0, 0, 0, w, bufH);
 
         sync[buf] = pVia->exaDriverPtr->MarkSync(pScrn->pScreen);
 
@@ -867,7 +859,7 @@ viaInitExa(ScreenPtr pScreen)
     pVia->nPOT[0] = nPOTSupported;
     pVia->nPOT[1] = nPOTSupported;
 
-    if (Success != viaSetupCBuffer(pScrn, &pVia->cb, 0)) {
+    if (Success != viaSetupCBuffer(pVia, &pVia->cb, 0)) {
         pVia->NoAccel = TRUE;
         return FALSE;
     }
diff --git a/src/via_exa_h2.c b/src/via_exa_h2.c
index 20cb583..db48122 100644
--- a/src/via_exa_h2.c
+++ b/src/via_exa_h2.c
@@ -437,8 +437,8 @@ viaExaPrepareComposite_H2(int op, PicturePtr pSrcPicture,
     }
 
     v3d->setFlags(v3d, curTex, FALSE, TRUE, TRUE);
-    v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
-    v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width,
+    v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+    v3d->emitClipRect(pVia, v3d, &pVia->cb, 0, 0, pDst->drawable.width,
                       pDst->drawable.height);
 
     return TRUE;
@@ -465,9 +465,9 @@ viaExaComposite_H2(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
     }
 
     if (pVia->maskP || pVia->srcP)
-        v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+        v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
 
-    v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY,
+    v3d->emitQuad(pVia, v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY,
                   width, height);
 }
 
@@ -491,7 +491,7 @@ viaAccelTextureBlit(ScrnInfoPtr pScrn, unsigned long srcOffset,
     v3d->setTexture(v3d, 0, srcOffset, srcPitch, TRUE,
                     1 << wOrder, 1 << hOrder, srcFormat,
                     via_single, via_single, via_src, FALSE);
-    v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
-    v3d->emitClipRect(v3d, &pVia->cb, dstX, dstY, w, h);
-    v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, 0, 0, w, h);
+    v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+    v3d->emitClipRect(pVia, v3d, &pVia->cb, dstX, dstY, w, h);
+    v3d->emitQuad(pVia, v3d, &pVia->cb, dstX, dstY, srcX, srcY, 0, 0, w, h);
 }
diff --git a/src/via_exa_h6.c b/src/via_exa_h6.c
index 576eeb0..a5e227a 100644
--- a/src/via_exa_h6.c
+++ b/src/via_exa_h6.c
@@ -450,8 +450,8 @@ viaExaPrepareComposite_H6(int op, PicturePtr pSrcPicture,
     }
 
     v3d->setFlags(v3d, curTex, FALSE, TRUE, TRUE);
-    v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
-    v3d->emitClipRect(v3d, &pVia->cb, 0, 0, pDst->drawable.width,
+    v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+    v3d->emitClipRect(pVia, v3d, &pVia->cb, 0, 0, pDst->drawable.width,
                       pDst->drawable.height);
 
     return TRUE;
@@ -478,8 +478,8 @@ viaExaComposite_H6(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
     }
 
     if (pVia->maskP || pVia->srcP)
-        v3d->emitState(v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
+        v3d->emitState(pVia, v3d, &pVia->cb, viaCheckUpload(pScrn, v3d));
 
-    v3d->emitQuad(v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY,
+    v3d->emitQuad(pVia, v3d, &pVia->cb, dstX, dstY, srcX, srcY, maskX, maskY,
                   width, height);
 }
commit 0517fba82a6286b96177bb4441a120a91bc14c04
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:39:37 2023 -0700

    Fix indentation of via_3d.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_3d.h b/src/via_3d.h
index c07eed4..0e87e66 100644
--- a/src/via_3d.h
+++ b/src/via_3d.h
@@ -113,8 +113,8 @@ typedef struct _Via3DState
         Bool forceUpload);
     void (*emitClipRect) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
         int x, int y, int w, int h);
-        Bool(*dstSupported) (int format);
-        Bool(*texSupported) (int format);
+    Bool(*dstSupported) (int format);
+    Bool(*texSupported) (int format);
 } Via3DState;
 
 void viaInit3DState(Via3DState * v3d);
commit 7bb0fe0211c3c8be97db70ca436a4dffa6e11023
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:24:36 2023 -0700

    Convert tabs to white spaces of via_3d.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_3d.h b/src/via_3d.h
index 15be0be..c07eed4 100644
--- a/src/via_3d.h
+++ b/src/via_3d.h
@@ -93,26 +93,26 @@ typedef struct _Via3DState
     Bool useDestAlpha;
     ViaTextureUnit tex[VIA_NUM_TEXUNITS];
     void (*setDestination) (struct _Via3DState * v3d, CARD32 offset,
-	CARD32 pitch, int format);
+        CARD32 pitch, int format);
     void (*setDrawing) (struct _Via3DState * v3d, int rop,
-	CARD32 planeMask, CARD32 solidColor, CARD32 solidAlpha);
+        CARD32 planeMask, CARD32 solidColor, CARD32 solidAlpha);
     void (*setFlags) (struct _Via3DState * v3d, int numTextures,
-	Bool writeAlpha, Bool writeColor, Bool blend);
+        Bool writeAlpha, Bool writeColor, Bool blend);
         Bool(*setTexture) (struct _Via3DState * v3d, int tex, CARD32 offset,
-	CARD32 pitch, Bool nPot, CARD32 width, CARD32 height, int format,
-	ViaTextureModes sMode, ViaTextureModes tMode,
-	ViaTexBlendingModes blendingMode, Bool agpTexture);
+        CARD32 pitch, Bool nPot, CARD32 width, CARD32 height, int format,
+        ViaTextureModes sMode, ViaTextureModes tMode,
+        ViaTexBlendingModes blendingMode, Bool agpTexture);
     void (*setTexBlendCol) (struct _Via3DState * v3d, int tex, Bool component,
-	CARD32 color);
+        CARD32 color);
     void (*setCompositeOperator) (struct _Via3DState * v3d, CARD8 op);
         Bool(*opSupported) (CARD8 op);
     void (*emitQuad) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
-	int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w,
-	int h);
+        int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w,
+        int h);
     void (*emitState) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
-	Bool forceUpload);
+        Bool forceUpload);
     void (*emitClipRect) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
-	int x, int y, int w, int h);
+        int x, int y, int w, int h);
         Bool(*dstSupported) (int format);
         Bool(*texSupported) (int format);
 } Via3DState;
commit a3b039615155f2f01baeb5b523862be74fa42270
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:24:35 2023 -0700

    Rearrange macro declarations inside via_dmabuffer.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index baac364..92106c8 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -42,12 +42,35 @@ typedef struct _ViaCommandBuffer
 
 #define VIA_DMASIZE 16384
 
-#define H1_ADDR(val) \
-    (((val) >> 2) | 0xF0000000)
+#define RING_VARS   \
+    ViaCommandBuffer *cb = &pVia->cb
+
+#define ADVANCE_RING    \
+    cb->flushFunc(cb)
 
 #define WAITFLAGS(flags)    \
     (cb)->waitFlags |= (flags)
 
+#define H1_ADDR(val) \
+    (((val) >> 2) | 0xF0000000)
+
+#define OUT_RING(val)                   \
+    do {                                \
+        (cb)->buf[(cb)->pos++] = (val); \
+    } while(0);
+
+#define OUT_RING_QW(val1, val2)             \
+    do {                                    \
+        (cb)->buf[(cb)->pos++] = (val1);    \
+        (cb)->buf[(cb)->pos++] = (val2);    \
+    } while (0)
+
+#define OUT_RING_H1(val1, val2) \
+    OUT_RING_QW(H1_ADDR(val1), val2)
+
+#define OUT_RING_SubA(val1, val2)   \
+    OUT_RING(((val1) << HC_SubA_SHIFT) | ((val2) & HC_Para_MASK))
+
 #define BEGIN_RING(size)                                            \
     do {                                                            \
         if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {    \
@@ -72,27 +95,4 @@ typedef struct _ViaCommandBuffer
         }                                                               \
     } while(0);
 
-#define OUT_RING(val)                   \
-    do {                                \
-        (cb)->buf[(cb)->pos++] = (val); \
-    } while(0);
-
-#define OUT_RING_QW(val1, val2)             \
-    do {                                    \
-        (cb)->buf[(cb)->pos++] = (val1);    \
-        (cb)->buf[(cb)->pos++] = (val2);    \
-    } while (0)
-
-#define ADVANCE_RING    \
-    cb->flushFunc(cb)
-
-#define RING_VARS   \
-    ViaCommandBuffer *cb = &pVia->cb
-
-#define OUT_RING_H1(val1, val2) \
-    OUT_RING_QW(H1_ADDR(val1), val2)
-
-#define OUT_RING_SubA(val1, val2)   \
-    OUT_RING(((val1) << HC_SubA_SHIFT) | ((val2) & HC_Para_MASK))
-
 #endif
commit 9b9dcbbd823348dbcf2d72d734ed8037ccf3f790
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:24:35 2023 -0700

    Fix indentation of via_dmabuffer.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index 9089219..baac364 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -42,54 +42,57 @@ typedef struct _ViaCommandBuffer
 
 #define VIA_DMASIZE 16384
 
-#define H1_ADDR(val) (((val) >> 2) | 0xF0000000)
-#define WAITFLAGS(flags)                        \
+#define H1_ADDR(val) \
+    (((val) >> 2) | 0xF0000000)
+
+#define WAITFLAGS(flags)    \
     (cb)->waitFlags |= (flags)
 
-#define BEGIN_RING(size)                                        \
-    do {                                                                \
-        if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {        \
-            cb->flushFunc(cb);                                  \
-        }                                                               \
+#define BEGIN_RING(size)                                            \
+    do {                                                            \
+        if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {    \
+            cb->flushFunc(cb);                                      \
+        }                                                           \
     } while(0)
 
-#define BEGIN_H2(paraType, h2size)                      \
-  do{                                                   \
-    BEGIN_RING((h2size)+6);                             \
-    if (cb->mode == 2 && (paraType) == cb->rindex)      \
-      break;                                            \
-    if (cb->pos & 1)                                    \
-      OUT_RING(HC_DUMMY);                               \
-    cb->header_start = cb->pos;                         \
-    cb->rindex = paraType;                              \
-    cb->mode = 2;                                       \
-    OUT_RING(HALCYON_HEADER2);                          \
-    OUT_RING((paraType) << 16);                                         \
-    if (!cb->has3dState && ((paraType) != HC_ParaType_CmdVdata)) {      \
-      cb->has3dState = TRUE;                                            \
-    }                                                                   \
-  } while(0);
+#define BEGIN_H2(paraType, h2size)                                      \
+    do {                                                                \
+        BEGIN_RING((h2size)+6);                                         \
+        if (cb->mode == 2 && (paraType) == cb->rindex)                  \
+            break;                                                      \
+        if (cb->pos & 1)                                                \
+            OUT_RING(HC_DUMMY);                                         \
+        cb->header_start = cb->pos;                                     \
+        cb->rindex = paraType;                                          \
+        cb->mode = 2;                                                   \
+        OUT_RING(HALCYON_HEADER2);                                      \
+        OUT_RING((paraType) << 16);                                     \
+        if (!cb->has3dState && ((paraType) != HC_ParaType_CmdVdata)) {  \
+            cb->has3dState = TRUE;                                      \
+        }                                                               \
+    } while(0);
 
-#define OUT_RING(val) do{       \
+#define OUT_RING(val)                   \
+    do {                                \
         (cb)->buf[(cb)->pos++] = (val); \
     } while(0);
 
-#define OUT_RING_QW(val1, val2)                 \
-    do {                                                \
-        (cb)->buf[(cb)->pos++] = (val1);                \
-        (cb)->buf[(cb)->pos++] = (val2);                \
+#define OUT_RING_QW(val1, val2)             \
+    do {                                    \
+        (cb)->buf[(cb)->pos++] = (val1);    \
+        (cb)->buf[(cb)->pos++] = (val2);    \
     } while (0)
 
-#define ADVANCE_RING \
-  cb->flushFunc(cb)
+#define ADVANCE_RING    \
+    cb->flushFunc(cb)
 
-#define RING_VARS \
-  ViaCommandBuffer *cb = &pVia->cb
+#define RING_VARS   \
+    ViaCommandBuffer *cb = &pVia->cb
 
 #define OUT_RING_H1(val1, val2) \
-  OUT_RING_QW(H1_ADDR(val1), val2)
+    OUT_RING_QW(H1_ADDR(val1), val2)
 
-#define OUT_RING_SubA(val1, val2) \
-  OUT_RING(((val1) << HC_SubA_SHIFT) | ((val2) & HC_Para_MASK))
+#define OUT_RING_SubA(val1, val2)   \
+    OUT_RING(((val1) << HC_SubA_SHIFT) | ((val2) & HC_Para_MASK))
 
 #endif
commit d016c60f6b105075b063aa49e087d767a7f38750
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Wed Mar 22 14:24:35 2023 -0700

    Convert tabs to white spaces of via_drmbuffer.h
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index a872909..9089219 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -43,41 +43,41 @@ typedef struct _ViaCommandBuffer
 #define VIA_DMASIZE 16384
 
 #define H1_ADDR(val) (((val) >> 2) | 0xF0000000)
-#define WAITFLAGS(flags)			\
+#define WAITFLAGS(flags)                        \
     (cb)->waitFlags |= (flags)
 
-#define BEGIN_RING(size)					\
-    do {								\
-	if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {	\
-	    cb->flushFunc(cb);					\
-	}								\
+#define BEGIN_RING(size)                                        \
+    do {                                                                \
+        if (cb->flushFunc && (cb->pos > (cb->bufSize-(size)))) {        \
+            cb->flushFunc(cb);                                  \
+        }                                                               \
     } while(0)
 
-#define BEGIN_H2(paraType, h2size)			\
-  do{							\
-    BEGIN_RING((h2size)+6);				\
-    if (cb->mode == 2 && (paraType) == cb->rindex)	\
-      break;						\
-    if (cb->pos & 1)					\
-      OUT_RING(HC_DUMMY);				\
-    cb->header_start = cb->pos;				\
-    cb->rindex = paraType;				\
-    cb->mode = 2;					\
-    OUT_RING(HALCYON_HEADER2);				\
-    OUT_RING((paraType) << 16);						\
-    if (!cb->has3dState && ((paraType) != HC_ParaType_CmdVdata)) {	\
-      cb->has3dState = TRUE;						\
-    }									\
+#define BEGIN_H2(paraType, h2size)                      \
+  do{                                                   \
+    BEGIN_RING((h2size)+6);                             \
+    if (cb->mode == 2 && (paraType) == cb->rindex)      \
+      break;                                            \
+    if (cb->pos & 1)                                    \
+      OUT_RING(HC_DUMMY);                               \
+    cb->header_start = cb->pos;                         \
+    cb->rindex = paraType;                              \
+    cb->mode = 2;                                       \
+    OUT_RING(HALCYON_HEADER2);                          \
+    OUT_RING((paraType) << 16);                                         \
+    if (!cb->has3dState && ((paraType) != HC_ParaType_CmdVdata)) {      \
+      cb->has3dState = TRUE;                                            \
+    }                                                                   \
   } while(0);
 
-#define OUT_RING(val) do{	\
-	(cb)->buf[(cb)->pos++] = (val);	\
+#define OUT_RING(val) do{       \
+        (cb)->buf[(cb)->pos++] = (val); \
     } while(0);
 
-#define OUT_RING_QW(val1, val2)			\
-    do {						\
-	(cb)->buf[(cb)->pos++] = (val1);		\
-	(cb)->buf[(cb)->pos++] = (val2);		\
+#define OUT_RING_QW(val1, val2)                 \
+    do {                                                \
+        (cb)->buf[(cb)->pos++] = (val1);                \
+        (cb)->buf[(cb)->pos++] = (val2);                \
     } while (0)
 
 #define ADVANCE_RING \


More information about the openchrome-devel mailing list