Skip to content

Commit e29fa4f

Browse files
committed
add rpi userland binaries
1 parent 2529980 commit e29fa4f

19 files changed

+817
-9
lines changed

baseboard-rpi3/chromeos-base/baseboard-bsp/baseboard-bsp-0.0.1-r4.ebuild renamed to baseboard-rpi3/chromeos-base/baseboard-bsp/baseboard-bsp-0.0.1-r5.ebuild

File renamed without changes.

baseboard-rpi3/chromeos-base/baseboard-bsp/baseboard-bsp-0.0.1.ebuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ IUSE=""
1414
RDEPEND="
1515
chromeos-base/rpi-boot-bin
1616
chromeos-base/rpi-firmware
17+
media-libs/raspberrypi-userland
1718
sys-apps/haveged
1819
"
1920

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DIST raspberrypi-userland-0_pre20160424.tar.gz 32933952 BLAKE2B 4a2d40200a6a4d673be277a0958f768342a2777c28b14b4c7fcac1dbc9c59f2ef2485234f11fbd228aea6bbcf4982a3fd1d4825268af60be91665ea6fee6922d SHA512 04a71837b1247ecbbe479b3b09b5705638a9e576dc99a1ab2200727509195a4a2f2a9b184e3c23ce3933a3236b260afc8bd2b75bc218567b386445bdd8208a5b
2+
DIST raspberrypi-userland-0_pre20201022.tar.gz 32958590 BLAKE2B 01733a24822d80c5bf9aa3e0feefc3e9437390a465d7a4184d0a9c6a68446e91515d3d6d398ff516d9fd1bdcd4a885512d358a4ed1d24d9b94bdc72d81db84d3 SHA512 1813224068b8a8e569c874a8ffb354f1ac86e95b482caaad18b9703a187baaea60f1f87dfbb0c7e4b3cb2eb875abbcc82aedba410646a3c1df0208bd73aaf9f9
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PKG_CONFIG_PATH='/opt/vc/lib/pkgconfig'
2+
PATH='/opt/vc/bin'
3+
LDPATH='/opt/vc/lib'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
2+
SUBSYSTEM=="vc-sm",GROUP="video",MODE="0660"
3+
SUBSYSTEM=="bcm2708_vcio",GROUP="video",MODE="0660"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prefix=/opt/vc
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: bcm_host
7+
Description: Broadcom VideoCore host API library
8+
Version: 1
9+
Libs: -L${libdir} -lbcm_host -lvcos -lvchiq_arm
10+
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=/opt/vc
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: EGL
7+
Description: Fake EGL package for RPi
8+
Version: 10
9+
Requires: bcm_host glesv2
10+
Libs: -L${libdir} -lEGL
11+
Cflags: -I${includedir}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=/opt/vc
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: GLESv2
7+
Description: Fake GL ES 2 package for RPi
8+
Version: 10
9+
Requires: bcm_host
10+
Libs: -L${libdir} -lGLESv2
11+
Cflags: -I${includedir}
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
From 825c3236e5908ff003644abd870bfe98e82722b2 Mon Sep 17 00:00:00 2001
2+
From: Dom Cobley <[email protected]>
3+
Date: Tue, 9 Jul 2013 09:26:26 -0400
4+
Subject: [PATCH] Allow applications to set next resource handle
5+
6+
This patch adds provisions in userland to
7+
let apps callers set the next rendereing dispmanx resource.
8+
It's useful for implementing, say, a buffer carousel.
9+
---
10+
interface/khronos/common/khrn_client_rpc.h | 2 ++
11+
interface/khronos/common/khrn_int_ids.h | 2 ++
12+
interface/khronos/egl/egl_client.c | 30 +++++++++++++++++++++++++++---
13+
interface/khronos/egl/egl_client_surface.c | 24 +++++++++++++++++++++++-
14+
interface/khronos/egl/egl_client_surface.h | 3 ++-
15+
interface/khronos/egl/egl_int_impl.h | 5 +++--
16+
6 files changed, 59 insertions(+), 7 deletions(-)
17+
18+
diff --git a/interface/khronos/common/khrn_client_rpc.h b/interface/khronos/common/khrn_client_rpc.h
19+
index 418aa67..a7557a8 100644
20+
--- a/interface/khronos/common/khrn_client_rpc.h
21+
+++ b/interface/khronos/common/khrn_client_rpc.h
22+
@@ -683,6 +683,7 @@ static INLINE void rpc_call18(CLIENT_THREAD_STATE_T *thread, uint32_t id, uint32
23+
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); }
24+
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); }
25+
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); }
26+
+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); }
27+
#endif
28+
29+
#define RPC_CALL1_OUT_CTRL(fn, thread, id, out) rpc_call1_out_ctrl(thread, id, out)
30+
@@ -700,6 +701,7 @@ static INLINE void rpc_call18(CLIENT_THREAD_STATE_T *thread, uint32_t id, uint32
31+
#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)
32+
#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)
33+
#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)
34+
+#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)
35+
36+
# if !defined(__SYMBIAN32__) //use functions defined in khrpc.cpp
37+
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; }
38+
diff --git a/interface/khronos/common/khrn_int_ids.h b/interface/khronos/common/khrn_int_ids.h
39+
index 8378f4a..ec961e0 100644
40+
--- a/interface/khronos/common/khrn_int_ids.h
41+
+++ b/interface/khronos/common/khrn_int_ids.h
42+
@@ -367,6 +367,7 @@
43+
*/
44+
45+
#define EGLINTCREATESURFACE_ID 0x4000
46+
+#define EGLINTCREATESURFACE_ID_V2 0x4100
47+
#define EGLINTCREATEGLES11_ID 0x4001
48+
#define EGLINTCREATEGLES20_ID 0x4002
49+
#define EGLINTCREATEVG_ID 0x4003
50+
@@ -377,6 +378,7 @@
51+
#define EGLINTMAKECURRENT_ID 0x4008
52+
#define EGLINTFLUSHANDWAIT_ID 0x4009
53+
#define EGLINTSWAPBUFFERS_ID 0x400a
54+
+#define EGLINTSWAPBUFFERS_ID_V2 0x410a
55+
#define EGLINTSELECTMIPMAP_ID 0x400b
56+
#define EGLINTFLUSH_ID 0x400c
57+
#define EGLINTGETCOLORDATA_ID 0x400d
58+
diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
59+
index fd07eb6..e902d19 100644
60+
--- a/interface/khronos/egl/egl_client.c
61+
+++ b/interface/khronos/egl/egl_client.c
62+
@@ -162,6 +162,17 @@
63+
void egl_gl_flush_callback(bool wait);
64+
void egl_vg_flush_callback(bool wait);
65+
66+
+#include "interface/vmcs_host/vc_dispmanx_types.h"
67+
+/**HACKHACK - give us the ability to inject a DispmanX
68+
+ * resource handle into the CreateWindowSurface and
69+
+ * SwapBuffers calls */
70+
+static DISPMANX_RESOURCE_HANDLE_T next_resource_handle;
71+
+
72+
+EGLAPI EGLBoolean EGLAPIENTRY eglSetNextResourceHandle(DISPMANX_RESOURCE_HANDLE_T handle)
73+
+{
74+
+ next_resource_handle = handle;
75+
+}
76+
+
77+
/*
78+
TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate)
79+
Also affects global image (and possibly others?)
80+
@@ -643,7 +654,8 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig c
81+
false,
82+
EGL_NO_TEXTURE,
83+
EGL_NO_TEXTURE,
84+
- 0, 0);
85+
+ 0, 0,
86+
+ next_resource_handle);
87+
88+
if (surface) {
89+
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
90+
@@ -888,7 +900,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig
91+
mipmap_texture,
92+
texture_format,
93+
texture_target,
94+
- 0, 0);
95+
+ 0, 0, 0);
96+
97+
if (surface) {
98+
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
99+
@@ -1030,7 +1042,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig c
100+
false,
101+
EGL_NO_TEXTURE,
102+
EGL_NO_TEXTURE,
103+
- pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle);
104+
+ pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle, 0);
105+
106+
if (surface) {
107+
if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
108+
@@ -2302,6 +2314,18 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
109+
110+
vcos_log_trace("eglSwapBuffers server call");
111+
112+
+ if (next_resource_handle)
113+
+ RPC_CALL7(eglIntSwapBuffers_impl,
114+
+ thread,
115+
+ EGLINTSWAPBUFFERS_ID_V2,
116+
+ RPC_UINT(surface->serverbuffer),
117+
+ RPC_UINT(surface->width),
118+
+ RPC_UINT(surface->height),
119+
+ RPC_UINT(surface->internal_handle),
120+
+ RPC_UINT(surface->swap_behavior == EGL_BUFFER_PRESERVED ? 1 : 0),
121+
+ RPC_UINT(khrn_platform_get_window_position(surface->win)),
122+
+ RPC_INT(next_resource_handle));
123+
+ else
124+
RPC_CALL6(eglIntSwapBuffers_impl,
125+
thread,
126+
EGLINTSWAPBUFFERS_ID,
127+
diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
128+
index cda5943..0be56c5 100644
129+
--- a/interface/khronos/egl/egl_client_surface.c
130+
+++ b/interface/khronos/egl/egl_client_surface.c
131+
@@ -314,7 +314,8 @@ EGL_SURFACE_T *egl_surface_create(
132+
EGLenum texture_format,
133+
EGLenum texture_target,
134+
EGLNativePixmapType pixmap,
135+
- const uint32_t *pixmap_server_handle)
136+
+ const uint32_t *pixmap_server_handle,
137+
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle)
138+
{
139+
KHRN_IMAGE_FORMAT_T color;
140+
KHRN_IMAGE_FORMAT_T depth;
141+
@@ -473,6 +474,27 @@ EGL_SURFACE_T *egl_surface_create(
142+
#endif
143+
uint32_t results[3];
144+
145+
+ if (next_resource_handle)
146+
+ RPC_CALL16_OUT_CTRL(eglIntCreateSurface_impl,
147+
+ thread,
148+
+ EGLINTCREATESURFACE_ID_V2,
149+
+ RPC_UINT(serverwin),
150+
+ RPC_UINT(buffers),
151+
+ RPC_UINT(width),
152+
+ RPC_UINT(height),
153+
+ RPC_UINT(color),
154+
+ RPC_UINT(depth),
155+
+ RPC_UINT(mask),
156+
+ RPC_UINT(multi),
157+
+ RPC_UINT(largest_pbuffer),
158+
+ RPC_UINT(mipmap_texture),
159+
+ RPC_UINT(config_depth_bits),
160+
+ RPC_UINT(config_stencil_bits),
161+
+ RPC_UINT(sem_name),
162+
+ RPC_UINT(type),
163+
+ RPC_INT(next_resource_handle),
164+
+ results);
165+
+ else
166+
RPC_CALL15_OUT_CTRL(eglIntCreateSurface_impl,
167+
thread,
168+
EGLINTCREATESURFACE_ID,
169+
diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h
170+
index c99d44c..b5bf70a 100644
171+
--- a/interface/khronos/egl/egl_client_surface.h
172+
+++ b/interface/khronos/egl/egl_client_surface.h
173+
@@ -322,7 +322,8 @@ extern EGL_SURFACE_T *egl_surface_create(
174+
EGLenum texture_format,
175+
EGLenum texture_target,
176+
EGLNativePixmapType pixmap,
177+
- const uint32_t *pixmap_server_handle);
178+
+ const uint32_t *pixmap_server_handle,
179+
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle);
180+
extern EGL_SURFACE_T *egl_surface_from_vg_image(
181+
VGImage vg_handle,
182+
EGLSurface name,
183+
diff --git a/interface/khronos/egl/egl_int_impl.h b/interface/khronos/egl/egl_int_impl.h
184+
index 8a5734c..51b3580 100644
185+
--- a/interface/khronos/egl/egl_int_impl.h
186+
+++ b/interface/khronos/egl/egl_int_impl.h
187+
@@ -56,7 +56,8 @@
188+
uint32_t config_stencil_bits,
189+
uint32_t sem,
190+
uint32_t type,
191+
- uint32_t *results))
192+
+ uint32_t *results,
193+
+ DISPMANX_RESOURCE_HANDLE_T next_resource_handle))
194+
195+
FN(int, eglIntCreatePbufferFromVGImage_impl, (
196+
VGImage vg_handle,
197+
@@ -110,7 +111,7 @@
198+
FN(int, eglIntFlushAndWait_impl, (uint32_t flushgl, uint32_t flushvg))
199+
FN(void, eglIntFlush_impl, (uint32_t flushgl, uint32_t flushvg))
200+
201+
-FN(void, eglIntSwapBuffers_impl, (EGL_SURFACE_ID_T s, uint32_t width, uint32_t height, uint32_t handle, uint32_t preserve, uint32_t position))
202+
+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))
203+
FN(void, eglIntSelectMipmap_impl, (EGL_SURFACE_ID_T s, int level))
204+
205+
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))
206+
--
207+
1.8.5.1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff -NrU5 1/makefiles/cmake/vmcs.cmake 2/makefiles/cmake/vmcs.cmake
2+
--- 1/makefiles/cmake/vmcs.cmake 2020-11-06 14:21:49.103179336 +0100
3+
+++ 2/makefiles/cmake/vmcs.cmake 2020-11-06 17:00:57.410230948 +0100
4+
@@ -72,10 +72,14 @@
5+
install(DIRECTORY ${vmcs_root}/interface/vctypes DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h")
6+
install(DIRECTORY ${vmcs_root}/vcinclude DESTINATION ${VMCS_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h")
7+
install(DIRECTORY ${vmcs_root}/interface/peer DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h")
8+
install(DIRECTORY ${vmcs_root}/interface/vmcs_host DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h" PATTERN "${vmcs_root}/interface/vmcs_host/khronos" EXCLUDE)
9+
10+
-install(DIRECTORY ${vmcs_root}/interface/khronos/include DESTINATION ${VMCS_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.h")
11+
+install(DIRECTORY ${vmcs_root}/interface/khronos/include DESTINATION ${VMCS_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.h"
12+
+ PATTERN EGL EXCLUDE
13+
+ PATTERN GLES EXCLUDE
14+
+ PATTERN GLES2 EXCLUDE
15+
+ PATTERN KHR EXCLUDE )
16+
install(DIRECTORY ${vmcs_root}/interface/vmcs_host/khronos/IL DESTINATION ${VMCS_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h")
17+
18+
install(DIRECTORY ${vmcs_root}/host_applications/linux/libs/bcm_host/include DESTINATION ${VMCS_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.h")
19+

0 commit comments

Comments
 (0)