diff options
Diffstat (limited to 'recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch')
| -rw-r--r-- | recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch | 511 |
1 files changed, 274 insertions, 237 deletions
diff --git a/recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch b/recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch index 4613504..c41cde7 100644 --- a/recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch +++ b/recipes-graphics/userland/files/0002-wayland-Add-support-for-the-Wayland-winsys.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | From 5608ec8002be8370e78c9dbb1e07cee4cfb18b58 Mon Sep 17 00:00:00 2001 | 1 | From da60a2a34a48e2b324fceae608964814488cc8fb Mon Sep 17 00:00:00 2001 |
| 2 | From: Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2 | From: Tomeu Vizoso <tomeu.vizoso@collabora.com> |
| 3 | Date: Tue, 1 Oct 2013 13:19:20 +0200 | 3 | Date: Tue, 1 Oct 2013 13:19:20 +0200 |
| 4 | Subject: [PATCH 02/16] wayland: Add support for the Wayland winsys | 4 | Subject: [PATCH 02/18] wayland: Add support for the Wayland winsys |
| 5 | 5 | ||
| 6 | * Adds EGL_WL_bind_wayland_display extension | 6 | * Adds EGL_WL_bind_wayland_display extension |
| 7 | * Adds wayland-egl library | 7 | * Adds wayland-egl library |
| @@ -16,38 +16,40 @@ a DispmanX display from the clients. | |||
| 16 | TODO: wl_dispmanx_server_buffer should probably be defined in a | 16 | TODO: wl_dispmanx_server_buffer should probably be defined in a |
| 17 | private header that can be included from EGL and vc_* instead of in | 17 | private header that can be included from EGL and vc_* instead of in |
| 18 | vc_vchi_dispmanx.h | 18 | vc_vchi_dispmanx.h |
| 19 | |||
| 20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 19 | --- | 21 | --- |
| 20 | .gitignore | 1 + | 22 | .gitignore | 1 + |
| 21 | CMakeLists.txt | 11 + | 23 | CMakeLists.txt | 11 + |
| 22 | README.md | 4 + | 24 | README.md | 4 + |
| 23 | buildme | 10 +- | 25 | buildme | 10 +- |
| 24 | .../linux/apps/raspicam/CMakeLists.txt | 2 +- | 26 | .../linux/apps/raspicam/CMakeLists.txt | 2 +- |
| 25 | interface/khronos/CMakeLists.txt | 53 ++++- | 27 | interface/khronos/CMakeLists.txt | 54 +++- |
| 26 | interface/khronos/common/khrn_client.c | 15 ++ | 28 | interface/khronos/common/khrn_client.c | 15 ++ |
| 27 | interface/khronos/common/khrn_client.h | 10 + | 29 | interface/khronos/common/khrn_client.h | 10 + |
| 28 | interface/khronos/common/khrn_client_mangle.h | 3 + | 30 | interface/khronos/common/khrn_client_mangle.h | 3 + |
| 29 | interface/khronos/common/khrn_client_platform.h | 8 + | 31 | .../khronos/common/khrn_client_platform.h | 8 + |
| 30 | interface/khronos/common/khrn_client_unmangle.h | 3 + | 32 | .../khronos/common/khrn_client_unmangle.h | 3 + |
| 31 | .../common/linux/khrn_client_platform_linux.c | 115 ++++++++-- | 33 | .../common/linux/khrn_client_platform_linux.c | 115 +++++++- |
| 32 | interface/khronos/common/linux/khrn_wayland.c | 215 ++++++++++++++++++ | 34 | interface/khronos/common/linux/khrn_wayland.c | 215 +++++++++++++++ |
| 33 | .../common/linux/khrn_wayland.h} | 46 +--- | 35 | .../common/linux/khrn_wayland.h} | 46 +--- |
| 34 | interface/khronos/egl/egl_client.c | 92 +++++--- | 36 | interface/khronos/egl/egl_client.c | 92 +++++-- |
| 35 | interface/khronos/egl/egl_client_get_proc.c | 11 + | 37 | interface/khronos/egl/egl_client_get_proc.c | 11 + |
| 36 | interface/khronos/egl/egl_client_surface.c | 42 +++- | 38 | interface/khronos/egl/egl_client_surface.c | 42 ++- |
| 37 | interface/khronos/egl/egl_client_surface.h | 38 +++- | 39 | interface/khronos/egl/egl_client_surface.h | 38 ++- |
| 38 | interface/khronos/egl/egl_int_impl.h | 2 +- | 40 | interface/khronos/egl/egl_int_impl.h | 2 +- |
| 39 | interface/khronos/ext/egl_wayland.c | 246 +++++++++++++++++++++ | 41 | interface/khronos/ext/egl_wayland.c | 246 ++++++++++++++++++ |
| 40 | interface/khronos/include/EGL/eglext.h | 23 ++ | 42 | interface/khronos/include/EGL/eglext.h | 23 ++ |
| 41 | interface/khronos/wayland-egl/wayland-egl-priv.h | 53 +++++ | 43 | .../khronos/wayland-egl/wayland-egl-priv.h | 53 ++++ |
| 42 | interface/khronos/wayland-egl/wayland-egl.c | 59 +++++ | 44 | interface/khronos/wayland-egl/wayland-egl.c | 59 +++++ |
| 43 | interface/khronos/wayland-egl/wayland-egl.pc.in | 10 + | 45 | .../khronos/wayland-egl/wayland-egl.pc.in | 10 + |
| 44 | interface/vmcs_host/CMakeLists.txt | 21 +- | 46 | interface/vmcs_host/CMakeLists.txt | 21 +- |
| 45 | interface/vmcs_host/vc_dispmanx.h | 10 + | 47 | interface/vmcs_host/vc_dispmanx.h | 10 + |
| 46 | interface/vmcs_host/vc_vchi_dispmanx.c | 42 ++++ | 48 | interface/vmcs_host/vc_vchi_dispmanx.c | 42 +++ |
| 47 | interface/vmcs_host/vc_vchi_dispmanx.h | 15 ++ | 49 | interface/vmcs_host/vc_vchi_dispmanx.h | 15 ++ |
| 48 | interface/wayland/dispmanx.xml | 123 +++++++++++ | 50 | interface/wayland/dispmanx.xml | 123 +++++++++ |
| 49 | makefiles/cmake/Wayland.cmake | 72 ++++++ | 51 | makefiles/cmake/Wayland.cmake | 72 +++++ |
| 50 | 30 files changed, 1257 insertions(+), 98 deletions(-) | 52 | 30 files changed, 1257 insertions(+), 99 deletions(-) |
| 51 | create mode 100644 interface/khronos/common/linux/khrn_wayland.c | 53 | create mode 100644 interface/khronos/common/linux/khrn_wayland.c |
| 52 | copy interface/{vmcs_host/vc_vchi_dispmanx.h => khronos/common/linux/khrn_wayland.h} (56%) | 54 | copy interface/{vmcs_host/vc_vchi_dispmanx.h => khronos/common/linux/khrn_wayland.h} (56%) |
| 53 | create mode 100644 interface/khronos/ext/egl_wayland.c | 55 | create mode 100644 interface/khronos/ext/egl_wayland.c |
| @@ -57,20 +59,20 @@ vc_vchi_dispmanx.h | |||
| 57 | create mode 100644 interface/wayland/dispmanx.xml | 59 | create mode 100644 interface/wayland/dispmanx.xml |
| 58 | create mode 100644 makefiles/cmake/Wayland.cmake | 60 | create mode 100644 makefiles/cmake/Wayland.cmake |
| 59 | 61 | ||
| 60 | Index: git/.gitignore | 62 | diff --git a/.gitignore b/.gitignore |
| 61 | =================================================================== | 63 | index 63570f1..1459436 100644 |
| 62 | --- git.orig/.gitignore | 64 | --- a/.gitignore |
| 63 | +++ git/.gitignore | 65 | +++ b/.gitignore |
| 64 | @@ -30,3 +30,4 @@ build/ | 66 | @@ -30,3 +30,4 @@ build/ |
| 65 | *.pts | 67 | *.pts |
| 66 | *.ppm | 68 | *.ppm |
| 67 | *.mkv | 69 | *.mkv |
| 68 | +*~ | 70 | +*~ |
| 69 | Index: git/CMakeLists.txt | 71 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 70 | =================================================================== | 72 | index cfc8ae5..673a5ad 100644 |
| 71 | --- git.orig/CMakeLists.txt | 73 | --- a/CMakeLists.txt |
| 72 | +++ git/CMakeLists.txt | 74 | +++ b/CMakeLists.txt |
| 73 | @@ -24,6 +24,17 @@ include(makefiles/cmake/global_settings. | 75 | @@ -24,6 +24,17 @@ include(makefiles/cmake/global_settings.cmake) |
| 74 | include(makefiles/cmake/arm-linux.cmake) | 76 | include(makefiles/cmake/arm-linux.cmake) |
| 75 | include(makefiles/cmake/vmcs.cmake) | 77 | include(makefiles/cmake/vmcs.cmake) |
| 76 | 78 | ||
| @@ -88,11 +90,11 @@ Index: git/CMakeLists.txt | |||
| 88 | enable_language(ASM) | 90 | enable_language(ASM) |
| 89 | 91 | ||
| 90 | # Global include paths | 92 | # Global include paths |
| 91 | Index: git/README.md | 93 | diff --git a/README.md b/README.md |
| 92 | =================================================================== | 94 | index 94b93b8..50b90b1 100644 |
| 93 | --- git.orig/README.md | 95 | --- a/README.md |
| 94 | +++ git/README.md | 96 | +++ b/README.md |
| 95 | @@ -6,3 +6,7 @@ Use buildme to build. It requires cmake | 97 | @@ -6,3 +6,7 @@ Use buildme to build. It requires cmake to be installed and an arm cross compile |
| 96 | https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian | 98 | https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian |
| 97 | 99 | ||
| 98 | Note that this repository does not contain the source for the edid_parser and vcdbg binaries due to licensing restrictions. | 100 | Note that this repository does not contain the source for the edid_parser and vcdbg binaries due to licensing restrictions. |
| @@ -100,10 +102,10 @@ Index: git/README.md | |||
| 100 | +To build support for the Wayland winsys in EGL, execute the buildme script like this: | 102 | +To build support for the Wayland winsys in EGL, execute the buildme script like this: |
| 101 | + | 103 | + |
| 102 | +$ BUILD_WAYLAND=1 ./buildme. | 104 | +$ BUILD_WAYLAND=1 ./buildme. |
| 103 | Index: git/buildme | 105 | diff --git a/buildme b/buildme |
| 104 | =================================================================== | 106 | index b8fd440..a780bb6 100755 |
| 105 | --- git.orig/buildme | 107 | --- a/buildme |
| 106 | +++ git/buildme | 108 | +++ b/buildme |
| 107 | @@ -8,6 +8,10 @@ fi | 109 | @@ -8,6 +8,10 @@ fi |
| 108 | 110 | ||
| 109 | BUILDSUBDIR=`echo $BUILDTYPE | tr '[A-Z]' '[a-z]'`; | 111 | BUILDSUBDIR=`echo $BUILDTYPE | tr '[A-Z]' '[a-z]'`; |
| @@ -130,23 +132,23 @@ Index: git/buildme | |||
| 130 | make -j `nproc` | 132 | make -j `nproc` |
| 131 | 133 | ||
| 132 | if [ "$1" != "" ]; then | 134 | if [ "$1" != "" ]; then |
| 133 | Index: git/host_applications/linux/apps/raspicam/CMakeLists.txt | 135 | diff --git a/host_applications/linux/apps/raspicam/CMakeLists.txt b/host_applications/linux/apps/raspicam/CMakeLists.txt |
| 134 | =================================================================== | 136 | index 42636e8..d47ad55 100644 |
| 135 | --- git.orig/host_applications/linux/apps/raspicam/CMakeLists.txt | 137 | --- a/host_applications/linux/apps/raspicam/CMakeLists.txt |
| 136 | +++ git/host_applications/linux/apps/raspicam/CMakeLists.txt | 138 | +++ b/host_applications/linux/apps/raspicam/CMakeLists.txt |
| 137 | @@ -28,7 +28,7 @@ add_executable(raspividyuv ${COMMON_SOU | 139 | @@ -33,7 +33,7 @@ add_executable(raspividyuv ${COMMON_SOURCES} RaspiVidYUV.c) |
| 138 | 140 | ||
| 139 | set (MMAL_LIBS mmal_core mmal_util mmal_vc_client) | 141 | set (MMAL_LIBS mmal_core mmal_util mmal_vc_client) |
| 140 | 142 | ||
| 141 | -target_link_libraries(raspistill ${MMAL_LIBS} vcos bcm_host brcmGLESv2 brcmEGL m) | 143 | -target_link_libraries(raspistill ${MMAL_LIBS} vcos bcm_host brcmGLESv2 brcmEGL m dl) |
| 142 | +target_link_libraries(raspistill ${MMAL_LIBS} vcos bcm_host brcmGLESv2 brcmEGL m ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES}) | 144 | +target_link_libraries(raspistill ${MMAL_LIBS} vcos bcm_host brcmGLESv2 brcmEGL m dl ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES}) |
| 143 | target_link_libraries(raspiyuv ${MMAL_LIBS} vcos bcm_host) | 145 | target_link_libraries(raspiyuv ${MMAL_LIBS} vcos bcm_host) |
| 144 | target_link_libraries(raspivid ${MMAL_LIBS} vcos bcm_host) | 146 | target_link_libraries(raspivid ${MMAL_LIBS} vcos bcm_host) |
| 145 | target_link_libraries(raspividyuv ${MMAL_LIBS} vcos bcm_host) | 147 | target_link_libraries(raspividyuv ${MMAL_LIBS} vcos bcm_host) |
| 146 | Index: git/interface/khronos/CMakeLists.txt | 148 | diff --git a/interface/khronos/CMakeLists.txt b/interface/khronos/CMakeLists.txt |
| 147 | =================================================================== | 149 | index 9ad615b..95c0e11 100644 |
| 148 | --- git.orig/interface/khronos/CMakeLists.txt | 150 | --- a/interface/khronos/CMakeLists.txt |
| 149 | +++ git/interface/khronos/CMakeLists.txt | 151 | +++ b/interface/khronos/CMakeLists.txt |
| 150 | @@ -6,6 +6,12 @@ | 152 | @@ -6,6 +6,12 @@ |
| 151 | # have quite a few circular dependencies, and so the only way | 153 | # have quite a few circular dependencies, and so the only way |
| 152 | # to make it work seems to be to have everything static. | 154 | # to make it work seems to be to have everything static. |
| @@ -216,7 +218,7 @@ Index: git/interface/khronos/CMakeLists.txt | |||
| 216 | # TODO do we need EGL_static and GLESv2_static now that khrn_static exists? | 218 | # TODO do we need EGL_static and GLESv2_static now that khrn_static exists? |
| 217 | add_library(EGL_static STATIC ${EGL_SOURCE}) | 219 | add_library(EGL_static STATIC ${EGL_SOURCE}) |
| 218 | add_library(GLESv2_static STATIC ${GLES_SOURCE}) | 220 | add_library(GLESv2_static STATIC ${GLES_SOURCE}) |
| 219 | @@ -72,8 +121,7 @@ include_directories (../../host_applicat | 221 | @@ -72,8 +121,7 @@ include_directories (../../host_applications/linux/libs/sm ) |
| 220 | set(VCSM_LIBS vcsm) | 222 | set(VCSM_LIBS vcsm) |
| 221 | add_definitions(-DKHRONOS_HAVE_VCSM) | 223 | add_definitions(-DKHRONOS_HAVE_VCSM) |
| 222 | endif() | 224 | endif() |
| @@ -226,7 +228,7 @@ Index: git/interface/khronos/CMakeLists.txt | |||
| 226 | target_link_libraries(GLESv2 EGL khrn_client vcos) | 228 | target_link_libraries(GLESv2 EGL khrn_client vcos) |
| 227 | target_link_libraries(WFC EGL) | 229 | target_link_libraries(WFC EGL) |
| 228 | target_link_libraries(OpenVG EGL) | 230 | target_link_libraries(OpenVG EGL) |
| 229 | @@ -87,7 +135,7 @@ add_library(brcmGLESv2 ${SHARED} ${GLES_ | 231 | @@ -87,7 +135,7 @@ add_library(brcmGLESv2 ${SHARED} ${GLES_SOURCE}) |
| 230 | add_library(brcmOpenVG ${SHARED} ${VG_SOURCE}) | 232 | add_library(brcmOpenVG ${SHARED} ${VG_SOURCE}) |
| 231 | add_library(brcmWFC ${SHARED} ${WFC_SOURCE}) | 233 | add_library(brcmWFC ${SHARED} ${WFC_SOURCE}) |
| 232 | 234 | ||
| @@ -235,11 +237,11 @@ Index: git/interface/khronos/CMakeLists.txt | |||
| 235 | target_link_libraries(brcmGLESv2 brcmEGL khrn_client vcos) | 237 | target_link_libraries(brcmGLESv2 brcmEGL khrn_client vcos) |
| 236 | target_link_libraries(brcmWFC brcmEGL) | 238 | target_link_libraries(brcmWFC brcmEGL) |
| 237 | target_link_libraries(brcmOpenVG brcmEGL) | 239 | target_link_libraries(brcmOpenVG brcmEGL) |
| 238 | Index: git/interface/khronos/common/khrn_client.c | 240 | diff --git a/interface/khronos/common/khrn_client.c b/interface/khronos/common/khrn_client.c |
| 239 | =================================================================== | 241 | index ef4babd..d7e798e 100644 |
| 240 | --- git.orig/interface/khronos/common/khrn_client.c | 242 | --- a/interface/khronos/common/khrn_client.c |
| 241 | +++ git/interface/khronos/common/khrn_client.c | 243 | +++ b/interface/khronos/common/khrn_client.c |
| 242 | @@ -54,6 +54,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 244 | @@ -54,6 +54,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 243 | #include "applications/vmcs/khronos/khronos_server.h" | 245 | #include "applications/vmcs/khronos/khronos_server.h" |
| 244 | #endif | 246 | #endif |
| 245 | 247 | ||
| @@ -250,7 +252,7 @@ Index: git/interface/khronos/common/khrn_client.c | |||
| 250 | VCOS_LOG_CAT_T khrn_client_log = VCOS_LOG_INIT("khrn_client", VCOS_LOG_WARN); | 252 | VCOS_LOG_CAT_T khrn_client_log = VCOS_LOG_INIT("khrn_client", VCOS_LOG_WARN); |
| 251 | 253 | ||
| 252 | /* | 254 | /* |
| 253 | @@ -142,6 +146,10 @@ void client_try_unload_server(CLIENT_PRO | 255 | @@ -142,6 +146,10 @@ void client_try_unload_server(CLIENT_PROCESS_STATE_T *process) |
| 254 | bool client_process_state_init(CLIENT_PROCESS_STATE_T *process) | 256 | bool client_process_state_init(CLIENT_PROCESS_STATE_T *process) |
| 255 | { | 257 | { |
| 256 | if (!process->inited) { | 258 | if (!process->inited) { |
| @@ -261,7 +263,7 @@ Index: git/interface/khronos/common/khrn_client.c | |||
| 261 | if (!khrn_pointer_map_init(&process->contexts, 64)) | 263 | if (!khrn_pointer_map_init(&process->contexts, 64)) |
| 262 | return false; | 264 | return false; |
| 263 | 265 | ||
| 264 | @@ -194,6 +202,13 @@ bool client_process_state_init(CLIENT_PR | 266 | @@ -194,6 +202,13 @@ bool client_process_state_init(CLIENT_PROCESS_STATE_T *process) |
| 265 | } | 267 | } |
| 266 | #endif | 268 | #endif |
| 267 | 269 | ||
| @@ -275,10 +277,10 @@ Index: git/interface/khronos/common/khrn_client.c | |||
| 275 | process->inited = true; | 277 | process->inited = true; |
| 276 | } | 278 | } |
| 277 | 279 | ||
| 278 | Index: git/interface/khronos/common/khrn_client.h | 280 | diff --git a/interface/khronos/common/khrn_client.h b/interface/khronos/common/khrn_client.h |
| 279 | =================================================================== | 281 | index 804039b..615f7b4 100644 |
| 280 | --- git.orig/interface/khronos/common/khrn_client.h | 282 | --- a/interface/khronos/common/khrn_client.h |
| 281 | +++ git/interface/khronos/common/khrn_client.h | 283 | +++ b/interface/khronos/common/khrn_client.h |
| 282 | @@ -310,6 +310,16 @@ struct CLIENT_PROCESS_STATE { | 284 | @@ -310,6 +310,16 @@ struct CLIENT_PROCESS_STATE { |
| 283 | #ifdef RPC_LIBRARY | 285 | #ifdef RPC_LIBRARY |
| 284 | KHRONOS_SERVER_CONNECTION_T khrn_connection; | 286 | KHRONOS_SERVER_CONNECTION_T khrn_connection; |
| @@ -296,11 +298,11 @@ Index: git/interface/khronos/common/khrn_client.h | |||
| 296 | }; | 298 | }; |
| 297 | 299 | ||
| 298 | extern bool client_process_state_init(CLIENT_PROCESS_STATE_T *process); | 300 | extern bool client_process_state_init(CLIENT_PROCESS_STATE_T *process); |
| 299 | Index: git/interface/khronos/common/khrn_client_mangle.h | 301 | diff --git a/interface/khronos/common/khrn_client_mangle.h b/interface/khronos/common/khrn_client_mangle.h |
| 300 | =================================================================== | 302 | index b3c04f4..b7b21c5 100644 |
| 301 | --- git.orig/interface/khronos/common/khrn_client_mangle.h | 303 | --- a/interface/khronos/common/khrn_client_mangle.h |
| 302 | +++ git/interface/khronos/common/khrn_client_mangle.h | 304 | +++ b/interface/khronos/common/khrn_client_mangle.h |
| 303 | @@ -83,6 +83,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 305 | @@ -83,6 +83,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 304 | #define eglReleaseGlobalImageBRCM mangled_eglReleaseGlobalImageBRCM | 306 | #define eglReleaseGlobalImageBRCM mangled_eglReleaseGlobalImageBRCM |
| 305 | #define eglInitGlobalImageBRCM mangled_eglInitGlobalImageBRCM | 307 | #define eglInitGlobalImageBRCM mangled_eglInitGlobalImageBRCM |
| 306 | #define eglTermGlobalImageBRCM mangled_eglTermGlobalImageBRCM | 308 | #define eglTermGlobalImageBRCM mangled_eglTermGlobalImageBRCM |
| @@ -310,11 +312,11 @@ Index: git/interface/khronos/common/khrn_client_mangle.h | |||
| 310 | 312 | ||
| 311 | /* OpenGL ES 1.1 and 2.0 functions */ | 313 | /* OpenGL ES 1.1 and 2.0 functions */ |
| 312 | 314 | ||
| 313 | Index: git/interface/khronos/common/khrn_client_platform.h | 315 | diff --git a/interface/khronos/common/khrn_client_platform.h b/interface/khronos/common/khrn_client_platform.h |
| 314 | =================================================================== | 316 | index 1c9da3a..715c67e 100644 |
| 315 | --- git.orig/interface/khronos/common/khrn_client_platform.h | 317 | --- a/interface/khronos/common/khrn_client_platform.h |
| 316 | +++ git/interface/khronos/common/khrn_client_platform.h | 318 | +++ b/interface/khronos/common/khrn_client_platform.h |
| 317 | @@ -48,6 +48,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 319 | @@ -48,6 +48,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 318 | #include "interface/khronos/common/vcos/khrn_client_platform_filler_vcos.h" | 320 | #include "interface/khronos/common/vcos/khrn_client_platform_filler_vcos.h" |
| 319 | #endif | 321 | #endif |
| 320 | 322 | ||
| @@ -334,11 +336,11 @@ Index: git/interface/khronos/common/khrn_client_platform.h | |||
| 334 | +#endif | 336 | +#endif |
| 335 | + | 337 | + |
| 336 | #endif // KHRN_CLIENT_PLATFORM_H | 338 | #endif // KHRN_CLIENT_PLATFORM_H |
| 337 | Index: git/interface/khronos/common/khrn_client_unmangle.h | 339 | diff --git a/interface/khronos/common/khrn_client_unmangle.h b/interface/khronos/common/khrn_client_unmangle.h |
| 338 | =================================================================== | 340 | index 4f3ce49..84f6ec0 100644 |
| 339 | --- git.orig/interface/khronos/common/khrn_client_unmangle.h | 341 | --- a/interface/khronos/common/khrn_client_unmangle.h |
| 340 | +++ git/interface/khronos/common/khrn_client_unmangle.h | 342 | +++ b/interface/khronos/common/khrn_client_unmangle.h |
| 341 | @@ -83,6 +83,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 343 | @@ -83,6 +83,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 342 | #undef eglReleaseGlobalImageBRCM | 344 | #undef eglReleaseGlobalImageBRCM |
| 343 | #undef eglInitGlobalImageBRCM | 345 | #undef eglInitGlobalImageBRCM |
| 344 | #undef eglTermGlobalImageBRCM | 346 | #undef eglTermGlobalImageBRCM |
| @@ -348,11 +350,11 @@ Index: git/interface/khronos/common/khrn_client_unmangle.h | |||
| 348 | 350 | ||
| 349 | /* OpenGL ES 1.1 and 2.0 functions */ | 351 | /* OpenGL ES 1.1 and 2.0 functions */ |
| 350 | 352 | ||
| 351 | Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | 353 | diff --git a/interface/khronos/common/linux/khrn_client_platform_linux.c b/interface/khronos/common/linux/khrn_client_platform_linux.c |
| 352 | =================================================================== | 354 | index 710d20f..50d60a6 100644 |
| 353 | --- git.orig/interface/khronos/common/linux/khrn_client_platform_linux.c | 355 | --- a/interface/khronos/common/linux/khrn_client_platform_linux.c |
| 354 | +++ git/interface/khronos/common/linux/khrn_client_platform_linux.c | 356 | +++ b/interface/khronos/common/linux/khrn_client_platform_linux.c |
| 355 | @@ -37,6 +37,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 357 | @@ -37,6 +37,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 356 | #include "X11/Xlib.h" | 358 | #include "X11/Xlib.h" |
| 357 | #endif | 359 | #endif |
| 358 | 360 | ||
| @@ -364,7 +366,7 @@ Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | |||
| 364 | extern VCOS_LOG_CAT_T khrn_client_log; | 366 | extern VCOS_LOG_CAT_T khrn_client_log; |
| 365 | 367 | ||
| 366 | extern void vc_vchi_khronos_init(); | 368 | extern void vc_vchi_khronos_init(); |
| 367 | @@ -464,14 +469,37 @@ EGLDisplay khrn_platform_set_display_id( | 369 | @@ -464,13 +469,36 @@ EGLDisplay khrn_platform_set_display_id(EGLNativeDisplayType display_id) |
| 368 | return EGL_NO_DISPLAY; | 370 | return EGL_NO_DISPLAY; |
| 369 | } | 371 | } |
| 370 | #else | 372 | #else |
| @@ -392,19 +394,18 @@ Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | |||
| 392 | +#endif | 394 | +#endif |
| 393 | + return EGL_NO_DISPLAY; | 395 | + return EGL_NO_DISPLAY; |
| 394 | + } | 396 | + } |
| 395 | +} | 397 | } |
| 396 | + | 398 | + |
| 397 | +#ifdef BUILD_WAYLAND | 399 | +#ifdef BUILD_WAYLAND |
| 398 | +struct wl_display *khrn_platform_get_wl_display() | 400 | +struct wl_display *khrn_platform_get_wl_display() |
| 399 | +{ | 401 | +{ |
| 400 | + return hacky_display; | 402 | + return hacky_display; |
| 401 | } | 403 | +} |
| 402 | #endif | ||
| 403 | +#endif | 404 | +#endif |
| 405 | #endif | ||
| 404 | 406 | ||
| 405 | #ifdef WANT_X | 407 | #ifdef WANT_X |
| 406 | static void dump_hierarchy(Window w, Window thisw, Window look, int level) | 408 | @@ -805,22 +833,81 @@ static EGL_DISPMANX_WINDOW_T *check_default(EGLNativeWindowType win) |
| 407 | @@ -805,22 +833,81 @@ static EGL_DISPMANX_WINDOW_T *check_defa | ||
| 408 | void platform_get_dimensions(EGLDisplay dpy, EGLNativeWindowType win, | 409 | void platform_get_dimensions(EGLDisplay dpy, EGLNativeWindowType win, |
| 409 | uint32_t *width, uint32_t *height, uint32_t *swapchain_count) | 410 | uint32_t *width, uint32_t *height, uint32_t *swapchain_count) |
| 410 | { | 411 | { |
| @@ -435,8 +436,8 @@ Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | |||
| 435 | +#ifdef BUILD_WAYLAND | 436 | +#ifdef BUILD_WAYLAND |
| 436 | + } | 437 | + } |
| 437 | +#endif | 438 | +#endif |
| 438 | +} | 439 | } |
| 439 | + | 440 | |
| 440 | +#ifdef BUILD_WAYLAND | 441 | +#ifdef BUILD_WAYLAND |
| 441 | +static DISPMANX_ELEMENT_HANDLE_T create_dummy_element() | 442 | +static DISPMANX_ELEMENT_HANDLE_T create_dummy_element() |
| 442 | +{ | 443 | +{ |
| @@ -467,9 +468,9 @@ Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | |||
| 467 | + vc_dispmanx_display_close(display); | 468 | + vc_dispmanx_display_close(display); |
| 468 | + | 469 | + |
| 469 | + return element; | 470 | + return element; |
| 470 | } | 471 | +} |
| 471 | +#endif | 472 | +#endif |
| 472 | 473 | + | |
| 473 | uint32_t platform_get_handle(EGLDisplay dpy, EGLNativeWindowType win) | 474 | uint32_t platform_get_handle(EGLDisplay dpy, EGLNativeWindowType win) |
| 474 | { | 475 | { |
| 475 | - EGL_DISPMANX_WINDOW_T *dwin = check_default(win); | 476 | - EGL_DISPMANX_WINDOW_T *dwin = check_default(win); |
| @@ -498,10 +499,11 @@ Index: git/interface/khronos/common/linux/khrn_client_platform_linux.c | |||
| 498 | } | 499 | } |
| 499 | 500 | ||
| 500 | #endif | 501 | #endif |
| 501 | Index: git/interface/khronos/common/linux/khrn_wayland.c | 502 | diff --git a/interface/khronos/common/linux/khrn_wayland.c b/interface/khronos/common/linux/khrn_wayland.c |
| 502 | =================================================================== | 503 | new file mode 100644 |
| 504 | index 0000000..0e1b9e7 | ||
| 503 | --- /dev/null | 505 | --- /dev/null |
| 504 | +++ git/interface/khronos/common/linux/khrn_wayland.c | 506 | +++ b/interface/khronos/common/linux/khrn_wayland.c |
| 505 | @@ -0,0 +1,215 @@ | 507 | @@ -0,0 +1,215 @@ |
| 506 | +/* | 508 | +/* |
| 507 | +Copyright (c) 2013, Raspberry Pi Foundation | 509 | +Copyright (c) 2013, Raspberry Pi Foundation |
| @@ -718,72 +720,74 @@ Index: git/interface/khronos/common/linux/khrn_wayland.c | |||
| 718 | + | 720 | + |
| 719 | + return wl_dispmanx_client_buffer; | 721 | + return wl_dispmanx_client_buffer; |
| 720 | +} | 722 | +} |
| 721 | Index: git/interface/vmcs_host/vc_vchi_dispmanx.h | 723 | diff --git a/interface/vmcs_host/vc_vchi_dispmanx.h b/interface/khronos/common/linux/khrn_wayland.h |
| 722 | =================================================================== | 724 | similarity index 56% |
| 723 | --- git.orig/interface/vmcs_host/vc_vchi_dispmanx.h | 725 | copy from interface/vmcs_host/vc_vchi_dispmanx.h |
| 724 | +++ git/interface/vmcs_host/vc_vchi_dispmanx.h | 726 | copy to interface/khronos/common/linux/khrn_wayland.h |
| 725 | @@ -66,4 +66,19 @@ typedef struct { | 727 | index b723b76..b9bf08c 100644 |
| 726 | #define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) | 728 | --- a/interface/vmcs_host/vc_vchi_dispmanx.h |
| 727 | #define ELEMENT_CHANGE_TRANSFORM (1<<5) | 729 | +++ b/interface/khronos/common/linux/khrn_wayland.h |
| 728 | 730 | @@ -1,5 +1,5 @@ | |
| 729 | +#ifdef BUILD_WAYLAND | 731 | /* |
| 730 | +/* XXX: This should be in a private header that can be included from EGL and vc_* */ | 732 | -Copyright (c) 2012, Broadcom Europe Ltd |
| 731 | +#include <wayland-server.h> | ||
| 732 | +#include "interface/vmcs_host/wayland-dispmanx-server-protocol.h" | ||
| 733 | +struct wl_dispmanx_server_buffer { | ||
| 734 | + struct wl_resource *resource; | ||
| 735 | + struct wl_dispmanx *dispmanx; | ||
| 736 | + enum wl_dispmanx_format format; | ||
| 737 | + DISPMANX_RESOURCE_HANDLE_T handle; | ||
| 738 | + int32_t width; | ||
| 739 | + int32_t height; | ||
| 740 | + int in_use; | ||
| 741 | +}; | ||
| 742 | +#endif | ||
| 743 | + | ||
| 744 | #endif | ||
| 745 | Index: git/interface/khronos/common/linux/khrn_wayland.h | ||
| 746 | =================================================================== | ||
| 747 | --- /dev/null | ||
| 748 | +++ git/interface/khronos/common/linux/khrn_wayland.h | ||
| 749 | @@ -0,0 +1,33 @@ | ||
| 750 | +/* | ||
| 751 | +Copyright (c) 2013, Raspberry Pi Foundation | 733 | +Copyright (c) 2013, Raspberry Pi Foundation |
| 752 | +All rights reserved. | 734 | All rights reserved. |
| 753 | + | 735 | |
| 754 | +Redistribution and use in source and binary forms, with or without | 736 | Redistribution and use in source and binary forms, with or without |
| 755 | +modification, are permitted provided that the following conditions are met: | 737 | @@ -25,45 +25,9 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 756 | + * Redistributions of source code must retain the above copyright | 738 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 757 | + notice, this list of conditions and the following disclaimer. | 739 | */ |
| 758 | + * Redistributions in binary form must reproduce the above copyright | 740 | |
| 759 | + notice, this list of conditions and the following disclaimer in the | 741 | -#ifndef VC_VCHI_DISPMANX_H |
| 760 | + documentation and/or other materials provided with the distribution. | 742 | -#define VC_VCHI_DISPMANX_H |
| 761 | + * Neither the name of the copyright holder nor the | ||
| 762 | + names of its contributors may be used to endorse or promote products | ||
| 763 | + derived from this software without specific prior written permission. | ||
| 764 | + | ||
| 765 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| 766 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 767 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 768 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY | ||
| 769 | +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 770 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 771 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| 772 | +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 773 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 774 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 775 | +*/ | ||
| 776 | + | ||
| 777 | +#include "interface/khronos/common/khrn_client.h" | 743 | +#include "interface/khronos/common/khrn_client.h" |
| 778 | + | 744 | |
| 745 | -#include "interface/peer/vc_vchi_dispmanx_common.h" | ||
| 779 | +int init_process_wayland(CLIENT_PROCESS_STATE_T *process); | 746 | +int init_process_wayland(CLIENT_PROCESS_STATE_T *process); |
| 780 | +int do_wl_roundtrip(); | 747 | +int do_wl_roundtrip(); |
| 781 | + | 748 | |
| 749 | -#define VC_NUM_HOST_RESOURCES 64 | ||
| 750 | -#define DISPMANX_MSGFIFO_SIZE 1024 | ||
| 751 | -#define DISPMANX_CLIENT_NAME MAKE_FOURCC("DISP") | ||
| 752 | -#define DISPMANX_NOTIFY_NAME MAKE_FOURCC("UPDH") | ||
| 753 | - | ||
| 754 | -//Or with command to indicate we don't need a response | ||
| 755 | -#define DISPMANX_NO_REPLY_MASK (1<<31) | ||
| 756 | - | ||
| 757 | -typedef struct { | ||
| 758 | - char description[32]; | ||
| 759 | - uint32_t width; | ||
| 760 | - uint32_t height; | ||
| 761 | - uint32_t aspect_pixwidth; | ||
| 762 | - uint32_t aspect_pixheight; | ||
| 763 | - uint32_t fieldrate_num; | ||
| 764 | - uint32_t fieldrate_denom; | ||
| 765 | - uint32_t fields_per_frame; | ||
| 766 | - uint32_t transform; | ||
| 767 | -} GET_MODES_DATA_T; | ||
| 768 | - | ||
| 769 | -typedef struct { | ||
| 770 | - int32_t response; | ||
| 771 | - uint32_t width; | ||
| 772 | - uint32_t height; | ||
| 773 | - uint32_t transform; | ||
| 774 | - uint32_t input_format; | ||
| 775 | -} GET_INFO_DATA_T; | ||
| 776 | - | ||
| 777 | -//Attributes changes flag mask | ||
| 778 | -#define ELEMENT_CHANGE_LAYER (1<<0) | ||
| 779 | -#define ELEMENT_CHANGE_OPACITY (1<<1) | ||
| 780 | -#define ELEMENT_CHANGE_DEST_RECT (1<<2) | ||
| 781 | -#define ELEMENT_CHANGE_SRC_RECT (1<<3) | ||
| 782 | -#define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) | ||
| 783 | -#define ELEMENT_CHANGE_TRANSFORM (1<<5) | ||
| 784 | - | ||
| 785 | -#endif | ||
| 782 | +struct wl_dispmanx_client_buffer *allocate_wl_buffer(struct wl_egl_window *window, KHRN_IMAGE_FORMAT_T color); | 786 | +struct wl_dispmanx_client_buffer *allocate_wl_buffer(struct wl_egl_window *window, KHRN_IMAGE_FORMAT_T color); |
| 783 | Index: git/interface/khronos/egl/egl_client.c | 787 | diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c |
| 784 | =================================================================== | 788 | index b8bb374..03fe67b 100644 |
| 785 | --- git.orig/interface/khronos/egl/egl_client.c | 789 | --- a/interface/khronos/egl/egl_client.c |
| 786 | +++ git/interface/khronos/egl/egl_client.c | 790 | +++ b/interface/khronos/egl/egl_client.c |
| 787 | @@ -153,6 +153,10 @@ by an attribute value" | 791 | @@ -153,6 +153,10 @@ by an attribute value" |
| 788 | #include <stdlib.h> | 792 | #include <stdlib.h> |
| 789 | #include <string.h> | 793 | #include <string.h> |
| @@ -795,7 +799,7 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 795 | 799 | ||
| 796 | #include "interface/khronos/egl/egl_client_cr.c" | 800 | #include "interface/khronos/egl/egl_client_cr.c" |
| 797 | 801 | ||
| 798 | @@ -162,17 +166,6 @@ static void egl_current_release(CLIENT_P | 802 | @@ -162,17 +166,6 @@ static void egl_current_release(CLIENT_PROCESS_STATE_T *process, EGL_CURRENT_T * |
| 799 | void egl_gl_flush_callback(bool wait); | 803 | void egl_gl_flush_callback(bool wait); |
| 800 | void egl_vg_flush_callback(bool wait); | 804 | void egl_vg_flush_callback(bool wait); |
| 801 | 805 | ||
| @@ -813,17 +817,17 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 813 | /* | 817 | /* |
| 814 | TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate) | 818 | TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate) |
| 815 | Also affects global image (and possibly others?) | 819 | Also affects global image (and possibly others?) |
| 816 | @@ -451,6 +444,9 @@ EGLAPI const char EGLAPIENTRY * eglQuery | 820 | @@ -450,6 +443,9 @@ EGLAPI const char EGLAPIENTRY * eglQueryString(EGLDisplay dpy, EGLint name) |
| 821 | #ifdef EGL_KHR_fence_sync | ||
| 817 | "EGL_KHR_fence_sync " | 822 | "EGL_KHR_fence_sync " |
| 818 | #endif | 823 | #endif |
| 819 | #endif | 824 | +#endif |
| 820 | +#if EGL_WL_bind_wayland_display | 825 | +#if EGL_WL_bind_wayland_display |
| 821 | + "EGL_WL_bind_wayland_display " | 826 | + "EGL_WL_bind_wayland_display " |
| 822 | +#endif | 827 | #endif |
| 823 | ; | 828 | ; |
| 824 | break; | 829 | break; |
| 825 | case EGL_VENDOR: | 830 | @@ -655,8 +651,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig c |
| 826 | @@ -655,8 +651,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateW | ||
| 827 | false, | 831 | false, |
| 828 | EGL_NO_TEXTURE, | 832 | EGL_NO_TEXTURE, |
| 829 | EGL_NO_TEXTURE, | 833 | EGL_NO_TEXTURE, |
| @@ -833,7 +837,7 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 833 | 837 | ||
| 834 | if (surface) { | 838 | if (surface) { |
| 835 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { | 839 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { |
| 836 | @@ -901,7 +896,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateP | 840 | @@ -901,7 +896,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig |
| 837 | mipmap_texture, | 841 | mipmap_texture, |
| 838 | texture_format, | 842 | texture_format, |
| 839 | texture_target, | 843 | texture_target, |
| @@ -842,7 +846,7 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 842 | 846 | ||
| 843 | if (surface) { | 847 | if (surface) { |
| 844 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { | 848 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { |
| 845 | @@ -1043,7 +1038,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateP | 849 | @@ -1043,7 +1038,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig c |
| 846 | false, | 850 | false, |
| 847 | EGL_NO_TEXTURE, | 851 | EGL_NO_TEXTURE, |
| 848 | EGL_NO_TEXTURE, | 852 | EGL_NO_TEXTURE, |
| @@ -851,7 +855,7 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 851 | 855 | ||
| 852 | if (surface) { | 856 | if (surface) { |
| 853 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { | 857 | if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) { |
| 854 | @@ -2245,6 +2240,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuf | 858 | @@ -2245,6 +2240,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) |
| 855 | CLIENT_THREAD_STATE_T *thread; | 859 | CLIENT_THREAD_STATE_T *thread; |
| 856 | CLIENT_PROCESS_STATE_T *process; | 860 | CLIENT_PROCESS_STATE_T *process; |
| 857 | EGLBoolean result; | 861 | EGLBoolean result; |
| @@ -861,7 +865,7 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 861 | 865 | ||
| 862 | vcos_log_trace("eglSwapBuffers start. dpy=%d. surf=%d.", (int)dpy, (int)surf); | 866 | vcos_log_trace("eglSwapBuffers start. dpy=%d. surf=%d.", (int)dpy, (int)surf); |
| 863 | 867 | ||
| 864 | @@ -2315,18 +2313,58 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuf | 868 | @@ -2315,18 +2313,58 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf) |
| 865 | 869 | ||
| 866 | vcos_log_trace("eglSwapBuffers server call"); | 870 | vcos_log_trace("eglSwapBuffers server call"); |
| 867 | 871 | ||
| @@ -932,11 +936,11 @@ Index: git/interface/khronos/egl/egl_client.c | |||
| 932 | RPC_CALL6(eglIntSwapBuffers_impl, | 936 | RPC_CALL6(eglIntSwapBuffers_impl, |
| 933 | thread, | 937 | thread, |
| 934 | EGLINTSWAPBUFFERS_ID, | 938 | EGLINTSWAPBUFFERS_ID, |
| 935 | Index: git/interface/khronos/egl/egl_client_get_proc.c | 939 | diff --git a/interface/khronos/egl/egl_client_get_proc.c b/interface/khronos/egl/egl_client_get_proc.c |
| 936 | =================================================================== | 940 | index 4cfa9ff..6a715af 100644 |
| 937 | --- git.orig/interface/khronos/egl/egl_client_get_proc.c | 941 | --- a/interface/khronos/egl/egl_client_get_proc.c |
| 938 | +++ git/interface/khronos/egl/egl_client_get_proc.c | 942 | +++ b/interface/khronos/egl/egl_client_get_proc.c |
| 939 | @@ -254,6 +254,17 @@ EGLAPI void EGLAPIENTRY (* eglGetProcAdd | 943 | @@ -254,6 +254,17 @@ EGLAPI void EGLAPIENTRY (* eglGetProcAddress(const char *procname))(void) |
| 940 | return (void(*)(void))eglQueryGlobalImageBRCM; | 944 | return (void(*)(void))eglQueryGlobalImageBRCM; |
| 941 | #endif | 945 | #endif |
| 942 | 946 | ||
| @@ -954,11 +958,11 @@ Index: git/interface/khronos/egl/egl_client_get_proc.c | |||
| 954 | return (void(*)(void)) NULL; | 958 | return (void(*)(void)) NULL; |
| 955 | } | 959 | } |
| 956 | 960 | ||
| 957 | Index: git/interface/khronos/egl/egl_client_surface.c | 961 | diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c |
| 958 | =================================================================== | 962 | index 128325e..42350bf 100644 |
| 959 | --- git.orig/interface/khronos/egl/egl_client_surface.c | 963 | --- a/interface/khronos/egl/egl_client_surface.c |
| 960 | +++ git/interface/khronos/egl/egl_client_surface.c | 964 | +++ b/interface/khronos/egl/egl_client_surface.c |
| 961 | @@ -46,6 +46,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 965 | @@ -46,6 +46,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 962 | #include "interface/khronos/egl/egl_int_impl.h" | 966 | #include "interface/khronos/egl/egl_int_impl.h" |
| 963 | #endif | 967 | #endif |
| 964 | 968 | ||
| @@ -1032,7 +1036,7 @@ Index: git/interface/khronos/egl/egl_client_surface.c | |||
| 1032 | RPC_CALL15_OUT_CTRL(eglIntCreateSurface_impl, | 1036 | RPC_CALL15_OUT_CTRL(eglIntCreateSurface_impl, |
| 1033 | thread, | 1037 | thread, |
| 1034 | EGLINTCREATESURFACE_ID, | 1038 | EGLINTCREATESURFACE_ID, |
| 1035 | @@ -663,6 +685,18 @@ void egl_surface_free(EGL_SURFACE_T *sur | 1039 | @@ -663,6 +685,18 @@ void egl_surface_free(EGL_SURFACE_T *surface) |
| 1036 | if( surface->type == WINDOW ) { | 1040 | if( surface->type == WINDOW ) { |
| 1037 | vcos_log_trace("egl_surface_free: calling platform_destroy_winhandle..."); | 1041 | vcos_log_trace("egl_surface_free: calling platform_destroy_winhandle..."); |
| 1038 | platform_destroy_winhandle( surface->win, surface->internal_handle ); | 1042 | platform_destroy_winhandle( surface->win, surface->internal_handle ); |
| @@ -1051,10 +1055,10 @@ Index: git/interface/khronos/egl/egl_client_surface.c | |||
| 1051 | } | 1055 | } |
| 1052 | /* return value ignored -- read performed to ensure blocking. we want this to | 1056 | /* return value ignored -- read performed to ensure blocking. we want this to |
| 1053 | * block so clients can safely destroy the surface's window as soon as the | 1057 | * block so clients can safely destroy the surface's window as soon as the |
| 1054 | Index: git/interface/khronos/egl/egl_client_surface.h | 1058 | diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h |
| 1055 | =================================================================== | 1059 | index b5bf70a..e328b77 100644 |
| 1056 | --- git.orig/interface/khronos/egl/egl_client_surface.h | 1060 | --- a/interface/khronos/egl/egl_client_surface.h |
| 1057 | +++ git/interface/khronos/egl/egl_client_surface.h | 1061 | +++ b/interface/khronos/egl/egl_client_surface.h |
| 1058 | @@ -288,6 +288,41 @@ typedef struct { | 1062 | @@ -288,6 +288,41 @@ typedef struct { |
| 1059 | type == PIXMAP | 1063 | type == PIXMAP |
| 1060 | */ | 1064 | */ |
| @@ -1097,7 +1101,7 @@ Index: git/interface/khronos/egl/egl_client_surface.h | |||
| 1097 | } EGL_SURFACE_T; | 1101 | } EGL_SURFACE_T; |
| 1098 | 1102 | ||
| 1099 | extern bool egl_surface_check_attribs( | 1103 | extern bool egl_surface_check_attribs( |
| 1100 | @@ -322,8 +357,7 @@ extern EGL_SURFACE_T *egl_surface_create | 1104 | @@ -322,8 +357,7 @@ extern EGL_SURFACE_T *egl_surface_create( |
| 1101 | EGLenum texture_format, | 1105 | EGLenum texture_format, |
| 1102 | EGLenum texture_target, | 1106 | EGLenum texture_target, |
| 1103 | EGLNativePixmapType pixmap, | 1107 | EGLNativePixmapType pixmap, |
| @@ -1107,10 +1111,10 @@ Index: git/interface/khronos/egl/egl_client_surface.h | |||
| 1107 | extern EGL_SURFACE_T *egl_surface_from_vg_image( | 1111 | extern EGL_SURFACE_T *egl_surface_from_vg_image( |
| 1108 | VGImage vg_handle, | 1112 | VGImage vg_handle, |
| 1109 | EGLSurface name, | 1113 | EGLSurface name, |
| 1110 | Index: git/interface/khronos/egl/egl_int_impl.h | 1114 | diff --git a/interface/khronos/egl/egl_int_impl.h b/interface/khronos/egl/egl_int_impl.h |
| 1111 | =================================================================== | 1115 | index 51b3580..6863a3b 100644 |
| 1112 | --- git.orig/interface/khronos/egl/egl_int_impl.h | 1116 | --- a/interface/khronos/egl/egl_int_impl.h |
| 1113 | +++ git/interface/khronos/egl/egl_int_impl.h | 1117 | +++ b/interface/khronos/egl/egl_int_impl.h |
| 1114 | @@ -57,7 +57,7 @@ FN(int, eglIntCreateSurface_impl, ( | 1118 | @@ -57,7 +57,7 @@ FN(int, eglIntCreateSurface_impl, ( |
| 1115 | uint32_t sem, | 1119 | uint32_t sem, |
| 1116 | uint32_t type, | 1120 | uint32_t type, |
| @@ -1120,10 +1124,11 @@ Index: git/interface/khronos/egl/egl_int_impl.h | |||
| 1120 | 1124 | ||
| 1121 | FN(int, eglIntCreatePbufferFromVGImage_impl, ( | 1125 | FN(int, eglIntCreatePbufferFromVGImage_impl, ( |
| 1122 | VGImage vg_handle, | 1126 | VGImage vg_handle, |
| 1123 | Index: git/interface/khronos/ext/egl_wayland.c | 1127 | diff --git a/interface/khronos/ext/egl_wayland.c b/interface/khronos/ext/egl_wayland.c |
| 1124 | =================================================================== | 1128 | new file mode 100644 |
| 1129 | index 0000000..5730743 | ||
| 1125 | --- /dev/null | 1130 | --- /dev/null |
| 1126 | +++ git/interface/khronos/ext/egl_wayland.c | 1131 | +++ b/interface/khronos/ext/egl_wayland.c |
| 1127 | @@ -0,0 +1,246 @@ | 1132 | @@ -0,0 +1,246 @@ |
| 1128 | +/* | 1133 | +/* |
| 1129 | +Copyright (c) 2013, Raspberry Pi Foundation | 1134 | +Copyright (c) 2013, Raspberry Pi Foundation |
| @@ -1371,11 +1376,11 @@ Index: git/interface/khronos/ext/egl_wayland.c | |||
| 1371 | + | 1376 | + |
| 1372 | + return EGL_FALSE; | 1377 | + return EGL_FALSE; |
| 1373 | +} | 1378 | +} |
| 1374 | Index: git/interface/khronos/include/EGL/eglext.h | 1379 | diff --git a/interface/khronos/include/EGL/eglext.h b/interface/khronos/include/EGL/eglext.h |
| 1375 | =================================================================== | 1380 | index 89a3369..d7e5ba7 100755 |
| 1376 | --- git.orig/interface/khronos/include/EGL/eglext.h | 1381 | --- a/interface/khronos/include/EGL/eglext.h |
| 1377 | +++ git/interface/khronos/include/EGL/eglext.h | 1382 | +++ b/interface/khronos/include/EGL/eglext.h |
| 1378 | @@ -191,6 +191,29 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLG | 1383 | @@ -191,6 +191,29 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG |
| 1379 | #endif | 1384 | #endif |
| 1380 | 1385 | ||
| 1381 | 1386 | ||
| @@ -1405,10 +1410,11 @@ Index: git/interface/khronos/include/EGL/eglext.h | |||
| 1405 | #ifdef __cplusplus | 1410 | #ifdef __cplusplus |
| 1406 | } | 1411 | } |
| 1407 | #endif | 1412 | #endif |
| 1408 | Index: git/interface/khronos/wayland-egl/wayland-egl-priv.h | 1413 | diff --git a/interface/khronos/wayland-egl/wayland-egl-priv.h b/interface/khronos/wayland-egl/wayland-egl-priv.h |
| 1409 | =================================================================== | 1414 | new file mode 100644 |
| 1415 | index 0000000..8e38d36 | ||
| 1410 | --- /dev/null | 1416 | --- /dev/null |
| 1411 | +++ git/interface/khronos/wayland-egl/wayland-egl-priv.h | 1417 | +++ b/interface/khronos/wayland-egl/wayland-egl-priv.h |
| 1412 | @@ -0,0 +1,53 @@ | 1418 | @@ -0,0 +1,53 @@ |
| 1413 | +/* Copied from Mesa */ | 1419 | +/* Copied from Mesa */ |
| 1414 | + | 1420 | + |
| @@ -1463,10 +1469,11 @@ Index: git/interface/khronos/wayland-egl/wayland-egl-priv.h | |||
| 1463 | +#endif | 1469 | +#endif |
| 1464 | + | 1470 | + |
| 1465 | +#endif | 1471 | +#endif |
| 1466 | Index: git/interface/khronos/wayland-egl/wayland-egl.c | 1472 | diff --git a/interface/khronos/wayland-egl/wayland-egl.c b/interface/khronos/wayland-egl/wayland-egl.c |
| 1467 | =================================================================== | 1473 | new file mode 100644 |
| 1474 | index 0000000..b8f050b | ||
| 1468 | --- /dev/null | 1475 | --- /dev/null |
| 1469 | +++ git/interface/khronos/wayland-egl/wayland-egl.c | 1476 | +++ b/interface/khronos/wayland-egl/wayland-egl.c |
| 1470 | @@ -0,0 +1,59 @@ | 1477 | @@ -0,0 +1,59 @@ |
| 1471 | +/* Copied from Mesa */ | 1478 | +/* Copied from Mesa */ |
| 1472 | + | 1479 | + |
| @@ -1527,10 +1534,11 @@ Index: git/interface/khronos/wayland-egl/wayland-egl.c | |||
| 1527 | + if (height) | 1534 | + if (height) |
| 1528 | + *height = egl_window->attached_height; | 1535 | + *height = egl_window->attached_height; |
| 1529 | +} | 1536 | +} |
| 1530 | Index: git/interface/khronos/wayland-egl/wayland-egl.pc.in | 1537 | diff --git a/interface/khronos/wayland-egl/wayland-egl.pc.in b/interface/khronos/wayland-egl/wayland-egl.pc.in |
| 1531 | =================================================================== | 1538 | new file mode 100644 |
| 1539 | index 0000000..8bafc15 | ||
| 1532 | --- /dev/null | 1540 | --- /dev/null |
| 1533 | +++ git/interface/khronos/wayland-egl/wayland-egl.pc.in | 1541 | +++ b/interface/khronos/wayland-egl/wayland-egl.pc.in |
| 1534 | @@ -0,0 +1,10 @@ | 1542 | @@ -0,0 +1,10 @@ |
| 1535 | +prefix=@CMAKE_INSTALL_PREFIX@ | 1543 | +prefix=@CMAKE_INSTALL_PREFIX@ |
| 1536 | +exec_prefix=${prefix} | 1544 | +exec_prefix=${prefix} |
| @@ -1542,10 +1550,10 @@ Index: git/interface/khronos/wayland-egl/wayland-egl.pc.in | |||
| 1542 | +Version: @PROJECT_APIVER@ | 1550 | +Version: @PROJECT_APIVER@ |
| 1543 | +Libs: -L${libdir} -lwayland-egl | 1551 | +Libs: -L${libdir} -lwayland-egl |
| 1544 | +Cflags: -I${includedir} | 1552 | +Cflags: -I${includedir} |
| 1545 | Index: git/interface/vmcs_host/CMakeLists.txt | 1553 | diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt |
| 1546 | =================================================================== | 1554 | index fde18da..6718215 100755 |
| 1547 | --- git.orig/interface/vmcs_host/CMakeLists.txt | 1555 | --- a/interface/vmcs_host/CMakeLists.txt |
| 1548 | +++ git/interface/vmcs_host/CMakeLists.txt | 1556 | +++ b/interface/vmcs_host/CMakeLists.txt |
| 1549 | @@ -9,13 +9,24 @@ add_definitions(-fno-strict-aliasing) | 1557 | @@ -9,13 +9,24 @@ add_definitions(-fno-strict-aliasing) |
| 1550 | 1558 | ||
| 1551 | include_directories(${VMCS_TARGET}/vcfiled) | 1559 | include_directories(${VMCS_TARGET}/vcfiled) |
| @@ -1576,11 +1584,11 @@ Index: git/interface/vmcs_host/CMakeLists.txt | |||
| 1576 | #add_library(bufman vc_vchi_bufman.c ) | 1584 | #add_library(bufman vc_vchi_bufman.c ) |
| 1577 | 1585 | ||
| 1578 | # OpenMAX/IL component service | 1586 | # OpenMAX/IL component service |
| 1579 | Index: git/interface/vmcs_host/vc_dispmanx.h | 1587 | diff --git a/interface/vmcs_host/vc_dispmanx.h b/interface/vmcs_host/vc_dispmanx.h |
| 1580 | =================================================================== | 1588 | index 37fdae1..fe3619a 100755 |
| 1581 | --- git.orig/interface/vmcs_host/vc_dispmanx.h | 1589 | --- a/interface/vmcs_host/vc_dispmanx.h |
| 1582 | +++ git/interface/vmcs_host/vc_dispmanx.h | 1590 | +++ b/interface/vmcs_host/vc_dispmanx.h |
| 1583 | @@ -39,6 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI | 1591 | @@ -39,6 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 1584 | #ifdef __cplusplus | 1592 | #ifdef __cplusplus |
| 1585 | extern "C" { | 1593 | extern "C" { |
| 1586 | #endif | 1594 | #endif |
| @@ -1592,7 +1600,7 @@ Index: git/interface/vmcs_host/vc_dispmanx.h | |||
| 1592 | // Same function as above, to aid migration of code. | 1600 | // Same function as above, to aid migration of code. |
| 1593 | VCHPRE_ int VCHPOST_ vc_dispman_init( void ); | 1601 | VCHPRE_ int VCHPOST_ vc_dispman_init( void ); |
| 1594 | // Stop the service from being used | 1602 | // Stop the service from being used |
| 1595 | @@ -135,6 +140,11 @@ VCHPRE_ int VCHPOST_ vc_dispmanx_resourc | 1603 | @@ -135,6 +140,11 @@ VCHPRE_ int VCHPOST_ vc_dispmanx_resource_set_palette( DISPMANX_RESOURCE_HANDLE_ |
| 1596 | // Start triggering callbacks synced to vsync | 1604 | // Start triggering callbacks synced to vsync |
| 1597 | VCHPRE_ int VCHPOST_ vc_dispmanx_vsync_callback( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg ); | 1605 | VCHPRE_ int VCHPOST_ vc_dispmanx_vsync_callback( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg ); |
| 1598 | 1606 | ||
| @@ -1604,11 +1612,11 @@ Index: git/interface/vmcs_host/vc_dispmanx.h | |||
| 1604 | #ifdef __cplusplus | 1612 | #ifdef __cplusplus |
| 1605 | } | 1613 | } |
| 1606 | #endif | 1614 | #endif |
| 1607 | Index: git/interface/vmcs_host/vc_vchi_dispmanx.c | 1615 | diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c |
| 1608 | =================================================================== | 1616 | index 7a6cdcd..eab146e 100755 |
| 1609 | --- git.orig/interface/vmcs_host/vc_vchi_dispmanx.c | 1617 | --- a/interface/vmcs_host/vc_vchi_dispmanx.c |
| 1610 | +++ git/interface/vmcs_host/vc_vchi_dispmanx.c | 1618 | +++ b/interface/vmcs_host/vc_vchi_dispmanx.c |
| 1611 | @@ -1319,3 +1319,45 @@ static void *dispmanx_notify_func( void | 1619 | @@ -1319,3 +1319,45 @@ static void *dispmanx_notify_func( void *arg ) { |
| 1612 | } | 1620 | } |
| 1613 | return 0; | 1621 | return 0; |
| 1614 | } | 1622 | } |
| @@ -1654,10 +1662,35 @@ Index: git/interface/vmcs_host/vc_vchi_dispmanx.c | |||
| 1654 | + buffer->in_use = in_use; | 1662 | + buffer->in_use = in_use; |
| 1655 | +} | 1663 | +} |
| 1656 | +#endif | 1664 | +#endif |
| 1657 | Index: git/interface/wayland/dispmanx.xml | 1665 | diff --git a/interface/vmcs_host/vc_vchi_dispmanx.h b/interface/vmcs_host/vc_vchi_dispmanx.h |
| 1658 | =================================================================== | 1666 | index b723b76..f0bae30 100644 |
| 1667 | --- a/interface/vmcs_host/vc_vchi_dispmanx.h | ||
| 1668 | +++ b/interface/vmcs_host/vc_vchi_dispmanx.h | ||
| 1669 | @@ -66,4 +66,19 @@ typedef struct { | ||
| 1670 | #define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) | ||
| 1671 | #define ELEMENT_CHANGE_TRANSFORM (1<<5) | ||
| 1672 | |||
| 1673 | +#ifdef BUILD_WAYLAND | ||
| 1674 | +/* XXX: This should be in a private header that can be included from EGL and vc_* */ | ||
| 1675 | +#include <wayland-server.h> | ||
| 1676 | +#include "interface/vmcs_host/wayland-dispmanx-server-protocol.h" | ||
| 1677 | +struct wl_dispmanx_server_buffer { | ||
| 1678 | + struct wl_resource *resource; | ||
| 1679 | + struct wl_dispmanx *dispmanx; | ||
| 1680 | + enum wl_dispmanx_format format; | ||
| 1681 | + DISPMANX_RESOURCE_HANDLE_T handle; | ||
| 1682 | + int32_t width; | ||
| 1683 | + int32_t height; | ||
| 1684 | + int in_use; | ||
| 1685 | +}; | ||
| 1686 | +#endif | ||
| 1687 | + | ||
| 1688 | #endif | ||
| 1689 | diff --git a/interface/wayland/dispmanx.xml b/interface/wayland/dispmanx.xml | ||
| 1690 | new file mode 100644 | ||
| 1691 | index 0000000..c18626d | ||
| 1659 | --- /dev/null | 1692 | --- /dev/null |
| 1660 | +++ git/interface/wayland/dispmanx.xml | 1693 | +++ b/interface/wayland/dispmanx.xml |
| 1661 | @@ -0,0 +1,123 @@ | 1694 | @@ -0,0 +1,123 @@ |
| 1662 | +<?xml version="1.0" encoding="UTF-8"?> | 1695 | +<?xml version="1.0" encoding="UTF-8"?> |
| 1663 | +<protocol name="dispmanx"> | 1696 | +<protocol name="dispmanx"> |
| @@ -1782,10 +1815,11 @@ Index: git/interface/wayland/dispmanx.xml | |||
| 1782 | + </interface> | 1815 | + </interface> |
| 1783 | + | 1816 | + |
| 1784 | +</protocol> | 1817 | +</protocol> |
| 1785 | Index: git/makefiles/cmake/Wayland.cmake | 1818 | diff --git a/makefiles/cmake/Wayland.cmake b/makefiles/cmake/Wayland.cmake |
| 1786 | =================================================================== | 1819 | new file mode 100644 |
| 1820 | index 0000000..ad90d30 | ||
| 1787 | --- /dev/null | 1821 | --- /dev/null |
| 1788 | +++ git/makefiles/cmake/Wayland.cmake | 1822 | +++ b/makefiles/cmake/Wayland.cmake |
| 1789 | @@ -0,0 +1,72 @@ | 1823 | @@ -0,0 +1,72 @@ |
| 1790 | +#============================================================================= | 1824 | +#============================================================================= |
| 1791 | +# Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 1825 | +# Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> |
| @@ -1859,3 +1893,6 @@ Index: git/makefiles/cmake/Wayland.cmake | |||
| 1859 | + list(APPEND ${_sources} "${_server_header}") | 1893 | + list(APPEND ${_sources} "${_server_header}") |
| 1860 | + set(${_sources} ${${_sources}} PARENT_SCOPE) | 1894 | + set(${_sources} ${${_sources}} PARENT_SCOPE) |
| 1861 | +endfunction() | 1895 | +endfunction() |
| 1896 | -- | ||
| 1897 | 2.19.1 | ||
| 1898 | |||
