Skip to contentSkip to conversation

configs/olimex_a20_olinuxino: fix mali not working because Linux version >= 4.20

PATCH Applied Giulio Benetti 2 participants 8 messages Oct 14, 2021 – Jan 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/olimex_a20_olinuxino: fix mali not working because Linux version >= 4.20

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

---
 .../a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/olimex/a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf +1 -1
index f754da3623..25ee0c349c 100644
@@ -1,4 +1,4 @@
 label Olinuxino
     kernel /boot/zImage
     fdtdir /boot
-    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
+    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 drm_kms_helper.drm_leak_fbdev_smem=1 ${extra}
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 18 lines · Giulio Benetti

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

---
  .../a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf    | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/olimex/a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf +0 -0
index f754da3623..25ee0c349c 100644

board/olimex/a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf line 4

Quoted 5 lines
board/olimex/a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf +1 -1
@@ -1,4 +1,4 @@
  label Olinuxino
      kernel /boot/zImage
      fdtdir /boot
-    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
+    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 drm_kms_helper.drm_leak_fbdev_smem=1 ${extra}

This lacks drm_kms_helper.drm_fbdev_overalloc=200 too at least. I'm going to send a v2 for this.

Sorry for the noise

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH v2 1/1 configs/olimex_a20_olinuxino: fix mali not working because Linux version >= 4.20

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it with 1. Same goes for drm_fbdev_overalloc that must be at least 200 for having a double buffer that is required by Mali. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

---
V1->V2:
* add double buffer setting too

---
 .../a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/olimex/a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf +1 -1
index f754da3623..358bda056b 100644
@@ -1,4 +1,4 @@
 label Olinuxino
     kernel /boot/zImage
     fdtdir /boot
-    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
+    append console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 drm_kms_helper.drm_leak_fbdev_smem=1 drm_kms_helper.drm_fbdev_overalloc=200 ${extra}
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 10 lines · On Fri, 15 Oct 2021 10:15:14 +0200 Giulio Benetti…

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it with 1. Same goes for drm_fbdev_overalloc that must be at least 200 for having a double buffer that is required by Mali. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

I appreciate the idea, but I'm not sure if we want this. Indeed, the A20 Olinuxino defconfigs are meant to be minimal, and there's nothing that forces anyone to use the proprietary Mali driver+blob, they can also use mesa3d instead, which might have different requirements.

So I'm rather keen on enabling your patch on sunxi-mali-mainline-driver/Config.in, but not this one I'm afraid.

Of course, if others disagree, I can change my mind :)

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Hi Thomas,

Quoted 14 lines

Il giorno 18 ott 2021, alle ore 21:45, Thomas Petazzoni <[email protected]> ha scritto:

On Fri, 15 Oct 2021 10:15:14 +0200

Quoted 9 lines · Giulio Benetti

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it with 1. Same goes for drm_fbdev_overalloc that must be at least 200 for having a double buffer that is required by Mali. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

Quoted 6 lines
Quoted 1 line

I appreciate the idea, but I'm not sure if we want this. Indeed, the A20 Olinuxino defconfigs are meant to be minimal, and there's nothing that forces anyone to use the proprietary Mali driver+blob, they can also use mesa3d instead, which might have different requirements.

They instead enable specifically sunxi-mali-mainline* in lime and lime2 defconfigs.
So at the moment sunxi-mali-mainline is built but it can’t work and it doesn’t make sense.
Also up to Linux 4.20 this neither worked because of lack of double buffer. So basically here sunxi-mali-mainline I’m pretty sure never worked.

Lime and Lime2 both use this extlinux.conf and they are the only ones.

The other way is to remove sunxi-mali-mainline from Lime and Lime2 that is a possible idea. Let me know what you prefer.

Kind regards
Giulio Benetti

Quoted 17 lines

So I'm rather keen on enabling your patch on sunxi-mali-mainline-driver/Config.in, but not this one I'm afraid.

Of course, if others disagree, I can change my mind :)

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
Quoted 5 lines · On Mon, 18 Oct 2021 21:59:41 +0200 Giulio Benetti…

They instead enable specifically sunxi-mali-mainline* in lime and lime2 defconfigs. So at the moment sunxi-mali-mainline is built but it can’t work and it doesn’t make sense. Also up to Linux 4.20 this neither worked because of lack of double buffer. So basically here sunxi-mali-mainline I’m pretty sure never worked.

Aah, I hadn't realized/verified that they enabled sunxi-mali-mainline*. In this case, obviously your patch makes sense. I've switched it back to "New" in patchwork.

Thanks for the additional explanation!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
Quoted 9 lines · Thomas Petazzoni
Quoted 5 lines · On Mon, 18 Oct 2021 21:59:41 +0200 Giulio Benetti…

They instead enable specifically sunxi-mali-mainline* in lime and lime2 defconfigs. So at the moment sunxi-mali-mainline is built but it can’t work and it doesn’t make sense. Also up to Linux 4.20 this neither worked because of lack of double buffer. So basically here sunxi-mali-mainline I’m pretty sure never worked.

Quoted 8 lines

Aah, I hadn't realized/verified that they enabled sunxi-mali-mainline*. In this case, obviously your patch makes sense. I've switched it back to "New" in patchwork.

Thanks for the additional explanation!

Thomas

Ping. This is still needed for having Mali working with other applied patches:
https://patchwork.ozlabs.org/project/buildroot/list/?series=270656&state=*

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw
In reply to Giulio Benetti
Quoted 11 lines · On Thu, 14 Oct 2021 23:36:30 +0200 Giulio Benetti…

Since on olinuxino_lime/lime2 we have a Linux version >= 4.20 we need to pass drm_kms_helper.drm_leak_fbdev_smem=1 to kernel command-line that really enables DRM_FBDEV_LEAK_PHYS_SMEM. CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM only adds the code for this, but drm_leak_fbdev_smem is 0 by default, so we need to override it. This fixes both olimex_a20_olinuxino_lime and lime2 that use extlinux.conf.

---
 .../a20_olinuxino/rootfs_overlay/boot/extlinux/extlinux.conf    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot