From c01c27d968ebc382d89b097b9eb08bba7f164217 Mon Sep 17 00:00:00 2001 From: Lucas Eriksson Date: Sat, 18 Aug 2018 02:20:48 +0200 Subject: [PATCH 1/4] nv2a: Fix EXP and LOG According to the NV_vertex_program specification, our implementations of these functions were wrong. spec: https://www.khronos.org/registry/OpenGL/extensions/NV/NV_vertex_program.txt --- hw/xbox/nv2a/nv2a_vsh.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_vsh.c b/hw/xbox/nv2a/nv2a_vsh.c index 97ccb58101..1518f2d679 100644 --- a/hw/xbox/nv2a/nv2a_vsh.c +++ b/hw/xbox/nv2a/nv2a_vsh.c @@ -674,13 +674,25 @@ static const char* vsh_header = "#define EXP(dest, mask, src) dest.mask = _EXP(_in(src).x).mask\n" "vec4 _EXP(float src)\n" "{\n" - " return vec4(exp2(src));\n" + " vec4 result;\n" + " result.x = exp2(floor(src));\n" + " result.y = src - floor(src);\n" + " result.z = exp2(src);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LOG(dest, mask, src) dest.mask = _LOG(_in(src).x).mask\n" "vec4 _LOG(float src)\n" "{\n" - " return vec4(log2(src));\n" + " float tmp = abs(src);\n" + " if (tmp == 0.0) { return vec4(-INFINITY, 1.0f, -INFINITY, 1.0f); }\n" + " vec4 result;\n" + " result.x = floor(log2(tmp));\n" + " result.y = tmp / exp2(floor(log2(tmp)));\n" + " result.z = log2(tmp);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LIT(dest, mask, src) dest.mask = _LIT(_in(src)).mask\n" From 5246cad0c12850412a56c8b30d144fc303119599 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 2 Sep 2018 15:43:36 -0700 Subject: [PATCH 2/4] nvnet: don't trigger interrupt if no packets are sent --- hw/xbox/nvnet.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xbox/nvnet.c b/hw/xbox/nvnet.c index 6de7b75467..efd94ae54c 100644 --- a/hw/xbox/nvnet.c +++ b/hw/xbox/nvnet.c @@ -28,6 +28,7 @@ #define IOPORT_SIZE 0x8 #define MMIO_SIZE 0x400 +// #define DEBUG #ifdef DEBUG # define NVNET_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) # define NVNET_DUMP_PACKETS_TO_SCREEN @@ -692,6 +693,7 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) struct RingDesc desc; bool is_last_packet; int i; + bool packet_sent = false; for (i = 0; i < s->tx_ring_size; i++) { /* Read ring descriptor */ @@ -716,6 +718,7 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) pci_dma_read(&s->dev, desc.packet_buffer, s->txrx_dma_buf, desc.length + 1); nvnet_send_packet(s, s->txrx_dma_buf, desc.length + 1); + packet_sent = true; /* Update descriptor */ is_last_packet = desc.flags & NV_TX_LASTPACKET; @@ -732,9 +735,11 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) } /* Trigger interrupt */ - NVNET_DPRINTF("Triggering interrupt\n"); - nvnet_set_reg(s, NvRegIrqStatus, NVREG_IRQSTAT_BIT4, 4); - nvnet_update_irq(s); + if (packet_sent) { + NVNET_DPRINTF("Triggering interrupt\n"); + nvnet_set_reg(s, NvRegIrqStatus, NVREG_IRQSTAT_BIT4, 4); + nvnet_update_irq(s); + } return 0; } From 9b8904eda01881e771b1a12d8201390b7fa79303 Mon Sep 17 00:00:00 2001 From: wutno Date: Wed, 5 Sep 2018 13:51:15 -0400 Subject: [PATCH 3/4] Update configure with --disable-stack-protector As noted in #106 this will produce working builds with GCC versions over 7.3.0-2. Upstream has already done this work-a-round. --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index be07f506b8..07d324c771 100755 --- a/build.sh +++ b/build.sh @@ -44,7 +44,7 @@ set -x # Print commands from now on --enable-debug \ --extra-cflags="$CFLAGS_COMMON $CFLAGS" \ $CONFIGURE \ - --target-list=i386-softmmu \ + --target-list=i386-softmmu \ --enable-sdl \ --with-sdlabi=2.0 \ --disable-curl \ @@ -60,6 +60,7 @@ set -x # Print commands from now on --disable-libiscsi \ --disable-spice \ --disable-user \ + --disable-stack-protector \ time make -j`nproc` 2>&1 | tee build.log From faf09c632d4bd3984e3241c20e6f45aead5fa7b8 Mon Sep 17 00:00:00 2001 From: Lucas Eriksson Date: Thu, 2 Aug 2018 11:36:50 +0200 Subject: [PATCH 4/4] ui: Fix AppVeyor build "-dirty"-bug --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 00270c96b3..55d85f6c53 100644 --- a/Makefile +++ b/Makefile @@ -443,7 +443,7 @@ qemu-version.h: FORCE else \ if test -d .git; then \ pkgvers=$$(git rev-parse --short HEAD 2>/dev/null | tr -d '\n');\ - if ! git diff-index --quiet HEAD &>/dev/null; then \ + if ! git diff --quiet HEAD >/dev/null 2>&1; then \ pkgvers="$${pkgvers}-dirty"; \ fi; \ fi; \