From 4de545a13aa01b167c52f1cff19b2e9b3aa7ec12 Mon Sep 17 00:00:00 2001
From: "Brian C. Woodcox" <bw@InSkyData.com>
Date: Fri, 24 Apr 2020 16:35:45 -0600
Subject: [PATCH] Update to use panfrost for graphics hardware acceleration

---
 gnu/packages/gl.scm                           |  27 +--
 gnu/packages/gnome.scm                        |  13 +-
 gnu/packages/linux.scm                        |   4 +-
 .../cogl-1.22.6-add-eglmesaext-header.patch   |  75 +++++++
 .../patches/mesa-skip-disk-cache-test.patch   |   7 +-
 .../mutter-3.32.2-add-eglmesaext-header.patch |  52 +++++
 .../webkitgtk-2.28.0-fix-bug-197192.patch     | 203 ++++++++++++++++++
 gnu/packages/qt.scm                           |   2 +
 gnu/packages/webkit.scm                       |   5 +-
 9 files changed, 364 insertions(+), 24 deletions(-)
 create mode 100644 gnu/packages/patches/cogl-1.22.6-add-eglmesaext-header.patch
 create mode 100644 gnu/packages/patches/mutter-3.32.2-add-eglmesaext-header.patch
 create mode 100644 gnu/packages/patches/webkitgtk-2.28.0-fix-bug-197192.patch

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 01241cd88e..65fe389927 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Brian C. Woodcox <bw@InSkyData.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -230,21 +231,21 @@ also known as DXTn or DXTC) for Mesa.")
            '(list "--disable-glx" "--disable-egl"))))))))
 
 (define-public mesa
-  (package
+  (let ((commit "69628ababbd79a5865c2c5bd01b4a963eb7800f9")
+        (revision "1"))
+   (package
     (name "mesa")
-    (version "19.3.4")
+    (version "20.1.0_devel.120669.69628ababbd")
     (source
-      (origin
-        (method url-fetch)
-        (uri (list (string-append "https://mesa.freedesktop.org/archive/"
-                                  "mesa-" version ".tar.xz")
-                   (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
-                                  "mesa-" version ".tar.xz")
-                   (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
-                                  version "/mesa-" version ".tar.xz")))
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "git://anongit.freedesktop.org/mesa/mesa")
+               (commit commit)))
+         (file-name (git-file-name "mesa-git" version))
         (sha256
          (base32
-          "1r4giqq7q7zqbn23lbw7v5vswagxx8qj6ij2w8bsb697mvk6g90x"))
+          "1bv39f466k6ig11byw2dmgib62vh9sm2hvi7rqcdplsaynxmbc6l"))
         (patches
          (search-patches "mesa-skip-disk-cache-test.patch"))))
     (build-system meson-build-system)
@@ -293,7 +294,7 @@ also known as DXTn or DXTC) for Mesa.")
        '(,@(match (%current-system)
              ((or "armhf-linux" "aarch64-linux")
               ;; TODO: Fix svga driver for aarch64 and armhf.
-              '("-Dgallium-drivers=etnaviv,freedreno,nouveau,r300,r600,swrast,tegra,v3d,vc4,virgl"))
+              '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
              (_
               '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
@@ -422,7 +423,7 @@ also known as DXTn or DXTC) for Mesa.")
 specifications - systems for rendering interactive 3D graphics.  A variety of
 device drivers allows Mesa to be used in many different environments ranging
 from software emulation to complete hardware acceleration for modern GPUs.")
-    (license license:x11)))
+    (license license:x11))))
 
 (define-public mesa-opencl
   (package
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 088de7dd4c..44d82b2c75 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -50,6 +50,7 @@
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2020 Naga Malleswari <nagamalli@riseup.net>
+;;; Copyright © 2020 Brian C. Woodcox <bw@InSkyData.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4425,15 +4426,17 @@ throughout GNOME for API documentation).")
 (define-public cogl
   (package
     (name "cogl")
-    (version "1.22.4")
+    (version "1.22.6")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://gnome/sources/cogl/"
                            (version-major+minor version) "/"
                            "cogl-" version ".tar.xz"))
+       (patches
+         (search-patches "cogl-1.22.6-add-eglmesaext-header.patch"))
        (sha256
-        (base32 "1q0drs82a8f6glg1v29bb6g2nf15fw0rvdx3d0rgcgfarfaby5sj"))))
+        (base32 "0x8v4n61q89qy27v824bqswpz6bmn801403w2q3pa1lcwk9ln4vd"))))
     ;; NOTE: mutter exports a bundled fork of cogl, so when making changes to
     ;; cogl, corresponding changes may be appropriate in mutter as well.
     (build-system gnu-build-system)
