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 avoid stalling th...
details: https://anonhg.NetBSD.org/xsrc/rev/a50bff0b0757
branches: trunk
changeset: 10369:a50bff0b0757
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jul 24 16:07:59 2019 +0000
description:
avoid stalling the CPU by letting the SX instruction FIFO drain every couple
of memory instructions.
No more missed IPIs when building stuff in an xterm so far...
diffstat:
external/mit/xf86-video-suncg14/dist/src/cg14.h | 11 ++++++++++-
external/mit/xf86-video-suncg14/dist/src/cg14_accel.c | 4 ++--
external/mit/xf86-video-suncg14/dist/src/cg14_render.c | 3 +--
3 files changed, 13 insertions(+), 5 deletions(-)
diffs (78 lines):
diff -r cd77004fe056 -r a50bff0b0757 external/mit/xf86-video-suncg14/dist/src/cg14.h
--- a/external/mit/xf86-video-suncg14/dist/src/cg14.h Tue Jul 23 12:01:53 2019 +0000
+++ b/external/mit/xf86-video-suncg14/dist/src/cg14.h Wed Jul 24 16:07:59 2019 +0000
@@ -31,6 +31,7 @@
#include "gcstruct.h"
#include "xf86sbusBus.h"
#include "exa.h"
+#include <sparc/sxreg.h>
/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
#define CG14_REGS_VOFF 0x00000000 /* registers */
@@ -100,7 +101,8 @@
uint32_t fillcolour;
int op;
Bool source_is_solid, no_source_pixmap;
- int xdir, ydir;
+ int xdir, ydir;
+ int queuecount;
ExaDriverPtr pExa;
} Cg14Rec, *Cg14Ptr;
@@ -123,7 +125,14 @@
static inline void
write_sx_io(Cg14Ptr p, int reg, uint32_t val)
{
+ if (p->queuecount > 6) {
+ /* let the queue drain to avoid stalling the CPU */
+ do { } while
+ ((read_sx_reg(p, SX_CONTROL_STATUS) & SX_MT) == 0);
+ p->queuecount = 0;
+ }
*(volatile uint32_t *)(p->sxio + (reg & ~7)) = val;
+ p->queuecount++;
}
Bool CG14SetupCursor(ScreenPtr);
diff -r cd77004fe056 -r a50bff0b0757 external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
--- a/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c Tue Jul 23 12:01:53 2019 +0000
+++ b/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c Wed Jul 24 16:07:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.14 2019/03/01 02:22:27 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.15 2019/07/24 16:07:59 macallan Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
* All rights reserved.
@@ -41,7 +41,6 @@
#include "compiler.h"
#include "cg14.h"
-#include <sparc/sxreg.h>
/*#define SX_DEBUG*/
@@ -1121,6 +1120,7 @@
pExa->UploadToScreen = CG14UploadToScreen;
pExa->DownloadFromScreen = CG14DownloadFromScreen;
+ p->queuecount = 0;
/* do some hardware init */
write_sx_reg(p, SX_PLANEMASK, 0xffffffff);
p->last_mask = 0xffffffff;
diff -r cd77004fe056 -r a50bff0b0757 external/mit/xf86-video-suncg14/dist/src/cg14_render.c
--- a/external/mit/xf86-video-suncg14/dist/src/cg14_render.c Tue Jul 23 12:01:53 2019 +0000
+++ b/external/mit/xf86-video-suncg14/dist/src/cg14_render.c Wed Jul 24 16:07:59 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_render.c,v 1.12 2017/12/08 22:49:37 macallan Exp $ */
+/* $NetBSD: cg14_render.c,v 1.13 2019/07/24 16:07:59 macallan Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
* All rights reserved.
@@ -41,7 +41,6 @@
#include "compiler.h"
#include "cg14.h"
-#include <sparc/sxreg.h>
/*#define SX_SINGLE*/
/*#define SX_RENDER_DEBUG*/
Home |
Main Index |
Thread Index |
Old Index