Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xf86-video-suncg14/dist/src don't pretend to ...



details:   https://anonhg.NetBSD.org/xsrc/rev/7453a5d9c577
branches:  trunk
changeset: 6974:7453a5d9c577
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed May 11 19:35:06 2022 +0000

description:
don't pretend to support PictOpSrc - those can be quite a bit more complicated
than simple copy ops
With this gtk3 buttons are still occasionally glitchy but at least we don't
crash anymore

diffstat:

 external/mit/xf86-video-suncg14/dist/src/cg14_accel.c |  26 +++++++++++++-----
 1 files changed, 18 insertions(+), 8 deletions(-)

diffs (88 lines):

diff -r 06678710126d -r 7453a5d9c577 external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
--- a/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c     Wed May 11 17:13:04 2022 +0000
+++ b/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c     Wed May 11 19:35:06 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.29 2022/03/04 05:56:55 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.30 2022/05/11 19:35:06 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -43,12 +43,17 @@
 #include "cg14.h"
 
 //#define SX_DEBUG
+#define SX_TRACE
+
+#ifdef SX_TRACE
+#define ENTER xf86Msg(X_ERROR, "%s>\n", __func__);
+#else
+#define ENTER
+#endif
 
 #ifdef SX_DEBUG
-#define ENTER xf86Msg(X_ERROR, "%s>\n", __func__);
 #define DPRINTF xf86Msg
 #else
-#define ENTER
 #define DPRINTF while (0) xf86Msg
 #endif
 
@@ -98,7 +103,7 @@
        Cg14Ptr p = GET_CG14_FROM_SCRN(pScrn);
 
        ENTER;
-       DPRINTF(X_ERROR, "%s bpp %d rop %x\n", __func__,
+       xf86Msg(X_ERROR, "%s bpp %d rop %x\n", __func__,
            pSrcPixmap->drawable.bitsPerPixel, alu);
 
        if (planemask != p->last_mask) {
@@ -1162,7 +1167,7 @@
         * over time and likely have to spill over into its own source file.
         */
        
-       if ((op != PictOpOver) && (op != PictOpAdd) && (op != PictOpSrc)) {
+       if ((op != PictOpOver) && (op != PictOpAdd)/* && (op != PictOpSrc)*/) {
                DPRINTF(X_ERROR, "%s: rejecting %d\n", __func__, op);
                return FALSE;
        }
@@ -1223,10 +1228,10 @@
        p->source_is_solid = FALSE;
 
        if (pSrcPicture->format == PICT_a1) {
-               xf86Msg(X_ERROR, "src mono, dst %x, op %d\n",
+               DPRINTF(X_ERROR, "src mono, dst %x, op %d\n",
                    pDstPicture->format, op);
                if (pMaskPicture != NULL) {
-                       xf86Msg(X_ERROR, "msk %x\n", pMaskPicture->format);
+                       DPRINTF(X_ERROR, "msk %x\n", pMaskPicture->format);
                }
        }
        if (pSrcPicture->pSourcePict != NULL) {
@@ -1244,7 +1249,7 @@
                    SourcePictTypeSolidFill) {
                        p->fillcolour = 
                           pMaskPicture->pSourcePict->solidFill.color;
-                       xf86Msg(X_ERROR, "%s: solid mask %08x\n",
+                       DPRINTF(X_ERROR, "%s: solid mask %08x\n",
                            __func__, p->fillcolour);
                }
        }
@@ -1274,6 +1279,7 @@
 
                /* stuff source colour into SX registers, swap as needed */
                temp = p->fillcolour;
+               DPRINTF(X_ERROR, "solid %08x\n", temp);
                switch (p->srcformat) {
                        case PICT_a8r8g8b8:
                        case PICT_x8r8g8b8:
@@ -1296,6 +1302,10 @@
        }
        p->op = op;
        if (op == PictOpSrc) {
+               if (pSrc == NULL) {
+                       DPRINTF(X_ERROR, "src type %d\n", pSrcPicture->pSourcePict->type);
+                       return FALSE;
+               }
                CG14PrepareCopy(pSrc, pDst, 1, 1, GXcopy, 0xffffffff);
        }
 #ifdef SX_DEBUG



Home | Main Index | Thread Index | Old Index