Skip to contentSkip to conversation

Add support for 4.2 kernel with vc4 DRM/KMS driver

PATCH In review Javier Martinez Canillas 4 participants 11 messages Nov 10, 2015 – Dec 2, 2015 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

v3 cover Add support for 4.2 kernel with vc4 DRM/KMS driver

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

The v4.2 kernel is under heavy development so is a work-in-progress and should not be used in production. That's why it's not set as the default virtual/kernel provider but the user can change the default providers in case that wants to use the VC4 DRM/KMS driver.

But even when it's still a development kernel, having the recipe in the meta-raspberrypi will allow people to test it. We have been using it in the Tizen RPi2 port [2] for some time. The patches in the series are:

Patch 1/2 adds a recipe for the 4.2 and some patches to make it build.

Patch 2/2 Adds a section to the README that explains that two gfx stacks are available and that the user can change the default providers.

To test it, besides this series I picked some patches from Andreas' git tree that are in his vc4-3 branch [3]:

f5865b4b1bc4 libsdl2: enable glesv2
c8666982c1bc xserver-xf86-config: setup for VC4 hardware acceleration b1082f5aeebe rpi-base.inc: add xf86-video-modesetting and xserver-xorg-extension-glx to XSERVER 5568cd057d07 xserver-xorg: align to vc4 needs
d9881d3ccb58 mesa: align to vc4 needs

and also needed to bump the mesa SRCREV to master HEAD (commit sha1 51694072218b5ae84b5d8f98ee2172d7c5d61b31).

X starts and also I'm able to run the glmark2-es benchmark and the VC4 EGL rendering is used:

root@raspberrypi2:~# glmark2-es2
=======================================================
    glmark2 2014.03
=======================================================
    OpenGL Information
    GL_VENDOR:     Broadcom
    GL_RENDERER:   Gallium 0.4 on VC4
    GL_VERSION:    OpenGL ES 2.0 Mesa 11.1.0-devel (git-51694072218b)
=======================================================
[build] use-vbo=false: FPS: 36 FrameTime: 27.778 ms
[build] use-vbo=true: FPS: 38 FrameTime: 26.316 ms
[texture] texture-filter=nearest: FPS: 39 FrameTime: 25.641 ms
[texture] texture-filter=linear: FPS: 38 FrameTime: 26.316 ms
[texture] texture-filter=mipmap: FPS: 38 FrameTime: 26.316 ms

In theory this kernel should have KMS support but setting a different mode than the one configured in the firmware config.txt did not work for me. Only xrandr --output HDMI-0 --auto works and xrandr --output HDMI-0 --mode using a different mode than the config.txt does not work.

But I think that could be solved as a follow up once these patches are merged.

[0]: https://www.mail-archive.com/[email protected]/msg25164.html
[1]: https://lists.yoctoproject.org/pipermail/yocto/2015-August/026151.html
[2]: http://blogs.s-osg.org/tizen-rpi2-now-supporting-3d-acceleration/
[3]: git://github.com/schnitzeltony/meta-raspberrypi.git

Best regards,
Javier

Changes in v3:
- Update to latest vc4-kms-v3d-rpi2 branch sha1. Suggested by Andreas Müller.
- Drop patches that were already merged in the vc4-kms-v3d-rpi2 branch.
- Bump Linux version from 4.1 to 4.2.
- Add explanation in the README graphics section how to choose the kernel that has vc4 DRM/KMS support. Suggested by Khem Raj and Andrei Gherzan.

Changes in v2:
- Add a linux-raspberrypi-vc4 recipe insted of a linux-raspberrypi one. Suggested by Petter Mabäcker, Andreas Müller and Andrei Gherzan.
- Split the readme change in a separate patch. Suggested by Andrei Gherzan.
- Don't make the vc4 patches inclusion conditional since will always be needed when choosing the recipe. Suggested by Andrei Gherzan.

Derek Foreman (1):
linux-raspberrypi: Add a 4.2.3 linux kernel with vc4 support