@@ -4462,7 +4465,7 @@ throughout GNOME for API documentation).")
      `(#:configure-flags (list "--enable-cogl-gst"
                                "--enable-wayland-egl-platform"
                                "--enable-wayland-egl-server"
-
+                               "--enable-gles2"
                                ;; Arrange to pass an absolute file name to
                                ;; dlopen for libGL.so.
                                (string-append "--with-gl-libname="
@@ -5872,6 +5875,9 @@ configuration program to choose applications starting on login.")
             (substitute* "installed-tests/js/testLocale.js"
               ((".*toBeDefined.*") "")
               ((".*expect\\(datestr\\).*") ""))
+            (substitute* "installed-tests/scripts/testCommandLine.sh"
+              (("gjs -c 'imports.system.exit(0)' && ! stat gjs-*.syscap") "")
+              (("gjs --profile -c 'imports.system.exit(0)' && ! stat gjs-*.syscap") ""))
             (substitute* "installed-tests/scripts/testCommandLine.sh"
               (("Valentín") "")
               (("☭") ""))
@@ -6029,6 +6035,7 @@ to display dialog boxes from the commandline and shell scripts.")
               (uri (string-append "mirror://gnome/sources/" name "/"
                                   (version-major+minor version) "/"
                                   name "-" version ".tar.xz"))
+              (patches (search-patches "mutter-3.32.2-add-eglmesaext-header.patch"))
               (sha256
                (base32
                 "1h577i2ap7dpfy1jg101jvc6nzccc0csgvd55ahydlr8f94frcva"))))
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index dd088ea24f..d4a36533ab 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -43,6 +43,7 @@
 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2020 Brian C. Woodcox <bw@InSkyData.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -326,7 +327,7 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
                   (with-directory-excursion dir
                     (setenv "PYTHON" (which "python"))
                     (format #t "Running deblob script...~%")
-                    (force-output)
+                    (force-output))
                     (invoke "/tmp/bin/deblob"))
 
                   (format #t "~%Packing new Linux-libre tarball...~%")
@@ -604,6 +605,7 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
     ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
     ;; All kernels should have NAMESPACES options enabled
     ("CONFIG_NAMESPACES" . #t)
+    ("CONFIG_DRM_PANFROST" . #t)
     ("CONFIG_UTS_NS" . #t)
     ("CONFIG_IPC_NS" . #t)
     ("CONFIG_USER_NS" . #t)
diff --git a/gnu/packages/patches/cogl-1.22.6-add-eglmesaext-header.patch b/gnu/packages/patches/cogl-1.22.6-add-eglmesaext-header.patch
new file mode 100644
index 0000000000..71117dd261
--- /dev/null
+++ b/gnu/packages/patches/cogl-1.22.6-add-eglmesaext-header.patch
@@ -0,0 +1,75 @@
+Add references to eglmesaext.h for build to succeed.
+This patch should not be necessary in the future as these
+have been added to eglext.h.
+See https://github.com/KhronosGroup/EGL-Registry/commit/1343ecc9f55d3e8ded6a42d7ccfd33391a1dd35f
+
+From: Brian Woodcox <bw@InSkyData.com>
+Date: March 18, 2020
+
+--- a/configure
++++ b/configure
+@@ -24156,8 +24156,9 @@
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_EGL_EGLEXT_H 1
+ _ACEOF
+- COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
+-#include <EGL/eglext.h>"
++ COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES
++#include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>"
+ fi
+ 
+ done
+@@ -25565,8 +25566,8 @@
+ fi
+ 
+         COGL_EGL_INCLUDES="#include <EGL/egl.h>
+-#include <EGL/eglext.h>"
+-
++#include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>"
+ 
+ fi
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -685,10 +685,15 @@
+             AC_SUBST([COGL_EGL_INCLUDES])
+ 
+             AC_CHECK_HEADERS([EGL/eglext.h],
+-                             [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
++                             [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES
+ #include <EGL/eglext.h>"],
+                              [],
+                              [$COGL_EGL_INCLUDES])
++            AC_CHECK_HEADERS([EGL/eglmesaext.h],
++                             [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES
++#include <EGL/eglmesaext.h>"],
++                             [],
++                             [$COGL_EGL_INCLUDES])
+ 
+             # Check for a GLES 1.x Common Profile library with/without EGL.
+             #
+@@ -1216,6 +1221,13 @@
+               [],
+               [AC_MSG_ERROR([Unable to locate required EGL headers])],
+               [#include <EGL/egl.h>])
++            AC_CHECK_HEADERS(
++              [EGL/eglmesaext.h],
++              [],
++              [AC_MSG_ERROR([Unable to locate required EGL headers])],
++              [#include <EGL/egl.h>
++#include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>])
+ 
+             AC_CHECK_LIB(EGL, [eglInitialize],
+               [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
+@@ -1226,7 +1238,8 @@
+           )
+ 
+         COGL_EGL_INCLUDES="#include <EGL/egl.h>
+-#include <EGL/eglext.h>"
++#include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>"
+         AC_SUBST([COGL_EGL_INCLUDES])
+       ])
diff --git a/gnu/packages/patches/mesa-skip-disk-cache-test.patch b/gnu/packages/patches/mesa-skip-disk-cache-test.patch
index 190f6b6ee1..585bf4f648 100644
--- a/gnu/packages/patches/mesa-skip-disk-cache-test.patch
+++ b/gnu/packages/patches/mesa-skip-disk-cache-test.patch
@@ -1,11 +1,6 @@
-disk_cache_create() here looks up the users home directory from <pwd.h>
-which resolves to "/" in the build environment. I could not find an easy
-way to set the home directory to something else, so we disable this test
-for now.
-
 --- a/src/compiler/glsl/tests/cache_test.c
 +++ b/src/compiler/glsl/tests/cache_test.c
-@@ -170,11 +170,6 @@
+@@ -219,11 +219,6 @@
     unsetenv("MESA_GLSL_CACHE_DIR");
     unsetenv("XDG_CACHE_HOME");
  
diff --git a/gnu/packages/patches/mutter-3.32.2-add-eglmesaext-header.patch b/gnu/packages/patches/mutter-3.32.2-add-eglmesaext-header.patch
new file mode 100644
index 0000000000..1d80c4e842
--- /dev/null
+++ b/gnu/packages/patches/mutter-3.32.2-add-eglmesaext-header.patch
@@ -0,0 +1,52 @@
+Add references to eglmesaext.h for build to succeed.
+This patch should not be necessary in the future as these
+have been added to eglext.h.   
+See https://github.com/KhronosGroup/EGL-Registry/commit/1343ecc9f55d3e8ded6a42d7ccfd33391a1dd35f
+
+From: Brian Woodcox <bw@InSkyData.com>
+Date: March 18, 2020
+
+--- a/cogl/cogl/meson.build
++++ b/cogl/cogl/meson.build
+@@ -48,7 +48,7 @@
+ built_headers += [cogl_gl_header_h]
+ 
+ if have_egl
+-  cogl_egl_includes_string = '#include <EGL/egl.h>\n#include <EGL/eglext.h>'
++  cogl_egl_includes_string = '#include <EGL/egl.h>\n#include <EGL/eglext.h>\n#include <EGL/eglmesaext.h>'
+ else
+   cogl_egl_includes_string = ''
+ endif
+
+--- a/src/backends/meta-egl-ext.h
++++ b/src/backends/meta-egl-ext.h
+@@ -29,6 +29,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ /*
+  * This is a little different to the tests shipped with EGL implementations,
+
+--- a/src/backends/meta-egl.c
++++ b/src/backends/meta-egl.c
+@@ -26,6 +26,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <gio/gio.h>
+ #include <glib.h>
+ #include <glib-object.h>
+
+--- a/src/backends/meta-egl.h
++++ b/src/backends/meta-egl.h
+@@ -27,6 +27,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <glib-object.h>
+ 
+ #define META_EGL_ERROR meta_egl_error_quark ()
diff --git a/gnu/packages/patches/webkitgtk-2.28.0-fix-bug-197192.patch b/gnu/packages/patches/webkitgtk-2.28.0-fix-bug-197192.patch
new file mode 100644
index 0000000000..251b2f271c
--- /dev/null
+++ b/gnu/packages/patches/webkitgtk-2.28.0-fix-bug-197192.patch
@@ -0,0 +1,203 @@
+There was a bug in older Cortex-A53, however in newer versions of Cortex-A53,
+webkit fails to build.  The code is removed for newer versions of Cortex-A53.   
+See https://bugs.webkit.org/show_bug.cgi?id=197192
+
+From: Brian Woodcox <bw@InSkyData.com>
+Date: March 18, 2020
+
+--- a/Source/JavaScriptCore/assembler/ARM64Assembler.h
++++ a/Source/JavaScriptCore/assembler/ARM64Assembler.h
+@@ -740,7 +740,6 @@
+     {
+         ASSERT(!(offset & 0xfff));
+         insn(pcRelative(true, offset >> 12, rd));
+-        nopCortexA53Fix843419();
+     }
+ 
+     template<int datasize, SetFlags setFlags = DontSetFlags>
+@@ -1390,7 +1389,6 @@
+     ALWAYS_INLINE void madd(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+         CHECK_DATASIZE();
+-        nopCortexA53Fix835769<datasize>();
+         insn(dataProcessing3Source(DATASIZE, DataOp_MADD, rm, ra, rn, rd));
+     }
+ 
+@@ -1443,7 +1441,6 @@
+     ALWAYS_INLINE void msub(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+         CHECK_DATASIZE();
+-        nopCortexA53Fix835769<datasize>();
+         insn(dataProcessing3Source(DATASIZE, DataOp_MSUB, rm, ra, rn, rd));
+     }
+ 
+@@ -1691,7 +1688,6 @@
+ 
+     ALWAYS_INLINE void smaddl(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+-        nopCortexA53Fix835769<64>();
+         insn(dataProcessing3Source(Datasize_64, DataOp_SMADDL, rm, ra, rn, rd));
+     }
+ 
+@@ -1702,7 +1698,6 @@
+ 
+     ALWAYS_INLINE void smsubl(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+-        nopCortexA53Fix835769<64>();
+         insn(dataProcessing3Source(Datasize_64, DataOp_SMSUBL, rm, ra, rn, rd));
+     }
+ 
+@@ -1960,7 +1955,6 @@
+ 
+     ALWAYS_INLINE void umaddl(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+-        nopCortexA53Fix835769<64>();
+         insn(dataProcessing3Source(Datasize_64, DataOp_UMADDL, rm, ra, rn, rd));
+     }
+ 
+@@ -1971,7 +1965,6 @@
+ 
+     ALWAYS_INLINE void umsubl(RegisterID rd, RegisterID rn, RegisterID rm, RegisterID ra)
+     {
+-        nopCortexA53Fix835769<64>();
+         insn(dataProcessing3Source(Datasize_64, DataOp_UMSUBL, rm, ra, rn, rd));
+     }
+ 
+@@ -3691,37 +3684,6 @@
+         return 0x1e7e0000 | (dn << 5) | rd;
+     }
+ 
+-    // Workaround for Cortex-A53 erratum (835769). Emit an extra nop if the
+-    // last instruction in the buffer is a load, store or prefetch. Needed
+-    // before 64-bit multiply-accumulate instructions.
+-    template<int datasize>
+-    ALWAYS_INLINE void nopCortexA53Fix835769()
+-    {
+-#if CPU(ARM64_CORTEXA53)
+-        CHECK_DATASIZE();
+-        if (datasize == 64) {
+-            if (LIKELY(m_buffer.codeSize() >= sizeof(int32_t))) {
+-                // From ARMv8 Reference Manual, Section C4.1: the encoding of the
+-                // instructions in the Loads and stores instruction group is:
+-                // ---- 1-0- ---- ---- ---- ---- ---- ----
+-                if (UNLIKELY((*reinterpret_cast_ptr<int32_t*>(reinterpret_cast_ptr<char*>(m_buffer.data()) + m_buffer.codeSize() - sizeof(int32_t)) & 0x0a000000) == 0x08000000))
+-                    nop();
+-            }
+-        }
+-#endif
+-    }
+-
+-    // Workaround for Cortex-A53 erratum (843419). Emit extra nops to avoid
+-    // wrong address access after ADRP instruction.
+-    ALWAYS_INLINE void nopCortexA53Fix843419()
+-    {
+-#if CPU(ARM64_CORTEXA53)
+-        nop();
+-        nop();
+-        nop();
+-#endif
+-    }
+-
+     Vector<LinkRecord, 0, UnsafeVectorOverflow> m_jumpsToLink;
+     int m_indexOfLastWatchpoint;
+     int m_indexOfTailOfLastWatchpoint;
+--- a/Source/JavaScriptCore/offlineasm/arm64.rb
++++ a/Source/JavaScriptCore/offlineasm/arm64.rb
+@@ -351,33 +351,6 @@
+     newList
+ end
+ 
+-# Workaround for Cortex-A53 erratum (835769)
+-def arm64CortexA53Fix835769(list)
+-    newList = []
+-    lastOpcodeUnsafe = false
+-
+-    list.each {
+-        | node |
+-        if node.is_a? Instruction
+-            case node.opcode
+-            when /^store/, /^load/
+-                # List all macro instructions that can be lowered to a load, store or prefetch ARM64 assembly instruction
+-                lastOpcodeUnsafe = true
+-            when  "muli", "mulp", "mulq", "smulli"
+-                # List all macro instructions that can be lowered to a 64-bit multiply-accumulate ARM64 assembly instruction
+-                # (defined as one of MADD, MSUB, SMADDL, SMSUBL, UMADDL or UMSUBL).
+-                if lastOpcodeUnsafe
+-                    newList << Instruction.new(node.codeOrigin, "nopCortexA53Fix835769", [])
+-                end
+-                lastOpcodeUnsafe = false
+-            else
+-                lastOpcodeUnsafe = false
+-            end
+-        end
+-        newList << node
+-    }
+-    newList
+-end
+ 
+ class Sequence
+     def getModifiedListARM64(result = @list)
+@@ -470,7 +443,6 @@
+         result = arm64FixSpecialRegisterArithmeticMode(result)
+         result = assignRegistersToTemporaries(result, :gpr, ARM64_EXTRA_GPRS)
+         result = assignRegistersToTemporaries(result, :fpr, ARM64_EXTRA_FPRS)
+-        result = arm64CortexA53Fix835769(result)
+         return result
+     end
+ end
+@@ -1115,10 +1087,6 @@
+             $asm.puts "bfi #{operands[3].arm64Operand(:quad)}, #{operands[0].arm64Operand(:quad)}, #{operands[1].value}, #{operands[2].value}"
+         when "pcrtoaddr"
+             $asm.puts "adr #{operands[1].arm64Operand(:quad)}, #{operands[0].value}"
+-        when "nopCortexA53Fix835769"
+-            $asm.putStr("#if CPU(ARM64_CORTEXA53)")
+-            $asm.puts "nop"
+-            $asm.putStr("#endif")
+         when "globaladdr"
+             uid = $asm.newUID
+ 
+--- a/Source/JavaScriptCore/offlineasm/instructions.rb
++++ a/Source/JavaScriptCore/offlineasm/instructions.rb
+@@ -354,7 +354,6 @@
+     [
+      "bfiq", # Bit field insert <source reg> <last bit written> <width immediate> <dest reg>
+      "pcrtoaddr",   # Address from PC relative offset - adr instruction
+-     "nopFixCortexA53Err835769", # nop on Cortex-A53 (nothing otherwise)
+      "globaladdr",
+      "divi",
+      "divis",
+--- a/Source/cmake/OptionsCommon.cmake
++++ a/Source/cmake/OptionsCommon.cmake
+@@ -19,32 +19,6 @@
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ define_property(TARGET PROPERTY FOLDER INHERITED BRIEF_DOCS "folder" FULL_DOCS "IDE folder name")
+ 
+-# Detect Cortex-A53 core if CPU is ARM64 and OS is Linux.
+-# Query /proc/cpuinfo for each available core and check reported CPU part number: 0xd03 signals Cortex-A53.
+-# (see Main ID Register in ARM Cortex-A53 MPCore Processor Technical Reference Manual)
+-set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE OFF)
+-if (WTF_CPU_ARM64 AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
+-    execute_process(COMMAND nproc OUTPUT_VARIABLE PROC_COUNT)
+-    math(EXPR PROC_MAX ${PROC_COUNT}-1)
+-    foreach (PROC_ID RANGE ${PROC_MAX})
+-        execute_process(COMMAND taskset -c ${PROC_ID} grep "^CPU part" /proc/cpuinfo OUTPUT_VARIABLE PROC_PART)
+-        if (PROC_PART MATCHES "0xd03")
+-            set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE ON)
+-            break ()
+-        endif ()
+-    endforeach ()
+-endif ()
+-option(WTF_CPU_ARM64_CORTEXA53 "Enable Cortex-A53-specific code paths" ${WTF_CPU_ARM64_CORTEXA53_INITIALVALUE})
+-
+-if (WTF_CPU_ARM64_CORTEXA53)
+-    if (NOT WTF_CPU_ARM64)
+-        message(FATAL_ERROR "WTF_CPU_ARM64_CORTEXA53 set without WTF_CPU_ARM64")
+-    endif ()
+-    WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-mfix-cortex-a53-835769)
+-endif ()
+-
+-EXPOSE_VARIABLE_TO_BUILD(WTF_CPU_ARM64_CORTEXA53)
+-
+ set(ARM_TRADITIONAL_DETECTED FALSE)
+ if (WTF_CPU_ARM)
+     set(ARM_THUMB2_TEST_SOURCE
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 8696dc4bb6..a1e7684964 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2018 John Soo <jsoo1@asu.edu>
 ;;; Copyright © 2020 Mike Rosset <mike.rosset@gmail.com>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
+;;; Copyright © 2020 Brian C. Woodcox <bw@InSkyData.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -485,6 +486,7 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                  "-no-compile-examples"
                  ;; Most "-system-..." are automatic, but some use
                  ;; the bundled copy by default.
+                 "-opengl" "es2"
                  "-system-sqlite"
                  "-system-harfbuzz"
                  "-system-pcre"
diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm
index 2c8697223c..8e9d5d7d05 100644
--- a/gnu/packages/webkit.scm
+++ b/gnu/packages/webkit.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Brian C. Woodcox <bw@InSkyData.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,7 +129,9 @@ engine that uses Wayland for graphics output.")
                                   "webkitgtk-" version ".tar.xz"))
               (sha256
                (base32
-                "12qfs9w93c5kiyi14ynm4rf4ad3c213dvzmdrc9c3ab2iwbks7rn"))))
+                "12qfs9w93c5kiyi14ynm4rf4ad3c213dvzmdrc9c3ab2iwbks7rn"))
+              (patches
+               (search-patches "webkitgtk-2.28.0-fix-bug-197192.patch"))))
     (build-system cmake-build-system)
     (outputs '("out" "doc"))
     (arguments
-- 
2.25.1

