From c2eb7730296d53c39bcf230b0d8334499324e782 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 10 Mar 2025 23:27:19 +0600 Subject: [PATCH 1/4] Qt: Fix more compile errors --- src/qt/qt_openglshadermanagerdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_openglshadermanagerdialog.cpp b/src/qt/qt_openglshadermanagerdialog.cpp index 0bf083252..7f8a19414 100644 --- a/src/qt/qt_openglshadermanagerdialog.cpp +++ b/src/qt/qt_openglshadermanagerdialog.cpp @@ -46,7 +46,7 @@ OpenGLShaderManagerDialog::OpenGLShaderManagerDialog(QWidget *parent) QListWidgetItem* item = new QListWidgetItem(ui->shaderListWidget); item->setText(filename); item->setData(Qt::UserRole + 1, QString(gl3_shader_file[i])); - item->setData(Qt::UserRole + 2, (uintptr_t)shaderfile); + item->setData(Qt::UserRole + 2, (qulonglong)(uintptr_t)shaderfile); } } } @@ -174,7 +174,7 @@ void OpenGLShaderManagerDialog::on_buttonAdd_clicked() QListWidgetItem* item = new QListWidgetItem(ui->shaderListWidget); item->setText(filename); item->setData(Qt::UserRole + 1, res); - item->setData(Qt::UserRole + 2, (uintptr_t)shaderfile); + item->setData(Qt::UserRole + 2, (qulonglong)(uintptr_t)shaderfile); if (ui->shaderListWidget->count()) { ui->shaderListWidget->setCurrentRow(ui->shaderListWidget->count() - 1); } From 2e77b47f89ec960416bb362dc75551afedd77800 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 11 Mar 2025 00:13:51 +0600 Subject: [PATCH 2/4] Call `glViewport` with correct function pointer --- src/qt/qt_openglrenderer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 37afd4810..6f024f36f 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -1103,14 +1103,6 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h) context->makeCurrent(this); -#ifdef Q_OS_MACOS - glViewport( - destination.x() * devicePixelRatio(), - destination.y() * devicePixelRatio(), - destination.width() * devicePixelRatio(), - destination.height() * devicePixelRatio()); -#endif - if (source.width() != w || source.height() != h) { glw.glBindTexture(GL_TEXTURE_2D, scene_texture.id); glw.glTexImage2D(GL_TEXTURE_2D, 0, (GLenum) QOpenGLTexture::RGBA8_UNorm, w, h, 0, (GLenum) QOpenGLTexture::BGRA, (GLenum) QOpenGLTexture::UInt32_RGBA8_Rev, NULL); @@ -1129,6 +1121,14 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h) source.setRect(x, y, w, h); onResize(this->width(), this->height()); +#ifdef Q_OS_MACOS + glw.glViewport( + destination.x() * devicePixelRatio(), + destination.y() * devicePixelRatio(), + destination.width() * devicePixelRatio(), + destination.height() * devicePixelRatio()); +#endif + if (video_framerate == -1) render(); } From f1720fdee481a226e4cc4269296a49be03269553 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Tue, 11 Mar 2025 01:20:00 +0600 Subject: [PATCH 3/4] Attempt fixing crash on NetBSD --- src/qt/qt_platform.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 35dbc0081..a1deb4137 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -368,6 +368,8 @@ plat_mmap(size_t size, uint8_t executable) void *ret = mmap(0, size, PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0), MAP_ANON | MAP_PRIVATE | (executable ? MAP_JIT : 0), -1, 0); # elif defined(PROT_MPROTECT) void *ret = mmap(0, size, PROT_MPROTECT(PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0)), MAP_ANON | MAP_PRIVATE, -1, 0); + if (ret) + mprotect(ret, size, PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0)); # else void *ret = mmap(0, size, PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0), MAP_ANON | MAP_PRIVATE, -1, 0); # endif From df5cc9b03876ac34f296a8ad900e116182fee47f Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 10 Mar 2025 21:31:29 +0100 Subject: [PATCH 4/4] VIA PIPC: Restore old readout on the VT82C596/B southbridges, where it was correct, fixes the P6BAT. --- src/chipset/via_pipc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index 11a192450..f7f5bf208 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -61,6 +61,7 @@ #define VIA_PIPC_586B 0x05864700 #define VIA_PIPC_596A 0x05960900 #define VIA_PIPC_596B 0x05962300 +#define VIA_PIPC_596 0x0596 #define VIA_PIPC_686A 0x06861400 #define VIA_PIPC_686B 0x06864000 #define VIA_PIPC_8231 0x82311000 @@ -413,7 +414,7 @@ pipc_reset_hard(void *priv) dev->power_regs[0x34] = 0x68; dev->power_regs[0x40] = 0x20; - dev->power_regs[0x42] = 0x00; + dev->power_regs[0x42] = ((dev->local >> 16) == VIA_PIPC_596) ? 0x50 : 0x00; acpi_set_irq_line(dev->acpi, 0x00); dev->power_regs[0x48] = 0x01; @@ -1595,7 +1596,7 @@ pipc_reset(void *priv) pipc_write(pm_func, 0x48, 0x01, priv); pipc_write(pm_func, 0x49, 0x00, priv); - dev->power_regs[0x42] = 0x00; + dev->power_regs[0x42] = ((dev->local >> 16) == VIA_PIPC_596) ? 0x50 : 0x00; acpi_set_irq_line(dev->acpi, 0x00); pipc_write(1, 0x04, 0x80, priv);