Javier Martinez Canillas (1):
README: Add a section about graphic stacks

 README                                             | 17 +++++++++
 ..._defconfig-Enable-config-options-for-vc4-.patch | 40 ++++++++++++++++++++++
 .../0002-bcm2708-Fix-DTC-build-error.patch         | 38 ++++++++++++++++++++
 .../linux/linux-raspberrypi-vc4/defconfig          |  1 +
 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb  |  9 +++++
 5 files changed, 105 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/defconfig
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb
Signature · 1 line
2.4.3
#1 lore raw

PATCH v3 1/2 linux-raspberrypi: Add a 4.2.3 linux kernel with vc4 support

From: Derek Foreman <[email protected]>

This adds Eric Anholt's WIP kernel with dri/kms/3d support for the GPU on the rpi2. Adding a recipe that tracks this kernel, will make it easier to test this setup.

This recipe should only used for testing purposes for now, so it will not be set as the default but can be chosen by changing the default providers.

[javier: Extended commit message and set default preference to -1]

---

Changes in v3:
- Update to latest vc4-kms-v3d-rpi2 branch sha1. Suggested by Andreas Müller.
- Drop patches that were already merged in the vc4-kms-v3d-rpi2 branch.
- Bump Linux version from 4.1 to 4.2.

Changes in v2:
- Add a linux-raspberrypi-vc4 recipe insted of a linux-raspberrypi one. Suggested by Petter Mabäcker, Andreas Müller and Andrei Gherzan.
- Split the readme change in a separate patch. Suggested by Andrei Gherzan.
- Don't make the vc4 patches inclusion conditional since will always be needed when choosing the recipe. Suggested by Andrei Gherzan.

 ..._defconfig-Enable-config-options-for-vc4-.patch | 40 ++++++++++++++++++++++
 .../0002-bcm2708-Fix-DTC-build-error.patch         | 38 ++++++++++++++++++++
 .../linux/linux-raspberrypi-vc4/defconfig          |  1 +
 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb  |  9 +++++
 4 files changed, 88 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/defconfig
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb
recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch new file +40 -0
new file mode 100644
index 000000000000..d7b722dd35df
@@ -0,0 +1,40 @@
+From 10e0beec47def7813e2e256697018f3d0a4559fe Mon Sep 17 00:00:00 2001
+From: Derek Foreman <[email protected]>
+Date: Fri, 6 Nov 2015 13:15:35 -0300
+Subject: [PATCH 1/1] ARM: bcm2709_defconfig: Enable config options for vc4
+ support
+
+Add the needed Kconfig symbols to build Eric Anholt's WIP kernel
+4.1 Linux kernel with vc4 dri/kms/3d support. Also increase CMA
+size from 5 MiB to 256 MiB as that is needed by the driver.
+
+Signed-off-by: Derek Foreman <[email protected]>
+---
+ arch/arm/configs/bcm2709_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig
+index c2ddd10dc106..4312906bfe0f 100644
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -394,7 +394,7 @@ CONFIG_NFC_PN533=m
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_DMA_CMA=y
+-CONFIG_CMA_SIZE_MBYTES=5
++CONFIG_CMA_SIZE_MBYTES=256
+ CONFIG_MTD=m
+ CONFIG_MTD_BLOCK=m
+ CONFIG_MTD_NAND=m
+@@ -807,6 +807,8 @@ CONFIG_FB=y
+ CONFIG_FB_BCM2708=y
+ CONFIG_FB_SSD1307=m
+ CONFIG_FB_RPISENSE=m
++CONFIG_DRM=y
++CONFIG_DRM_VC4=y
+ # CONFIG_BACKLIGHT_GENERIC is not set
+ CONFIG_BACKLIGHT_GPIO=m
+ CONFIG_FRAMEBUFFER_CONSOLE=y
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch new file +38 -0
new file mode 100644
index 000000000000..59aa0e54d353
@@ -0,0 +1,38 @@
+From 2d0adbb07ccccef248173af3ac090ca867cf3460 Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <[email protected]>
+Date: Mon, 9 Nov 2015 16:17:28 -0300
+Subject: [PATCH 1/1] bcm2708: Fix DTC build error
+
+Commit fa6a6d220c4c ("bcm2708: Use #include in dtsi files") changed the bcm*
+DTSI files to use the pre-processor #include directive instead the /include/
+but forgot to change the arch/arm/boot/dts/bcm2708.dtsi file. Later commit
+7f04e14bebf1 ("fixup! bcm2708: Use #include in dtsi files") tried to do that
+change but introduced a build error:
+
+DTC     arch/arm/boot/dts/bcm2708-rpi-b.dtb
+In file included from arch/arm/boot/dts/bcm2708-rpi-b.dts:3:0:
+arch/arm/boot/dts/bcm2708.dtsi:1:9: error: #include expects "FILENAME" or <FILENAME>
+            ^
+scripts/Makefile.lib:293: recipe for target 'arch/arm/boot/dts/bcm2708-rpi-b.dtb' failed
+make[1]: *** [arch/arm/boot/dts/bcm2708-rpi-b.dtb] Error 1
+arch/arm/Makefile:327: recipe for target 'bcm2708-rpi-b.dtb' failed
+make: *** [bcm2708-rpi-b.dtb] Error 2
+
+Signed-off-by: Javier Martinez Canillas <[email protected]>
+---
+ arch/arm/boot/dts/bcm2708.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
+index a70fa3107ac2..b954255bb860 100644
+--- a/arch/arm/boot/dts/bcm2708.dtsi
++++ b/arch/arm/boot/dts/bcm2708.dtsi
+@@ -1,4 +1,4 @@
+-#include/ "bcm2708_common.dtsi"
++#include "bcm2708_common.dtsi"
+ 
+ / {
+ 	compatible = "brcm,bcm2708";
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/defconfig new file +1 -0
new file mode 100644
index 000000000000..ecbf32cfdc4c
@@ -0,0 +1 @@
+# Dummy file to get through do_kernel_configme.
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +9 -0
new file mode 100644
index 000000000000..cdd351c3ee66
@@ -0,0 +1,9 @@
+LINUX_VERSION ?= "4.2.3"
+
+SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8"
+SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \
+           file://0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch \
+           file://0002-bcm2708-Fix-DTC-build-error.patch \
+          "
+
+require linux-raspberrypi.inc
Signature · 1 line
2.4.3
#2 lore raw

Re: [meta-raspberrypi][PATCH v3 1/2] linux-raspberrypi: Add a 4.2.3 linux kernel with vc4 support

Quoted 140 lines · Javier Martinez Canillas

From: Derek Foreman <[email protected]>

This adds Eric Anholt's WIP kernel with dri/kms/3d support for the GPU on the rpi2. Adding a recipe that tracks this kernel, will make it easier to test this setup.

This recipe should only used for testing purposes for now, so it will not be set as the default but can be chosen by changing the default providers.

[javier: Extended commit message and set default preference to -1]

---

Changes in v3:
- Update to latest vc4-kms-v3d-rpi2 branch sha1. Suggested by Andreas Müller.
- Drop patches that were already merged in the vc4-kms-v3d-rpi2 branch.
- Bump Linux version from 4.1 to 4.2.

Changes in v2:
- Add a linux-raspberrypi-vc4 recipe insted of a linux-raspberrypi one. Suggested by Petter Mabäcker, Andreas Müller and Andrei Gherzan.
- Split the readme change in a separate patch. Suggested by Andrei Gherzan.
- Don't make the vc4 patches inclusion conditional since will always be needed when choosing the recipe. Suggested by Andrei Gherzan.

 ..._defconfig-Enable-config-options-for-vc4-.patch | 40 ++++++++++++++++++++++
 .../0002-bcm2708-Fix-DTC-build-error.patch         | 38 ++++++++++++++++++++
 .../linux/linux-raspberrypi-vc4/defconfig          |  1 +
 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb  |  9 +++++
 4 files changed, 88 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/defconfig
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb
recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch new file +40 -0
new file mode 100644
index 000000000000..d7b722dd35df
@@ -0,0 +1,40 @@
+From 10e0beec47def7813e2e256697018f3d0a4559fe Mon Sep 17 00:00:00 2001
+From: Derek Foreman <[email protected]>
+Date: Fri, 6 Nov 2015 13:15:35 -0300
+Subject: [PATCH 1/1] ARM: bcm2709_defconfig: Enable config options for vc4
+ support
+
+Add the needed Kconfig symbols to build Eric Anholt's WIP kernel
+4.1 Linux kernel with vc4 dri/kms/3d support. Also increase CMA
+size from 5 MiB to 256 MiB as that is needed by the driver.
+
+Signed-off-by: Derek Foreman <[email protected]>
+---
+ arch/arm/configs/bcm2709_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig
+index c2ddd10dc106..4312906bfe0f 100644
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -394,7 +394,7 @@ CONFIG_NFC_PN533=m
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_DMA_CMA=y
+-CONFIG_CMA_SIZE_MBYTES=5
++CONFIG_CMA_SIZE_MBYTES=256
+ CONFIG_MTD=m
+ CONFIG_MTD_BLOCK=m
+ CONFIG_MTD_NAND=m
+@@ -807,6 +807,8 @@ CONFIG_FB=y
+ CONFIG_FB_BCM2708=y
+ CONFIG_FB_SSD1307=m
+ CONFIG_FB_RPISENSE=m
++CONFIG_DRM=y
++CONFIG_DRM_VC4=y
+ # CONFIG_BACKLIGHT_GENERIC is not set
+ CONFIG_BACKLIGHT_GPIO=m
+ CONFIG_FRAMEBUFFER_CONSOLE=y
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch new file +38 -0
new file mode 100644
index 000000000000..59aa0e54d353
@@ -0,0 +1,38 @@
+From 2d0adbb07ccccef248173af3ac090ca867cf3460 Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <[email protected]>
+Date: Mon, 9 Nov 2015 16:17:28 -0300
+Subject: [PATCH 1/1] bcm2708: Fix DTC build error
+
+Commit fa6a6d220c4c ("bcm2708: Use #include in dtsi files") changed the bcm*
+DTSI files to use the pre-processor #include directive instead the /include/
+but forgot to change the arch/arm/boot/dts/bcm2708.dtsi file. Later commit
+7f04e14bebf1 ("fixup! bcm2708: Use #include in dtsi files") tried to do that
+change but introduced a build error:
+
+DTC     arch/arm/boot/dts/bcm2708-rpi-b.dtb
+In file included from arch/arm/boot/dts/bcm2708-rpi-b.dts:3:0:
+arch/arm/boot/dts/bcm2708.dtsi:1:9: error: #include expects "FILENAME" or <FILENAME>
+            ^
+scripts/Makefile.lib:293: recipe for target 'arch/arm/boot/dts/bcm2708-rpi-b.dtb' failed
+make[1]: *** [arch/arm/boot/dts/bcm2708-rpi-b.dtb] Error 1
+arch/arm/Makefile:327: recipe for target 'bcm2708-rpi-b.dtb' failed
+make: *** [bcm2708-rpi-b.dtb] Error 2
+
+Signed-off-by: Javier Martinez Canillas <[email protected]>
+---
+ arch/arm/boot/dts/bcm2708.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
+index a70fa3107ac2..b954255bb860 100644
+--- a/arch/arm/boot/dts/bcm2708.dtsi
++++ b/arch/arm/boot/dts/bcm2708.dtsi
+@@ -1,4 +1,4 @@
+-#include/ "bcm2708_common.dtsi"
++#include "bcm2708_common.dtsi"
+ 
+ / {
+ 	compatible = "brcm,bcm2708";
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/defconfig new file +1 -0
new file mode 100644
index 000000000000..ecbf32cfdc4c
@@ -0,0 +1 @@
+# Dummy file to get through do_kernel_configme.
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +0 -0
new file mode 100644
index 000000000000..cdd351c3ee66

recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb line 4

Quoted 4 lines
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +4 -0
@@ -0,0 +1,9 @@
+LINUX_VERSION ?= "4.2.3"
+
+SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8"
+SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \

Cloning this seems a problematic:

ERROR: Fetcher failure: Fetch command failed with exit code 141, output:
Cloning into bare repository '/home/andrei/work/yocto/shared-downloads/git2/github.com.anholt.linux.git'...
error: inflate: data stream error (invalid distance too far back)
fatal: pack has bad object at offset 357395694: inflate returned -3

Any idea what might go wrong?

Quoted 8 lines
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +5 -0
+           file://0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch \
+           file://0002-bcm2708-Fix-DTC-build-error.patch \
+          "
+
+require linux-raspberrypi.inc
Signature · 1 line
2.4.3
Signature · 1 line
Andrei Gherzan
#3 lore raw

Re: [meta-raspberrypi][PATCH v3 1/2] linux-raspberrypi: Add a 4.2.3 linux kernel with vc4 support

Quoted 148 lines · Andrei Gherzan
Quoted 140 lines · Javier Martinez Canillas

From: Derek Foreman <[email protected]>

This adds Eric Anholt's WIP kernel with dri/kms/3d support for the GPU on the rpi2. Adding a recipe that tracks this kernel, will make it easier to test this setup.

This recipe should only used for testing purposes for now, so it will not be set as the default but can be chosen by changing the default providers.

[javier: Extended commit message and set default preference to -1]

---

Changes in v3:
- Update to latest vc4-kms-v3d-rpi2 branch sha1. Suggested by Andreas Müller.
- Drop patches that were already merged in the vc4-kms-v3d-rpi2 branch.
- Bump Linux version from 4.1 to 4.2.

Changes in v2:
- Add a linux-raspberrypi-vc4 recipe insted of a linux-raspberrypi one. Suggested by Petter Mabäcker, Andreas Müller and Andrei Gherzan.
- Split the readme change in a separate patch. Suggested by Andrei Gherzan.
- Don't make the vc4 patches inclusion conditional since will always be needed when choosing the recipe. Suggested by Andrei Gherzan.

 ..._defconfig-Enable-config-options-for-vc4-.patch | 40 ++++++++++++++++++++++
 .../0002-bcm2708-Fix-DTC-build-error.patch         | 38 ++++++++++++++++++++
 .../linux/linux-raspberrypi-vc4/defconfig          |  1 +
 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb  |  9 +++++
 4 files changed, 88 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4/defconfig
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb
recipes-kernel/linux/linux-raspberrypi-vc4/0001-ARM-bcm2709_defconfig-Enable-config-options-for-vc4-.patch new file +40 -0
new file mode 100644
index 000000000000..d7b722dd35df
@@ -0,0 +1,40 @@
+From 10e0beec47def7813e2e256697018f3d0a4559fe Mon Sep 17 00:00:00 2001
+From: Derek Foreman <[email protected]>
+Date: Fri, 6 Nov 2015 13:15:35 -0300
+Subject: [PATCH 1/1] ARM: bcm2709_defconfig: Enable config options for vc4
+ support
+
+Add the needed Kconfig symbols to build Eric Anholt's WIP kernel
+4.1 Linux kernel with vc4 dri/kms/3d support. Also increase CMA
+size from 5 MiB to 256 MiB as that is needed by the driver.
+
+Signed-off-by: Derek Foreman <[email protected]>
+---
+ arch/arm/configs/bcm2709_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig
+index c2ddd10dc106..4312906bfe0f 100644
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -394,7 +394,7 @@ CONFIG_NFC_PN533=m
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_DMA_CMA=y
+-CONFIG_CMA_SIZE_MBYTES=5
++CONFIG_CMA_SIZE_MBYTES=256
+ CONFIG_MTD=m
+ CONFIG_MTD_BLOCK=m
+ CONFIG_MTD_NAND=m
+@@ -807,6 +807,8 @@ CONFIG_FB=y
+ CONFIG_FB_BCM2708=y
+ CONFIG_FB_SSD1307=m
+ CONFIG_FB_RPISENSE=m
++CONFIG_DRM=y
++CONFIG_DRM_VC4=y
+ # CONFIG_BACKLIGHT_GENERIC is not set
+ CONFIG_BACKLIGHT_GPIO=m
+ CONFIG_FRAMEBUFFER_CONSOLE=y
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/0002-bcm2708-Fix-DTC-build-error.patch new file +38 -0
new file mode 100644
index 000000000000..59aa0e54d353
@@ -0,0 +1,38 @@
+From 2d0adbb07ccccef248173af3ac090ca867cf3460 Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <[email protected]>
+Date: Mon, 9 Nov 2015 16:17:28 -0300
+Subject: [PATCH 1/1] bcm2708: Fix DTC build error
+
+Commit fa6a6d220c4c ("bcm2708: Use #include in dtsi files") changed the bcm*
+DTSI files to use the pre-processor #include directive instead the /include/
+but forgot to change the arch/arm/boot/dts/bcm2708.dtsi file. Later commit
+7f04e14bebf1 ("fixup! bcm2708: Use #include in dtsi files") tried to do that
+change but introduced a build error:
+
+DTC     arch/arm/boot/dts/bcm2708-rpi-b.dtb
+In file included from arch/arm/boot/dts/bcm2708-rpi-b.dts:3:0:
+arch/arm/boot/dts/bcm2708.dtsi:1:9: error: #include expects "FILENAME" or <FILENAME>
+            ^
+scripts/Makefile.lib:293: recipe for target 'arch/arm/boot/dts/bcm2708-rpi-b.dtb' failed
+make[1]: *** [arch/arm/boot/dts/bcm2708-rpi-b.dtb] Error 1
+arch/arm/Makefile:327: recipe for target 'bcm2708-rpi-b.dtb' failed
+make: *** [bcm2708-rpi-b.dtb] Error 2
+
+Signed-off-by: Javier Martinez Canillas <[email protected]>
+---
+ arch/arm/boot/dts/bcm2708.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
+index a70fa3107ac2..b954255bb860 100644
+--- a/arch/arm/boot/dts/bcm2708.dtsi
++++ b/arch/arm/boot/dts/bcm2708.dtsi
+@@ -1,4 +1,4 @@
+-#include/ "bcm2708_common.dtsi"
++#include "bcm2708_common.dtsi"
+ 
+ / {
+ 	compatible = "brcm,bcm2708";
+-- 
+2.4.3
+
recipes-kernel/linux/linux-raspberrypi-vc4/defconfig new file +1 -0
new file mode 100644
index 000000000000..ecbf32cfdc4c
@@ -0,0 +1 @@
+# Dummy file to get through do_kernel_configme.
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +0 -0
new file mode 100644
index 000000000000..cdd351c3ee66

recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb line 4

Quoted 4 lines
recipes-kernel/linux/linux-raspberrypi-vc4_4.2.bb new file +4 -0
@@ -0,0 +1,9 @@
+LINUX_VERSION ?= "4.2.3"
+
+SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8"
+SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \

Cloning this seems a problematic:

Quoted 6 lines

ERROR: Fetcher failure: Fetch command failed with exit code 141, output:
Cloning into bare repository '/home/andrei/work/yocto/shared-downloads/git2/github.com.anholt.linux.git'...
error: inflate: data stream error (invalid distance too far back)
fatal: pack has bad object at offset 357395694: inflate returned -3

Any idea what might go wrong?

Scratch that as it seems to have been related to my netowrk. But now there is another problem. The branch you selected in the recipe doesn't contain the wanted revision. I'm wondering if that is due to a rebase or it is just a miss in the patch? If it's the first thing... then we need to find a stable revision (why do people rebase?).

Signature · 1 line
Andrei Gherzan
#4 lore raw

PATCH v3 2/2 README: Add a section about graphic stacks

In reply to Javier Martinez Canillas

This patch adds a section to the README that explains the RPi have different graphics stacks and that the user can choose by manually changing providers.

---

Changes in v3:
- Add explanation in the README graphics section how to choose the kernel that has vc4 DRM/KMS support. Suggested by Khem Raj and Andrei Gherzan.

Changes in v2: None

 README | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
README +17 -0
index e16dee9ca7e5..e6cabb7c1f63 100644
@@ -24,6 +24,7 @@ Contents:
     2.J. Boot to U-Boot
     2.K. Image with Initramfs
     2.L. Device tree support
+    2.M. Graphic stacks
 3. Extra apps
     3.A. omxplayer
 4. Source code and mirrors
@@ -189,6 +190,22 @@ kernels.
 NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
       older kernel versions.
 
+2.M. Graphic stacks
+===================
+The Raspberry Pi boards can use one of two graphics stacks: The userland
+user-space driver or the vc4 DRM/KMS kernel driver. By default userland
+is used since the vc4 is still experimental. But this can be changed by
+modifying the defaults for the kernel, egl, gles2, libgl and mesa providers.
+
+So to use the experimental vc4 DRM/KMS kernel, add the following to the
+conf/local.conf file:
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi-vc4"
+PREFERRED_PROVIDER_virtual/egl = "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
+PREFERRED_PROVIDER_virtual/libgl = "mesa"
+PREFERRED_PROVIDER_virtual/mesa = "mesa"
+
 3. Extra apps
 =============
 
Signature · 1 line
2.4.3
#5 lore raw
In reply to Javier Martinez Canillas
Quoted 11 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

Any comments about this series?

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#6 lore raw
Quoted 7 lines · Javier Martinez Canillas
Quoted 6 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

Quoted 7 lines
Quoted 5 lines

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

Any comments about this series?

Whole series looks good to me.

Quoted 6 lines

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America

#7 lore raw
Quoted 15 lines · Khem Raj
Quoted 13 lines · Javier Martinez Canillas
Quoted 11 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

Quoted 4 lines
Quoted 1 line

Any comments about this series?

Whole series looks good to me.

Hop to find some time to test this weekend.

Andreas

#8 lore raw
Quoted 16 lines · Andreas Müller
Quoted 15 lines · Khem Raj
Quoted 13 lines · Javier Martinez Canillas
Quoted 11 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

Any comments about this series?

Whole series looks good to me.

Thanks Khem.

Quoted 2 lines

Hop to find some time to test this weekend.

Andreas, did you find time to test?

Quoted 2 lines

Andreas

Andrei, gentle ping about this series again.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#9 lore raw
Quoted 22 lines · Javier Martinez Canillas
Quoted 16 lines · Andreas Müller
Quoted 15 lines · Khem Raj
Quoted 13 lines · Javier Martinez Canillas
Quoted 11 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second version of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in v3.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

Any comments about this series?

Whole series looks good to me.

Quoted 6 lines

Thanks Khem.

Quoted 2 lines

Hop to find some time to test this weekend.

Andreas, did you find time to test?

Am very sorry: No chance currently

Quoted 11 lines
Quoted 3 lines

Andreas

Andrei, gentle ping about this series again.

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America

#10 lore raw
In reply to Khem Raj

--
Andrei Gherzan

Quoted 12 lines · Khem Raj
Quoted 9 lines · Javier Martinez Canillas
Quoted 8 lines · Javier Martinez Canillas

Hello Andrei,

This series adds support for Eric Anholt's v4.2 kernel, that has support for the vc4 DRM/KMS driver, which is the new open source graphics driver stack for the Raspberry Pi to be used instead of the userland driver.

This is a third version of the series which addresses feedback provided by Andreas Müller, Khem Raj and you. The first version and second

version

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

of the series can be found at [0] and [1]. Some of the v2 patches have been dropped since are no longer necessary so the delta is smaller in

v3.

Quoted 3 lines
Quoted 1 line

Any comments about this series?

Whole series looks good to me.

Looks good to me too. I will try to test them (compile time) and bring them in as an option.