From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:58036) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTB9e-0003kO-L3 for guix-patches@gnu.org; Mon, 27 Apr 2020 17:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTB9b-0003XB-UM for guix-patches@gnu.org; Mon, 27 Apr 2020 17:19:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTB9a-0003Wz-5E for guix-patches@gnu.org; Mon, 27 Apr 2020 17:19:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTB9Z-0000lk-Vz for guix-patches@gnu.org; Mon, 27 Apr 2020 17:19:01 -0400 Subject: [bug#40835] [PATCH] Update to use panfrost for graphics hardware acceleration Resent-Message-ID: From: Brian Woodcox Message-Id: <65E1BABE-56D0-4F84-92A3-7C4238722FC3@inskydata.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_6103C829-0C10-4CDB-B304-28E6203B07DB" Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Date: Mon, 27 Apr 2020 15:17:34 -0600 In-Reply-To: <87lfmgvlqx.fsf@ponder> References: <54EFA16B-27F2-40F4-8FF0-F59BC65BF8AB@inskydata.com> <87lfmgvlqx.fsf@ponder> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Vagrant Cascadian Cc: 40835@debbugs.gnu.org --Apple-Mail=_6103C829-0C10-4CDB-B304-28E6203B07DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Vagrant, Sorry, this should have been applied to commit = d4c6e06f369024efc63e11de1a5bacd3fe9f7e8d on the tip-pinebook-pro branch. The rest of my answers below. > On Apr 27, 2020, at 12:15 PM, Vagrant Cascadian = wrote: >=20 > On 2020-04-24, Brian Woodcox wrote: >> These patches add the panfrost graphics acceleration for the Pinebook >> Pro laptop. >=20 > Thanks! Been working with the pinebook pro for some months now running > guix, and it's great to see others making progress on it. :) >=20 >=20 >> You need to edit the /boot/extlinux/extlinux.conf file on the SD card = and alter the FDTDIR line. >>=20 >> I changed mine from >>=20 >> FDTDIR = /gnu/store/ls1byzmapi911cylh4s6044x0cmc61c8-linux-libre-pinebook-pro-5.6.0= /lib/dtbs >>=20 >> to >>=20 >> FDTDIR = /gnu/store/ls1byzmapi911cylh4s6044x0cmc61c8-linux-libre-pinebook-pro-5.6.0= /lib/dtbs/rockchip >=20 > The u-boot-pinebook-pro-rk3399 on guix master works correctly as well = as > the one from wip-pinebook-pro (should be the same). >=20 > This seems like your u-boot does not contain the correct value for > "fdtfile". It should be rockchip/rk3399-pinebook-pro.dtb. Are you > actually running an older u-boot? Did you at any point run saveenv = from > u-boot, which saves the old u-boot configuration with an inappropriate > fdtfile variable? >=20 >=20 > It would be better to split up your patches into a separate patch > series, it is hard to review as one single large patch changing many > things. >=20 I=E2=80=99m not sure what this problem is exactly. For some reason the = rockchip folder is not being added to the end of the patch for the FDTFILE, also, you do not need to = actually specify the file as u-boot will find it as long as it=E2=80=99s on the directory. > A few targeted comments below... >=20 >> 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 >> @@ -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=3Detnaviv,freedreno,nouveau,r300,r600,swrast,tegra,v3= d,vc4,virgl")) >> + = '("-Dgallium-drivers=3Detnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,= r600,swrast,tegra,v3d,vc4,virgl")) >> (_ >> = '("-Dgallium-drivers=3Diris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")= )) >> ;; Enable various optional features. TODO: opencl requires = libclc, >=20 > This last part of your mesa patch is already on core-updates. Looking > forward to when the rest is properly supported upstream! Okay, thanks. >=20 >=20 >> 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 >> @@ -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")) >>=20 >> (format #t "~%Packing new Linux-libre = tarball...~%") >=20 > This looks like leftovers from your hack breaking linux-libre :P Doh, you are correct, my mistake. This should of course be left as the = original code. >=20 >=20 >> @@ -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) >=20 > This obviously can't be enabled on all architectures. In the > linux-libre-arm64-generic and linux-libre-pinebook-pro kernels it's > already enabled as a module. >=20 > It obviously makes debugging easier to be available earlier, but it = also > bloats platforms that do not use this driver. Okay. >=20 >=20 >> 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 = >> -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"); >=20 > This removes a comment from the refreshed patch; I presume the comment > is still appropriate, though? Yes, Patch should have been applied to = d4c6e06f369024efc63e11de1a5bacd3fe9f7e8d as stated above. >=20 >=20 >> 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 =C2=A9 2018 John Soo >> ;;; Copyright =C2=A9 2020 Mike Rosset >> ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka = >> +;;; Copyright =C2=A9 2020 Brian C. Woodcox >> ;;; >> ;;; 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" >=20 > This might break some things where a different opengl is the default, > some architectures or platforms may require a different opengl > implementation. >=20 > I seem to recall some conversations in Debian about the complexities > around which opengl to enable per-architecture or per-platform or ... = a > complicated matrix of concerns. Open to suggestions. >=20 >=20 > live well, > vagrant Thanks for the feedback. Brian.= --Apple-Mail=_6103C829-0C10-4CDB-B304-28E6203B07DB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi Vagrant,

Sorry, this should have been applied to = commit d4c6e06f369024efc63e11de1a5bacd3fe9f7e8d on the = tip-pinebook-pro branch.

The = rest of my answers below.

On Apr 27, 2020, at 12:15 PM, Vagrant Cascadian <vagrant@debian.org> = wrote:

On 2020-04-24, Brian Woodcox wrote:
These patches add the panfrost graphics = acceleration for the Pinebook
Pro laptop.

Thanks! Been working with the = pinebook pro for some months now running
guix, and it's = great to see others making progress on it. :)


You need = to edit the /boot/extlinux/extlinux.conf file on the SD card and alter = the FDTDIR line.

I changed mine from

FDTDIR = /gnu/store/ls1byzmapi911cylh4s6044x0cmc61c8-linux-libre-pinebook-pro-5.6.0= /lib/dtbs

to

FDTDIR = /gnu/store/ls1byzmapi911cylh4s6044x0cmc61c8-linux-libre-pinebook-pro-5.6.0= /lib/dtbs/rockchip

The = u-boot-pinebook-pro-rk3399 on guix master works correctly as well as
the one from wip-pinebook-pro (should be the same).

This seems like your u-boot does not contain = the correct value for
"fdtfile". It should be = rockchip/rk3399-pinebook-pro.dtb. Are you
actually running = an older u-boot? Did you at any point run saveenv from
u-boot, which saves the old u-boot configuration with an = inappropriate
fdtfile variable?


It would be better to split up your patches = into a separate patch
series, it is hard to review as one = single large patch changing many
things.


I=E2=80= =99m not sure what this problem is exactly.  For some reason the = rockchip folder is not being added
to the end of the patch = for the FDTFILE, also, you do not need to actually specify the file as = u-boot will
find it as long as it=E2=80=99s on the = directory.


A few targeted = comments below...

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
@@ -293,7 +294,7 @@ also known as DXTn or DXTC) for = Mesa.")
=        '(,@(match = (%current-system)
=             &n= bsp;((or "armhf-linux" "aarch64-linux")
=             &n= bsp; ;; TODO: Fix svga driver for aarch64 and armhf.
- =             &n= bsp;'("-Dgallium-drivers=3Detnaviv,freedreno,nouveau,r300,r600,swrast,tegr= a,v3d,vc4,virgl"))
+ =             &n= bsp;'("-Dgallium-drivers=3Detnaviv,freedreno,kmsro,lima,nouveau,panfrost,r= 300,r600,swrast,tegra,v3d,vc4,virgl"))
=             &n= bsp;(_
=             &n= bsp; '("-Dgallium-drivers=3Diris,nouveau,r300,r600,radeonsi,svga,swra= st,virgl")))
=          ;; Enable various = optional features.  TODO: opencl requires libclc,

This last part of your mesa patch = is already on core-updates. Looking
forward to when the = rest is properly supported upstream!

Okay, = thanks.



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
@@ -326,7 +327,7 @@ corresponding = UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
=             &n= bsp;     (with-directory-excursion dir
=             &n= bsp;       (setenv "PYTHON" (which = "python"))
=             &n= bsp;       (format #t "Running deblob = script...~%")
- =             &n= bsp;      (force-output)
+ =             &n= bsp;      (force-output))
=             &n= bsp;       (invoke = "/tmp/bin/deblob"))

=             &n= bsp;     (format #t "~%Packing new Linux-libre = tarball...~%")

This looks like = leftovers from your hack breaking linux-libre :P

Doh, = you are correct, my mistake.  This should of course be left as the = original code.



@@ -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)

This obviously can't be enabled = on all architectures. In the
linux-libre-arm64-generic and = linux-libre-pinebook-pro kernels it's
already enabled as a = module.

It obviously makes debugging easier = to be available earlier, but it also
bloats platforms that = do not use this driver.

Okay.



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");

This removes a comment from the = refreshed patch; I presume the comment
is still = appropriate, though?

Yes, Patch should have been applied = to d4c6e06f369024efc63e11de1a5bacd3fe9f7e8d as stated = above.



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 =C2=A9 2018 John Soo <jsoo1@asu.edu>
;;; Copyright =C2=A9 = 2020 Mike Rosset <mike.rosset@gmail.com>
;;; Copyright =C2=A9= 2020 Jakub K=C4=85dzio=C5=82ka <kuba@kadziolka.net>
+;;; Copyright =C2=A9 = 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.")
=             &n= bsp;    "-no-compile-examples"
=             &n= bsp;    ;; Most "-system-..." are automatic, but = some use
=             &n= bsp;    ;; the bundled copy by default.
+ =             &n= bsp;   "-opengl" "es2"
=             &n= bsp;    "-system-sqlite"
=             &n= bsp;    "-system-harfbuzz"
=             &n= bsp;    "-system-pcre"

This might break some things where a different opengl is the = default,
some architectures or platforms may require a = different opengl
implementation.

I seem to recall some conversations in Debian about the = complexities
around which opengl to enable = per-architecture or per-platform or ... a
complicated = matrix of concerns.

Open to suggestions.



live well,
 vagrant


Thanks for the = feedback.

Brian.
= --Apple-Mail=_6103C829-0C10-4CDB-B304-28E6203B07DB--