Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,3 @@
PACKAGECONFIG_GLESV2 = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'glesv2', d)}"
PACKAGECONFIG:append:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' egl ${PACKAGECONFIG_GLESV2}', d)}"
@@ -0,0 +1,2 @@
# userland driver EGL implementation does not have all needed bits for it so remove it from build
COMPATIBLE_HOST:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '(.*)', 'null', d)}"
@@ -0,0 +1,5 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
# when using userland graphic KHR/khrplatform.h is provided by userland but virtual/libgl is provided by mesa-gl where
# we explicitly delete KHR/khrplatform.h since its already coming from userland package
DEPENDS:append:rpi = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'userland', d)}"
@@ -0,0 +1,3 @@
# when using userland graphic KHR/khrplatform.h is provided by userland but virtual/libgl is provided by mesa-gl where
# we explicitly delete KHR/khrplatform.h since its already coming from userland package
DEPENDS:append:rpi = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'userland', d)}"
@@ -0,0 +1,3 @@
# when using userland graphic KHR/khrplatform.h is provided by userland but virtual/libgl is provided by mesa-gl where
# we explicitly delete KHR/khrplatform.h since its already coming from userland package
DEPENDS:append:rpi = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'userland', d)}"
@@ -0,0 +1,3 @@
# mesa-demos userland driver doesn't provide libgles1 and the EGL headers it provides break the mesa-demos build.
# And enabling the `wayland` option without enabling `egl` is useless.
PACKAGECONFIG:remove:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'egl gles1 wayland', d)}"
@@ -0,0 +1,8 @@
PACKAGECONFIG:append:rpi = " gbm"
PROVIDES:append:rpi = " virtual/libgbm"
GALLIUMDRIVERS:append:rpi = ",swrast"
do_install:append:rpi() {
rm -rf ${D}${includedir}/KHR/khrplatform.h
}
@@ -0,0 +1,6 @@
# DRI3 note:
# With oe-core commit 8509e2e1a87578882b71948ccef3b50ccf1228b3 dri3 is set
# as default. To state out clearly that Raspi needs dri3 and to avoid surprises
# in case oe-core changes this default, we set dri3 explicitly.
PACKAGECONFIG:append:rpi = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
DRIDRIVERS:class-target:rpi = ""
@@ -0,0 +1,5 @@
# mesa-demos need libgles1 and userland driver does not have it so remove it from piglit rdeps
RDEPENDS:${PN}:remove:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'mesa-demos', d)}"
# it needs EGL >= 11 but userland says it provided version 10, remove it from build
# | -- Requested 'egl >= 11.0' but version of EGL is 10
COMPATIBLE_HOST:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '(.*)', 'null', d)}"
@@ -0,0 +1,24 @@
From 070b114fd54b6ad38b4eff04279fe89ccaaef61b Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 01:39:30 -0500
Subject: [PATCH] gitignore: add archives from lib directory
The build creates two *.a files in the lib directory, add these to .gitignore.
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 633f325..4a1ca0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,5 +21,6 @@ test_pattern/test_pattern
worms/worms
# other directories
+lib/*.a
*_/
@@ -0,0 +1,214 @@
From 3b60fa1598385fb36fef1c47f59cb08d3a6fba35 Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 01:54:37 -0500
Subject: [PATCH] add "install" targets to Makefiles
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
Makefile | 3 +++
game/Makefile | 4 ++++
lib/Makefile | 1 +
life/Makefile | 4 ++++
mandelbrot/Makefile | 4 ++++
offscreen/Makefile | 4 ++++
pngview/Makefile | 4 ++++
radar_sweep/Makefile | 4 ++++
radar_sweep_alpha/Makefile | 4 ++++
rgb_triangle/Makefile | 4 ++++
spriteview/Makefile | 4 ++++
test_pattern/Makefile | 4 ++++
worms/Makefile | 4 ++++
13 files changed, 48 insertions(+)
diff --git a/Makefile b/Makefile
index 4e14e18..4a06de9 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,9 @@ default :all
all:
for target in $(TARGETS); do ($(MAKE) -C $$target); done
+install:
+ for target in $(TARGETS); do ($(MAKE) -C $$target install); done
+
clean:
for target in $(TARGETS); do ($(MAKE) -C $$target clean); done
diff --git a/game/Makefile b/game/Makefile
index ced9cce..6da6a6d 100644
--- a/game/Makefile
+++ b/game/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/lib/Makefile b/lib/Makefile
index 15d7c37..2765c91 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -29,6 +29,7 @@ $(LIB): $(OBJS)
$(LIBPNG): $(OBJSPNG)
$(AR) rcs lib$(LIBPNG).a $(OBJSPNG)
+install:
clean:
@rm -f $(OBJS)
diff --git a/life/Makefile b/life/Makefile
index 2fcb034..44f1edb 100644
--- a/life/Makefile
+++ b/life/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -pthread -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/mandelbrot/Makefile b/mandelbrot/Makefile
index e61beb3..a6e6735 100644
--- a/mandelbrot/Makefile
+++ b/mandelbrot/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -pthread -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/offscreen/Makefile b/offscreen/Makefile
index 2bc81b9..8d23354 100644
--- a/offscreen/Makefile
+++ b/offscreen/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/pngview/Makefile b/pngview/Makefile
index f947320..8c037ec 100644
--- a/pngview/Makefile
+++ b/pngview/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/radar_sweep/Makefile b/radar_sweep/Makefile
index 3a46150..5f814b7 100644
--- a/radar_sweep/Makefile
+++ b/radar_sweep/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/radar_sweep_alpha/Makefile b/radar_sweep_alpha/Makefile
index 5680b9b..f66c338 100644
--- a/radar_sweep_alpha/Makefile
+++ b/radar_sweep_alpha/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/rgb_triangle/Makefile b/rgb_triangle/Makefile
index 2017956..2ce779d 100644
--- a/rgb_triangle/Makefile
+++ b/rgb_triangle/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/spriteview/Makefile b/spriteview/Makefile
index 2713936..ada9277 100644
--- a/spriteview/Makefile
+++ b/spriteview/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/test_pattern/Makefile b/test_pattern/Makefile
index be434d9..1e02b0a 100644
--- a/test_pattern/Makefile
+++ b/test_pattern/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
diff --git a/worms/Makefile b/worms/Makefile
index 2a21a4b..c249c8c 100644
--- a/worms/Makefile
+++ b/worms/Makefile
@@ -15,6 +15,10 @@ all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
+install: $(BIN)
+ install -d $(DESTDIR)/usr/bin
+ install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+
clean:
@rm -f $(OBJS)
@rm -f $(BIN)
@@ -0,0 +1,114 @@
From 314fbde187e9187b1b3e18e50dd937c070e93633 Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 01:58:59 -0500
Subject: [PATCH] switch to "pkg-config"
I get a build error saying:
ERROR: /usr/bin/libpng16-config should not be used, use an alternative such as pkg-config
Therefore switch to the more common and more generic "pkg-config" instead of
using a libpng-specific tool for flags and libraries.
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
game/Makefile | 4 ++--
lib/Makefile | 4 ++--
mandelbrot/Makefile | 4 ++--
offscreen/Makefile | 4 ++--
pngview/Makefile | 4 ++--
spriteview/Makefile | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/game/Makefile b/game/Makefile
index 6da6a6d..0a90a38 100644
--- a/game/Makefile
+++ b/game/Makefile
@@ -1,8 +1,8 @@
OBJS=main.o
BIN=game
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell libpng-config --ldflags) -L../lib -lraspidmx -lraspidmxPng
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
+LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/lib/Makefile b/lib/Makefile
index 2765c91..1e8c759 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -11,9 +11,9 @@ OBJS=../common/backgroundLayer.o ../common/imageGraphics.o ../common/key.o \
OBJSPNG=../common/spriteLayer.o ../common/loadpng.o ../common/savepng.o ../common/scrollingLayer.o
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm
-LDFLAGSPNG=${LDFLAGS} $(shell libpng-config --ldflags)
+LDFLAGSPNG=${LDFLAGS} $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/mandelbrot/Makefile b/mandelbrot/Makefile
index a6e6735..82910bb 100644
--- a/mandelbrot/Makefile
+++ b/mandelbrot/Makefile
@@ -1,8 +1,8 @@
OBJS=main.o mandelbrot.o info.o
BIN=mandelbrot
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell libpng-config --ldflags) -L../lib -lraspidmx -lraspidmxPng
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
+LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/offscreen/Makefile b/offscreen/Makefile
index 8d23354..0120796 100644
--- a/offscreen/Makefile
+++ b/offscreen/Makefile
@@ -1,8 +1,8 @@
OBJS=pngresize.o resizeDispmanX.o
BIN=pngresize
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell libpng-config --ldflags) -L../lib -lraspidmx -lraspidmxPng
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
+LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/pngview/Makefile b/pngview/Makefile
index 8c037ec..71a5d76 100644
--- a/pngview/Makefile
+++ b/pngview/Makefile
@@ -1,8 +1,8 @@
OBJS=pngview.o
BIN=pngview
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell libpng-config --ldflags) -L../lib -lraspidmx -lraspidmxPng
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
+LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/spriteview/Makefile b/spriteview/Makefile
index ada9277..904c1e8 100644
--- a/spriteview/Makefile
+++ b/spriteview/Makefile
@@ -1,8 +1,8 @@
OBJS=spriteview.o
BIN=spriteview
-CFLAGS+=-Wall -g -O3 -I../common $(shell libpng-config --cflags)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell libpng-config --ldflags) -L../lib -lraspidmx -lraspidmxPng
+CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
+LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
@@ -0,0 +1,170 @@
From bde71fc22bde61ef8fe319c60f478ec370f5bc5d Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 02:13:39 -0500
Subject: [PATCH] add libvchostif to link
I end up with link errors of the type:
libvchostif.so: error adding symbols: DSO missing from command line
Which is caused by not having -lvchostif in the link.
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
game/Makefile | 2 +-
life/Makefile | 2 +-
mandelbrot/Makefile | 2 +-
offscreen/Makefile | 2 +-
pngview/Makefile | 2 +-
radar_sweep/Makefile | 2 +-
radar_sweep_alpha/Makefile | 2 +-
rgb_triangle/Makefile | 2 +-
spriteview/Makefile | 2 +-
test_pattern/Makefile | 2 +-
worms/Makefile | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/game/Makefile b/game/Makefile
index 0a90a38..b756fa2 100644
--- a/game/Makefile
+++ b/game/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o
BIN=game
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/life/Makefile b/life/Makefile
index 44f1edb..2addf69 100644
--- a/life/Makefile
+++ b/life/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o life.o info.o
BIN=life
CFLAGS+=-Wall -g -O3 -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/mandelbrot/Makefile b/mandelbrot/Makefile
index 82910bb..31097f2 100644
--- a/mandelbrot/Makefile
+++ b/mandelbrot/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o mandelbrot.o info.o
BIN=mandelbrot
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/offscreen/Makefile b/offscreen/Makefile
index 0120796..4f13fd0 100644
--- a/offscreen/Makefile
+++ b/offscreen/Makefile
@@ -2,7 +2,7 @@ OBJS=pngresize.o resizeDispmanX.o
BIN=pngresize
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/pngview/Makefile b/pngview/Makefile
index 71a5d76..cce8d63 100644
--- a/pngview/Makefile
+++ b/pngview/Makefile
@@ -2,7 +2,7 @@ OBJS=pngview.o
BIN=pngview
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/radar_sweep/Makefile b/radar_sweep/Makefile
index 5f814b7..aa1d32c 100644
--- a/radar_sweep/Makefile
+++ b/radar_sweep/Makefile
@@ -2,7 +2,7 @@ OBJS=radar_sweep.o
BIN=radar_sweep
CFLAGS+=-Wall -O3 -g -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/radar_sweep_alpha/Makefile b/radar_sweep_alpha/Makefile
index f66c338..571d47b 100644
--- a/radar_sweep_alpha/Makefile
+++ b/radar_sweep_alpha/Makefile
@@ -2,7 +2,7 @@ OBJS=radar_sweep_alpha.o
BIN=radar_sweep_alpha
CFLAGS+=-Wall -O3 -g -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/rgb_triangle/Makefile b/rgb_triangle/Makefile
index 2ce779d..0266715 100644
--- a/rgb_triangle/Makefile
+++ b/rgb_triangle/Makefile
@@ -2,7 +2,7 @@ OBJS=rgb_triangle.o
BIN=rgb_triangle
CFLAGS+=-Wall -O3 -g -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/spriteview/Makefile b/spriteview/Makefile
index 904c1e8..d2fb3c8 100644
--- a/spriteview/Makefile
+++ b/spriteview/Makefile
@@ -2,7 +2,7 @@ OBJS=spriteview.o
BIN=spriteview
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/test_pattern/Makefile b/test_pattern/Makefile
index 1e02b0a..c231fb6 100644
--- a/test_pattern/Makefile
+++ b/test_pattern/Makefile
@@ -2,7 +2,7 @@ OBJS=test_pattern.o
BIN=test_pattern
CFLAGS+=-Wall -g -O3 -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/worms/Makefile b/worms/Makefile
index c249c8c..3b6c830 100644
--- a/worms/Makefile
+++ b/worms/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o worms.o
BIN=worms
CFLAGS+=-Wall -g -O3 -I../common
-LDFLAGS+=-L/opt/vc/lib/ -lbcm_host -lm -L../lib -lraspidmx
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
@@ -0,0 +1,87 @@
From 07e7b727b7df7fc5bf0e1f296ba136e0653202ea Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 03:25:08 -0500
Subject: [PATCH] change library linking order
Since -lraspidmxPng requires the png library (libpng), re-arrange the order of
linking so that it succeeds. Otherwise I get errors like the following:
undefined reference to `png_create_write_struct'
...as well as undefined references to various other libpng objects.
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
game/Makefile | 2 +-
mandelbrot/Makefile | 2 +-
offscreen/Makefile | 2 +-
pngview/Makefile | 2 +-
spriteview/Makefile | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/Makefile b/game/Makefile
index b756fa2..f33916d 100644
--- a/game/Makefile
+++ b/game/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o
BIN=game
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx -lraspidmxPng $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/mandelbrot/Makefile b/mandelbrot/Makefile
index 31097f2..08d1113 100644
--- a/mandelbrot/Makefile
+++ b/mandelbrot/Makefile
@@ -2,7 +2,7 @@ OBJS=main.o mandelbrot.o info.o
BIN=mandelbrot
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx -lraspidmxPng $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/offscreen/Makefile b/offscreen/Makefile
index 4f13fd0..49fc744 100644
--- a/offscreen/Makefile
+++ b/offscreen/Makefile
@@ -2,7 +2,7 @@ OBJS=pngresize.o resizeDispmanX.o
BIN=pngresize
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx -lraspidmxPng $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/pngview/Makefile b/pngview/Makefile
index cce8d63..bd6c154 100644
--- a/pngview/Makefile
+++ b/pngview/Makefile
@@ -2,7 +2,7 @@ OBJS=pngview.o
BIN=pngview
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx -lraspidmxPng $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
diff --git a/spriteview/Makefile b/spriteview/Makefile
index d2fb3c8..89d9e01 100644
--- a/spriteview/Makefile
+++ b/spriteview/Makefile
@@ -2,7 +2,7 @@ OBJS=spriteview.o
BIN=spriteview
CFLAGS+=-Wall -g -O3 -I../common $(shell pkg-config --cflags libpng)
-LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm $(shell pkg-config --libs libpng) -L../lib -lraspidmx -lraspidmxPng
+LDFLAGS+=-L/opt/vc/lib/ -lvchostif -lbcm_host -lm -L../lib -lraspidmx -lraspidmxPng $(shell pkg-config --libs libpng)
INCLUDES+=-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
@@ -0,0 +1,24 @@
From 1868a111450be0053ab124df501cfcb7542f5e77 Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 03:47:17 -0500
Subject: [PATCH] game/Makefile: install sample png files
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
game/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/game/Makefile b/game/Makefile
index f33916d..d007972 100644
--- a/game/Makefile
+++ b/game/Makefile
@@ -18,6 +18,8 @@ $(BIN): $(OBJS)
install: $(BIN)
install -d $(DESTDIR)/usr/bin
install -m 0755 $(BIN) $(DESTDIR)/usr/bin
+ install -d $(DESTDIR)/usr/share/raspidmx
+ install -m 444 spotlight.png sprite.png texture.png $(DESTDIR)/usr/share/raspidmx
clean:
@rm -f $(OBJS)
@@ -0,0 +1,57 @@
From f195ffffb133c9cda88d5eac41c0f584fd4540c9 Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 4 Dec 2020 03:48:36 -0500
Subject: [PATCH] Makefile: reorganize
Reorganize the main Makefile in order to:
1. be able to build in parallel
2. have build failures in subdirectories stop the build
Now the "-j <#threads>" option can be used with 'make'.
Also, if a build failure occurs in a subdirectory, this new arrangement will
cause the build to stop and fail instead of silently ignoring it.
To build simply invoke 'make' with or without a -j option.
To install simply invoke: make TARGET=install
To clean simply invoke: make TARGET=clean
Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
Makefile | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index 4a06de9..1f9f7c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
-TARGETS=lib \
- life \
+TARGETS=life \
mandelbrot \
offscreen \
pngview \
@@ -10,15 +9,11 @@ TARGETS=lib \
spriteview \
test_pattern \
worms
+.PHONY: all lib install clean $(TARGETS)
-default :all
-
-all:
- for target in $(TARGETS); do ($(MAKE) -C $$target); done
-
-install:
- for target in $(TARGETS); do ($(MAKE) -C $$target install); done
-
-clean:
- for target in $(TARGETS); do ($(MAKE) -C $$target clean); done
+all: $(TARGETS)
+$(TARGETS): lib
+ $(MAKE) -C $@ $(TARGET)
+lib:
+ $(MAKE) -C $@ $(TARGET)
@@ -0,0 +1,31 @@
SUMMARY = "Some examples using the DispmanX API on the Raspberry Pi"
HOMEPAGE = "https://github.com/AndrewFromMelbourne/raspidmx"
SECTION = "graphics"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=52962875ab02c36df6cde47b1f463024"
COMPATIBLE_HOST = "null"
COMPATIBLE_HOST:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'null', '(.*)', d)}"
SRC_URI = "git://github.com/AndrewFromMelbourne/raspidmx;protocol=https;branch=master \
file://0001-gitignore-add-archives-from-lib-directory.patch \
file://0002-add-install-targets-to-Makefiles.patch \
file://0003-switch-to-pkg-config.patch \
file://0004-add-libvchostif-to-link.patch \
file://0005-change-library-linking-order.patch \
file://0006-game-Makefile-install-sample-png-files.patch \
file://0007-Makefile-reorganize.patch \
"
PV = "0.0+git${SRCPV}"
SRCREV = "e2ee6faa0d01a5ece06bcc74a47f37d7e6837310"
S = "${WORKDIR}/git"
inherit pkgconfig
DEPENDS += "libpng userland"
do_install () {
oe_runmake 'DESTDIR=${D}' 'TARGET=install'
}
@@ -0,0 +1,207 @@
From 8a734f44beea9b10548ba696eaea1f5a76148fd5 Mon Sep 17 00:00:00 2001
From: Dom Cobley <dc4@broadcom.com>
Date: Tue, 9 Jul 2013 09:26:26 -0400
Subject: [PATCH] Allow applications to set next resource handle
This patch adds provisions in userland to
let apps callers set the next rendereing dispmanx resource.
It's useful for implementing, say, a buffer carousel.
---
Upstream-Status: Pending
interface/khronos/common/khrn_client_rpc.h | 2 ++
interface/khronos/common/khrn_int_ids.h | 2 ++
interface/khronos/egl/egl_client.c | 30 +++++++++++++++++++---
interface/khronos/egl/egl_client_surface.c | 24 ++++++++++++++++-
interface/khronos/egl/egl_client_surface.h | 3 ++-
interface/khronos/egl/egl_int_impl.h | 5 ++--
6 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/interface/khronos/common/khrn_client_rpc.h b/interface/khronos/common/khrn_client_rpc.h
index dc4351d..10ea060 100644
--- a/interface/khronos/common/khrn_client_rpc.h
+++ b/interface/khronos/common/khrn_client_rpc.h
@@ -685,6 +685,7 @@ static INLINE void rpc_call12_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id
static INLINE void rpc_call13_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
static INLINE void rpc_call14_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
static INLINE void rpc_call15_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, uint32_t p13, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
+static INLINE void rpc_call16_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, uint32_t p13, uint32_t p14, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
#endif
#define RPC_CALL1_OUT_CTRL(fn, thread, id, out) rpc_call1_out_ctrl(thread, id, out)
@@ -702,6 +703,7 @@ static INLINE void rpc_call15_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id
#define RPC_CALL13_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, out) rpc_call13_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, out)
#define RPC_CALL14_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, out) rpc_call14_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, out)
#define RPC_CALL15_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, out) rpc_call15_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, out)
+#define RPC_CALL16_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, out) rpc_call16_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, out)
# if !defined(__SYMBIAN32__) //use functions defined in khrpc.cpp
static INLINE uint32_t rpc_call1_out_ctrl_res(CLIENT_THREAD_STATE_T *thread,uint32_t id, void *out) { uint32_t res; rpc_begin(thread); RPC_CALL(thread, id); res = rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_RES | RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); return res; }
diff --git a/interface/khronos/common/khrn_int_ids.h b/interface/khronos/common/khrn_int_ids.h
index 8378f4a..ec961e0 100644
--- a/interface/khronos/common/khrn_int_ids.h
+++ b/interface/khronos/common/khrn_int_ids.h
@@ -367,6 +367,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define EGLINTCREATESURFACE_ID 0x4000
+#define EGLINTCREATESURFACE_ID_V2 0x4100
#define EGLINTCREATEGLES11_ID 0x4001
#define EGLINTCREATEGLES20_ID 0x4002
#define EGLINTCREATEVG_ID 0x4003
@@ -377,6 +378,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define EGLINTMAKECURRENT_ID 0x4008
#define EGLINTFLUSHANDWAIT_ID 0x4009
#define EGLINTSWAPBUFFERS_ID 0x400a
+#define EGLINTSWAPBUFFERS_ID_V2 0x410a
#define EGLINTSELECTMIPMAP_ID 0x400b
#define EGLINTFLUSH_ID 0x400c
#define EGLINTGETCOLORDATA_ID 0x400d
diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
index 9d617c8..b8bb374 100644
--- a/interface/khronos/egl/egl_client.c
+++ b/interface/khronos/egl/egl_client.c
@@ -162,6 +162,17 @@ static void egl_current_release(CLIENT_PROCESS_STATE_T *process, EGL_CURRENT_T *
void egl_gl_flush_callback(bool wait);
void egl_vg_flush_callback(bool wait);
+#include "interface/vmcs_host/vc_dispmanx_types.h"
+/**HACKHACK - give us the ability to inject a DispmanX
+ * resource handle into the CreateWindowSurface and
+ * SwapBuffers calls */
+static DISPMANX_RESOURCE_HANDLE_T next_resource_handle;
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSetNextResourceHandle(DISPMANX_RESOURCE_HANDLE_T handle)
+{
+ next_resource_handle = handle;
+}
+
/*
TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate)
Also affects global image (and possibly others?)
@@ -644,7 +655,8 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig c
false,
EGL_NO_TEXTURE,
EGL_NO_TEXTURE,
- 0, 0);
+ 0, 0,
+ next_resource_handle);
if (surface) {
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
@@ -889,7 +901,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig
mipmap_texture,
texture_format,
texture_target,
- 0, 0);
+ 0, 0, 0);
if (surface) {
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
@@ -1031,7 +1043,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig c
false,
EGL_NO_TEXTURE,
EGL_NO_TEXTURE,
- pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle);
+ pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle, 0);
if (surface) {
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
@@ -2303,6 +2315,18 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
vcos_log_trace("eglSwapBuffers server call");
+ if (next_resource_handle)
+ RPC_CALL7(eglIntSwapBuffers_impl,
+ thread,
+ EGLINTSWAPBUFFERS_ID_V2,
+ RPC_UINT(surface->serverbuffer),
+ RPC_UINT(surface->width),
+ RPC_UINT(surface->height),
+ RPC_UINT(surface->internal_handle),
+ RPC_UINT(surface->swap_behavior == EGL_BUFFER_PRESERVED ? 1 : 0),
+ RPC_UINT(khrn_platform_get_window_position(surface->win)),
+ RPC_INT(next_resource_handle));
+ else
RPC_CALL6(eglIntSwapBuffers_impl,
thread,
EGLINTSWAPBUFFERS_ID,
diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
index 6846dfa..128325e 100644
--- a/interface/khronos/egl/egl_client_surface.c
+++ b/interface/khronos/egl/egl_client_surface.c
@@ -314,7 +314,8 @@ EGL_SURFACE_T *egl_surface_create(
EGLenum texture_format,
EGLenum texture_target,
EGLNativePixmapType pixmap,
- const uint32_t *pixmap_server_handle)
+ const uint32_t *pixmap_server_handle,
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle)
{
KHRN_IMAGE_FORMAT_T color;
KHRN_IMAGE_FORMAT_T depth;
@@ -473,6 +474,27 @@ EGL_SURFACE_T *egl_surface_create(
#endif
uint32_t results[3];
+ if (next_resource_handle)
+ RPC_CALL16_OUT_CTRL(eglIntCreateSurface_impl,
+ thread,
+ EGLINTCREATESURFACE_ID_V2,
+ RPC_UINT(serverwin),
+ RPC_UINT(buffers),
+ RPC_UINT(width),
+ RPC_UINT(height),
+ RPC_UINT(color),
+ RPC_UINT(depth),
+ RPC_UINT(mask),
+ RPC_UINT(multi),
+ RPC_UINT(largest_pbuffer),
+ RPC_UINT(mipmap_texture),
+ RPC_UINT(config_depth_bits),
+ RPC_UINT(config_stencil_bits),
+ RPC_UINT(sem_name),
+ RPC_UINT(type),
+ RPC_INT(next_resource_handle),
+ results);
+ else
RPC_CALL15_OUT_CTRL(eglIntCreateSurface_impl,
thread,
EGLINTCREATESURFACE_ID,
diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h
index c99d44c..b5bf70a 100644
--- a/interface/khronos/egl/egl_client_surface.h
+++ b/interface/khronos/egl/egl_client_surface.h
@@ -322,7 +322,8 @@ extern EGL_SURFACE_T *egl_surface_create(
EGLenum texture_format,
EGLenum texture_target,
EGLNativePixmapType pixmap,
- const uint32_t *pixmap_server_handle);
+ const uint32_t *pixmap_server_handle,
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle);
extern EGL_SURFACE_T *egl_surface_from_vg_image(
VGImage vg_handle,
EGLSurface name,
diff --git a/interface/khronos/egl/egl_int_impl.h b/interface/khronos/egl/egl_int_impl.h
index 8a5734c..51b3580 100644
--- a/interface/khronos/egl/egl_int_impl.h
+++ b/interface/khronos/egl/egl_int_impl.h
@@ -56,7 +56,8 @@ FN(int, eglIntCreateSurface_impl, (
uint32_t config_stencil_bits,
uint32_t sem,
uint32_t type,
- uint32_t *results))
+ uint32_t *results,
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle))
FN(int, eglIntCreatePbufferFromVGImage_impl, (
VGImage vg_handle,
@@ -110,7 +111,7 @@ FN(void, eglIntMakeCurrent_impl, (uint32_t pid_0, uint32_t pid_1, uint32_t glver
FN(int, eglIntFlushAndWait_impl, (uint32_t flushgl, uint32_t flushvg))
FN(void, eglIntFlush_impl, (uint32_t flushgl, uint32_t flushvg))
-FN(void, eglIntSwapBuffers_impl, (EGL_SURFACE_ID_T s, uint32_t width, uint32_t height, uint32_t handle, uint32_t preserve, uint32_t position))
+FN(void, eglIntSwapBuffers_impl, (EGL_SURFACE_ID_T s, uint32_t width, uint32_t height, uint32_t handle, uint32_t preserve, uint32_t position, DISPMANX_RESOURCE_HANDLE_T new_back_buffer))
FN(void, eglIntSelectMipmap_impl, (EGL_SURFACE_ID_T s, int level))
FN(void, eglIntGetColorData_impl, (EGL_SURFACE_ID_T s, KHRN_IMAGE_FORMAT_T format, uint32_t width, uint32_t height, int32_t stride, uint32_t y_offset, void *data))
@@ -0,0 +1,33 @@
From 15fbe266af3dcc5b7660397204b06d04364a953a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 2 Apr 2022 21:37:42 -0700
Subject: [PATCH] mmal: Do not use -Werror
Clang warns about unused-but-set variables
interface/mmal/vc/mmal_vc_api.c:395:18: error: variable 'status' set but not used [-We
rror,-Wunused-but-set-variable]
| MMAL_STATUS_T status;
| ^
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
interface/mmal/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/interface/mmal/CMakeLists.txt b/interface/mmal/CMakeLists.txt
index 46f149d..c5c1642 100644
--- a/interface/mmal/CMakeLists.txt
+++ b/interface/mmal/CMakeLists.txt
@@ -3,7 +3,7 @@ if (NOT DEFINED LIBRARY_TYPE)
set(LIBRARY_TYPE SHARED)
endif (NOT DEFINED LIBRARY_TYPE)
-add_definitions(-Wall -Werror)
+add_definitions(-Wall)
add_library(mmal SHARED util/mmal_util.c)
--
2.35.1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
From 73e338f99f89bc85fe384759a385d95e904adb7f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 10 Aug 2015 02:38:27 -0700
Subject: [PATCH] wayland-egl: Add bcm_host to dependencies
It uses headers like vcos_platform_types.h but does not
depend on module which should add the required include paths
lets add the dependency on bcm_host module which should do it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/wayland-egl/wayland-egl.pc.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/interface/khronos/wayland-egl/wayland-egl.pc.in b/interface/khronos/wayland-egl/wayland-egl.pc.in
index 8bafc15..fd259c9 100644
--- a/interface/khronos/wayland-egl/wayland-egl.pc.in
+++ b/interface/khronos/wayland-egl/wayland-egl.pc.in
@@ -6,5 +6,6 @@ includedir=${prefix}/include
Name: wayland-egl
Description: VideoCore wayland-egl library
Version: @PROJECT_APIVER@
+Requires: bcm_host
Libs: -L${libdir} -lwayland-egl
Cflags: -I${includedir}
@@ -0,0 +1,28 @@
From 8e79662e7b396325bee3f310a9406c74110cc7f4 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Sat, 24 Jan 2015 22:07:19 +0100
Subject: [PATCH] interface: remove faulty assert() to make weston happy at
runtime
This was removed after a discussion on IRC with the weston guys
('daniels' on irc.freenode.net/#wayland).
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Upstream-Status: Pending
interface/vmcs_host/vc_vchi_dispmanx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c
index eab146e..29e0dee 100755
--- a/interface/vmcs_host/vc_vchi_dispmanx.c
+++ b/interface/vmcs_host/vc_vchi_dispmanx.c
@@ -1306,7 +1306,6 @@ static void *dispmanx_notify_func( void *arg ) {
// Decrement the use count - the corresponding "use" is in vc_dispmanx_update_submit.
vchi_service_release(dispmanx_client.notify_handle[0]);
if (dispmanx_client.update_callback ) {
- vcos_assert( dispmanx_client.pending_update_handle == handle);
dispmanx_client.update_callback(handle, dispmanx_client.update_callback_param);
}
} else {
@@ -0,0 +1,32 @@
From 22652fec1206eb6e5b3c05e2c4933feffce922e8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 6 Feb 2016 11:10:47 -0800
Subject: [PATCH] zero-out wl buffers in egl_surface_free
origins from buildroot
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/egl/egl_client_surface.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
index 42350bf..1f923d9 100644
--- a/interface/khronos/egl/egl_client_surface.c
+++ b/interface/khronos/egl/egl_client_surface.c
@@ -690,11 +690,13 @@ void egl_surface_free(EGL_SURFACE_T *surface)
if (surface->back_wl_buffer) {
wl_buffer_destroy(surface->back_wl_buffer->wl_buffer);
free(surface->back_wl_buffer);
+ surface->back_wl_buffer = 0;
}
if (surface->front_wl_buffer) {
wl_buffer_destroy(surface->front_wl_buffer->wl_buffer);
free(surface->front_wl_buffer);
+ surface->front_wl_buffer = 0;
}
#endif
}
@@ -0,0 +1,33 @@
From 5c0fb637f8b1286da19b904c7be1692a4aa61244 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 6 Feb 2016 11:11:41 -0800
Subject: [PATCH] initialize front back wayland buffers
origins from metrological wayland support
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/egl/egl_client_surface.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
index 1f923d9..9a9582c 100644
--- a/interface/khronos/egl/egl_client_surface.c
+++ b/interface/khronos/egl/egl_client_surface.c
@@ -401,11 +401,14 @@ EGL_SURFACE_T *egl_surface_create(
#ifdef BUILD_WAYLAND
if (type == WINDOW && wl_display) {
surface->wl_egl_window = (struct wl_egl_window*)win;
+ surface->front_wl_buffer = NULL;
surface->back_wl_buffer = allocate_wl_buffer(
surface->wl_egl_window, color);
resource = surface->back_wl_buffer->resource;
} else {
surface->wl_egl_window = NULL;
+ surface->front_wl_buffer = NULL;
+ surface->back_wl_buffer = NULL;
resource = DISPMANX_NO_HANDLE;
}
#endif
@@ -0,0 +1,26 @@
From 18839d288b60aa3592ba5a3ac4ac44eb8328a793 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 6 Feb 2016 11:09:18 -0800
Subject: [PATCH] Remove RPC_FLUSH
Origins from buildroot
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/ext/gl_oes_egl_image_client.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/interface/khronos/ext/gl_oes_egl_image_client.c b/interface/khronos/ext/gl_oes_egl_image_client.c
index f9b7287..b04ffef 100644
--- a/interface/khronos/ext/gl_oes_egl_image_client.c
+++ b/interface/khronos/ext/gl_oes_egl_image_client.c
@@ -107,7 +107,6 @@ GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageO
GLEGLIMAGETARGETTEXTURE2DOES_ID,
RPC_ENUM(target),
RPC_EGLID(image));
- RPC_FLUSH(thread);
#if EGL_BRCM_global_image
}
#endif
@@ -0,0 +1,77 @@
From f324e2724973aa76d054c3662d5d0903fd405390 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 6 Feb 2016 13:12:47 -0800
Subject: [PATCH] fix cmake dependency race
Fixes errors like
/a/builder/mnt/build-oe/tmp-glibc/work/raspberrypi2-oe-linux-gnueabi/userland/git-r5/git/interface/vmcs_host/vc_vchi_dispmanx.h:72:66:
fatal error: interface/vmcs_host/wayland-dispmanx-server-protocol.h: No
such file or directory
compilation terminated.
interface/khronos/CMakeFiles/EGL_static.dir/build.make:773: recipe for
target 'interface/khronos/CMakeFiles/EGL_static.dir/ext/egl_wayland.c.o'
failed
make[2]: ***
[interface/khronos/CMakeFiles/EGL_static.dir/ext/egl_wayland.c.o] Error 1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/vcos/pthreads/CMakeLists.txt | 8 ++++++++
interface/vmcs_host/CMakeLists.txt | 8 --------
interface/vmcs_host/vc_vchi_dispmanx.h | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/interface/vcos/pthreads/CMakeLists.txt b/interface/vcos/pthreads/CMakeLists.txt
index 1d81ca3..d6cd415 100644
--- a/interface/vcos/pthreads/CMakeLists.txt
+++ b/interface/vcos/pthreads/CMakeLists.txt
@@ -33,6 +33,14 @@ set (SOURCES
../generic/vcos_generic_blockpool.c
)
+if (BUILD_WAYLAND)
+wayland_add_protocol_server(
+ SOURCES
+ ../../../interface/wayland/dispmanx.xml
+ dispmanx
+)
+endif ()
+
if (VCOS_PTHREADS_BUILD_SHARED)
add_library (vcos SHARED ${SOURCES})
target_link_libraries (vcos pthread dl rt)
diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
index 552312a..775742d 100755
--- a/interface/vmcs_host/CMakeLists.txt
+++ b/interface/vmcs_host/CMakeLists.txt
@@ -15,14 +15,6 @@ set(VCHOSTIF_SOURCE
# ${VMCS_TARGET}/vmcs_main.c
# vc_vchi_haud.c
-if (BUILD_WAYLAND)
-wayland_add_protocol_server(
- VCHOSTIF_SOURCE
- ../../interface/wayland/dispmanx.xml
- dispmanx
-)
-endif ()
-
add_library(vchostif ${VCHOSTIF_SOURCE})
#add_library(bufman vc_vchi_bufman.c )
diff --git a/interface/vmcs_host/vc_vchi_dispmanx.h b/interface/vmcs_host/vc_vchi_dispmanx.h
index f0bae30..8c44c58 100644
--- a/interface/vmcs_host/vc_vchi_dispmanx.h
+++ b/interface/vmcs_host/vc_vchi_dispmanx.h
@@ -69,7 +69,7 @@ typedef struct {
#ifdef BUILD_WAYLAND
/* XXX: This should be in a private header that can be included from EGL and vc_* */
#include <wayland-server.h>
-#include "interface/vmcs_host/wayland-dispmanx-server-protocol.h"
+#include "interface/vcos/pthreads/wayland-dispmanx-server-protocol.h"
struct wl_dispmanx_server_buffer {
struct wl_resource *resource;
struct wl_dispmanx *dispmanx;
@@ -0,0 +1,59 @@
From 09de2ce12ed8a879cc822cd20c5f2756d030808a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Mar 2016 20:38:30 -0700
Subject: [PATCH] Fix for framerate with nested composition
frame rate appears irregular and lower than expected when using nested composition.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/egl/egl_client.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
index 03fe67b..13a110c 100644
--- a/interface/khronos/egl/egl_client.c
+++ b/interface/khronos/egl/egl_client.c
@@ -2342,6 +2342,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
surface->back_wl_buffer = buffer;
}
+ glFlush();
+ glFinish();
+
RPC_CALL7(eglIntSwapBuffers_impl,
thread,
EGLINTSWAPBUFFERS_ID_V2,
@@ -2353,6 +2356,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
RPC_UINT(khrn_platform_get_window_position(surface->win)),
RPC_INT(surface->back_wl_buffer->resource));
+ RPC_FLUSH(thread);
+
surface->front_wl_buffer->in_use = 1;
wl_surface_attach(wl_egl_window->wl_surface,
surface->front_wl_buffer->wl_buffer,
@@ -2360,11 +2365,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
wl_surface_damage(wl_egl_window->wl_surface, 0, 0,
surface->width, surface->height);
wl_surface_commit(wl_egl_window->wl_surface);
+ wl_display_flush(wl_display);
while(ret != -1 && surface->back_wl_buffer->in_use)
ret = wl_display_dispatch_queue(wl_display, process->wl_queue);
} else
#endif
+ {
RPC_CALL6(eglIntSwapBuffers_impl,
thread,
EGLINTSWAPBUFFERS_ID,
@@ -2376,6 +2383,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
RPC_UINT(khrn_platform_get_window_position(surface->win)));
RPC_FLUSH(thread);
+ }
#ifdef ANDROID
CLIENT_UNLOCK();
@@ -0,0 +1,27 @@
From 140df8cbf93fc3295f57bffeb254adeb0b17d3a0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 2 Apr 2016 10:37:24 -0700
Subject: [PATCH] build shared library for vchostif
Fixes #149
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/vmcs_host/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
index 775742d..76813c9 100755
--- a/interface/vmcs_host/CMakeLists.txt
+++ b/interface/vmcs_host/CMakeLists.txt
@@ -15,7 +15,7 @@ set(VCHOSTIF_SOURCE
# ${VMCS_TARGET}/vmcs_main.c
# vc_vchi_haud.c
-add_library(vchostif ${VCHOSTIF_SOURCE})
+add_library(vchostif SHARED ${VCHOSTIF_SOURCE})
#add_library(bufman vc_vchi_bufman.c )
set(INSTALL_TARGETS vchostif)
@@ -0,0 +1,91 @@
From bdb5bbe994b91a7c64ca6103fbf2bbd590e6b8e5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 2 Apr 2016 10:54:59 -0700
Subject: [PATCH] implement buffer wrapping interface for dispmanx
Courtesy: Zan Dobersek
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/ext/egl_wayland.c | 42 +++++++++++++++++++++++++++++
interface/wayland/dispmanx.xml | 10 +++++++
2 files changed, 52 insertions(+)
diff --git a/interface/khronos/ext/egl_wayland.c b/interface/khronos/ext/egl_wayland.c
index 5730743..9ef89cd 100644
--- a/interface/khronos/ext/egl_wayland.c
+++ b/interface/khronos/ext/egl_wayland.c
@@ -133,8 +133,50 @@ dispmanx_create_buffer(struct wl_client *client, struct wl_resource *resource,
buffer->handle);
}
+static void
+dispmanx_wrap_buffer(struct wl_client *client, struct wl_resource *resource,
+ uint32_t id, uint32_t handle, int32_t width, int32_t height,
+ uint32_t stride, uint32_t buffer_height, uint32_t format)
+{
+ struct wl_dispmanx_server_buffer *buffer;
+ VC_IMAGE_TYPE_T vc_format = get_vc_format(format);
+ uint32_t dummy;
+
+ if(vc_format == VC_IMAGE_MIN) {
+ wl_resource_post_error(resource,
+ WL_DISPMANX_ERROR_INVALID_FORMAT,
+ "invalid format");
+ return;
+ }
+
+ buffer = calloc(1, sizeof *buffer);
+ if (buffer == NULL) {
+ wl_resource_post_no_memory(resource);
+ return;
+ }
+
+ buffer->handle = handle;
+ buffer->width = width;
+ buffer->height = height;
+ buffer->format = format;
+
+ buffer->resource = wl_resource_create(resource->client, &wl_buffer_interface,
+ 1, id);
+ if (!buffer->resource) {
+ wl_resource_post_no_memory(resource);
+ vc_dispmanx_resource_delete(buffer->handle);
+ free(buffer);
+ return;
+ }
+
+ wl_resource_set_implementation(buffer->resource,
+ (void (**)(void)) &dispmanx_buffer_interface,
+ buffer, destroy_buffer);
+}
+
static const struct wl_dispmanx_interface dispmanx_interface = {
dispmanx_create_buffer,
+ dispmanx_wrap_buffer,
};
static void
diff --git a/interface/wayland/dispmanx.xml b/interface/wayland/dispmanx.xml
index c18626d..11ed1ef 100644
--- a/interface/wayland/dispmanx.xml
+++ b/interface/wayland/dispmanx.xml
@@ -118,6 +118,16 @@
<arg name="buffer" type="object" interface="wl_buffer"/>
<arg name="handle" type="uint"/>
</event>
+
+ <request name="wrap_buffer">
+ <arg name="id" type="new_id" interface="wl_buffer"/>
+ <arg name="handle" type="uint"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="stride" type="uint"/>
+ <arg name="buffer_height" type="uint"/>
+ <arg name="format" type="uint"/>
+ </request>
</interface>
</protocol>
@@ -0,0 +1,89 @@
From ffdcdf7605f4f266b408cf161e7c76dab54d689b Mon Sep 17 00:00:00 2001
From: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
Date: Thu, 19 Jan 2017 18:56:07 +0000
Subject: [PATCH] Implement triple buffering for wayland
Change from double to triple buffering for wayland.
This enables higher frame rates without tearing artifacts
by allowing both the glFinish and the buffer release
interlock to operate without pushing the frame period
to two vertical intervals
Signed-off-by: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/egl/egl_client.c | 3 ++-
interface/khronos/egl/egl_client_surface.c | 8 ++++++++
interface/khronos/egl/egl_client_surface.h | 11 +++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
index 13a110c..0380274 100644
--- a/interface/khronos/egl/egl_client.c
+++ b/interface/khronos/egl/egl_client.c
@@ -2323,7 +2323,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
buffer_temp = surface->front_wl_buffer;
surface->front_wl_buffer = surface->back_wl_buffer;
- surface->back_wl_buffer = buffer_temp;
+ surface->back_wl_buffer = surface->middle_wl_buffer;
+ surface->middle_wl_buffer = buffer_temp;
configid = egl_config_to_id(surface->config);
color = egl_config_get_color_format(configid);
diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
index 9a9582c..10b3b04 100644
--- a/interface/khronos/egl/egl_client_surface.c
+++ b/interface/khronos/egl/egl_client_surface.c
@@ -402,12 +402,14 @@ EGL_SURFACE_T *egl_surface_create(
if (type == WINDOW && wl_display) {
surface->wl_egl_window = (struct wl_egl_window*)win;
surface->front_wl_buffer = NULL;
+ surface->middle_wl_buffer = NULL;
surface->back_wl_buffer = allocate_wl_buffer(
surface->wl_egl_window, color);
resource = surface->back_wl_buffer->resource;
} else {
surface->wl_egl_window = NULL;
surface->front_wl_buffer = NULL;
+ surface->middle_wl_buffer = NULL;
surface->back_wl_buffer = NULL;
resource = DISPMANX_NO_HANDLE;
}
@@ -696,6 +698,12 @@ void egl_surface_free(EGL_SURFACE_T *surface)
surface->back_wl_buffer = 0;
}
+ if (surface->middle_wl_buffer) {
+ wl_buffer_destroy(surface->middle_wl_buffer->wl_buffer);
+ free(surface->middle_wl_buffer);
+ surface->middle_wl_buffer = 0;
+ }
+
if (surface->front_wl_buffer) {
wl_buffer_destroy(surface->front_wl_buffer->wl_buffer);
free(surface->front_wl_buffer);
diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h
index e328b77..58a3184 100644
--- a/interface/khronos/egl/egl_client_surface.h
+++ b/interface/khronos/egl/egl_client_surface.h
@@ -312,6 +312,17 @@ typedef struct {
*/
struct wl_dispmanx_client_buffer *front_wl_buffer;
+ /*
+ middle_wl_buffer
+
+ Validity:
+ type == WINDOW
+
+ Invariant:
+ client-side information about the wl_buffer in the middle
+ */
+ struct wl_dispmanx_client_buffer *middle_wl_buffer;
+
/*
back_wl_buffer
@@ -0,0 +1,32 @@
From 4624c934d1a783968306e61ded4389c153e3d009 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 10 May 2017 06:39:34 +0000
Subject: [PATCH] GLES2/gl2ext.h: Define GL_R8_EXT and GL_RG8_EXT
weston code uses these defines
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
interface/khronos/include/GLES2/gl2ext.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/interface/khronos/include/GLES2/gl2ext.h b/interface/khronos/include/GLES2/gl2ext.h
index 4eacf7f..b1acc9f 100644
--- a/interface/khronos/include/GLES2/gl2ext.h
+++ b/interface/khronos/include/GLES2/gl2ext.h
@@ -327,6 +327,14 @@ typedef void* GLeglImageOES;
#define GL_RGBX_BRCM 0x80EE
#endif
+#ifndef GL_EXT_texture_rg
+#define GL_EXT_texture_rg 1
+#define GL_RED_EXT 0x1903
+#define GL_RG_EXT 0x8227
+#define GL_R8_EXT 0x8229
+#define GL_RG8_EXT 0x822B
+#endif /* GL_EXT_texture_rg */
+
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
@@ -0,0 +1,29 @@
From 528a439539a77e67bf136d425eac3240ca6f1cd7 Mon Sep 17 00:00:00 2001
From: Andrea Galbusera <gizero@gmail.com>
Date: Fri, 14 Jul 2017 09:52:54 +0200
Subject: [PATCH] EGL/glplatform.h: define EGL_CAST
C++ / C typecast macros for special EGL handle values: used by libepoxy code
The definition comes from the updated version of this header in mesa.
Upstream-Status: Pending
---
interface/khronos/include/EGL/eglplatform.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/interface/khronos/include/EGL/eglplatform.h b/interface/khronos/include/EGL/eglplatform.h
index 1f7c930..c39d425 100644
--- a/interface/khronos/include/EGL/eglplatform.h
+++ b/interface/khronos/include/EGL/eglplatform.h
@@ -202,4 +202,11 @@ EGLAPI void EGLAPIENTRY BEGL_GetDefaultDriverInterfaces(BEGL_DriverInterfaces *i
#include "interface/khronos/common/khrn_client_mangle.h"
#endif
+/* C++ / C typecast macros for special EGL handle values */
+#if defined(__cplusplus)
+#define EGL_CAST(type, value) (static_cast<type>(value))
+#else
+#define EGL_CAST(type, value) ((type) (value))
+#endif
+
#endif /* __eglplatform_h */
@@ -0,0 +1,143 @@
From c5969e5e5c50e2c9b32c6f945040a8e5763ba06c Mon Sep 17 00:00:00 2001
From: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
Date: Sat, 27 Jan 2018 12:28:31 -0500
Subject: [PATCH] Allow multiple wayland compositor state data per process
When eglBindWaylandDisplayWL is called store the wl_global
created in a list associated with the wayland display.
This allows multiple wayland compositor instances to be
created and used per process. This scenario is common for
applications integrating externl process UI elements
via embedded composition e.g. westeros
Signed-off-by: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/common/khrn_client.c | 2 +-
interface/khronos/common/khrn_client.h | 11 +++++-
interface/khronos/ext/egl_wayland.c | 50 ++++++++++++++++++++++----
3 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/interface/khronos/common/khrn_client.c b/interface/khronos/common/khrn_client.c
index d7e798e..60bdb63 100644
--- a/interface/khronos/common/khrn_client.c
+++ b/interface/khronos/common/khrn_client.c
@@ -147,7 +147,7 @@ bool client_process_state_init(CLIENT_PROCESS_STATE_T *process)
{
if (!process->inited) {
#ifdef BUILD_WAYLAND
- process->wl_global = NULL;
+ process->wlStateMap = NULL;
#endif
if (!khrn_pointer_map_init(&process->contexts, 64))
diff --git a/interface/khronos/common/khrn_client.h b/interface/khronos/common/khrn_client.h
index 615f7b4..4fa86f7 100644
--- a/interface/khronos/common/khrn_client.h
+++ b/interface/khronos/common/khrn_client.h
@@ -170,6 +170,15 @@ static INLINE CLIENT_THREAD_STATE_T *CLIENT_GET_CHECK_THREAD_STATE(void)
return (CLIENT_THREAD_STATE_T *)platform_tls_get_check(client_tls);
}
+#ifdef BUILD_WAYLAND
+typedef struct WAYLAND_STATE
+{
+ struct WAYLAND_STATE *next;
+ struct wl_display *display;
+ struct wl_global *wl_global;
+} WAYLAND_STATE_T;
+#endif
+
/*
per-process state
@@ -318,7 +327,7 @@ struct CLIENT_PROCESS_STATE {
struct wl_event_queue *wl_queue;
/* Compositor-side Wayland state */
- struct wl_global *wl_global;
+ WAYLAND_STATE_T *wlStateMap;
#endif
};
diff --git a/interface/khronos/ext/egl_wayland.c b/interface/khronos/ext/egl_wayland.c
index 9ef89cd..abd5ab3 100644
--- a/interface/khronos/ext/egl_wayland.c
+++ b/interface/khronos/ext/egl_wayland.c
@@ -208,17 +208,38 @@ eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
CLIENT_THREAD_STATE_T *thread;
CLIENT_PROCESS_STATE_T *process;
+ WAYLAND_STATE_T *stateIter;
+ WAYLAND_STATE_T *stateNew;
+ struct wl_global *wl_global;
if (!CLIENT_LOCK_AND_GET_STATES(dpy, &thread, &process))
return EGL_FALSE;
- if (process->wl_global != NULL)
+ stateIter= process->wlStateMap;
+ while( stateIter )
+ {
+ if ( stateIter->display == display )
+ goto error;
+ stateIter= stateIter->next;
+ }
+
+ wl_global = wl_global_create(display, &wl_dispmanx_interface, 1,
+ NULL, bind_dispmanx);
+ if (wl_global == NULL)
goto error;
- process->wl_global = wl_global_create(display, &wl_dispmanx_interface, 1,
- NULL, bind_dispmanx);
- if (process->wl_global == NULL)
+ stateNew= (WAYLAND_STATE_T*)calloc( 1, sizeof(WAYLAND_STATE_T));
+ if (stateNew == NULL )
+ {
+ wl_global_destroy(wl_global);
goto error;
+ }
+
+ stateNew->next= process->wlStateMap;
+ stateNew->display= display;
+ stateNew->wl_global= wl_global;
+ process->wlStateMap= stateNew;
+ CLIENT_UNLOCK();
return EGL_TRUE;
@@ -232,12 +253,29 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
CLIENT_THREAD_STATE_T *thread;
CLIENT_PROCESS_STATE_T *process;
+ WAYLAND_STATE_T *stateIter;
+ WAYLAND_STATE_T *statePrev;
if (!CLIENT_LOCK_AND_GET_STATES(dpy, &thread, &process))
return EGL_FALSE;
- wl_global_destroy(process->wl_global);
- process->wl_global = NULL;
+ statePrev= NULL;
+ stateIter= process->wlStateMap;
+ while( stateIter )
+ {
+ if ( stateIter->display == display )
+ {
+ wl_global_destroy(stateIter->wl_global);
+ if ( statePrev )
+ statePrev->next= stateIter->next;
+ else
+ process->wlStateMap= stateIter->next;
+ free( stateIter );
+ break;
+ }
+ statePrev= stateIter;
+ stateIter= stateIter->next;
+ }
CLIENT_UNLOCK();
@@ -0,0 +1,34 @@
From 8091dac73f792fb000e7ec97de6be23cd84b7cb7 Mon Sep 17 00:00:00 2001
From: Hugo Hromic <hhromic@gmail.com>
Date: Sun, 13 May 2018 10:49:04 +0100
Subject: [PATCH] khronos: backport typedef for EGL_EXT_image_dma_buf_import
The `gstreamer1.0-plugins-base` package version `1.14` uses `EGL_EXT_image_dma_buf_import`, which
expects the `EGLuint64KHR` typedef that is present in recent versions of Khronos.
However, the older version included in userland does not provide it.
This patch backports the missing typedef from recent Khronos into userland.
See: <https://www.khronos.org/registry/EGL/api/EGL/eglext.h>
Submitted to userland in <https://github.com/raspberrypi/userland/pull/467>
Upstream-Status: Submitted
---
interface/khronos/include/EGL/eglext.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/interface/khronos/include/EGL/eglext.h b/interface/khronos/include/EGL/eglext.h
index d7e5ba7..dcc90ce 100755
--- a/interface/khronos/include/EGL/eglext.h
+++ b/interface/khronos/include/EGL/eglext.h
@@ -190,6 +190,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSy
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif
+#ifndef EGL_KHR_uint64_typedef
+#define EGL_KHR_uint64_typedef 1
+typedef khronos_uint64_t EGLuint64KHR;
+#endif /* EGL_KHR_uint64_typedef */
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
@@ -0,0 +1,34 @@
From 214f1895db14e3a88d5b2b3b6c844af3890e2eba Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Jul 2018 00:48:38 -0700
Subject: [PATCH] Add EGL_IMG_context_priority related defines
These defines are needed for compiling weston 4.x
taken from Khronos headers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/include/EGL/eglext.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/interface/khronos/include/EGL/eglext.h b/interface/khronos/include/EGL/eglext.h
index dcc90ce..6842bf9 100755
--- a/interface/khronos/include/EGL/eglext.h
+++ b/interface/khronos/include/EGL/eglext.h
@@ -93,6 +93,14 @@ typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGL
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
#endif
+#ifndef EGL_IMG_context_priority
+#define EGL_IMG_context_priority 1
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3102
+#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
+#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
+#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
+#endif /* EGL_IMG_context_priority */
+
#ifndef EGL_KHR_vg_parent_image
#define EGL_KHR_vg_parent_image 1
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
@@ -0,0 +1,30 @@
From bcdc525b2e4403f9e878e93cbd0d146ce9e37bb8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 25 Jul 2019 23:30:27 -0700
Subject: [PATCH] libfdt: Undefine __wordsize if already defined
glibc 2.30+ defines __wordsize, which is same so its easier to compile
for multiple versions of glibc even ones which does not have this define
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
opensrc/helpers/libfdt/libfdt_env.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/opensrc/helpers/libfdt/libfdt_env.h b/opensrc/helpers/libfdt/libfdt_env.h
index f4608be..5e83a27 100644
--- a/opensrc/helpers/libfdt/libfdt_env.h
+++ b/opensrc/helpers/libfdt/libfdt_env.h
@@ -18,6 +18,10 @@
#include <string.h>
#include <limits.h>
+#ifdef __bitwise
+#undef __bitwise
+#endif
+
#ifdef __CHECKER__
#define FDT_FORCE __attribute__((force))
#define FDT_BITWISE __attribute__((bitwise))
@@ -0,0 +1,42 @@
From 372b3b75945300604c9b7b012ecb25c0548a1495 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Wed, 13 Jun 2018 18:22:22 +0000
Subject: [PATCH] openmaxil: add pkg-config file
---
Upstream-Status: Pending
CMakeLists.txt | 2 +-
pkgconfig/openmaxil.pc.in | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 pkgconfig/openmaxil.pc.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80337b2..3e3c90e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,7 +133,7 @@ include_directories("${PROJECT_BINARY_DIR}")
include(FindPkgConfig QUIET)
if(PKG_CONFIG_FOUND)
# Produce a pkg-config file
- foreach(PCFILE bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc)
+ foreach(PCFILE bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc openmaxil.pc)
configure_file("pkgconfig/${PCFILE}.in" "${PCFILE}" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
diff --git a/pkgconfig/openmaxil.pc.in b/pkgconfig/openmaxil.pc.in
new file mode 100644
index 0000000..8793a61
--- /dev/null
+++ b/pkgconfig/openmaxil.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: openmaxil
+Description: Broadcom openmaxil library
+Version: 1
+Libs: -L${libdir} -lopenmaxil -lvcos -lvchiq_arm -pthread
+Cflags: -I${includedir} -I${includedir}/IL -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM
@@ -0,0 +1,34 @@
From d08003ab30452b4268121bcf82e03fdf21c89cdd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 31 Mar 2020 11:51:02 -0700
Subject: [PATCH] cmake: Disable format-overflow warning as error
gcc10 complains about a check which could potentially be null
build/inc/interface/vcos/vcos_logging.h:234:88: error: '%s' directive argument is null [-Werror=format-overflow=]
234 | # define _VCOS_LOG_X(cat, _level, fmt...) do { if (vcos_is_log_enabled(cat,_level)) vcos_log_impl(cat,_level,fmt); } while (0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A potential fix would be to check for fmt not being null but lets leave
that to experts
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
host_applications/linux/libs/bcm_host/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/host_applications/linux/libs/bcm_host/CMakeLists.txt b/host_applications/linux/libs/bcm_host/CMakeLists.txt
index 2f4beb9..7a4ab06 100644
--- a/host_applications/linux/libs/bcm_host/CMakeLists.txt
+++ b/host_applications/linux/libs/bcm_host/CMakeLists.txt
@@ -3,7 +3,7 @@ if (WIN32)
set(VCOS_PLATFORM win32)
else ()
set(VCOS_PLATFORM pthreads)
- add_definitions(-Wall -Werror)
+ add_definitions(-Wall -Werror -Wno-error=format-overflow)
endif ()
# set this as we want all the source of vchostif to be available in libbcm_host
@@ -0,0 +1,30 @@
From 451e8458e45926e4e1c0433864ac4cf8b05d792b Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 27 Nov 2020 03:12:26 -0500
Subject: [PATCH] all host_applications: remove non-existent projects
The ALL_APPS symbol will optionally build an additional set of projects,
however, several of them don't exist anymore. Remove them from the list of
ALL_APPS.
Upstream-Status: Submitted [https://github.com/raspberrypi/userland/pull/661]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
host_applications/linux/CMakeLists.txt | 4 ----
1 file changed, 4 deletions(-)
diff --git a/host_applications/linux/CMakeLists.txt b/host_applications/linux/CMakeLists.txt
index 928b637..554ae46 100644
--- a/host_applications/linux/CMakeLists.txt
+++ b/host_applications/linux/CMakeLists.txt
@@ -14,10 +14,6 @@ add_subdirectory(apps/dtoverlay)
add_subdirectory(apps/dtmerge)
if(ALL_APPS)
- add_subdirectory(apps/vcdbg)
- add_subdirectory(libs/elftoolchain)
- # add_subdirectory(apps/smct)
- add_subdirectory(apps/edid_parser)
add_subdirectory(apps/hello_pi)
endif()
@@ -0,0 +1,28 @@
From 5f4324a0008c2e8e1f511432f98bf85c9fffd35c Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Fri, 27 Nov 2020 03:18:50 -0500
Subject: [PATCH] hello_pi: optionally build wayland-specific app
Only build the wayland-specific hello_pi app when building for wayland.
Upstream-Status: Inappropriate [the wayland example is not part of upstream]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
host_applications/linux/apps/hello_pi/CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/host_applications/linux/apps/hello_pi/CMakeLists.txt b/host_applications/linux/apps/hello_pi/CMakeLists.txt
index 2849fad..7de3265 100644
--- a/host_applications/linux/apps/hello_pi/CMakeLists.txt
+++ b/host_applications/linux/apps/hello_pi/CMakeLists.txt
@@ -25,7 +25,9 @@ add_subdirectory(hello_encode)
add_subdirectory(hello_jpeg)
add_subdirectory(hello_videocube)
add_subdirectory(hello_teapot)
-add_subdirectory(hello_wayland)
+if (BUILD_WAYLAND)
+ add_subdirectory(hello_wayland)
+endif()
if(BUILD_FONT)
set(VGFONT_SRCS libs/vgfont/font.c libs/vgfont/vgft.c libs/vgfont/graphics.c)
@@ -0,0 +1,40 @@
From 4a3e515d3ea7ff0fc4063b9677b056af4ee7a3f6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 2 Dec 2020 14:28:01 -0800
Subject: [PATCH] userland: Sync needed defines for weston build
eglext.h from userland is not sufficient to compile latest weston,
therefore import needed defines and typedefs from latest mesa
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
interface/khronos/include/EGL/eglext.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/interface/khronos/include/EGL/eglext.h b/interface/khronos/include/EGL/eglext.h
index 6842bf9..7118e92 100755
--- a/interface/khronos/include/EGL/eglext.h
+++ b/interface/khronos/include/EGL/eglext.h
@@ -225,6 +225,20 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, st
#endif
+typedef void* EGLSyncKHR;
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
+#ifndef EGL_ANDROID_native_fence_sync
+#define EGL_ANDROID_native_fence_sync 1
+#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
+#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
+#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
+#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1
+typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync);
+#endif
+#endif /* EGL_ANDROID_native_fence_sync */
#ifdef __cplusplus
}
@@ -0,0 +1,113 @@
DESCRIPTION = "This repository contains the source code for the ARM side \
libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib \
and includes source for the ARM side code to interface to: EGL, mmal, GLESv2,\
vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG."
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENCE;md5=0448d6488ef8cc380632b1569ee6d196"
PROVIDES += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "virtual/libgles2 virtual/egl", d)}"
PROVIDES += "virtual/libomxil"
RPROVIDES:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "", "libgles2 egl libegl libegl1 libglesv2-2", d)}"
COMPATIBLE_MACHINE = "^rpi$"
SRCBRANCH = "master"
SRCFORK = "raspberrypi"
SRCREV = "54fd97ae4066a10b6b02089bc769ceed328737e0"
# Use the date of the above commit as the package version. Update this when
# SRCREV is changed.
PV = "20220323"
SRC_URI = "\
git://github.com/${SRCFORK}/userland.git;protocol=https;branch=${SRCBRANCH} \
file://0001-mmal-Do-not-use-Werror.patch \
file://0001-Allow-applications-to-set-next-resource-handle.patch \
file://0002-wayland-Add-support-for-the-Wayland-winsys.patch \
file://0003-wayland-Add-Wayland-example.patch \
file://0004-wayland-egl-Add-bcm_host-to-dependencies.patch \
file://0005-interface-remove-faulty-assert-to-make-weston-happy-.patch \
file://0006-zero-out-wl-buffers-in-egl_surface_free.patch \
file://0007-initialize-front-back-wayland-buffers.patch \
file://0008-Remove-RPC_FLUSH.patch \
file://0009-fix-cmake-dependency-race.patch \
file://0010-Fix-for-framerate-with-nested-composition.patch \
file://0011-build-shared-library-for-vchostif.patch \
file://0012-implement-buffer-wrapping-interface-for-dispmanx.patch \
file://0013-Implement-triple-buffering-for-wayland.patch \
file://0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch \
file://0015-EGL-glplatform.h-define-EGL_CAST.patch \
file://0016-Allow-multiple-wayland-compositor-state-data-per-pro.patch \
file://0017-khronos-backport-typedef-for-EGL_EXT_image_dma_buf_i.patch \
file://0018-Add-EGL_IMG_context_priority-related-defines.patch \
file://0019-libfdt-Undefine-__wordsize-if-already-defined.patch \
file://0020-openmaxil-add-pkg-config-file.patch \
file://0021-cmake-Disable-format-overflow-warning-as-error.patch \
file://0022-all-host_applications-remove-non-existent-projects.patch \
file://0023-hello_pi-optionally-build-wayland-specific-app.patch \
file://0024-userland-Sync-needed-defines-for-weston-build.patch \
"
SRC_URI:remove:toolchain-clang = "file://0021-cmake-Disable-format-overflow-warning-as-error.patch"
S = "${WORKDIR}/git"
inherit cmake pkgconfig
ASNEEDED = ""
EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed' \
-DVMCS_INSTALL_PREFIX=${exec_prefix} \
"
EXTRA_OECMAKE:append:aarch64 = " -DARM64=ON "
PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
PACKAGECONFIG[wayland] = "-DBUILD_WAYLAND=TRUE -DWAYLAND_SCANNER_EXECUTABLE:FILEPATH=${STAGING_BINDIR_NATIVE}/wayland-scanner,,wayland-native wayland"
PACKAGECONFIG[allapps] = "-DALL_APPS=true,,,"
CFLAGS:append = " -fPIC -Wno-unused-but-set-variable"
do_install:append () {
for f in `find ${D}${includedir}/interface/vcos/ -name "*.h"`; do
sed -i 's/include "vcos_platform.h"/include "pthreads\/vcos_platform.h"/g' ${f}
sed -i 's/include "vcos_futex_mutex.h"/include "pthreads\/vcos_futex_mutex.h"/g' ${f}
sed -i 's/include "vcos_platform_types.h"/include "pthreads\/vcos_platform_types.h"/g' ${f}
done
rm -rf ${D}${prefix}${sysconfdir}
if [ "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" = "1" ]; then
rm -rf ${D}${libdir}/libEGL*
rm -rf ${D}${libdir}/libGLES*
rm -rf ${D}${libdir}/libwayland-*
rm -rf ${D}${libdir}/pkgconfig/egl.pc ${D}${libdir}/pkgconfig/glesv2.pc \
${D}${libdir}/pkgconfig/wayland-egl.pc
rm -rf ${D}${includedir}/EGL ${D}${includedir}/GLES* ${D}${includedir}/KHR
else
ln -sf brcmglesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
ln -sf brcmegl.pc ${D}${libdir}/pkgconfig/egl.pc
ln -sf brcmvg.pc ${D}${libdir}/pkgconfig/vg.pc
fi
# Currently man files are installed in /usr/man instead of /usr/share/man, see comments in:
# https://github.com/raspberrypi/userland/commit/45a0022ac64b4d0788def3c5230c972430f6fc23
mkdir -pv ${D}${datadir}
mv -v ${D}${prefix}/man ${D}${mandir}
}
# Shared libs from userland package build aren't versioned, so we need
# to force the .so files into the runtime package (and keep them
# out of -dev package).
FILES_SOLIBSDEV = ""
INSANE_SKIP:${PN} += "dev-so"
FILES:${PN} += " \
${libdir}/*.so \
${libdir}/plugins"
FILES:${PN}-dev += "${includedir} \
${prefix}/src"
FILES:${PN}-doc += "${datadir}/install"
FILES:${PN}-dbg += "${libdir}/plugins/.debug"
RDEPENDS:${PN} += "bash"
RDEPENDS:${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "libegl-mesa", "", d)}"
@@ -0,0 +1,10 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: egl
Description: egl for RaspberryPI
Version: 0.0
Libs: -L${libdir} -lEGL -lGLESv2
Cflags: -I${includedir}/vc -I${includedir}/interface -I${includedir}/interface/vcos -I${includedir}/interface/vcos/pthreads
@@ -0,0 +1,24 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: vchiq.sh
# Required-Start: $remote_fs rmnologin
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Create /dev/vchiq.
# Description: Get the major number from /proc/devices and use it
# ti create /dev/vchiq
### END INIT INFO
rm -f /dev/vchiq
#Get the major number
major=$(awk "\$2==\"vchiq\" {print \$1}" /proc/devices)
if [ -z "$major" ]; then
echo "Error: Cannot find vchiq in /proc/devices"
exit 2
else
mknod /dev/vchiq c "$major" 0
chmod a+w /dev/vchiq
fi
@@ -0,0 +1,6 @@
CONFLICTS = "vc-graphics"
VCDIR = "hardfp/opt/vc"
require vc-graphics.inc
PR = "${INCPR}.0"
@@ -0,0 +1,6 @@
CONFLICTS = "vc-graphics-hardfp"
VCDIR = "opt/vc"
require vc-graphics.inc
PR = "${INCPR}.0"
@@ -0,0 +1,54 @@
DESCRIPTION = "Graphics libraries for BCM2835."
LICENSE = "Broadcom-RPi"
LIC_FILES_CHKSUM = "file://LICENCE;md5=86e53f5f5909ee66900418028de11780"
PROVIDES = "virtual/libgles2 virtual/egl"
COMPATIBLE_MACHINE = "^rpi$"
INHIBIT_DEFAULT_DEPS = "1"
include recipes-bsp/common/raspberrypi-firmware.inc
SRC_URI += " \
file://egl.pc \
file://vchiq.sh \
"
S = "${RPIFW_S}/${VCDIR}"
INCPR = "r1"
inherit pkgconfig update-rc.d
do_install () {
install -d ${D}${bindir}
cp -R bin/* ${D}${bindir}
install -d ${D}${libdir}
# note: -H option to deref symlinked .so
cp -R -H lib/* ${D}${libdir}
install -d ${D}${includedir}
cp -R include/* ${D}${includedir}
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/
install -d ${D}/${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/vchiq.sh ${D}${sysconfdir}/init.d/
}
# These are proprietary binaries generated elsewhere so don't check ldflags
INSANE_SKIP:${PN} = "ldflags"
INITSCRIPT_NAME = "vchiq.sh"
INITSCRIPT_PARAMS = "start 03 S ."
FILES:${PN} = "${bindir}/* \
${libdir}/lib*.so \
${sysconfdir}/init.d \
${libdir}/plugins"
FILES:${PN}-dev = "${libdir}/pkgconfig \
${includedir}"
FILES:${PN}-dbg += "${libdir}/plugins/.debug"
@@ -0,0 +1,7 @@
# until fully tested, prefer `libwayland-egl` provided by `userland` instead of `wayland` when not using vc4graphics
do_install:append:rpi () {
if [ "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" = "0" ]; then
rm -f ${D}${libdir}/libwayland-egl*
rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
fi
}
@@ -0,0 +1,10 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
do_install:append:rpi() {
if [ -e ${D}/${sysconfdir}/init.d/weston ]; then
sed -i 's#weston-start --#weston-start -- --continue-without-input#' ${D}/${sysconfdir}/init.d/weston
fi
if [ -e ${D}${systemd_system_unitdir}/weston.service ]; then
sed -i 's#ExecStart=/usr/bin/weston#ExecStart=/usr/bin/weston --continue-without-input#' ${D}${systemd_system_unitdir}/weston.service
fi
}
@@ -0,0 +1,10 @@
PACKAGECONFIG:remove:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'fbdev', 'egl clients', d)}"
EXTRA_OECONF:append:rpi = " \
--disable-xwayland-test \
--disable-simple-egl-clients \
${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' \
--disable-resize-optimization \
--disable-setuid-install \
', d)} \
"
@@ -0,0 +1,6 @@
# Initial xorg.conf for the RaspberryPi
# Most things are setup automatically by magic pixies in the system.
#
# It is suggested this file is not used any more and configuration
# snippets are placed in xorg.conf.d instead.
#
@@ -0,0 +1,5 @@
Section "Device"
Identifier "Adafruit PiTFT"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
@@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "stmpe-ts"
Option "Calibration" "3800 200 200 3800"
Option "SwapAxes" "1"
EndSection
@@ -0,0 +1,16 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append:rpi = " \
file://xorg.conf.d/98-pitft.conf \
file://xorg.conf.d/99-calibration.conf \
"
do_install:append:rpi () {
PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
if [ "${PITFT}" = "1" ]; then
install -d ${D}/${sysconfdir}/X11/xorg.conf.d/
install -m 0644 ${WORKDIR}/xorg.conf.d/98-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
install -m 0644 ${WORKDIR}/xorg.conf.d/99-calibration.conf ${D}/${sysconfdir}/X11/xorg.conf.d/
fi
}
FILES:${PN}:append:rpi = " ${sysconfdir}/X11/xorg.conf.d/*"
@@ -0,0 +1,5 @@
OPENGL_PKGCONFIGS:rpi = "dri glx ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'dri3 glamor', '', d)}"
# when using userland graphic KHR/khrplatform.h is provided by userland but virtual/libgl is provided by mesa-gl where
# we explicitly delete KHR/khrplatform.h since its already coming from userland package
DEPENDS:append:rpi = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'userland', d)}"