[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-android-client-protocol.h
^
|
@@ -1,149 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#ifndef ANDROID_CLIENT_PROTOCOL_H
-#define ANDROID_CLIENT_PROTOCOL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-client.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct android_wlegl;
-struct android_wlegl_handle;
-
-extern const struct wl_interface android_wlegl_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-#ifndef ANDROID_WLEGL_ERROR_ENUM
-#define ANDROID_WLEGL_ERROR_ENUM
-enum android_wlegl_error {
- ANDROID_WLEGL_ERROR_BAD_HANDLE = 0,
- ANDROID_WLEGL_ERROR_BAD_VALUE = 1,
-};
-#endif /* ANDROID_WLEGL_ERROR_ENUM */
-
-#define ANDROID_WLEGL_CREATE_HANDLE 0
-#define ANDROID_WLEGL_CREATE_BUFFER 1
-
-static inline void
-android_wlegl_set_user_data(struct android_wlegl *android_wlegl, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) android_wlegl, user_data);
-}
-
-static inline void *
-android_wlegl_get_user_data(struct android_wlegl *android_wlegl)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) android_wlegl);
-}
-
-static inline void
-android_wlegl_destroy(struct android_wlegl *android_wlegl)
-{
- wl_proxy_destroy((struct wl_proxy *) android_wlegl);
-}
-
-static inline struct android_wlegl_handle *
-android_wlegl_create_handle(struct android_wlegl *android_wlegl, int32_t num_fds, struct wl_array *ints)
-{
- struct wl_proxy *id;
-
- id = wl_proxy_create((struct wl_proxy *) android_wlegl,
- &android_wlegl_handle_interface);
- if (!id)
- return NULL;
-
- wl_proxy_marshal((struct wl_proxy *) android_wlegl,
- ANDROID_WLEGL_CREATE_HANDLE, id, num_fds, ints);
-
- return (struct android_wlegl_handle *) id;
-}
-
-static inline struct wl_buffer *
-android_wlegl_create_buffer(struct android_wlegl *android_wlegl, int32_t width, int32_t height, int32_t stride, int32_t format, int32_t usage, struct android_wlegl_handle *native_handle)
-{
- struct wl_proxy *id;
-
- id = wl_proxy_create((struct wl_proxy *) android_wlegl,
- &wl_buffer_interface);
- if (!id)
- return NULL;
-
- wl_proxy_marshal((struct wl_proxy *) android_wlegl,
- ANDROID_WLEGL_CREATE_BUFFER, id, width, height, stride, format, usage, native_handle);
-
- return (struct wl_buffer *) id;
-}
-
-#ifndef ANDROID_WLEGL_HANDLE_ERROR_ENUM
-#define ANDROID_WLEGL_HANDLE_ERROR_ENUM
-enum android_wlegl_handle_error {
- ANDROID_WLEGL_HANDLE_ERROR_TOO_MANY_FDS = 0,
-};
-#endif /* ANDROID_WLEGL_HANDLE_ERROR_ENUM */
-
-#define ANDROID_WLEGL_HANDLE_ADD_FD 0
-#define ANDROID_WLEGL_HANDLE_DESTROY 1
-
-static inline void
-android_wlegl_handle_set_user_data(struct android_wlegl_handle *android_wlegl_handle, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) android_wlegl_handle, user_data);
-}
-
-static inline void *
-android_wlegl_handle_get_user_data(struct android_wlegl_handle *android_wlegl_handle)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) android_wlegl_handle);
-}
-
-static inline void
-android_wlegl_handle_add_fd(struct android_wlegl_handle *android_wlegl_handle, int32_t fd)
-{
- wl_proxy_marshal((struct wl_proxy *) android_wlegl_handle,
- ANDROID_WLEGL_HANDLE_ADD_FD, fd);
-}
-
-static inline void
-android_wlegl_handle_destroy(struct android_wlegl_handle *android_wlegl_handle)
-{
- wl_proxy_marshal((struct wl_proxy *) android_wlegl_handle,
- ANDROID_WLEGL_HANDLE_DESTROY);
-
- wl_proxy_destroy((struct wl_proxy *) android_wlegl_handle);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-android-protocol.c
^
|
@@ -1,70 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#include <android-config.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface android_wlegl_handle_interface;
-extern const struct wl_interface wl_buffer_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-static const struct wl_interface *types[] = {
- NULL,
- &android_wlegl_handle_interface,
- NULL,
- NULL,
- &wl_buffer_interface,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- &android_wlegl_handle_interface,
-};
-
-static const struct wl_message android_wlegl_requests[] = {
- { "create_handle", "nia", types + 1 },
- { "create_buffer", "niiiiio", types + 4 },
-};
-
-WL_EXPORT const struct wl_interface android_wlegl_interface = {
- "android_wlegl", 1,
- 2, android_wlegl_requests,
- 0, NULL,
-};
-
-static const struct wl_message android_wlegl_handle_requests[] = {
- { "add_fd", "h", types + 0 },
- { "destroy", "", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface android_wlegl_handle_interface = {
- "android_wlegl_handle", 1,
- 2, android_wlegl_handle_requests,
- 0, NULL,
-};
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-android-server-protocol.h
^
|
@@ -1,142 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#ifndef ANDROID_SERVER_PROTOCOL_H
-#define ANDROID_SERVER_PROTOCOL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-util.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct android_wlegl;
-struct android_wlegl_handle;
-
-extern const struct wl_interface android_wlegl_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-#ifndef ANDROID_WLEGL_ERROR_ENUM
-#define ANDROID_WLEGL_ERROR_ENUM
-enum android_wlegl_error {
- ANDROID_WLEGL_ERROR_BAD_HANDLE = 0,
- ANDROID_WLEGL_ERROR_BAD_VALUE = 1,
-};
-#endif /* ANDROID_WLEGL_ERROR_ENUM */
-
-/**
- * android_wlegl - Android EGL graphics buffer support
- * @create_handle: Create an Android native_handle_t object
- * @create_buffer: Create a wl_buffer from the native handle
- *
- * Interface used in the Android wrapper libEGL to share graphics buffers
- * between the server and the client.
- */
-struct android_wlegl_interface {
- /**
- * create_handle - Create an Android native_handle_t object
- * @id: (none)
- * @num_fds: (none)
- * @ints: an array of int32_t
- *
- * This creator method initialises the native_handle_t object
- * with everything except the file descriptors, which have to be
- * submitted separately.
- */
- void (*create_handle)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id,
- int32_t num_fds,
- struct wl_array *ints);
- /**
- * create_buffer - Create a wl_buffer from the native handle
- * @id: (none)
- * @width: (none)
- * @height: (none)
- * @stride: (none)
- * @format: (none)
- * @usage: (none)
- * @native_handle: (none)
- *
- * Pass the Android native_handle_t to the server and attach it
- * to the new wl_buffer object.
- *
- * The android_wlegl_handle object must be destroyed immediately
- * after this request.
- */
- void (*create_buffer)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id,
- int32_t width,
- int32_t height,
- int32_t stride,
- int32_t format,
- int32_t usage,
- struct wl_resource *native_handle);
-};
-
-#ifndef ANDROID_WLEGL_HANDLE_ERROR_ENUM
-#define ANDROID_WLEGL_HANDLE_ERROR_ENUM
-enum android_wlegl_handle_error {
- ANDROID_WLEGL_HANDLE_ERROR_TOO_MANY_FDS = 0,
-};
-#endif /* ANDROID_WLEGL_HANDLE_ERROR_ENUM */
-
-/**
- * android_wlegl_handle - An Android native_handle_t object
- * @add_fd: (none)
- * @destroy: (none)
- *
- * The Android native_handle_t is a semi-opaque object, that contains an
- * EGL implementation specific number of int32 values and file descriptors.
- *
- * We cannot send a variable size array of file descriptors over the
- * Wayland protocol, so we send them one by one.
- */
-struct android_wlegl_handle_interface {
- /**
- * add_fd - (none)
- * @fd: (none)
- */
- void (*add_fd)(struct wl_client *client,
- struct wl_resource *resource,
- int32_t fd);
- /**
- * destroy - (none)
- */
- void (*destroy)(struct wl_client *client,
- struct wl_resource *resource);
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/libhybris/hybris/include/hybris/internal/binding.h
^
|
@@ -1,448 +0,0 @@
-
-/**
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- * 2012 Canonical Ltd
- * 2013 Jolla Ltd.
- *
- * Auto-generated via "generate_wrapper_macros.py"
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-
-#ifndef HYBRIS_BINDING_H_
-#define HYBRIS_BINDING_H_
-
-/* floating_point_abi.h defines FP_ATTRIB */
-#include <hybris/internal/floating_point_abi.h>
-
-void *android_dlopen(const char *filename, int flag);
-void *android_dlsym(void *name, const char *symbol);
-int android_dlclose(void *handle);
-const char *android_dlerror(void);
-int android_dladdr(const void *addr, void *info);
-
-
-
-/**
- * XXX AUTO-GENERATED FILE XXX
- *
- * Do not edit this file directly, but update the templates in
- * utils/generate_wrapper_macros.py and run it again to build
- * an updated version of this header file:
- *
- * python utils/generate_wrapper_macros.py > \
- * hybris/include/hybris/internal/binding.h
- *
- * If you need macros with more arguments, just customize the
- * MAX_ARGS variable in generate_wrapper_macros.py.
- *
- * XXX AUTO-GENERATED FILE XXX
- **/
-
-
-#define HYBRIS_DLSYSM(name, fptr, sym) \
- if (!name##_handle) \
- hybris_##name##_initialize(); \
- if (*(fptr) == NULL) \
- { \
- *(fptr) = (void *) android_dlsym(name##_handle, sym); \
- }
-
-#define HYBRIS_LIBRARY_INITIALIZE(name, path) \
- void *name##_handle; \
- void hybris_##name##_initialize() \
- { \
- name##_handle = android_dlopen(path, RTLD_LAZY); \
- }
-
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
- return_type symbol() \
- { \
- static return_type (*f)() FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION1(name, return_type, symbol, a1) \
- return_type symbol(a1 n1) \
- { \
- static return_type (*f)(a1) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION2(name, return_type, symbol, a1, a2) \
- return_type symbol(a1 n1, a2 n2) \
- { \
- static return_type (*f)(a1, a2) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION3(name, return_type, symbol, a1, a2, a3) \
- return_type symbol(a1 n1, a2 n2, a3 n3) \
- { \
- static return_type (*f)(a1, a2, a3) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION4(name, return_type, symbol, a1, a2, a3, a4) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4) \
- { \
- static return_type (*f)(a1, a2, a3, a4) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION5(name, return_type, symbol, a1, a2, a3, a4, a5) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION6(name, return_type, symbol, a1, a2, a3, a4, a5, a6) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION7(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION8(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION9(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION10(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION11(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION12(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION13(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION14(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13, a14 n14) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) FP_ATTRIB = NULL; \
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/libhybris/hybris/include/hybris/internal/floating_point_abi.h
^
|
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2013 Jolla Ltd.
- * Contact: Thomas Perl <thomas.perl@jollamobile.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef HYBRIS_FLOATING_POINT_ABI_H_
-#define HYBRIS_FLOATING_POINT_ABI_H_
-
-/**
- * Make sure to use FP_ATTRIB on all functions that are loaded from
- * Android (bionic libc) libraries to make sure floating point arguments
- * are passed the right way.
- *
- * See: http://wiki.debian.org/ArmHardFloatPort/VfpComparison
- * http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
- *
- * It doesn't hurt to have it added for non-floating point arguments and
- * return types, even though it does not really have any effect.
- *
- * If you use the convenience macros in hybris/internal/binding.h, your
- * wrapper functions will automatically make use of this attribute.
- **/
-
-#ifdef __ARM_PCS_VFP
-# define FP_ATTRIB __attribute__((pcs("aapcs")))
-#else
-# define FP_ATTRIB
-#endif
-
-#endif /* HYBRIS_FLOATING_POINT_ABI_H_ */
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/upstream/hybris/egl/platforms/common/wayland-android-client-protocol.h
^
|
@@ -1,149 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#ifndef ANDROID_CLIENT_PROTOCOL_H
-#define ANDROID_CLIENT_PROTOCOL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-client.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct android_wlegl;
-struct android_wlegl_handle;
-
-extern const struct wl_interface android_wlegl_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-#ifndef ANDROID_WLEGL_ERROR_ENUM
-#define ANDROID_WLEGL_ERROR_ENUM
-enum android_wlegl_error {
- ANDROID_WLEGL_ERROR_BAD_HANDLE = 0,
- ANDROID_WLEGL_ERROR_BAD_VALUE = 1,
-};
-#endif /* ANDROID_WLEGL_ERROR_ENUM */
-
-#define ANDROID_WLEGL_CREATE_HANDLE 0
-#define ANDROID_WLEGL_CREATE_BUFFER 1
-
-static inline void
-android_wlegl_set_user_data(struct android_wlegl *android_wlegl, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) android_wlegl, user_data);
-}
-
-static inline void *
-android_wlegl_get_user_data(struct android_wlegl *android_wlegl)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) android_wlegl);
-}
-
-static inline void
-android_wlegl_destroy(struct android_wlegl *android_wlegl)
-{
- wl_proxy_destroy((struct wl_proxy *) android_wlegl);
-}
-
-static inline struct android_wlegl_handle *
-android_wlegl_create_handle(struct android_wlegl *android_wlegl, int32_t num_fds, struct wl_array *ints)
-{
- struct wl_proxy *id;
-
- id = wl_proxy_create((struct wl_proxy *) android_wlegl,
- &android_wlegl_handle_interface);
- if (!id)
- return NULL;
-
- wl_proxy_marshal((struct wl_proxy *) android_wlegl,
- ANDROID_WLEGL_CREATE_HANDLE, id, num_fds, ints);
-
- return (struct android_wlegl_handle *) id;
-}
-
-static inline struct wl_buffer *
-android_wlegl_create_buffer(struct android_wlegl *android_wlegl, int32_t width, int32_t height, int32_t stride, int32_t format, int32_t usage, struct android_wlegl_handle *native_handle)
-{
- struct wl_proxy *id;
-
- id = wl_proxy_create((struct wl_proxy *) android_wlegl,
- &wl_buffer_interface);
- if (!id)
- return NULL;
-
- wl_proxy_marshal((struct wl_proxy *) android_wlegl,
- ANDROID_WLEGL_CREATE_BUFFER, id, width, height, stride, format, usage, native_handle);
-
- return (struct wl_buffer *) id;
-}
-
-#ifndef ANDROID_WLEGL_HANDLE_ERROR_ENUM
-#define ANDROID_WLEGL_HANDLE_ERROR_ENUM
-enum android_wlegl_handle_error {
- ANDROID_WLEGL_HANDLE_ERROR_TOO_MANY_FDS = 0,
-};
-#endif /* ANDROID_WLEGL_HANDLE_ERROR_ENUM */
-
-#define ANDROID_WLEGL_HANDLE_ADD_FD 0
-#define ANDROID_WLEGL_HANDLE_DESTROY 1
-
-static inline void
-android_wlegl_handle_set_user_data(struct android_wlegl_handle *android_wlegl_handle, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) android_wlegl_handle, user_data);
-}
-
-static inline void *
-android_wlegl_handle_get_user_data(struct android_wlegl_handle *android_wlegl_handle)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) android_wlegl_handle);
-}
-
-static inline void
-android_wlegl_handle_add_fd(struct android_wlegl_handle *android_wlegl_handle, int32_t fd)
-{
- wl_proxy_marshal((struct wl_proxy *) android_wlegl_handle,
- ANDROID_WLEGL_HANDLE_ADD_FD, fd);
-}
-
-static inline void
-android_wlegl_handle_destroy(struct android_wlegl_handle *android_wlegl_handle)
-{
- wl_proxy_marshal((struct wl_proxy *) android_wlegl_handle,
- ANDROID_WLEGL_HANDLE_DESTROY);
-
- wl_proxy_destroy((struct wl_proxy *) android_wlegl_handle);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/upstream/hybris/egl/platforms/common/wayland-android-protocol.c
^
|
@@ -1,70 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#include <android-config.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface android_wlegl_handle_interface;
-extern const struct wl_interface wl_buffer_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-static const struct wl_interface *types[] = {
- NULL,
- &android_wlegl_handle_interface,
- NULL,
- NULL,
- &wl_buffer_interface,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- &android_wlegl_handle_interface,
-};
-
-static const struct wl_message android_wlegl_requests[] = {
- { "create_handle", "nia", types + 1 },
- { "create_buffer", "niiiiio", types + 4 },
-};
-
-WL_EXPORT const struct wl_interface android_wlegl_interface = {
- "android_wlegl", 1,
- 2, android_wlegl_requests,
- 0, NULL,
-};
-
-static const struct wl_message android_wlegl_handle_requests[] = {
- { "add_fd", "h", types + 0 },
- { "destroy", "", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface android_wlegl_handle_interface = {
- "android_wlegl_handle", 1,
- 2, android_wlegl_handle_requests,
- 0, NULL,
-};
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/upstream/hybris/egl/platforms/common/wayland-android-server-protocol.h
^
|
@@ -1,142 +0,0 @@
-/*
- * Copyright © 2012 Collabora, Ltd.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#ifndef ANDROID_SERVER_PROTOCOL_H
-#define ANDROID_SERVER_PROTOCOL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-util.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct android_wlegl;
-struct android_wlegl_handle;
-
-extern const struct wl_interface android_wlegl_interface;
-extern const struct wl_interface android_wlegl_handle_interface;
-
-#ifndef ANDROID_WLEGL_ERROR_ENUM
-#define ANDROID_WLEGL_ERROR_ENUM
-enum android_wlegl_error {
- ANDROID_WLEGL_ERROR_BAD_HANDLE = 0,
- ANDROID_WLEGL_ERROR_BAD_VALUE = 1,
-};
-#endif /* ANDROID_WLEGL_ERROR_ENUM */
-
-/**
- * android_wlegl - Android EGL graphics buffer support
- * @create_handle: Create an Android native_handle_t object
- * @create_buffer: Create a wl_buffer from the native handle
- *
- * Interface used in the Android wrapper libEGL to share graphics buffers
- * between the server and the client.
- */
-struct android_wlegl_interface {
- /**
- * create_handle - Create an Android native_handle_t object
- * @id: (none)
- * @num_fds: (none)
- * @ints: an array of int32_t
- *
- * This creator method initialises the native_handle_t object
- * with everything except the file descriptors, which have to be
- * submitted separately.
- */
- void (*create_handle)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id,
- int32_t num_fds,
- struct wl_array *ints);
- /**
- * create_buffer - Create a wl_buffer from the native handle
- * @id: (none)
- * @width: (none)
- * @height: (none)
- * @stride: (none)
- * @format: (none)
- * @usage: (none)
- * @native_handle: (none)
- *
- * Pass the Android native_handle_t to the server and attach it
- * to the new wl_buffer object.
- *
- * The android_wlegl_handle object must be destroyed immediately
- * after this request.
- */
- void (*create_buffer)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id,
- int32_t width,
- int32_t height,
- int32_t stride,
- int32_t format,
- int32_t usage,
- struct wl_resource *native_handle);
-};
-
-#ifndef ANDROID_WLEGL_HANDLE_ERROR_ENUM
-#define ANDROID_WLEGL_HANDLE_ERROR_ENUM
-enum android_wlegl_handle_error {
- ANDROID_WLEGL_HANDLE_ERROR_TOO_MANY_FDS = 0,
-};
-#endif /* ANDROID_WLEGL_HANDLE_ERROR_ENUM */
-
-/**
- * android_wlegl_handle - An Android native_handle_t object
- * @add_fd: (none)
- * @destroy: (none)
- *
- * The Android native_handle_t is a semi-opaque object, that contains an
- * EGL implementation specific number of int32 values and file descriptors.
- *
- * We cannot send a variable size array of file descriptors over the
- * Wayland protocol, so we send them one by one.
- */
-struct android_wlegl_handle_interface {
- /**
- * add_fd - (none)
- * @fd: (none)
- */
- void (*add_fd)(struct wl_client *client,
- struct wl_resource *resource,
- int32_t fd);
- /**
- * destroy - (none)
- */
- void (*destroy)(struct wl_client *client,
- struct wl_resource *resource);
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/upstream/hybris/include/hybris/internal/binding.h
^
|
@@ -1,448 +0,0 @@
-
-/**
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- * 2012 Canonical Ltd
- * 2013 Jolla Ltd.
- *
- * Auto-generated via "generate_wrapper_macros.py"
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- **/
-
-#ifndef HYBRIS_BINDING_H_
-#define HYBRIS_BINDING_H_
-
-/* floating_point_abi.h defines FP_ATTRIB */
-#include <hybris/internal/floating_point_abi.h>
-
-void *android_dlopen(const char *filename, int flag);
-void *android_dlsym(void *name, const char *symbol);
-int android_dlclose(void *handle);
-const char *android_dlerror(void);
-int android_dladdr(const void *addr, void *info);
-
-
-
-/**
- * XXX AUTO-GENERATED FILE XXX
- *
- * Do not edit this file directly, but update the templates in
- * utils/generate_wrapper_macros.py and run it again to build
- * an updated version of this header file:
- *
- * python utils/generate_wrapper_macros.py > \
- * hybris/include/hybris/internal/binding.h
- *
- * If you need macros with more arguments, just customize the
- * MAX_ARGS variable in generate_wrapper_macros.py.
- *
- * XXX AUTO-GENERATED FILE XXX
- **/
-
-
-#define HYBRIS_DLSYSM(name, fptr, sym) \
- if (!name##_handle) \
- hybris_##name##_initialize(); \
- if (*(fptr) == NULL) \
- { \
- *(fptr) = (void *) android_dlsym(name##_handle, sym); \
- }
-
-#define HYBRIS_LIBRARY_INITIALIZE(name, path) \
- void *name##_handle; \
- void hybris_##name##_initialize() \
- { \
- name##_handle = android_dlopen(path, RTLD_LAZY); \
- }
-
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
- return_type symbol() \
- { \
- static return_type (*f)() FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION1(name, return_type, symbol, a1) \
- return_type symbol(a1 n1) \
- { \
- static return_type (*f)(a1) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION2(name, return_type, symbol, a1, a2) \
- return_type symbol(a1 n1, a2 n2) \
- { \
- static return_type (*f)(a1, a2) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION3(name, return_type, symbol, a1, a2, a3) \
- return_type symbol(a1 n1, a2 n2, a3 n3) \
- { \
- static return_type (*f)(a1, a2, a3) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION4(name, return_type, symbol, a1, a2, a3, a4) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4) \
- { \
- static return_type (*f)(a1, a2, a3, a4) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION5(name, return_type, symbol, a1, a2, a3, a4, a5) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION6(name, return_type, symbol, a1, a2, a3, a4, a5, a6) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION7(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION8(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION9(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION10(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION11(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION12(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION13(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) FP_ATTRIB = NULL; \
- HYBRIS_DLSYSM(name, &f, #symbol); \
- return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13); \
- }
-
-
-#define HYBRIS_IMPLEMENT_FUNCTION14(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) \
- return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13, a14 n14) \
- { \
- static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) FP_ATTRIB = NULL; \
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.3.tar.bz2/upstream/hybris/include/hybris/internal/floating_point_abi.h
^
|
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2013 Jolla Ltd.
- * Contact: Thomas Perl <thomas.perl@jollamobile.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef HYBRIS_FLOATING_POINT_ABI_H_
-#define HYBRIS_FLOATING_POINT_ABI_H_
-
-/**
- * Make sure to use FP_ATTRIB on all functions that are loaded from
- * Android (bionic libc) libraries to make sure floating point arguments
- * are passed the right way.
- *
- * See: http://wiki.debian.org/ArmHardFloatPort/VfpComparison
- * http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
- *
- * It doesn't hurt to have it added for non-floating point arguments and
- * return types, even though it does not really have any effect.
- *
- * If you use the convenience macros in hybris/internal/binding.h, your
- * wrapper functions will automatically make use of this attribute.
- **/
-
-#ifdef __ARM_PCS_VFP
-# define FP_ATTRIB __attribute__((pcs("aapcs")))
-#else
-# define FP_ATTRIB
-#endif
-
-#endif /* HYBRIS_FLOATING_POINT_ABI_H_ */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/.gitignore
^
|
@@ -28,9 +28,42 @@
aclocal-copy
arm-*-linux-gnueabi-libtool
+# Generated .pc, .h and .c files
+hybris/camera/libcamera.pc
+hybris/documentation.list
+hybris/egl/egl.pc
+hybris/egl/platforms/common/hybris-egl-platform.pc
+hybris/egl/platforms/common/wayland-android-client-protocol.h
+hybris/egl/platforms/common/wayland-android-protocol.c
+hybris/egl/platforms/common/wayland-android-server-protocol.h
+hybris/egl/platforms/common/wayland-egl.pc
+hybris/egl/platforms/hwcomposer/hwcomposer-egl.pc
+hybris/glesv1/glesv1_cm.pc
+hybris/glesv2/glesv2.pc
+hybris/hardware/libhardware.pc
+hybris/input/libis.pc
+hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.pc
+hybris/libnfc_nxp/libnfc_nxp.pc
+hybris/libsync/libsync.pc
+hybris/properties/libandroid-properties.pc
+hybris/sf/libsf.pc
+hybris/vibrator/libvibrator.pc
+
+# Util binaries
+hybris/utils/getprop
+hybris/utils/setprop
+
+# Test binaries
+hybris/tests/test_camera
+hybris/tests/test_egl_configs
+hybris/tests/test_gps
+hybris/tests/test_input
+hybris/tests/test_nfc
+hybris/tests/test_sf
hybris/tests/test_egl
hybris/tests/test_glesv2
hybris/tests/test_lights
hybris/tests/test_offscreen_rendering
hybris/tests/test_sensors
hybris/tests/test_ui
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/camera/camera.c
^
|
@@ -21,7 +21,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/camera/camera_compatibility_layer.h>
#include <hybris/camera/camera_compatibility_layer_capabilities.h>
#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/common/dlfcn.c
^
|
@@ -16,7 +16,7 @@
*/
#include <../include/hybris/dlfcn/dlfcn.h>
-#include <../include/hybris/internal/binding.h>
+#include <../include/hybris/common/binding.h>
void *hybris_dlopen(const char *filename, int flag)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -2,7 +2,6 @@
* Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
* Copyright (c) 2012 Canonical Ltd
* Copyright (c) 2013 Christophe Chapuis <chris.chapuis@gmail.com>
- * Copyright (c) 2013 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +17,7 @@
*
*/
-#include <hybris/internal/floating_point_abi.h>
+#include <hybris/common/binding.h>
#include "hooks_shm.h"
@@ -33,15 +32,17 @@
#include <strings.h>
#include <dlfcn.h>
#include <pthread.h>
+#include <sys/xattr.h>
+#include <grp.h>
#include <signal.h>
#include <errno.h>
#include <dirent.h>
#include <sys/types.h>
-#include <sys/xattr.h>
-#include <grp.h>
+#include <stdarg.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#include <fcntl.h>
#include <netdb.h>
#include <unistd.h>
@@ -496,7 +497,6 @@
*((int *)__mutex) = (int) realmutex;
}
- /* TODO: Android uses CLOCK_MONOTONIC here but I am not sure which one to use */
clock_gettime(CLOCK_REALTIME, &tv);
tv.tv_sec += __msecs/1000;
tv.tv_nsec += (__msecs % 1000) * 1000000;
@@ -713,7 +713,6 @@
*((unsigned int *) mutex) = (unsigned int) realmutex;
}
- /* TODO: Android uses CLOCK_MONOTONIC here but I am not sure which one to use */
struct timespec tv;
clock_gettime(CLOCK_REALTIME, &tv);
tv.tv_sec += reltime->tv_sec;
@@ -1263,9 +1262,69 @@
extern int __cxa_atexit(void (*)(void*), void*, void*);
+struct open_redirect {
+ const char *from;
+ const char *to;
+};
+
+struct open_redirect open_redirects[] = {
+ { "/dev/log/main", "/dev/log_main" },
+ { "/dev/log/radio", "/dev/log_radio" },
+ { "/dev/log/system", "/dev/log_system" },
+ { "/dev/log/events", "/dev/log_events" },
+ { NULL, NULL }
+};
+
+int my_open(const char *pathname, int flags, ...)
+{
+ va_list ap;
+ mode_t mode = 0;
+ const char *target_path = pathname;
+
+ if (pathname != NULL) {
+ struct open_redirect *entry = &open_redirects[0];
+ while (entry->from != NULL) {
+ if (strcmp(pathname, entry->from) == 0) {
+ target_path = entry->to;
+ break;
+ }
+ entry++;
+ }
+ }
+
+ if (flags & O_CREAT) {
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+ }
+
+ return open(target_path, flags, mode);
+}
+
+/**
+ * NOTE: Normally we don't have to wrap __system_property_get (libc.so) as it is only used
+ * through the property_get (libcutils.so) function. However when property_get is used
+ * internally in libcutils.so we don't have any chance to hook our replacement in.
+ * Therefore we have to hook __system_property_get too and just replace it with the
+ * implementation of our internal property handling
+ */
+
+int my_system_property_get(const char *name, const char *value)
+{
+ return property_get(name, value, NULL);
+}
+
+static __thread void *tls_hooks[16];
+
+void *__get_tls_hooks()
+{
+ return tls_hooks;
+}
+
static struct _hook hooks[] = {
{"property_get", property_get },
{"property_set", property_set },
+ {"__system_property_get", my_system_property_get },
{"getenv", getenv },
{"printf", printf },
{"malloc", my_malloc },
@@ -1331,15 +1390,7 @@
{"strncasecmp",strncasecmp},
/* dirent.h */
{"opendir", opendir},
- {"fdopendir", fdopendir},
{"closedir", closedir},
- {"readdir", my_readdir},
- {"readdir_r", my_readdir_r},
- {"rewinddir", rewinddir},
- {"seekdir", seekdir},
- {"telldir", telldir},
- {"dirfd", dirfd},
- // TODO: scandir, scandirat, alphasort, versionsort
/* pthread.h */
{"pthread_atfork", pthread_atfork},
{"pthread_create", my_pthread_create},
@@ -1359,7 +1410,7 @@
{"pthread_mutex_lock_timeout_np", my_pthread_mutex_lock_timeout_np},
{"pthread_mutexattr_init", pthread_mutexattr_init},
{"pthread_mutexattr_destroy", pthread_mutexattr_destroy},
- {"pthread_mutexattr_getttype", pthread_mutexattr_gettype},
+ {"pthread_mutexattr_gettype", pthread_mutexattr_gettype},
{"pthread_mutexattr_settype", pthread_mutexattr_settype},
{"pthread_mutexattr_getpshared", pthread_mutexattr_getpshared},
{"pthread_mutexattr_setpshared", my_pthread_mutexattr_setpshared},
@@ -1481,6 +1532,25 @@
{"gethostent", gethostent},
{"strftime", strftime},
{"sysconf", my_sysconf},
+ {"dlopen", android_dlopen},
+ {"dlerror", android_dlerror},
+ {"dlsym", android_dlsym},
+ {"dladdr", android_dladdr},
+ {"dlclose", android_dlclose},
+ /* dirent.h */
+ {"opendir", opendir},
+ {"fdopendir", fdopendir},
+ {"closedir", closedir},
+ {"readdir", my_readdir},
+ {"readdir_r", my_readdir_r},
+ {"rewinddir", rewinddir},
+ {"seekdir", seekdir},
+ {"telldir", telldir},
+ {"dirfd", dirfd},
+ /* fcntl.h */
+ {"open", my_open},
+ // TODO: scandir, scandirat, alphasort, versionsort
+ {"__get_tls_hooks", __get_tls_hooks},
{"sscanf", sscanf},
{"scanf", scanf},
{"vscanf", vscanf},
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/common/jb/Makefile.am
^
|
@@ -18,6 +18,7 @@
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS) \
-I$(top_srcdir)/common \
+ -D_GNU_SOURCE \
-DLINKER_TEXT_BASE=0xB0000100 \
-DLINKER_AREA_SIZE=0x01000000 \
-DDEFAULT_HYBRIS_LD_LIBRARY_PATH="\"@DEFAULT_HYBRIS_LD_LIBRARY_PATH@\"" \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/common/jb/dlfcn.c
^
|
@@ -43,7 +43,7 @@
#define likely(expr) __builtin_expect (expr, 1)
#define unlikely(expr) __builtin_expect (expr, 0)
-static pthread_mutex_t dl_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t dl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static void set_dlerror(int err)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -67,6 +67,11 @@
[wayland="no"])
AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"])
+AC_ARG_ENABLE(wayland_serverside_buffers,
+ [ --enable-wayland_serverside_buffers Enable serverside buffer allocation for wayland (default=enabled)],
+ [wayland_serverside_buffers=$enableval],
+ [wayland_serverside_buffers=yes])
+AM_CONDITIONAL( [WANT_WL_SERVERSIDE_BUFFERS], [test x"$wayland_serverside_buffers" = x"yes"])
AC_ARG_ENABLE(arch,
[ --enable-arch[=arch] Compile specific CPU target(default=arm)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/egl.c
^
|
@@ -17,6 +17,8 @@
/* EGL function pointers */
#define EGL_EGLEXT_PROTOTYPES
+/* For RTLD_DEFAULT */
+#define _GNU_SOURCE
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
@@ -30,7 +32,7 @@
#include <assert.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <string.h>
#include <system/window.h>
@@ -38,6 +40,9 @@
static void *_libegl = NULL;
static void *_libgles = NULL;
+static void *_hybris_libgles1 = NULL;
+static void *_hybris_libgles2 = NULL;
+static int _egl_context_client_version = 1;
static EGLint (*_eglGetError)(void) = NULL;
@@ -134,8 +139,8 @@
egl_helper_get_mapping,
};
-#define EGL_DLSYM(fptr, sym) do { if (_libegl == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libegl, sym); } } while (0)
-#define GLESv2_DLSYM(fptr, sym) do { if (_libgles == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libgles, sym); } } while (0)
+#define EGL_DLSYM(fptr, sym) do { if (_libegl == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libegl, sym); } } while (0)
+#define GLESv2_DLSYM(fptr, sym) do { if (_libgles == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libgles, sym); } } while (0)
EGLint eglGetError(void)
{
@@ -143,40 +148,33 @@
return (*_eglGetError)();
}
-struct _eglDisplayMapping {
- EGLNativeDisplayType ndt;
- EGLDisplay display;
-};
-
#define _EGL_MAX_DISPLAYS 100
-struct _eglDisplayMapping *_displayMappings[_EGL_MAX_DISPLAYS];
+struct _EGLDisplay *_displayMappings[_EGL_MAX_DISPLAYS];
-void _addMapping(EGLNativeDisplayType display_id, EGLDisplay display)
+void _addMapping(struct _EGLDisplay *display_id)
{
int i;
for (i = 0; i < _EGL_MAX_DISPLAYS; i++)
{
if (_displayMappings[i] == NULL)
{
- _displayMappings[i] = (struct _eglDisplayMapping *) malloc(sizeof(struct _eglDisplayMapping));
- _displayMappings[i]->ndt = display_id;
- _displayMappings[i]->display = display;
+ _displayMappings[i] = display_id;
return;
}
}
}
-EGLNativeDisplayType _egldisplay2NDT(EGLDisplay display)
+struct _EGLDisplay *hybris_egl_display_get_mapping(EGLDisplay display)
{
int i;
for (i = 0; i < _EGL_MAX_DISPLAYS; i++)
{
if (_displayMappings[i])
{
- if (_displayMappings[i]->display == display)
+ if (_displayMappings[i]->dpy == display)
{
- return _displayMappings[i]->ndt;
+ return _displayMappings[i];
}
}
@@ -189,17 +187,22 @@
EGL_DLSYM(&_eglGetDisplay, "eglGetDisplay");
EGLNativeDisplayType real_display;
- if (!ws_IsValidDisplay(display_id))
- {
- return EGL_NO_DISPLAY;
- }
-
real_display = (*_eglGetDisplay)(EGL_DEFAULT_DISPLAY);
if (real_display == EGL_NO_DISPLAY)
{
return EGL_NO_DISPLAY;
}
- _addMapping(display_id, real_display);
+
+ struct _EGLDisplay *dpy = hybris_egl_display_get_mapping(real_display);
+ if (!dpy) {
+ dpy = ws_GetDisplay(display_id);
+ if (!dpy) {
+ return EGL_NO_DISPLAY;
+ }
+ dpy->dpy = real_display;
+ _addMapping(dpy);
+ }
+
return real_display;
}
@@ -212,6 +215,9 @@
EGLBoolean eglTerminate(EGLDisplay dpy)
{
EGL_DLSYM(&_eglTerminate, "eglTerminate");
+
+ struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
+ ws_Terminate(display);
return (*_eglTerminate)(dpy);
}
@@ -252,12 +258,18 @@
{
EGL_DLSYM(&_eglCreateWindowSurface, "eglCreateWindowSurface");
- win = ws_CreateWindow(win, _egldisplay2NDT(dpy));
-
+ HYBRIS_TRACE_BEGIN("hybris-egl", "eglCreateWindowSurface", "");
+ struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
+ win = ws_CreateWindow(win, display);
+
assert(((struct ANativeWindowBuffer *) win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC);
+ HYBRIS_TRACE_BEGIN("native-egl", "eglCreateWindowSurface", "");
EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, win, attrib_list);
+ HYBRIS_TRACE_END("native-egl", "eglCreateWindowSurface", "");
egl_helper_push_mapping(result, win);
+
+ HYBRIS_TRACE_END("hybris-egl", "eglCreateWindowSurface", "");
return result;
}
@@ -353,8 +365,26 @@
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
{
+ EGLBoolean ret;
+ EGLSurface surface;
+ EGLNativeWindowType win;
+ HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapInterval", "=%d", interval);
+
+ /* Some egl implementations don't pass through the setSwapInterval
+ * call. Since we may support various swap intervals internally, we'll
+ * call it anyway and then give the wrapped egl implementation a chance
+ * to chage it. */
+ EGL_DLSYM(&_eglGetCurrentSurface, "eglGetCurrentSurface");
+ surface = (*_eglGetCurrentSurface)(EGL_DRAW);
+ if (egl_helper_has_mapping(surface))
+ ws_setSwapInterval(dpy, egl_helper_get_mapping(surface), interval);
+
+ HYBRIS_TRACE_BEGIN("native-egl", "eglSwapInterval", "=%d", interval);
EGL_DLSYM(&_eglSwapInterval, "eglSwapInterval");
- return (*_eglSwapInterval)(dpy, interval);
+ ret = (*_eglSwapInterval)(dpy, interval);
+ HYBRIS_TRACE_END("native-egl", "eglSwapInterval", "");
+ HYBRIS_TRACE_END("hybris-egl", "eglSwapInterval", "");
+ return ret;
}
EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
@@ -362,6 +392,15 @@
const EGLint *attrib_list)
{
EGL_DLSYM(&_eglCreateContext, "eglCreateContext");
+
+ EGLint *p = attrib_list;
+ while (p != NULL && *p != EGL_NONE) {
+ if (*p == EGL_CONTEXT_CLIENT_VERSION) {
+ _egl_context_client_version = p[1];
+ }
+ p += 2;
+ }
+
return (*_eglCreateContext)(dpy, config, share_context, attrib_list);
}
@@ -412,15 +451,33 @@
EGLBoolean eglWaitNative(EGLint engine)
{
EGL_DLSYM(&_eglWaitNative, "eglWaitNative");
- return (*_eglWaitNative)(engine);
+ return (*_eglWaitNative)(engine);
+}
+
+EGLBoolean _my_eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
+{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/eglhybris.h
^
|
@@ -35,6 +35,8 @@
int hybris_egl_has_mapping(EGLSurface surface);
EGLNativeWindowType hybris_egl_get_mapping(EGLSurface surface);
+struct _EGLDisplay *hybris_egl_display_get_mapping(EGLDisplay dpy);
+
#ifdef __cplusplus
}
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/eglplatformcommon.cpp
^
|
@@ -82,6 +82,8 @@
snprintf(b, 1020, "vaddr.%p.%p.%i.%is%ix%ix%i", buf, vaddr, cnt, buf->width, buf->stride, buf->height, bytes_pp);
cnt++;
int fd = ::open(b, O_WRONLY|O_CREAT, S_IRWXU);
+ if(fd < 0)
+ return;
::write(fd, vaddr, buf->stride * buf->height * bytes_pp);
::close(fd);
@@ -93,7 +95,7 @@
extern "C" EGLBoolean eglplatformcommon_eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
assert(my_gralloc != NULL);
- server_wlegl_create(display, my_gralloc);
+ server_wlegl_create(display, my_gralloc, my_alloc);
return EGL_TRUE;
}
@@ -103,7 +105,7 @@
}
extern "C" EGLBoolean eglplatformcommon_eglQueryWaylandBufferWL(EGLDisplay dpy,
- struct wl_buffer *buffer, EGLint attribute, EGLint *value)
+ struct wl_resource *buffer, EGLint attribute, EGLint *value)
{
server_wlegl_buffer *buf = server_wlegl_buffer_from(buffer);
ANativeWindowBuffer* anwb = (ANativeWindowBuffer *) buf->buf;
@@ -132,8 +134,73 @@
return EGL_FALSE ;
}
+// Added as part of EGL_HYBRIS_WL_acquire_native_buffer. Buffers are released
+// and decRef'ed using eglHybrisReleaseNativeBuffer
+extern "C" EGLBoolean eglplatformcommon_eglHybrisAcquireNativeBufferWL(EGLDisplay dpy, struct wl_resource *wlBuffer, EGLClientBuffer *buffer)
+ {
+ if (!buffer)
+ return EGL_FALSE;
+ server_wlegl_buffer *buf = server_wlegl_buffer_from(wlBuffer);
+ if (!buf->buf->isAllocated()) {
+ // We only return the handles from buffers which are allocated server side. This is because some
+ // hardware compositors have problems with client-side allocated buffers.
+ buffer = 0;
+ return EGL_FALSE;
+ }
+ ANativeWindowBuffer* anwb = (ANativeWindowBuffer *) buf->buf;
+ anwb->common.incRef(&anwb->common);
+ *buffer = (EGLClientBuffer *) anwb;
+ return EGL_TRUE;
+}
+
#endif
+// Added as part of EGL_HYBRIS_native_buffer2
+extern "C" EGLBoolean eglplatformcommon_eglHybrisNativeBufferHandle(EGLDisplay dpy, EGLClientBuffer buffer, void **handle)
+{
+ if (!buffer || !handle)
+ return EGL_FALSE;
+ ANativeWindowBuffer *anwb = (ANativeWindowBuffer *) buffer;
+ *handle = (void *) anwb->handle;
+ return EGL_TRUE;
+}
+
+extern "C" void eglplatformcommon_eglHybrisGetNativeBufferInfo(EGLClientBuffer buffer, int *num_ints, int *num_fds)
+{
+ RemoteWindowBuffer *buf = static_cast<RemoteWindowBuffer *>((ANativeWindowBuffer *) buffer);
+ *num_ints = buf->handle->numInts;
+ *num_fds = buf->handle->numFds;
+}
+
+extern "C" void eglplatformcommon_eglHybrisSerializeNativeBuffer(EGLClientBuffer buffer, int *ints, int *fds)
+{
+ RemoteWindowBuffer *buf = static_cast<RemoteWindowBuffer *>((ANativeWindowBuffer *) buffer);
+ memcpy(ints, buf->handle->data + buf->handle->numFds, buf->handle->numInts * sizeof(int));
+ memcpy(fds, buf->handle->data, buf->handle->numFds * sizeof(int));
+}
+
+extern "C" EGLBoolean eglplatformcommon_eglHybrisCreateRemoteBuffer(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint stride,
+ int num_ints, int *ints, int num_fds, int *fds, EGLClientBuffer *buffer)
+{
+ assert(my_gralloc != NULL);
+
+ native_handle_t *native = native_handle_create(num_fds, num_ints);
+ memcpy(&native->data[0], fds, num_fds * sizeof(int));
+ memcpy(&native->data[num_fds], ints, num_ints * sizeof(int));
+
+ int ret = my_gralloc->registerBuffer(my_gralloc, (buffer_handle_t)native);
+
+ if (ret == 0)
+ {
+ RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, stride, format, usage, (buffer_handle_t)native, my_gralloc, my_alloc);
+ buf->common.incRef(&buf->common);
+ *buffer = (EGLClientBuffer) static_cast<ANativeWindowBuffer *>(buf);
+ return EGL_TRUE;
+ }
+ else
+ return EGL_FALSE;
+}
+
extern "C" EGLBoolean eglplatformcommon_eglHybrisCreateNativeBuffer(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint *stride, EGLClientBuffer *buffer)
{
int ret;
@@ -147,8 +214,9 @@
if (ret == 0)
{
- RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, _stride, format, usage, _handle, my_gralloc);
+ RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, _stride, format, usage, _handle, my_gralloc, my_alloc);
buf->common.incRef(&buf->common);
+ buf->setAllocated(true);
*buffer = (EGLClientBuffer) static_cast<ANativeWindowBuffer *>(buf);
*stride = _stride;
return EGL_TRUE;
@@ -203,9 +271,9 @@
static int debugenvchecked = 0;
if (*target == EGL_WAYLAND_BUFFER_WL)
{
- server_wlegl_buffer *buf = server_wlegl_buffer_from((struct wl_buffer *)*buffer);
- HYBRIS_TRACE_BEGIN("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", ((struct wl_buffer *)*buffer)->resource.object.id);
- HYBRIS_TRACE_END("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", ((struct wl_buffer *)*buffer)->resource.object.id);
+ server_wlegl_buffer *buf = server_wlegl_buffer_from((struct wl_resource *)*buffer);
+ HYBRIS_TRACE_BEGIN("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", wl_resource_get_id((struct wl_resource *)*buffer));
+ HYBRIS_TRACE_END("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", wl_resource_get_id((struct wl_resource *)*buffer));
if (debugenvchecked == 0)
{
if (getenv("HYBRIS_WAYLAND_KHR_DUMP_BUFFERS") != NULL)
@@ -241,6 +309,11 @@
return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglQueryWaylandBufferWL;
}
else
+ if (strcmp(procname, "eglHybrisAcquireNativeBufferWL") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType) eglplatformcommon_eglHybrisAcquireNativeBufferWL;
+ }
+ else
#endif
if (strcmp(procname, "eglHybrisCreateNativeBuffer") == 0)
{
@@ -261,6 +334,26 @@
{
return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisReleaseNativeBuffer;
}
+ else
+ if (strcmp(procname, "eglHybrisGetNativeBufferInfo") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisGetNativeBufferInfo;
+ }
+ else
+ if (strcmp(procname, "eglHybrisSerializeNativeBuffer") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisSerializeNativeBuffer;
+ }
+ else
+ if (strcmp(procname, "eglHybrisCreateRemoteBuffer") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisCreateRemoteBuffer;
+ }
+ else
+ if (strcmp(procname, "eglHybrisNativeBufferHandle") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisNativeBufferHandle;
+ }
return NULL;
}
@@ -271,8 +364,7 @@
{
const char *ret = (*real_eglQueryString)(dpy, name);
static char eglextensionsbuf[512];
- assert(ret != NULL);
- snprintf(eglextensionsbuf, 510, "%sEGL_HYBRIS_native_buffer %s", ret,
+ snprintf(eglextensionsbuf, 510, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
#ifdef WANT_WAYLAND
"EGL_WL_bind_wayland_display "
#else
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/hybris_nativebufferext.h
^
|
@@ -24,6 +24,12 @@
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISUNLOCKNATIVEBUFFERPROC)(EGLClientBuffer buffer);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISRELEASENATIVEBUFFERPROC)(EGLClientBuffer buffer);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISGETNATIVEBUFFERINFOPROC)(EGLClientBuffer buffer, int *num_ints, int *num_fds);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC)(EGLClientBuffer buffer, int *ints, int *fds);
+
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISCREATEREMOTEBUFFERPROC)(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint stride,
+ int num_ints, int *ints, int num_fds, int *fds, EGLClientBuffer *buffer);
+
enum {
/* buffer is never read in software */
HYBRIS_USAGE_SW_READ_NEVER = 0x00000000,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/nativewindowbase.cpp
^
|
@@ -5,7 +5,7 @@
#include "support.h"
#include <stdarg.h>
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
extern "C" {
#include <sync/sync.h>
}
@@ -99,7 +99,7 @@
ANativeWindow::setSwapInterval = _setSwapInterval;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
ANativeWindow::lockBuffer_DEPRECATED = &_lockBuffer_DEPRECATED;
ANativeWindow::dequeueBuffer_DEPRECATED = &_dequeueBuffer_DEPRECATED;
ANativeWindow::queueBuffer_DEPRECATED = &_queueBuffer_DEPRECATED;
@@ -164,7 +164,7 @@
*buffer = static_cast<ANativeWindowBuffer*>(temp);
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
if (fenceFd >= 0)
{
sync_wait(fenceFd, -1);
@@ -257,7 +257,7 @@
case NATIVE_WINDOW_DEFAULT_WIDTH: return "NATIVE_WINDOW_DEFAULT_WIDTH";
case NATIVE_WINDOW_DEFAULT_HEIGHT: return "NATIVE_WINDOW_DEFAULT_HEIGHT";
case NATIVE_WINDOW_TRANSFORM_HINT: return "NATIVE_WINDOW_TRANSFORM_HINT";
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1 || ANDROID_VERSION_MAJOR>=5
case NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND: return "NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND";
#endif
default: return "NATIVE_UNKNOWN_QUERY";
@@ -371,7 +371,7 @@
case NATIVE_WINDOW_API_DISCONNECT : // 14, /* private */
TRACE("api disconnect");
break;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1 || ANDROID_VERSION_MAJOR>=5
case NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS : // 15, /* private */
TRACE("set buffers user dimensions");
break;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl.cpp
^
|
@@ -39,7 +39,7 @@
static inline server_wlegl *
server_wlegl_from(struct wl_resource *resource)
{
- return reinterpret_cast<server_wlegl *>(resource->data);
+ return reinterpret_cast<server_wlegl *>(wl_resource_get_user_data(resource));
}
static void
@@ -97,7 +97,7 @@
return;
}
- buffer = server_wlegl_buffer_create(id, width, height, stride,
+ buffer = server_wlegl_buffer_create(client, id, width, height, stride,
format, usage, native, wlegl);
if (!buffer) {
native_handle_close((native_handle_t *)native);
@@ -107,13 +107,49 @@
"invalid native handle");
return;
}
+}
+
+static void
+server_wlegl_get_server_buffer_handle(wl_client *client, wl_resource *res, uint32_t id, int32_t width, int32_t height, int32_t format, int32_t usage)
+{
+ if (width == 0 || height == 0) {
+ wl_resource_post_error(res, 0, "invalid buffer size: %u,%u\n", width, height);
+ return;
+ }
+
+ server_wlegl *wlegl = server_wlegl_from(res);
+
+ wl_resource *resource = wl_resource_create(client, &android_wlegl_server_buffer_handle_interface, wl_resource_get_version(res), id);
+
+ buffer_handle_t _handle;
+ int _stride;
+
+ usage |= GRALLOC_USAGE_HW_COMPOSER;
+
+ int ret = wlegl->alloc->alloc(wlegl->alloc, width, height, format, usage, &_handle, &_stride);
+ server_wlegl_buffer *buffer = server_wlegl_buffer_create_server(client, width, height, _stride, format, usage, _handle, wlegl);
+
+ struct wl_array ints;
+ int *ints_data;
+ wl_array_init(&ints);
+ ints_data = (int*) wl_array_add(&ints, _handle->numInts * sizeof(int));
+ memcpy(ints_data, _handle->data + _handle->numFds, _handle->numInts * sizeof(int));
+
+ android_wlegl_server_buffer_handle_send_buffer_ints(resource, &ints);
+ wl_array_release(&ints);
+
+ for (int i = 0; i < _handle->numFds; i++) {
+ android_wlegl_server_buffer_handle_send_buffer_fd(resource, _handle->data[i]);
+ }
- wl_client_add_resource(client, &buffer->base.resource);
+ android_wlegl_server_buffer_handle_send_buffer(resource, buffer->resource, format, _stride);
+ wl_resource_destroy(resource);
}
static const struct android_wlegl_interface server_wlegl_impl = {
server_wlegl_create_handle,
server_wlegl_create_buffer,
+ server_wlegl_get_server_buffer_handle,
};
static void
@@ -123,12 +159,12 @@
server_wlegl *wlegl = reinterpret_cast<server_wlegl *>(data);
struct wl_resource *resource;
- resource = wl_client_add_object(client, &android_wlegl_interface,
- &server_wlegl_impl, id, wlegl);
+ resource = wl_resource_create(client, &android_wlegl_interface, version, id);
+ wl_resource_set_implementation(resource, &server_wlegl_impl, wlegl, 0);
}
server_wlegl *
-server_wlegl_create(struct wl_display *display, gralloc_module_t *gralloc)
+server_wlegl_create(struct wl_display *display, gralloc_module_t *gralloc, alloc_device_t *alloc)
{
struct server_wlegl *wlegl;
int ret;
@@ -136,10 +172,10 @@
wlegl = new server_wlegl;
wlegl->display = display;
- wlegl->global = wl_display_add_global(display,
- &android_wlegl_interface,
+ wlegl->global = wl_global_create(display, &android_wlegl_interface, 2,
wlegl, server_wlegl_bind);
wlegl->gralloc = (const gralloc_module_t *)gralloc;
+ wlegl->alloc = alloc;
return wlegl;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl.h
^
|
@@ -37,7 +37,7 @@
struct server_wlegl;
server_wlegl *
-server_wlegl_create(struct wl_display *wldpy, gralloc_module_t *gralloc);
+server_wlegl_create(struct wl_display *wldpy, gralloc_module_t *gralloc, alloc_device_t *alloc);
void
server_wlegl_destroy(server_wlegl *wlegl);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl_buffer.cpp
^
|
@@ -38,27 +38,22 @@
};
server_wlegl_buffer *
-server_wlegl_buffer_from(struct wl_buffer *buffer)
+server_wlegl_buffer_from(struct wl_resource *buffer)
{
- if (buffer->resource.object.implementation !=
- (void (**)(void)) &server_wlegl_buffer_impl)
- return NULL;
-
- return container_of(buffer, server_wlegl_buffer, base);
+ return static_cast<server_wlegl_buffer *>(wl_resource_get_user_data(buffer));
}
static void
server_wlegl_buffer_dtor(struct wl_resource *resource)
{
- struct wl_buffer *base =
- reinterpret_cast<struct wl_buffer*>(resource->data);
- server_wlegl_buffer *buffer = server_wlegl_buffer_from(base);
+ server_wlegl_buffer *buffer = server_wlegl_buffer_from(resource);
buffer->buf->common.decRef(&buffer->buf->common);
delete buffer;
}
server_wlegl_buffer *
-server_wlegl_buffer_create(uint32_t id,
+server_wlegl_buffer_create(wl_client *client,
+ uint32_t id,
int32_t width,
int32_t height,
int32_t stride,
@@ -70,29 +65,42 @@
server_wlegl_buffer *buffer = new server_wlegl_buffer;
int ret;
- memset(buffer, 0, sizeof(*buffer));
-
buffer->wlegl = wlegl;
-
- buffer->base.resource.object.id = id;
- buffer->base.resource.object.interface = &wl_buffer_interface;
- buffer->base.resource.object.implementation =
- (void (**)(void)) &server_wlegl_buffer_impl;
-
- buffer->base.resource.data = &buffer->base;
- buffer->base.resource.destroy = server_wlegl_buffer_dtor;
-
- buffer->base.width = width;
- buffer->base.height = height;
+ buffer->resource = wl_resource_create(client, &wl_buffer_interface, 1, id);
+ wl_resource_set_implementation(buffer->resource, &server_wlegl_buffer_impl, buffer, server_wlegl_buffer_dtor);
ret = wlegl->gralloc->registerBuffer(wlegl->gralloc, handle);
if (ret) {
delete buffer;
return NULL;
}
-
+
+ buffer->buf = new RemoteWindowBuffer(
+ width, height, stride, format, usage, handle, wlegl->gralloc, NULL);
+ buffer->buf->common.incRef(&buffer->buf->common);
+ return buffer;
+}
+
+server_wlegl_buffer *
+server_wlegl_buffer_create_server(wl_client *client,
+ int32_t width,
+ int32_t height,
+ int32_t stride,
+ int32_t format,
+ int32_t usage,
+ buffer_handle_t handle,
+ server_wlegl *wlegl)
+{
+ server_wlegl_buffer *buffer = new server_wlegl_buffer;
+ int ret;
+
+ buffer->wlegl = wlegl;
+ buffer->resource = wl_resource_create(client, &wl_buffer_interface, 1, 0);
+ wl_resource_set_implementation(buffer->resource, &server_wlegl_buffer_impl, buffer, server_wlegl_buffer_dtor);
+
buffer->buf = new RemoteWindowBuffer(
- width, height, stride, format, usage, handle, wlegl->gralloc);
+ width, height, stride, format, usage, handle, wlegl->gralloc, wlegl->alloc);
+ buffer->buf->setAllocated(true);
buffer->buf->common.incRef(&buffer->buf->common);
return buffer;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl_buffer.h
^
|
@@ -33,18 +33,23 @@
struct server_wlegl;
struct server_wlegl_buffer {
- struct wl_buffer base;
+ struct wl_resource *resource;
server_wlegl *wlegl;
RemoteWindowBuffer *buf;
};
server_wlegl_buffer *
-server_wlegl_buffer_create(uint32_t id, int32_t width, int32_t height,
+server_wlegl_buffer_create(wl_client *client, uint32_t id, int32_t width, int32_t height,
int32_t stride, int32_t format, int32_t usage,
buffer_handle_t handle, server_wlegl *wlegl);
server_wlegl_buffer *
-server_wlegl_buffer_from(struct wl_buffer *);
+server_wlegl_buffer_create_server(wl_client *client, int32_t width, int32_t height,
+ int32_t stride, int32_t format, int32_t usage,
+ buffer_handle_t handle, server_wlegl *wlegl);
+
+server_wlegl_buffer *
+server_wlegl_buffer_from(struct wl_resource *);
#endif /* SERVER_WLEGL_BUFFER_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl_private.h
^
|
@@ -34,6 +34,7 @@
struct wl_global *global;
const gralloc_module_t *gralloc;
+ alloc_device_t *alloc;
};
#endif /* SERVER_WLEGL_PRIVATE_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-android.xml
^
|
@@ -26,7 +26,7 @@
THIS SOFTWARE.
</copyright>
- <interface name="android_wlegl" version="1">
+ <interface name="android_wlegl" version="2">
<description summary="Android EGL graphics buffer support">
Interface used in the Android wrapper libEGL to share
graphics buffers between the server and the client.
@@ -67,6 +67,15 @@
<arg name="native_handle" type="object" interface="android_wlegl_handle" />
</request>
+
+ <request name="get_server_buffer_handle" since="2">
+ <arg name="id" type="new_id" interface="android_wlegl_server_buffer_handle"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="format" type="int"/>
+ <arg name="usage" type="int"/>
+ </request>
+
</interface>
<interface name="android_wlegl_handle" version="1">
@@ -91,4 +100,28 @@
</interface>
+
+ <interface name="android_wlegl_server_buffer_handle" version="1">
+ <description summary="a server allocated buffer">
+ On creation a server_side_buffer object will immediately send
+ the "buffer_fd" and "buffer_ints" events needed by the client to
+ reference the gralloc buffer, followed by the "buffer" event carrying
+ the wl_buffer object.
+ </description>
+ <event name="buffer_fd">
+ <arg name="fd" type="fd"/>
+ </event>
+ <event name="buffer_ints">
+ <arg name="ints" type="array"/>
+ </event>
+ <event name="buffer">
+ <description summary="the wl_buffer">
+ This event will be sent after the ints and all the fds have been sent
+ </description>
+ <arg name="buffer" type="new_id" interface="wl_buffer"/>
+ <arg name="format" type="int"/>
+ <arg name="stride" type="int"/>
+ </event>
+ </interface>
+
</protocol>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-egl-priv.h
^
|
@@ -27,6 +27,7 @@
void *nativewindow;
void (*resize_callback)(struct wl_egl_window *, void *);
+ void (*free_callback)(struct wl_egl_window *, void *);
};
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-egl.c
^
|
@@ -31,6 +31,7 @@
egl_window->surface = surface;
egl_window->resize_callback = NULL;
+ egl_window->free_callback = NULL;
wl_egl_window_resize(egl_window, width, height, 0, 0);
egl_window->attached_width = 0;
egl_window->attached_height = 0;
@@ -43,6 +44,8 @@
WL_EGL_EXPORT void
wl_egl_window_destroy(struct wl_egl_window *egl_window)
{
+ if (egl_window->free_callback)
+ egl_window->free_callback(egl_window, NULL);
free(egl_window);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/windowbuffer.cpp
^
|
@@ -27,7 +27,11 @@
RemoteWindowBuffer::~RemoteWindowBuffer()
{
+ if (!m_allocated) {
this->m_gralloc->unregisterBuffer(this->m_gralloc, this->handle);
native_handle_close(this->handle);
native_handle_delete(const_cast<native_handle_t*>(this->handle));
+ } else if (this->m_alloc) {
+ this->m_alloc->free((alloc_device_t *)this->m_alloc, this->handle);
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/common/windowbuffer.h
^
|
@@ -38,7 +38,8 @@
unsigned int format,
unsigned int usage,
buffer_handle_t handle,
- const gralloc_module_t *gralloc
+ const gralloc_module_t *gralloc,
+ const alloc_device_t *alloc = NULL
) {
// Base members
ANativeWindowBuffer::width = width;
@@ -48,9 +49,17 @@
ANativeWindowBuffer::stride = stride;
ANativeWindowBuffer::handle = handle;
this->m_gralloc = gralloc;
+ this->m_alloc = alloc;
+ this->m_allocated = false;
};
~RemoteWindowBuffer();
+
+ void setAllocated(bool allocated) { m_allocated = allocated; }
+ bool isAllocated() const { return m_allocated; }
+
private:
const gralloc_module_t *m_gralloc;
+ const alloc_device_t *m_alloc;
+ bool m_allocated;
};
#endif /* WINDOWBUFFER_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/fbdev/eglplatform_fbdev.cpp
^
|
@@ -44,13 +44,23 @@
eglplatformcommon_init(egl_iface, gralloc, alloc);
}
-extern "C" int fbdevws_IsValidDisplay(EGLNativeDisplayType display)
+extern "C" _EGLDisplay *fbdevws_GetDisplay(EGLNativeDisplayType display)
{
assert (gralloc != NULL);
- return display == EGL_DEFAULT_DISPLAY;
+
+ _EGLDisplay *dpy = 0;
+ if (display == EGL_DEFAULT_DISPLAY) {
+ dpy = new _EGLDisplay;
+ }
+ return dpy;
+}
+
+extern "C" void fbdevws_Terminate(_EGLDisplay *dpy)
+{
+ delete dpy;
}
-extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
{
assert (gralloc != NULL);
assert (_nativewindow == NULL);
@@ -80,14 +90,24 @@
eglplatformcommon_passthroughImageKHR(ctx, target, buffer, attrib_list);
}
+extern "C" void fbdevws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval)
+{
+ FbDevNativeWindow *window = static_cast<FbDevNativeWindow *>((struct ANativeWindow *)win);
+ window->setSwapInterval(interval);
+}
+
struct ws_module ws_module_info = {
fbdevws_init_module,
- fbdevws_IsValidDisplay,
+ fbdevws_GetDisplay,
+ fbdevws_Terminate,
fbdevws_CreateWindow,
fbdevws_DestroyWindow,
fbdevws_eglGetProcAddress,
fbdevws_passthroughImageKHR,
- eglplatformcommon_eglQueryString
+ eglplatformcommon_eglQueryString,
+ NULL,
+ NULL,
+ fbdevws_setSwapInterval,
};
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/fbdev/fbdev_window.cpp
^
|
@@ -71,8 +71,10 @@
m_fbDev = fbDev;
m_bufFormat = m_fbDev->format;
m_usage = GRALLOC_USAGE_HW_FB;
+ m_bufferCount = 0;
+ m_allocateBuffers = true;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
if (m_fbDev->numFramebuffers>0)
setBufferCount(m_fbDev->numFramebuffers);
else
@@ -149,6 +151,9 @@
pthread_mutex_lock(&_mutex);
+ if (m_allocateBuffers)
+ reallocateBuffers();
+
HYBRIS_TRACE_BEGIN("fbdev-platform", "dequeueBuffer-wait", "");
#if defined(DEBUG)
@@ -451,12 +456,9 @@
*/
int FbDevNativeWindow::setUsage(int usage)
{
- int need_realloc = (m_usage != usage);
- TRACE("usage=x%x realloc=%d", usage, need_realloc);
+ m_allocateBuffers = (m_usage != usage);
+ TRACE("usage=x%x m_allocateBuffers=%d", usage, m_allocateBuffers);
m_usage = usage;
- if (need_realloc)
- this->setBufferCount(m_bufList.size());
-
return NO_ERROR;
}
@@ -469,11 +471,9 @@
*/
int FbDevNativeWindow::setBuffersFormat(int format)
{
- int need_realloc = (format != m_bufFormat);
- TRACE("format=x%x realloc=%d", format, need_realloc);
+ m_allocateBuffers |= (format != m_bufFormat);
+ TRACE("format=x%x m_allocateBuffers=%d", format, m_allocateBuffers);
m_bufFormat = format;
- if (need_realloc)
- this->setBufferCount(m_bufList.size());
return NO_ERROR;
}
@@ -485,12 +485,18 @@
int FbDevNativeWindow::setBufferCount(int cnt)
{
TRACE("cnt=%d", cnt);
- int err=NO_ERROR;
- pthread_mutex_lock(&_mutex);
+ if (m_bufferCount != cnt) {
+ m_bufferCount = cnt;
+ m_allocateBuffers = true;
+ }
+ return NO_ERROR;
+}
+void FbDevNativeWindow::reallocateBuffers()
+{
destroyBuffers();
- for(unsigned int i = 0; i < cnt; i++)
+ for(unsigned int i = 0; i < m_bufferCount; i++)
{
FbDevNativeWindowBuffer *fbnb = new FbDevNativeWindowBuffer(m_alloc,
m_fbDev->width, m_fbDev->height, m_fbDev->format,
@@ -505,16 +511,15 @@
if (fbnb->status)
{
fbnb->common.decRef(&fbnb->common);
- fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", __PRETTY_FUNCTION__, m_freeBufs, cnt);
+ fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", __PRETTY_FUNCTION__, m_freeBufs, m_bufferCount);
break;
}
m_freeBufs++;
m_bufList.push_back(fbnb);
}
- pthread_mutex_unlock(&_mutex);
- return err;
+ m_allocateBuffers = false;
}
/*
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/fbdev/fbdev_window.h
^
|
@@ -48,9 +48,9 @@
framebuffer_device_t* fbDev);
~FbDevNativeWindow();
-protected:
// overloads from BaseNativeWindow
virtual int setSwapInterval(int interval);
+protected:
virtual int dequeueBuffer(BaseNativeWindowBuffer** buffer, int* fenceFd);
virtual int queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
@@ -73,13 +73,17 @@
private:
void destroyBuffers();
+ void reallocateBuffers();
private:
framebuffer_device_t* m_fbDev;
alloc_device_t* m_alloc;
unsigned int m_usage;
unsigned int m_bufFormat;
+ unsigned int m_bufferCount;
int m_freeBufs;
+ bool m_allocateBuffers;
+
std::list<FbDevNativeWindowBuffer*> m_bufList;
FbDevNativeWindowBuffer* m_frontBuf;
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/eglplatform_hwcomposer.cpp
^
|
@@ -36,13 +36,22 @@
eglplatformcommon_init(egl_iface, gralloc, alloc);
}
-extern "C" int hwcomposerws_IsValidDisplay(EGLNativeDisplayType display)
+extern "C" _EGLDisplay *hwcomposerws_GetDisplay(EGLNativeDisplayType display)
{
assert (gralloc != NULL);
- return display == EGL_DEFAULT_DISPLAY;
+ _EGLDisplay *dpy = 0;
+ if (display == EGL_DEFAULT_DISPLAY) {
+ dpy = new _EGLDisplay;
+ }
+ return dpy;
}
-extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+extern "C" void hwcomposerws_Terminate(_EGLDisplay *dpy)
+{
+ delete dpy;
+}
+
+extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
{
assert (gralloc != NULL);
assert (_nativewindow == NULL);
@@ -76,7 +85,8 @@
struct ws_module ws_module_info = {
hwcomposerws_init_module,
- hwcomposerws_IsValidDisplay,
+ hwcomposerws_GetDisplay,
+ hwcomposerws_Terminate,
hwcomposerws_CreateWindow,
hwcomposerws_DestroyWindow,
hwcomposerws_eglGetProcAddress,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/null/Makefile.am
^
|
@@ -2,8 +2,25 @@
eglplatform_null_la_SOURCES = eglplatform_null.c
-eglplatform_null_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -I$(top_srcdir)/egl
+eglplatform_null_la_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/egl \
+ -I$(top_srcdir)/egl/platforms/common \
+ $(ANDROID_HEADERS_CFLAGS) \
+ $(WAYLAND_SERVER_CFLAGS)
-eglplatform_null_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+eglplatform_null_la_LDFLAGS = \
+ -avoid-version -module -shared -export-dynamic \
+ $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
+ $(top_builddir)/hardware/libhardware.la \
+ $(WAYLAND_SERVER_LIBS)
+if WANT_DEBUG
+eglplatform_null_la_CFLAGS += -I$(top_srcdir)/common -ggdb -O0
+endif
+if WANT_TRACE
+eglplatform_null_la_CFLAGS += -DDEBUG
+endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/null/eglplatform_null.c
^
|
@@ -3,12 +3,17 @@
#include <dlfcn.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
+#include <eglplatformcommon.h>
+#include "logging.h"
static void * (*_androidCreateDisplaySurface)();
static void *_libui = NULL;
+static gralloc_module_t *gralloc = 0;
+static alloc_device_t *alloc = 0;
+
static void _init_androidui()
{
_libui = (void *) android_dlopen("/system/lib/libui.so", RTLD_LAZY);
@@ -25,14 +30,25 @@
static void nullws_init_module(struct ws_egl_interface *egl_iface)
{
+ int err;
+ hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const hw_module_t **) &gralloc);
+ err = gralloc_open((const hw_module_t *) gralloc, &alloc);
+ TRACE("++ %lu wayland: got gralloc %p err:%s", pthread_self(), gralloc, strerror(-err));
+ eglplatformcommon_init(egl_iface, gralloc, alloc);
+
+}
+
+static struct _EGLDisplay *nullws_GetDisplay(EGLNativeDisplayType display)
+{
+ return malloc(sizeof(struct _EGLDisplay));
}
-static int nullws_IsValidDisplay(EGLNativeDisplayType display)
+static void nullws_Terminate(struct _EGLDisplay *dpy)
{
- return 1;
+ free(dpy);
}
-static EGLNativeWindowType nullws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+static EGLNativeWindowType nullws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display)
{
if (win == 0)
{
@@ -47,28 +63,14 @@
// TODO: Cleanup?
}
-static __eglMustCastToProperFunctionPointerType nullws_eglGetProcAddress(const char *procname)
-{
- return NULL;
-}
-
-static void nullws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list)
-{
-}
-
-const char *nullws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name))
-{
- return (*real_eglQueryString)(dpy, name);
-}
-
-
struct ws_module ws_module_info = {
nullws_init_module,
- nullws_IsValidDisplay,
+ nullws_GetDisplay,
+ nullws_Terminate,
nullws_CreateWindow,
nullws_DestroyWindow,
- nullws_eglGetProcAddress,
- nullws_passthroughImageKHR,
- nullws_eglQueryString
+ eglplatformcommon_eglGetProcAddress,
+ eglplatformcommon_passthroughImageKHR,
+ eglplatformcommon_eglQueryString
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/wayland/Makefile.am
^
|
@@ -21,6 +21,10 @@
eglplatform_wayland_la_CXXFLAGS += -ggdb -O0
endif
+if !WANT_WL_SERVERSIDE_BUFFERS
+eglplatform_wayland_la_CXXFLAGS += -DHYBRIS_NO_SERVER_SIDE_BUFFERS
+endif
+
eglplatform_wayland_la_LDFLAGS = \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/wayland/eglplatform_wayland.cpp
^
|
@@ -16,12 +16,12 @@
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file license.lgpl included in the packaging
** of this file.
- **
+ **
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
- **
+ **
****************************************************************************************/
#include <android-config.h>
@@ -30,12 +30,17 @@
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <assert.h>
+#include <stdlib.h>
extern "C" {
#include <eglplatformcommon.h>
};
+#include <eglhybris.h>
+
+#include <EGL/eglext.h>
extern "C" {
#include <wayland-client.h>
@@ -45,10 +50,28 @@
#include "wayland_window.h"
#include "logging.h"
#include "wayland-egl-priv.h"
+#include "server_wlegl_buffer.h"
+#include "wayland-android-client-protocol.h"
static gralloc_module_t *gralloc = 0;
static alloc_device_t *alloc = 0;
+
+static const char * (*_eglQueryString)(EGLDisplay dpy, EGLint name) = NULL;
+static __eglMustCastToProperFunctionPointerType (*_eglGetProcAddress)(const char *procname) = NULL;
+static EGLSyncKHR (*_eglCreateSyncKHR)(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list) = NULL;
+static EGLBoolean (*_eglDestroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync) = NULL;
+static EGLint (*_eglClientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) = NULL;
+
+struct WaylandDisplay {
+ _EGLDisplay base;
+
+ wl_display *wl_dpy;
+ wl_event_queue *queue;
+ wl_registry *registry;
+ android_wlegl *wlegl;
+};
+
extern "C" void waylandws_init_module(struct ws_egl_interface *egl_iface)
{
int err;
@@ -58,14 +81,115 @@
eglplatformcommon_init(egl_iface, gralloc, alloc);
}
-extern "C" int waylandws_IsValidDisplay(EGLNativeDisplayType display)
+static void _init_egl_funcs(EGLDisplay display)
+{
+ if (_eglQueryString != NULL)
+ return;
+
+ _eglQueryString = (const char * (*)(void*, int))
+ hybris_android_egl_dlsym("eglQueryString");
+ assert(_eglQueryString);
+ _eglGetProcAddress = (__eglMustCastToProperFunctionPointerType (*)(const char *))
+ hybris_android_egl_dlsym("eglGetProcAddress");
+ assert(_eglGetProcAddress);
+
+ const char *extensions = (*_eglQueryString)(display, EGL_EXTENSIONS);
+
+ if (strstr(extensions, "EGL_KHR_fence_sync")) {
+ _eglCreateSyncKHR = (PFNEGLCREATESYNCKHRPROC)
+ (*_eglGetProcAddress)("eglCreateSyncKHR");
+ assert(_eglCreateSyncKHR);
+ _eglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)
+ (*_eglGetProcAddress)("eglDestroySyncKHR");
+ assert(_eglDestroySyncKHR);
+ _eglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)
+ (*_eglGetProcAddress)("eglClientWaitSyncKHR");
+ assert(_eglClientWaitSyncKHR);
+ }
+}
+
+static void registry_handle_global(void *data, wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
+{
+ WaylandDisplay *dpy = (WaylandDisplay *)data;
+
+ if (strcmp(interface, "android_wlegl") == 0) {
+ dpy->wlegl = static_cast<struct android_wlegl *>(wl_registry_bind(registry, name, &android_wlegl_interface, std::min(2u, version)));
+ }
+}
+
+static const wl_registry_listener registry_listener = {
+ registry_handle_global
+};
+
+static void callback_done(void *data, wl_callback *cb, uint32_t d)
+{
+ WaylandDisplay *dpy = (WaylandDisplay *)data;
+
+ wl_callback_destroy(cb);
+ if (!dpy->wlegl) {
+ fprintf(stderr, "Fatal: the server doesn't advertise the android_wlegl global!");
+ abort();
+ }
+}
+
+static const wl_callback_listener callback_listener = {
+ callback_done
+};
+
+extern "C" _EGLDisplay *waylandws_GetDisplay(EGLNativeDisplayType display)
{
- return 1;
+ WaylandDisplay *wdpy = new WaylandDisplay;
+ wdpy->wl_dpy = (wl_display *)display;
+ wdpy->wlegl = NULL;
+ wdpy->queue = wl_display_create_queue(wdpy->wl_dpy);
+ wdpy->registry = wl_display_get_registry(wdpy->wl_dpy);
+ wl_proxy_set_queue((wl_proxy *) wdpy->registry, wdpy->queue);
+ wl_registry_add_listener(wdpy->registry, ®istry_listener, wdpy);
+
+ wl_callback *cb = wl_display_sync(wdpy->wl_dpy);
+ wl_proxy_set_queue((wl_proxy *) cb, wdpy->queue);
+ wl_callback_add_listener(cb, &callback_listener, wdpy);
+
+ return &wdpy->base;
}
-extern "C" EGLNativeWindowType waylandws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+extern "C" void waylandws_Terminate(_EGLDisplay *dpy)
{
- WaylandNativeWindow *window = new WaylandNativeWindow((struct wl_egl_window *) win, (struct wl_display *) display, alloc);
+ WaylandDisplay *wdpy = (WaylandDisplay *)dpy;
+ int ret = 0;
+ // We still have the sync callback on flight, wait for it to arrive
+ while (ret == 0 && !wdpy->wlegl) {
+ ret = wl_display_dispatch_queue(wdpy->wl_dpy, wdpy->queue);
+ }
+ assert(ret >= 0);
+ android_wlegl_destroy(wdpy->wlegl);
+ wl_registry_destroy(wdpy->registry);
+ wl_event_queue_destroy(wdpy->queue);
+ delete wdpy;
+}
+
+extern "C" EGLNativeWindowType waylandws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
+{
+ struct wl_egl_window *wl_window = (struct wl_egl_window*) win;
+ struct wl_display *wl_display = (struct wl_display*) display;
+
+ if (wl_window == 0 || wl_display == 0) {
+ HYBRIS_ERROR("Running with EGL_PLATFORM=wayland without setup wayland environment is not possible");
+ HYBRIS_ERROR("If you want to run a standlone EGL client do it like this:");
+ HYBRIS_ERROR(" $ export EGL_PLATFORM=null");
+ HYBRIS_ERROR(" $ test_glevs2");
+ abort();
+ }
+
+ WaylandDisplay *wdpy = (WaylandDisplay *)display;
+
+ int ret = 0;
+ while (ret == 0 && !wdpy->wlegl) {
+ ret = wl_display_dispatch_queue(wdpy->wl_dpy, wdpy->queue);
+ }
+ assert(ret >= 0);
+
+ WaylandNativeWindow *window = new WaylandNativeWindow((struct wl_egl_window *) win, wdpy->wl_dpy, wdpy->wlegl, alloc, gralloc);
window->common.incRef(&window->common);
return (EGLNativeWindowType) static_cast<struct ANativeWindow *>(window);
}
@@ -83,12 +207,37 @@
return ((WaylandNativeWindow *) eglwin->nativewindow)->postBuffer((ANativeWindowBuffer *) buffer);
}
-extern "C" __eglMustCastToProperFunctionPointerType waylandws_eglGetProcAddress(const char *procname)
+extern "C" wl_buffer *waylandws_createWlBuffer(EGLDisplay dpy, EGLImageKHR image)
+{
+ egl_image *img = reinterpret_cast<egl_image *>(image);
+ if (!img) {
+ // The spec says we should send a EGL_BAD_PARAMETER error here, but we don't have the
+ // means, as of now.
+ return NULL;
+ }
+ if (img->target == EGL_WAYLAND_BUFFER_WL) {
+ WaylandDisplay *wdpy = (WaylandDisplay *)hybris_egl_display_get_mapping(dpy);
+ server_wlegl_buffer *buf = server_wlegl_buffer_from((wl_resource *)img->egl_buffer);
+ WaylandNativeWindowBuffer wnb(buf->buf);
+ // The buffer will be managed by the app, so pass NULL as the queue so that
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/wayland/wayland_window.cpp
^
|
@@ -35,15 +35,27 @@
#include "logging.h"
#include <eglhybris.h>
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
extern "C" {
#include <sync/sync.h>
}
#endif
+static void
+buffer_create_sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
+{
+ struct wl_callback **created_callback = static_cast<struct wl_callback **>(data);
+
+ *created_callback = NULL;
+ wl_callback_destroy(callback);
+}
+static const struct wl_callback_listener buffer_create_sync_listener = {
+ buffer_create_sync_callback
+};
-void WaylandNativeWindowBuffer::wlbuffer_from_native_handle(struct android_wlegl *android_wlegl)
+void WaylandNativeWindowBuffer::wlbuffer_from_native_handle(struct android_wlegl *android_wlegl,
+ struct wl_display *display, struct wl_event_queue *queue)
{
struct wl_array ints;
int *ints_data;
@@ -64,8 +76,13 @@
wlbuffer = android_wlegl_create_buffer(android_wlegl,
width, height, stride,
format, usage, wlegl_handle);
+ wl_proxy_set_queue((struct wl_proxy *) wlbuffer, queue);
android_wlegl_handle_destroy(wlegl_handle);
+
+ creation_callback = wl_display_sync(display);
+ wl_callback_add_listener(creation_callback, &buffer_create_sync_listener, &creation_callback);
+ wl_proxy_set_queue((struct wl_proxy *)creation_callback, queue);
}
void WaylandNativeWindow::resize(unsigned int width, unsigned int height)
@@ -76,13 +93,17 @@
unlock();
}
-
void WaylandNativeWindow::resize_callback(struct wl_egl_window *egl_window, void *)
{
TRACE("%dx%d",egl_window->width,egl_window->height);
((WaylandNativeWindow *) egl_window->nativewindow)->resize(egl_window->width, egl_window->height);
}
+void WaylandNativeWindow::free_callback(struct wl_egl_window *egl_window, void *)
+{
+ ((WaylandNativeWindow*)(egl_window->nativewindow))->m_window = 0;
+}
+
void WaylandNativeWindow::lock()
{
pthread_mutex_lock(&this->mutex);
@@ -93,23 +114,7 @@
pthread_mutex_unlock(&this->mutex);
}
- void
-WaylandNativeWindow::registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
- const char *interface, uint32_t version)
-{
- WaylandNativeWindow *nw = static_cast<WaylandNativeWindow *>(data);
-
- if (strcmp(interface, "android_wlegl") == 0) {
- nw->m_android_wlegl = static_cast<struct android_wlegl *>(wl_registry_bind(registry, name, &android_wlegl_interface, 1));
- }
-}
-
-static const struct wl_registry_listener registry_listener = {
- WaylandNativeWindow::registry_handle_global
-};
-
-
- void
+void
WaylandNativeWindow::sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
int *done = static_cast<int *>(data);
@@ -122,7 +127,7 @@
WaylandNativeWindow::sync_callback
};
- int
+int
WaylandNativeWindow::wayland_roundtrip(WaylandNativeWindow *display)
{
struct wl_callback *callback;
@@ -132,7 +137,7 @@
callback = wl_display_sync(display->m_display);
wl_callback_add_listener(callback, &sync_listener, &done);
wl_proxy_set_queue((struct wl_proxy *) callback, display->wl_queue);
- while (ret == 0 && !done)
+ while (ret >= 0 && !done)
ret = wl_display_dispatch_queue(display->m_display, display->wl_queue);
return ret;
@@ -154,7 +159,20 @@
abort();
}
-WaylandNativeWindow::WaylandNativeWindow(struct wl_egl_window *window, struct wl_display *display, alloc_device_t* alloc_device)
+static void
+wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
+{
+ WaylandNativeWindow *surface = static_cast<WaylandNativeWindow *>(data);
+ surface->frame();
+ wl_callback_destroy(callback);
+}
+
+static const struct wl_callback_listener frame_listener = {
+ wayland_frame_callback
+};
+
+WaylandNativeWindow::WaylandNativeWindow(struct wl_egl_window *window, struct wl_display *display, android_wlegl *wlegl, alloc_device_t* alloc_device, gralloc_module_t *gralloc)
+ : m_android_wlegl(wlegl)
{
int wayland_ok;
@@ -167,23 +185,27 @@
this->m_defaultWidth = window->width;
this->m_defaultHeight = window->height;
this->m_window->resize_callback = resize_callback;
- this->m_format = 1;
+ this->m_window->free_callback = free_callback;
+ this->frame_callback = NULL;
this->wl_queue = wl_display_create_queue(display);
- this->registry = wl_display_get_registry(display);
- wl_proxy_set_queue((struct wl_proxy *) this->registry,
- this->wl_queue);
- wl_registry_add_listener(this->registry, ®istry_listener, this);
-
- wayland_ok = wayland_roundtrip(this);
- assert(wayland_ok >= 0);
- assert(this->m_android_wlegl != NULL);
+ this->m_format = 1;
+
+ const_cast<int&>(ANativeWindow::minSwapInterval) = 0;
+ const_cast<int&>(ANativeWindow::maxSwapInterval) = 1;
+ // This is the default as per the EGL documentation
+ this->m_swap_interval = 1;
this->m_alloc = alloc_device;
+ m_gralloc = gralloc;
m_usage=GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&cond, NULL);
+ m_queueReads = 0;
m_freeBufs = 0;
+ m_damage_rects = NULL;
+ m_damage_n_rects = 0;
+ m_lastBuffer = 0;
setBufferCount(3);
HYBRIS_TRACE_END("wayland-platform", "create_window", "");
}
@@ -191,22 +213,42 @@
WaylandNativeWindow::~WaylandNativeWindow()
{
std::list<WaylandNativeWindowBuffer *>::iterator it = m_bufList.begin();
- for (; it != m_bufList.end(); it++)
- {
- WaylandNativeWindowBuffer* buf=*it;
- if (buf->wlbuffer)
- wl_buffer_destroy(buf->wlbuffer);
- buf->wlbuffer = NULL;
- buf->common.decRef(&buf->common);
- }
- wl_registry_destroy(registry);
+ destroyBuffers();
+ if (frame_callback)
+ wl_callback_destroy(frame_callback);
wl_event_queue_destroy(wl_queue);
- android_wlegl_destroy(m_android_wlegl);
+ if (m_window) {
+ m_window->nativewindow = NULL;
+ m_window->resize_callback = NULL;
+ m_window->free_callback = NULL;
+ }
+}
+
+void WaylandNativeWindow::frame() {
+ HYBRIS_TRACE_BEGIN("wayland-platform", "frame_event", "");
+
+ this->frame_callback = NULL;
+
+ HYBRIS_TRACE_END("wayland-platform", "frame_event", "");
}
// overloads from BaseNativeWindow
int WaylandNativeWindow::setSwapInterval(int interval) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/platforms/wayland/wayland_window.h
^
|
@@ -24,7 +24,6 @@
**
****************************************************************************************/
-
#ifndef Wayland_WINDOW_H
#define Wayland_WINDOW_H
#include "nativewindowbase.h"
@@ -38,12 +37,53 @@
#include <pthread.h>
}
#include <list>
+#include <deque>
class WaylandNativeWindowBuffer : public BaseNativeWindowBuffer
{
+public:
+ WaylandNativeWindowBuffer() : wlbuffer(0), busy(0), youngest(0), other(0), creation_callback(0) {}
+ WaylandNativeWindowBuffer(ANativeWindowBuffer *other)
+ {
+ ANativeWindowBuffer::width = other->width;
+ ANativeWindowBuffer::height = other->height;
+ ANativeWindowBuffer::format = other->format;
+ ANativeWindowBuffer::usage = other->usage;
+ ANativeWindowBuffer::handle = other->handle;
+ ANativeWindowBuffer::stride = other->stride;
+ this->wlbuffer = NULL;
+ this->creation_callback = NULL;
+ this->busy = 0;
+ this->other = other;
+ this->youngest = 0;
+ }
+
+ struct wl_buffer *wlbuffer;
+ int busy;
+ int youngest;
+ ANativeWindowBuffer *other;
+ struct wl_callback *creation_callback;
+
+ void wlbuffer_from_native_handle(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
+
+ virtual void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue) {}
+};
+
+#ifdef HYBRIS_NO_SERVER_SIDE_BUFFERS
+
+class ClientWaylandBuffer : public WaylandNativeWindowBuffer
+{
friend class WaylandNativeWindow;
protected:
- WaylandNativeWindowBuffer(alloc_device_t* alloc_device,
+ ClientWaylandBuffer()
+ : m_alloc(0)
+ {}
+
+ ClientWaylandBuffer(alloc_device_t* alloc_device,
unsigned int width,
unsigned int height,
unsigned int format,
@@ -55,6 +95,7 @@
ANativeWindowBuffer::format = format;
ANativeWindowBuffer::usage = usage;
this->wlbuffer = NULL;
+ this->creation_callback = NULL;
this->busy = 0;
this->other = NULL;
this->m_alloc = alloc_device;
@@ -64,60 +105,71 @@
&this->handle, &this->stride);
assert(alloc_ok == 0);
this->youngest = 0;
+ this->common.incRef(&this->common);
}
- WaylandNativeWindowBuffer(ANativeWindowBuffer *other)
- {
- ANativeWindowBuffer::width = other->width;
- ANativeWindowBuffer::height = other->height;
- ANativeWindowBuffer::format = other->format;
- ANativeWindowBuffer::usage = other->usage;
- ANativeWindowBuffer::handle = other->handle;
- ANativeWindowBuffer::stride = other->stride;
- this->wlbuffer = NULL;
- this->busy = 0;
- this->other = other;
- this->m_alloc = NULL;
- this->youngest = 0;
- }
- ~WaylandNativeWindowBuffer()
+
+ ~ClientWaylandBuffer()
{
if (this->m_alloc)
m_alloc->free(m_alloc, this->handle);
}
- void wlbuffer_from_native_handle(struct android_wlegl *android_wlegl);
+
+ void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
protected:
void* vaddr;
alloc_device_t* m_alloc;
public:
- struct wl_buffer *wlbuffer;
- int busy;
- int youngest;
- ANativeWindowBuffer *other;
+
+};
+
+#else
+
+class ServerWaylandBuffer : public WaylandNativeWindowBuffer
+{
+public:
+ ServerWaylandBuffer(unsigned int w, unsigned int h, int format, int usage, gralloc_module_t *gralloc, android_wlegl *android_wlegl, struct wl_event_queue *queue);
+ ~ServerWaylandBuffer();
+ void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
+
+ struct wl_array ints;
+ struct wl_array fds;
+ gralloc_module_t *m_gralloc;
+ wl_buffer *m_buf;
};
+#endif // HYBRIS_NO_SERVER_SIDE_BUFFERS
class WaylandNativeWindow : public BaseNativeWindow {
public:
- WaylandNativeWindow(struct wl_egl_window *win, struct wl_display *display, alloc_device_t* alloc_device);
+ WaylandNativeWindow(struct wl_egl_window *win, struct wl_display *display, android_wlegl *wlegl, alloc_device_t* alloc_device, gralloc_module_t *gralloc);
~WaylandNativeWindow();
void lock();
void unlock();
+ void frame();
void resize(unsigned int width, unsigned int height);
void releaseBuffer(struct wl_buffer *buffer);
int postBuffer(ANativeWindowBuffer *buffer);
+ virtual int setSwapInterval(int interval);
+ void prepareSwap(EGLint *damage_rects, EGLint damage_n_rects);
+ void finishSwap();
+
static void sync_callback(void *data, struct wl_callback *callback, uint32_t serial);
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
const char *interface, uint32_t version);
static void resize_callback(struct wl_egl_window *egl_window, void *);
+ static void free_callback(struct wl_egl_window *egl_window, void *);
struct wl_event_queue *wl_queue;
-
+
protected:
// overloads from BaseNativeWindow
- virtual int setSwapInterval(int interval);
virtual int dequeueBuffer(BaseNativeWindowBuffer **buffer, int *fenceFd);
virtual int lockBuffer(BaseNativeWindowBuffer* buffer);
virtual int queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
@@ -140,12 +192,16 @@
WaylandNativeWindowBuffer *addBuffer();
void destroyBuffer(WaylandNativeWindowBuffer *);
void destroyBuffers();
+ int readQueue(bool block);
+
std::list<WaylandNativeWindowBuffer *> m_bufList;
std::list<WaylandNativeWindowBuffer *> fronted;
std::list<WaylandNativeWindowBuffer *> posted;
std::list<WaylandNativeWindowBuffer *> post_registered;
+ std::deque<WaylandNativeWindowBuffer *> queue;
struct wl_egl_window *m_window;
struct wl_display *m_display;
+ WaylandNativeWindowBuffer *m_lastBuffer;
unsigned int m_width;
unsigned int m_height;
unsigned int m_format;
@@ -154,12 +210,15 @@
unsigned int m_usage;
struct android_wlegl *m_android_wlegl;
alloc_device_t* m_alloc;
- struct wl_registry *registry;
pthread_mutex_t mutex;
pthread_cond_t cond;
+ int m_queueReads;
int m_freeBufs;
+ EGLint *m_damage_rects, m_damage_n_rects;
struct wl_callback *frame_callback;
+ int m_swap_interval;
static int wayland_roundtrip(WaylandNativeWindow *display);
+ gralloc_module_t *m_gralloc;
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/ws.c
^
|
@@ -55,13 +55,19 @@
}
-int ws_IsValidDisplay(EGLNativeDisplayType display)
+struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType display)
{
_init_ws();
- return ws->IsValidDisplay(display);
+ return ws->GetDisplay(display);
}
-EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+void ws_Terminate(struct _EGLDisplay *dpy)
+{
+ _init_ws();
+ ws->Terminate(dpy);
+}
+
+EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display)
{
_init_ws();
return ws->CreateWindow(win, display);
@@ -91,4 +97,25 @@
return ws->eglQueryString(dpy, name, real_eglQueryString);
}
+void ws_prepareSwap(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects)
+{
+ _init_ws();
+ if (ws->prepareSwap)
+ ws->prepareSwap(dpy, win, damage_rects, damage_n_rects);
+}
+
+void ws_finishSwap(EGLDisplay dpy, EGLNativeWindowType win)
+{
+ _init_ws();
+ if (ws->finishSwap)
+ ws->finishSwap(dpy, win);
+}
+
+void ws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval)
+{
+ _init_ws();
+ if (ws->setSwapInterval)
+ ws->setSwapInterval(dpy, win, interval);
+}
+
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/egl/ws.h
^
|
@@ -1,6 +1,7 @@
#ifndef __LIBHYBRIS_WS_H
#define __LIBHYBRIS_WS_H
#include <EGL/egl.h>
+#include <EGL/eglext.h>
struct ws_egl_interface {
void * (*android_egl_dlsym)(const char *symbol);
@@ -9,24 +10,44 @@
EGLNativeWindowType (*get_mapping)(EGLSurface surface);
};
+struct egl_image
+{
+ EGLImageKHR egl_image;
+ EGLClientBuffer egl_buffer;
+ EGLenum target;
+};
+
/* Defined in egl.c */
extern struct ws_egl_interface hybris_egl_interface;
+struct _EGLDisplay {
+ EGLDisplay dpy;
+};
+
struct ws_module {
void (*init_module)(struct ws_egl_interface *egl_interface);
- int (*IsValidDisplay)(EGLNativeDisplayType display_id);
- EGLNativeWindowType (*CreateWindow)(EGLNativeWindowType win, EGLNativeDisplayType display);
+
+ struct _EGLDisplay *(*GetDisplay)(EGLNativeDisplayType native);
+ void (*Terminate)(struct _EGLDisplay *display);
+ EGLNativeWindowType (*CreateWindow)(EGLNativeWindowType win, struct _EGLDisplay *display);
void (*DestroyWindow)(EGLNativeWindowType win);
__eglMustCastToProperFunctionPointerType (*eglGetProcAddress)(const char *procname);
void (*passthroughImageKHR)(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list);
const char *(*eglQueryString)(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name));
+ void (*prepareSwap)(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects);
+ void (*finishSwap)(EGLDisplay dpy, EGLNativeWindowType win);
+ void (*setSwapInterval)(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval);
};
-int ws_IsValidDisplay(EGLNativeDisplayType display);
-EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display);
+struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType native);
+void ws_Terminate(struct _EGLDisplay *dpy);
+EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display);
void ws_DestroyWindow(EGLNativeWindowType win);
__eglMustCastToProperFunctionPointerType ws_eglGetProcAddress(const char *procname);
void ws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list);
const char *ws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name));
+void ws_prepareSwap(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects);
+void ws_finishSwap(EGLDisplay dpy, EGLNativeWindowType win);
+void ws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval);
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/glesv1/glesv1_cm.c
^
|
@@ -24,7 +24,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#define GLESV1_CM_LIBRARY_PATH "/system/lib/libGLESv1_CM.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/glesv2/Makefile.am
^
|
@@ -2,7 +2,7 @@
libGLESv2.la
libGLESv2_la_SOURCES = glesv2.c
-libGLESv2_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+libGLESv2_la_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = glesv2.pc
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/glesv2/glesv2.c
^
|
@@ -22,1021 +22,404 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
-#include <hybris/internal/floating_point_abi.h>
+#include <egl/ws.h>
+#include <hybris/common/binding.h>
+#include <hybris/common/floating_point_abi.h>
static void *_libglesv2 = NULL;
-static void (*_glActiveTexture)(GLenum texture) = NULL;
-static void (*_glAttachShader)(GLuint program, GLuint shader) = NULL;
-static void (*_glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) = NULL;
-static void (*_glBindBuffer)(GLenum target, GLuint buffer) = NULL;
-static void (*_glBindFramebuffer)(GLenum target, GLuint framebuffer) = NULL;
-static void (*_glBindRenderbuffer)(GLenum target, GLuint renderbuffer) = NULL;
-static void (*_glBindTexture)(GLenum target, GLuint texture) = NULL;
+/* Only functions with floating point argument need a wrapper to change the call convention correctly */
+
static void (*_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = NULL;
-static void (*_glBlendEquation)(GLenum mode ) = NULL;
-static void (*_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) = NULL;
-static void (*_glBlendFunc)(GLenum sfactor, GLenum dfactor) = NULL;
-static void (*_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) = NULL;
-static void (*_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) = NULL;
-static void (*_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) = NULL;
-static GLenum (*_glCheckFramebufferStatus)(GLenum target) = NULL;
-static void (*_glClear)(GLbitfield mask) = NULL;
static void (*_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = NULL;
static void (*_glClearDepthf)(GLclampf depth) FP_ATTRIB = NULL;
-static void (*_glClearStencil)(GLint s) = NULL;
-static void (*_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) = NULL;
-static void (*_glCompileShader)(GLuint shader) = NULL;
-static void (*_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) = NULL;
-static void (*_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) = NULL;
-static void (*_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = NULL;
-static void (*_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static GLuint (*_glCreateProgram)(void) = NULL;
-static GLuint (*_glCreateShader)(GLenum type) = NULL;
-static void (*_glCullFace)(GLenum mode) = NULL;
-static void (*_glDeleteBuffers)(GLsizei n, const GLuint* buffers) = NULL;
-static void (*_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers) = NULL;
-static void (*_glDeleteProgram)(GLuint program) = NULL;
-static void (*_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) = NULL;
-static void (*_glDeleteShader)(GLuint shader) = NULL;
-static void (*_glDeleteTextures)(GLsizei n, const GLuint* textures) = NULL;
-static void (*_glDepthFunc)(GLenum func) = NULL;
-static void (*_glDepthMask)(GLboolean flag) = NULL;
static void (*_glDepthRangef)(GLclampf zNear, GLclampf zFar) FP_ATTRIB = NULL;
-static void (*_glDetachShader)(GLuint program, GLuint shader) = NULL;
-static void (*_glDisable)(GLenum cap) = NULL;
-static void (*_glDisableVertexAttribArray)(GLuint index) = NULL;
-static void (*_glDrawArrays)(GLenum mode, GLint first, GLsizei count) = NULL;
-static void (*_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) = NULL;
-static void (*_glEnable)(GLenum cap) = NULL;
-static void (*_glEnableVertexAttribArray)(GLuint index) = NULL;
-static void (*_glFinish)(void) = NULL;
-static void (*_glFlush)(void) = NULL;
-static void (*_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
-static void (*_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
-static void (*_glFrontFace)(GLenum mode) = NULL;
-static void (*_glGenBuffers)(GLsizei n, GLuint* buffers) = NULL;
-static void (*_glGenerateMipmap)(GLenum target) = NULL;
-static void (*_glGenFramebuffers)(GLsizei n, GLuint* framebuffers) = NULL;
-static void (*_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) = NULL;
-static void (*_glGenTextures)(GLsizei n, GLuint* textures) = NULL;
-static void (*_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
-static void (*_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
-static void (*_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) = NULL;
-static int (*_glGetAttribLocation)(GLuint program, const GLchar* name) = NULL;
-static void (*_glGetBooleanv)(GLenum pname, GLboolean* params) = NULL;
-static void (*_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static GLenum (*_glGetError)(void) = NULL;
-static void (*_glGetFloatv)(GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) = NULL;
-static void (*_glGetIntegerv)(GLenum pname, GLint* params) = NULL;
-static void (*_glGetProgramiv)(GLuint program, GLenum pname, GLint* params) = NULL;
-static void (*_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
-static void (*_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static void (*_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) = NULL;
-static void (*_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
-static void (*_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) = NULL;
-static void (*_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) = NULL;
-static const GLubyte* (*_glGetString)(GLenum name) = NULL;
-static void (*_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static void (*_glGetUniformfv)(GLuint program, GLint location, GLfloat* params) = NULL;
-static void (*_glGetUniformiv)(GLuint program, GLint location, GLint* params) = NULL;
-static int (*_glGetUniformLocation)(GLuint program, const GLchar* name) = NULL;
-static void (*_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) = NULL;
-static void (*_glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) = NULL;
-static void (*_glHint)(GLenum target, GLenum mode) = NULL;
-static GLboolean (*_glIsBuffer)(GLuint buffer) = NULL;
-static GLboolean (*_glIsEnabled)(GLenum cap) = NULL;
-static GLboolean (*_glIsFramebuffer)(GLuint framebuffer) = NULL;
-static GLboolean (*_glIsProgram)(GLuint program) = NULL;
-static GLboolean (*_glIsRenderbuffer)(GLuint renderbuffer) = NULL;
-static GLboolean (*_glIsShader)(GLuint shader) = NULL;
-static GLboolean (*_glIsTexture)(GLuint texture) = NULL;
static void (*_glLineWidth)(GLfloat width) FP_ATTRIB = NULL;
-static void (*_glLinkProgram)(GLuint program) = NULL;
-static void (*_glPixelStorei)(GLenum pname, GLint param) = NULL;
static void (*_glPolygonOffset)(GLfloat factor, GLfloat units) FP_ATTRIB = NULL;
-static void (*_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) = NULL;
-static void (*_glReleaseShaderCompiler)(void) = NULL;
-static void (*_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
static void (*_glSampleCoverage)(GLclampf value, GLboolean invert) FP_ATTRIB = NULL;
-static void (*_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static void (*_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) = NULL;
-static void (*_glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) = NULL;
-static void (*_glStencilFunc)(GLenum func, GLint ref, GLuint mask) = NULL;
-static void (*_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) = NULL;
-static void (*_glStencilMask)(GLuint mask) = NULL;
-static void (*_glStencilMaskSeparate)(GLenum face, GLuint mask) = NULL;
-static void (*_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) = NULL;
-static void (*_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) = NULL;
-static void (*_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
static void (*_glTexParameterf)(GLenum target, GLenum pname, GLfloat param) FP_ATTRIB = NULL;
-static void (*_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) = NULL;
-static void (*_glTexParameteri)(GLenum target, GLenum pname, GLint param) = NULL;
-static void (*_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) = NULL;
-static void (*_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
static void (*_glUniform1f)(GLint location, GLfloat x) FP_ATTRIB = NULL;
-static void (*_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform1i)(GLint location, GLint x) = NULL;
-static void (*_glUniform1iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform2f)(GLint location, GLfloat x, GLfloat y) FP_ATTRIB = NULL;
-static void (*_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform2i)(GLint location, GLint x, GLint y) = NULL;
-static void (*_glUniform2iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = NULL;
-static void (*_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform3i)(GLint location, GLint x, GLint y, GLint z) = NULL;
-static void (*_glUniform3iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
-static void (*_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) = NULL;
-static void (*_glUniform4iv)(GLint location, GLsizei count, const GLint* v) = NULL;
-static void (*_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUseProgram)(GLuint program) = NULL;
-static void (*_glValidateProgram)(GLuint program) = NULL;
static void (*_glVertexAttrib1f)(GLuint indx, GLfloat x) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib1fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib2fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib3fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib4fv)(GLuint indx, const GLfloat* values) = NULL;
-static void (*_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) = NULL;
-static void (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static void (*_glEGLImageTargetTexture2DOES) (GLenum target, GLeglImageOES image) = NULL;
+static void (*_glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) = NULL;
#define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
+/*
+This generates a function that when first called overwrites it's plt entry with new address. Subsequent calls jump directly at the target function in the android library. This means effectively 0 call overhead after the first call.
+*/
+
+#define GLES2_IDLOAD(sym) \
+ __asm__ (".type " #sym ", %gnu_indirect_function"); \
+typeof(sym) * sym ## _dispatch (void) __asm__ (#sym);\
+typeof(sym) * sym ## _dispatch (void) \
+{ \
+ return (void *) android_dlsym(_libglesv2, #sym); \
+}
+
static void __attribute__((constructor)) _init_androidglesv2() {
_libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW);
- GLES2_LOAD(glActiveTexture);
- GLES2_LOAD(glAttachShader);
- GLES2_LOAD(glBindAttribLocation);
- GLES2_LOAD(glBindBuffer);
- GLES2_LOAD(glBindFramebuffer);
- GLES2_LOAD(glBindRenderbuffer);
- GLES2_LOAD(glBindTexture);
GLES2_LOAD(glBlendColor);
- GLES2_LOAD(glBlendEquation);
- GLES2_LOAD(glBlendEquationSeparate);
- GLES2_LOAD(glBlendFunc);
- GLES2_LOAD(glBlendFuncSeparate);
- GLES2_LOAD(glBufferData);
- GLES2_LOAD(glBufferSubData);
- GLES2_LOAD(glCheckFramebufferStatus);
- GLES2_LOAD(glClear);
GLES2_LOAD(glClearColor);
GLES2_LOAD(glClearDepthf);
- GLES2_LOAD(glClearStencil);
- GLES2_LOAD(glColorMask);
- GLES2_LOAD(glCompileShader);
- GLES2_LOAD(glCompressedTexImage2D);
- GLES2_LOAD(glCompressedTexSubImage2D);
- GLES2_LOAD(glCopyTexImage2D);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/hardware/hardware.c
^
|
@@ -19,7 +19,7 @@
#include <dlfcn.h>
#include <stddef.h>
#include <hardware/hardware.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
static void *_libhardware = NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/EGL/eglext.h
^
|
@@ -456,6 +456,22 @@
#endif
#endif
+
+#ifndef EGL_EXT_swap_buffers_with_damage
+#define EGL_EXT_swap_buffers_with_damage 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT( EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif
+
+
+#ifndef EGL_EXT_buffer_age
+#define EGL_EXT_buffer_age 1
+#define EGL_BUFFER_AGE_EXT 0x313D
+#endif
+
+
#include <EGL/eglmesaext.h>
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/Makefile.am
^
|
@@ -68,3 +68,9 @@
dlfcnincludedir = $(includedir)/hybris/dlfcn
dlfcninclude_HEADERS = \
hybris/dlfcn/dlfcn.h
+
+commonincludedir = $(includedir)/hybris/common
+commoninclude_HEADERS = \
+ hybris/common/binding.h \
+ hybris/common/floating_point_abi.h \
+ hybris/common/dlfcn.h
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/hybris/common/binding.h
^
|
@@ -0,0 +1,448 @@
+
+/**
+ * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
+ * 2012 Canonical Ltd
+ * 2013 Jolla Ltd.
+ *
+ * Auto-generated via "generate_wrapper_macros.py"
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+#ifndef HYBRIS_BINDING_H_
+#define HYBRIS_BINDING_H_
+
+/* floating_point_abi.h defines FP_ATTRIB */
+#include <hybris/common/floating_point_abi.h>
+
+void *android_dlopen(const char *filename, int flag);
+void *android_dlsym(void *name, const char *symbol);
+int android_dlclose(void *handle);
+const char *android_dlerror(void);
+int android_dladdr(const void *addr, void *info);
+
+
+
+/**
+ * XXX AUTO-GENERATED FILE XXX
+ *
+ * Do not edit this file directly, but update the templates in
+ * utils/generate_wrapper_macros.py and run it again to build
+ * an updated version of this header file:
+ *
+ * python utils/generate_wrapper_macros.py > \
+ * hybris/include/hybris/common/binding.h
+ *
+ * If you need macros with more arguments, just customize the
+ * MAX_ARGS variable in generate_wrapper_macros.py.
+ *
+ * XXX AUTO-GENERATED FILE XXX
+ **/
+
+
+#define HYBRIS_DLSYSM(name, fptr, sym) \
+ if (!name##_handle) \
+ hybris_##name##_initialize(); \
+ if (*(fptr) == NULL) \
+ { \
+ *(fptr) = (void *) android_dlsym(name##_handle, sym); \
+ }
+
+#define HYBRIS_LIBRARY_INITIALIZE(name, path) \
+ void *name##_handle; \
+ void hybris_##name##_initialize() \
+ { \
+ name##_handle = android_dlopen(path, RTLD_LAZY); \
+ }
+
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
+ return_type symbol() \
+ { \
+ static return_type (*f)() FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION1(name, return_type, symbol, a1) \
+ return_type symbol(a1 n1) \
+ { \
+ static return_type (*f)(a1) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION2(name, return_type, symbol, a1, a2) \
+ return_type symbol(a1 n1, a2 n2) \
+ { \
+ static return_type (*f)(a1, a2) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION3(name, return_type, symbol, a1, a2, a3) \
+ return_type symbol(a1 n1, a2 n2, a3 n3) \
+ { \
+ static return_type (*f)(a1, a2, a3) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION4(name, return_type, symbol, a1, a2, a3, a4) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION5(name, return_type, symbol, a1, a2, a3, a4, a5) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION6(name, return_type, symbol, a1, a2, a3, a4, a5, a6) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION7(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION8(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION9(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION10(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION11(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION12(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION13(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION14(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13, a14 n14) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) FP_ATTRIB = NULL; \
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/hybris/common/dlfcn.h
^
|
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013 Intel Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _HYBRIS_DLFCN_H_
+#define _HYBRIS_DLFCN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *hybris_dlopen(const char *filename, int flag);
+void *hybris_dlsym(void *handle, const char *symbol);
+int hybris_dlclose(void *handle);
+char *hybris_dlerror(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _HYBRIS_DLFCN_H_
+
+// vim: noai:ts=4:sw=4:ss=4:expandtab
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/hybris/common/floating_point_abi.h
^
|
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Jolla Ltd.
+ * Contact: Thomas Perl <thomas.perl@jollamobile.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HYBRIS_FLOATING_POINT_ABI_H_
+#define HYBRIS_FLOATING_POINT_ABI_H_
+
+/**
+ * Make sure to use FP_ATTRIB on all functions that are loaded from
+ * Android (bionic libc) libraries to make sure floating point arguments
+ * are passed the right way.
+ *
+ * See: http://wiki.debian.org/ArmHardFloatPort/VfpComparison
+ * http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
+ *
+ * It doesn't hurt to have it added for non-floating point arguments and
+ * return types, even though it does not really have any effect.
+ *
+ * If you use the convenience macros in hybris/common/binding.h, your
+ * wrapper functions will automatically make use of this attribute.
+ **/
+
+#ifdef __ARM_PCS_VFP
+# define FP_ATTRIB __attribute__((pcs("aapcs")))
+#else
+# define FP_ATTRIB
+#endif
+
+#endif /* HYBRIS_FLOATING_POINT_ABI_H_ */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/include/hybris/dlfcn/dlfcn.h
^
|
@@ -15,22 +15,7 @@
*
*/
-#ifndef _HYBRIS_DLFCN_H_
-#define _HYBRIS_DLFCN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void *hybris_dlopen(const char *filename, int flag);
-void *hybris_dlsym(void *handle, const char *symbol);
-int hybris_dlclose(void *handle);
-char *hybris_dlerror(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _HYBRIS_DLFCN_H_
+/* File was moved. Just providing it here for compatibility */
+#include <hybris/common/dlfcn.h>
// vim: noai:ts=4:sw=4:ss=4:expandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/input/is.c
^
|
@@ -21,7 +21,7 @@
#include <stddef.h>
#include <stdbool.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/input/input_stack_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libis_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
^
|
@@ -32,7 +32,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(libnfc_ndef_so, "/system/lib/libnfc_ndef.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/libnfc_nxp/libnfc_nxp.c
^
|
@@ -54,7 +54,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(libnfc_so, "/system/lib/libnfc.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/properties/cache.c
^
|
@@ -44,6 +44,7 @@
static int max_prop;
/* helpers */
+static void cache_update();
static int prop_qcmp(const void *a, const void *b);
static struct hybris_prop_value *cache_find_internal(const char *key);
static void cache_add_internal(const char *key, const char *value);
@@ -65,6 +66,37 @@
*/
char *hybris_propcache_find(const char *key)
{
+ char *ret = NULL;
+
+ cache_update();
+
+ /* then look up the key and do a copy if we get a result */
+ struct hybris_prop_value *prop = cache_find_internal(key);
+ if (prop)
+ return prop->value;
+
+out:
+ return ret;
+}
+
+void hybris_propcache_list(hybris_propcache_list_cb cb, void *cookie)
+{
+ int n;
+ struct hybris_prop_value *current;
+
+ if (!cb)
+ return;
+
+ cache_update();
+
+ for (n = 0; n < max_prop; n++) {
+ current = &prop_array[n];
+ cb(current->key, current->value, cookie);
+ }
+}
+
+static void cache_update()
+{
struct stat st;
FILE *f = fopen("/system/build.prop", "r");
char *ret = NULL;
@@ -98,14 +130,8 @@
qsort(prop_array, max_prop, sizeof(struct hybris_prop_value), prop_qcmp);
}
- /* then look up the key and do a copy if we get a result */
- struct hybris_prop_value *prop = cache_find_internal(key);
- if (prop)
- ret = strdup(prop->value);
-
out:
fclose(f);
- return ret;
}
/* private:
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/properties/properties.c
^
|
@@ -118,8 +118,7 @@
return result;
}
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
- void *cookie)
+int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie)
{
int err;
prop_msg_t msg;
@@ -128,9 +127,9 @@
msg.cmd = PROP_MSG_LISTPROP;
err = send_prop_msg(&msg, propfn, cookie);
- if (err < 0) {
- return err;
- }
+ if (err < 0)
+ /* fallback to property cache */
+ hybris_propcache_list((hybris_propcache_list_cb) propfn, cookie);
return 0;
}
@@ -176,7 +175,6 @@
if (ret) {
strcpy(value, ret);
- free(ret);
return strlen(value);
} else if (default_value != NULL) {
strcpy(value, default_value);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/properties/properties_p.h
^
|
@@ -18,6 +18,9 @@
#ifndef HYBRIS_PROPERTIES
#define HYBRIS_PROPERTIES
+typedef void (*hybris_propcache_list_cb)(const char *key, const char *value, void *cookie);
+
+void hybris_propcache_list(hybris_propcache_list_cb cb, void *cookie);
char *hybris_propcache_find(const char *key);
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/sf/sf.c
^
|
@@ -21,7 +21,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/tests/test_camera.c
^
|
@@ -120,6 +120,8 @@
char fn[256];
sprintf(fn, "/tmp/shot_%d.jpeg", shot_counter);
int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if(fd < 0)
+ return;
ssize_t ret = write(fd, data, data_size);
close(fd);
shot_counter++;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/tests/test_glesv2.c
^
|
@@ -148,8 +148,17 @@
//glViewport ( 0 , 0 , 800, 600); // commented out so it uses the initial window dimensions
glClearColor ( 1. , 1. , 1. , 1.); // background color
float phase = 0;
+ int frames = -1;
+ if(argc == 2) {
+ frames = atoi(argv[1]);
+ }
+ if(frames < 0) {
+ frames = 30 * 60;
+ }
+
int i;
- for (i=0; i<3*60; ++i) {
+ for (i = 0; i < frames; ++i) {
+ if(i % 60 == 0) printf("frame:%i\n", i);
glClear(GL_COLOR_BUFFER_BIT);
glUniform1f ( phase_loc , phase ); // write the value of phase to the shaders phase
phase = fmodf ( phase + 0.5f , 2.f * 3.141f ); // and update the local variable
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/tests/test_gps.c
^
|
@@ -38,6 +38,7 @@
const UlpPhoneContextInterface *UlpPhoneContext = NULL;
#endif /* HAVE_ULP */
char *apn = 0;
+char *agps_server = 0;
static const GpsInterface* get_gps_interface()
{
@@ -436,7 +437,7 @@
char *location = 0, *longitude, *latitude;
float accuracy = 100; /* Use 100m as location accuracy by default */
- while ((opt = getopt(argc, argv, "acl:p:rtux")) != -1)
+ while ((opt = getopt(argc, argv, "acl:p:s:rtux")) != -1)
{
switch (opt) {
case 'a':
@@ -463,6 +464,9 @@
case 'p':
apn = optarg;
break;
+ case 's':
+ agps_server = optarg;
+ break;
case 'u':
ulp = 1;
break;
@@ -475,6 +479,7 @@
\t-a for agps,\n \
\t-c for coldstarting the gps,\n \
\t-p <apn name> to specify an apn name,\n \
+ \t-s <agps_server:port> to specify a different supls server.\n \
\t-r for agpsril,\n \
\t-t to inject time,\n \
\t-u to use ULP (if available,\n \
@@ -514,7 +519,19 @@
fprintf(stdout, "*** set up agps interface\n");
AGps->init(&callbacks2);
fprintf(stdout, "*** set up agps server\n");
- AGps->set_server(AGPS_TYPE_SUPL, "supl.google.com", 7276);
+ if(agps_server)
+ {
+ char *server,*port = 0;
+
+ server = strdup(agps_server);
+ strtok_r (server, ":", &port);
+
+ fprintf(stdout, "SUPL server: %s at port number: %s\n", server, port);
+ AGps->set_server(AGPS_TYPE_SUPL, server, atoi(port));
+ free(server);
+ }
+ else
+ AGps->set_server(AGPS_TYPE_SUPL, "supl.google.com", 7276);
}
if(agpsril)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/ui/ui.c
^
|
@@ -17,7 +17,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/ui/ui_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/utils/getprop.c
^
|
@@ -33,7 +33,7 @@
char temp[PROP_VALUE_MAX + PROP_NAME_MAX + 16];
snprintf(temp, sizeof(temp), "[%s]: [%s]", key, name);
- list->items = realloc(list->items, (list->count + 1) * sizeof(char **));
+ list->items = realloc(list->items, (list->count + 1) * sizeof(char *));
list->items[list->count++] = strdup(temp);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/hybris/vibrator/vibrator.c
^
|
@@ -20,7 +20,7 @@
#include <stddef.h>
#include <stdbool.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(vibrator, "/system/lib/libhardware_legacy.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/libhybris/utils/generate_wrapper_macros.py
^
|
@@ -77,7 +77,7 @@
#define HYBRIS_BINDING_H_
/* floating_point_abi.h defines FP_ATTRIB */
-#include <hybris/internal/floating_point_abi.h>
+#include <hybris/common/floating_point_abi.h>
void *android_dlopen(const char *filename, int flag);
void *android_dlsym(void *name, const char *symbol);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/.gitignore
^
|
@@ -28,9 +28,42 @@
aclocal-copy
arm-*-linux-gnueabi-libtool
+# Generated .pc, .h and .c files
+hybris/camera/libcamera.pc
+hybris/documentation.list
+hybris/egl/egl.pc
+hybris/egl/platforms/common/hybris-egl-platform.pc
+hybris/egl/platforms/common/wayland-android-client-protocol.h
+hybris/egl/platforms/common/wayland-android-protocol.c
+hybris/egl/platforms/common/wayland-android-server-protocol.h
+hybris/egl/platforms/common/wayland-egl.pc
+hybris/egl/platforms/hwcomposer/hwcomposer-egl.pc
+hybris/glesv1/glesv1_cm.pc
+hybris/glesv2/glesv2.pc
+hybris/hardware/libhardware.pc
+hybris/input/libis.pc
+hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.pc
+hybris/libnfc_nxp/libnfc_nxp.pc
+hybris/libsync/libsync.pc
+hybris/properties/libandroid-properties.pc
+hybris/sf/libsf.pc
+hybris/vibrator/libvibrator.pc
+
+# Util binaries
+hybris/utils/getprop
+hybris/utils/setprop
+
+# Test binaries
+hybris/tests/test_camera
+hybris/tests/test_egl_configs
+hybris/tests/test_gps
+hybris/tests/test_input
+hybris/tests/test_nfc
+hybris/tests/test_sf
hybris/tests/test_egl
hybris/tests/test_glesv2
hybris/tests/test_lights
hybris/tests/test_offscreen_rendering
hybris/tests/test_sensors
hybris/tests/test_ui
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/camera/camera.c
^
|
@@ -21,7 +21,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/camera/camera_compatibility_layer.h>
#include <hybris/camera/camera_compatibility_layer_capabilities.h>
#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/common/dlfcn.c
^
|
@@ -16,7 +16,7 @@
*/
#include <../include/hybris/dlfcn/dlfcn.h>
-#include <../include/hybris/internal/binding.h>
+#include <../include/hybris/common/binding.h>
void *hybris_dlopen(const char *filename, int flag)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/common/hooks.c
^
|
@@ -2,7 +2,6 @@
* Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
* Copyright (c) 2012 Canonical Ltd
* Copyright (c) 2013 Christophe Chapuis <chris.chapuis@gmail.com>
- * Copyright (c) 2013 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +17,7 @@
*
*/
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include "hooks_shm.h"
@@ -33,17 +32,22 @@
#include <strings.h>
#include <dlfcn.h>
#include <pthread.h>
+#include <sys/xattr.h>
+#include <grp.h>
#include <signal.h>
#include <errno.h>
#include <dirent.h>
#include <sys/types.h>
+#include <stdarg.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#include <fcntl.h>
+#include <netdb.h>
#include <unistd.h>
+#include <syslog.h>
#include <locale.h>
-#include <search.h>
#include <hybris/properties/properties.h>
@@ -493,7 +497,6 @@
*((int *)__mutex) = (int) realmutex;
}
- /* TODO: Android uses CLOCK_MONOTONIC here but I am not sure which one to use */
clock_gettime(CLOCK_REALTIME, &tv);
tv.tv_sec += __msecs/1000;
tv.tv_nsec += (__msecs % 1000) * 1000000;
@@ -710,7 +713,6 @@
*((unsigned int *) mutex) = (unsigned int) realmutex;
}
- /* TODO: Android uses CLOCK_MONOTONIC here but I am not sure which one to use */
struct timespec tv;
clock_gettime(CLOCK_REALTIME, &tv);
tv.tv_sec += reltime->tv_sec;
@@ -1173,6 +1175,79 @@
return 0;
}
+/* "struct dirent" from bionic/libc/include/dirent.h */
+struct bionic_dirent {
+ uint64_t d_ino;
+ int64_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
+
+static struct bionic_dirent *my_readdir(DIR *dirp)
+{
+ /**
+ * readdir(3) manpage says:
+ * The data returned by readdir() may be overwritten by subsequent calls
+ * to readdir() for the same directory stream.
+ *
+ * XXX: At the moment, for us, the data will be overwritten even by
+ * subsequent calls to /different/ directory streams. Eventually fix that
+ * (e.g. by storing per-DIR * bionic_dirent structs, and removing them on
+ * closedir, requires hooking of all funcs returning/taking DIR *) and
+ * handling the additional data attachment there)
+ **/
+
+ static struct bionic_dirent result;
+
+ struct dirent *real_result = readdir(dirp);
+ if (!real_result) {
+ return NULL;
+ }
+
+ result.d_ino = real_result->d_ino;
+ result.d_off = real_result->d_off;
+ result.d_reclen = real_result->d_reclen;
+ result.d_type = real_result->d_type;
+ memcpy(result.d_name, real_result->d_name, sizeof(result.d_name));
+
+ // Make sure the string is zero-terminated, even if cut off (which
+ // shouldn't happen, as both bionic and glibc have d_name defined
+ // as fixed array of 256 chars)
+ result.d_name[sizeof(result.d_name)-1] = '\0';
+ return &result;
+}
+
+static int my_readdir_r(DIR *dir, struct bionic_dirent *entry,
+ struct bionic_dirent **result)
+{
+ struct dirent entry_r;
+ struct dirent *result_r;
+
+ int res = readdir_r(dir, &entry_r, &result_r);
+
+ if (res == 0) {
+ if (result_r != NULL) {
+ *result = entry;
+
+ entry->d_ino = entry_r.d_ino;
+ entry->d_off = entry_r.d_off;
+ entry->d_reclen = entry_r.d_reclen;
+ entry->d_type = entry_r.d_type;
+ memcpy(entry->d_name, entry_r.d_name, sizeof(entry->d_name));
+
+ // Make sure the string is zero-terminated, even if cut off (which
+ // shouldn't happen, as both bionic and glibc have d_name defined
+ // as fixed array of 256 chars)
+ entry->d_name[sizeof(entry->d_name) - 1] = '\0';
+ } else {
+ *result = NULL;
+ }
+ }
+
+ return res;
+}
+
extern long my_sysconf(int name);
FP_ATTRIB static double my_strtod(const char *nptr, char **endptr)
@@ -1185,19 +1260,137 @@
return strtod_l(nptr, endptr, hybris_locale);
}
-static char* use_from_bionic[] = {
- "setjmp",
- "longjmp",
- NULL
+extern int __cxa_atexit(void (*)(void*), void*, void*);
+
+struct open_redirect {
+ const char *from;
+ const char *to;
+};
+
+struct open_redirect open_redirects[] = {
+ { "/dev/log/main", "/dev/log_main" },
+ { "/dev/log/radio", "/dev/log_radio" },
+ { "/dev/log/system", "/dev/log_system" },
+ { "/dev/log/events", "/dev/log_events" },
+ { NULL, NULL }
};
+int my_open(const char *pathname, int flags, ...)
+{
+ va_list ap;
+ mode_t mode = 0;
+ const char *target_path = pathname;
+
+ if (pathname != NULL) {
+ struct open_redirect *entry = &open_redirects[0];
+ while (entry->from != NULL) {
+ if (strcmp(pathname, entry->from) == 0) {
+ target_path = entry->to;
+ break;
+ }
+ entry++;
+ }
+ }
+
+ if (flags & O_CREAT) {
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+ }
+
+ return open(target_path, flags, mode);
+}
+
+/**
+ * NOTE: Normally we don't have to wrap __system_property_get (libc.so) as it is only used
+ * through the property_get (libcutils.so) function. However when property_get is used
+ * internally in libcutils.so we don't have any chance to hook our replacement in.
+ * Therefore we have to hook __system_property_get too and just replace it with the
+ * implementation of our internal property handling
+ */
+
+int my_system_property_get(const char *name, const char *value)
+{
+ return property_get(name, value, NULL);
+}
+
+static __thread void *tls_hooks[16];
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/common/jb/Makefile.am
^
|
@@ -18,6 +18,7 @@
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS) \
-I$(top_srcdir)/common \
+ -D_GNU_SOURCE \
-DLINKER_TEXT_BASE=0xB0000100 \
-DLINKER_AREA_SIZE=0x01000000 \
-DDEFAULT_HYBRIS_LD_LIBRARY_PATH="\"@DEFAULT_HYBRIS_LD_LIBRARY_PATH@\"" \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/common/jb/dlfcn.c
^
|
@@ -43,7 +43,7 @@
#define likely(expr) __builtin_expect (expr, 1)
#define unlikely(expr) __builtin_expect (expr, 0)
-static pthread_mutex_t dl_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t dl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static void set_dlerror(int err)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/configure.ac
^
|
@@ -67,6 +67,11 @@
[wayland="no"])
AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"])
+AC_ARG_ENABLE(wayland_serverside_buffers,
+ [ --enable-wayland_serverside_buffers Enable serverside buffer allocation for wayland (default=enabled)],
+ [wayland_serverside_buffers=$enableval],
+ [wayland_serverside_buffers=yes])
+AM_CONDITIONAL( [WANT_WL_SERVERSIDE_BUFFERS], [test x"$wayland_serverside_buffers" = x"yes"])
AC_ARG_ENABLE(arch,
[ --enable-arch[=arch] Compile specific CPU target(default=arm)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/egl.c
^
|
@@ -17,6 +17,8 @@
/* EGL function pointers */
#define EGL_EGLEXT_PROTOTYPES
+/* For RTLD_DEFAULT */
+#define _GNU_SOURCE
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
@@ -30,7 +32,7 @@
#include <assert.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <string.h>
#include <system/window.h>
@@ -38,6 +40,9 @@
static void *_libegl = NULL;
static void *_libgles = NULL;
+static void *_hybris_libgles1 = NULL;
+static void *_hybris_libgles2 = NULL;
+static int _egl_context_client_version = 1;
static EGLint (*_eglGetError)(void) = NULL;
@@ -134,8 +139,8 @@
egl_helper_get_mapping,
};
-#define EGL_DLSYM(fptr, sym) do { if (_libegl == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libegl, sym); } } while (0)
-#define GLESv2_DLSYM(fptr, sym) do { if (_libgles == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libgles, sym); } } while (0)
+#define EGL_DLSYM(fptr, sym) do { if (_libegl == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libegl, sym); } } while (0)
+#define GLESv2_DLSYM(fptr, sym) do { if (_libgles == NULL) { _init_androidegl(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libgles, sym); } } while (0)
EGLint eglGetError(void)
{
@@ -143,40 +148,33 @@
return (*_eglGetError)();
}
-struct _eglDisplayMapping {
- EGLNativeDisplayType ndt;
- EGLDisplay display;
-};
-
#define _EGL_MAX_DISPLAYS 100
-struct _eglDisplayMapping *_displayMappings[_EGL_MAX_DISPLAYS];
+struct _EGLDisplay *_displayMappings[_EGL_MAX_DISPLAYS];
-void _addMapping(EGLNativeDisplayType display_id, EGLDisplay display)
+void _addMapping(struct _EGLDisplay *display_id)
{
int i;
for (i = 0; i < _EGL_MAX_DISPLAYS; i++)
{
if (_displayMappings[i] == NULL)
{
- _displayMappings[i] = (struct _eglDisplayMapping *) malloc(sizeof(struct _eglDisplayMapping));
- _displayMappings[i]->ndt = display_id;
- _displayMappings[i]->display = display;
+ _displayMappings[i] = display_id;
return;
}
}
}
-EGLNativeDisplayType _egldisplay2NDT(EGLDisplay display)
+struct _EGLDisplay *hybris_egl_display_get_mapping(EGLDisplay display)
{
int i;
for (i = 0; i < _EGL_MAX_DISPLAYS; i++)
{
if (_displayMappings[i])
{
- if (_displayMappings[i]->display == display)
+ if (_displayMappings[i]->dpy == display)
{
- return _displayMappings[i]->ndt;
+ return _displayMappings[i];
}
}
@@ -189,17 +187,22 @@
EGL_DLSYM(&_eglGetDisplay, "eglGetDisplay");
EGLNativeDisplayType real_display;
- if (!ws_IsValidDisplay(display_id))
- {
- return EGL_NO_DISPLAY;
- }
-
real_display = (*_eglGetDisplay)(EGL_DEFAULT_DISPLAY);
if (real_display == EGL_NO_DISPLAY)
{
return EGL_NO_DISPLAY;
}
- _addMapping(display_id, real_display);
+
+ struct _EGLDisplay *dpy = hybris_egl_display_get_mapping(real_display);
+ if (!dpy) {
+ dpy = ws_GetDisplay(display_id);
+ if (!dpy) {
+ return EGL_NO_DISPLAY;
+ }
+ dpy->dpy = real_display;
+ _addMapping(dpy);
+ }
+
return real_display;
}
@@ -212,6 +215,9 @@
EGLBoolean eglTerminate(EGLDisplay dpy)
{
EGL_DLSYM(&_eglTerminate, "eglTerminate");
+
+ struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
+ ws_Terminate(display);
return (*_eglTerminate)(dpy);
}
@@ -252,12 +258,18 @@
{
EGL_DLSYM(&_eglCreateWindowSurface, "eglCreateWindowSurface");
- win = ws_CreateWindow(win, _egldisplay2NDT(dpy));
-
+ HYBRIS_TRACE_BEGIN("hybris-egl", "eglCreateWindowSurface", "");
+ struct _EGLDisplay *display = hybris_egl_display_get_mapping(dpy);
+ win = ws_CreateWindow(win, display);
+
assert(((struct ANativeWindowBuffer *) win)->common.magic == ANDROID_NATIVE_WINDOW_MAGIC);
+ HYBRIS_TRACE_BEGIN("native-egl", "eglCreateWindowSurface", "");
EGLSurface result = (*_eglCreateWindowSurface)(dpy, config, win, attrib_list);
+ HYBRIS_TRACE_END("native-egl", "eglCreateWindowSurface", "");
egl_helper_push_mapping(result, win);
+
+ HYBRIS_TRACE_END("hybris-egl", "eglCreateWindowSurface", "");
return result;
}
@@ -353,8 +365,26 @@
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
{
+ EGLBoolean ret;
+ EGLSurface surface;
+ EGLNativeWindowType win;
+ HYBRIS_TRACE_BEGIN("hybris-egl", "eglSwapInterval", "=%d", interval);
+
+ /* Some egl implementations don't pass through the setSwapInterval
+ * call. Since we may support various swap intervals internally, we'll
+ * call it anyway and then give the wrapped egl implementation a chance
+ * to chage it. */
+ EGL_DLSYM(&_eglGetCurrentSurface, "eglGetCurrentSurface");
+ surface = (*_eglGetCurrentSurface)(EGL_DRAW);
+ if (egl_helper_has_mapping(surface))
+ ws_setSwapInterval(dpy, egl_helper_get_mapping(surface), interval);
+
+ HYBRIS_TRACE_BEGIN("native-egl", "eglSwapInterval", "=%d", interval);
EGL_DLSYM(&_eglSwapInterval, "eglSwapInterval");
- return (*_eglSwapInterval)(dpy, interval);
+ ret = (*_eglSwapInterval)(dpy, interval);
+ HYBRIS_TRACE_END("native-egl", "eglSwapInterval", "");
+ HYBRIS_TRACE_END("hybris-egl", "eglSwapInterval", "");
+ return ret;
}
EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
@@ -362,6 +392,15 @@
const EGLint *attrib_list)
{
EGL_DLSYM(&_eglCreateContext, "eglCreateContext");
+
+ EGLint *p = attrib_list;
+ while (p != NULL && *p != EGL_NONE) {
+ if (*p == EGL_CONTEXT_CLIENT_VERSION) {
+ _egl_context_client_version = p[1];
+ }
+ p += 2;
+ }
+
return (*_eglCreateContext)(dpy, config, share_context, attrib_list);
}
@@ -412,15 +451,16 @@
EGLBoolean eglWaitNative(EGLint engine)
{
EGL_DLSYM(&_eglWaitNative, "eglWaitNative");
- return (*_eglWaitNative)(engine);
+ return (*_eglWaitNative)(engine);
}
EGLBoolean _my_eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/eglhybris.h
^
|
@@ -35,6 +35,8 @@
int hybris_egl_has_mapping(EGLSurface surface);
EGLNativeWindowType hybris_egl_get_mapping(EGLSurface surface);
+struct _EGLDisplay *hybris_egl_display_get_mapping(EGLDisplay dpy);
+
#ifdef __cplusplus
}
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/eglplatformcommon.cpp
^
|
@@ -82,6 +82,8 @@
snprintf(b, 1020, "vaddr.%p.%p.%i.%is%ix%ix%i", buf, vaddr, cnt, buf->width, buf->stride, buf->height, bytes_pp);
cnt++;
int fd = ::open(b, O_WRONLY|O_CREAT, S_IRWXU);
+ if(fd < 0)
+ return;
::write(fd, vaddr, buf->stride * buf->height * bytes_pp);
::close(fd);
@@ -93,7 +95,7 @@
extern "C" EGLBoolean eglplatformcommon_eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
assert(my_gralloc != NULL);
- server_wlegl_create(display, my_gralloc);
+ server_wlegl_create(display, my_gralloc, my_alloc);
return EGL_TRUE;
}
@@ -103,7 +105,7 @@
}
extern "C" EGLBoolean eglplatformcommon_eglQueryWaylandBufferWL(EGLDisplay dpy,
- struct wl_buffer *buffer, EGLint attribute, EGLint *value)
+ struct wl_resource *buffer, EGLint attribute, EGLint *value)
{
server_wlegl_buffer *buf = server_wlegl_buffer_from(buffer);
ANativeWindowBuffer* anwb = (ANativeWindowBuffer *) buf->buf;
@@ -132,8 +134,73 @@
return EGL_FALSE ;
}
+// Added as part of EGL_HYBRIS_WL_acquire_native_buffer. Buffers are released
+// and decRef'ed using eglHybrisReleaseNativeBuffer
+extern "C" EGLBoolean eglplatformcommon_eglHybrisAcquireNativeBufferWL(EGLDisplay dpy, struct wl_resource *wlBuffer, EGLClientBuffer *buffer)
+ {
+ if (!buffer)
+ return EGL_FALSE;
+ server_wlegl_buffer *buf = server_wlegl_buffer_from(wlBuffer);
+ if (!buf->buf->isAllocated()) {
+ // We only return the handles from buffers which are allocated server side. This is because some
+ // hardware compositors have problems with client-side allocated buffers.
+ buffer = 0;
+ return EGL_FALSE;
+ }
+ ANativeWindowBuffer* anwb = (ANativeWindowBuffer *) buf->buf;
+ anwb->common.incRef(&anwb->common);
+ *buffer = (EGLClientBuffer *) anwb;
+ return EGL_TRUE;
+}
+
#endif
+// Added as part of EGL_HYBRIS_native_buffer2
+extern "C" EGLBoolean eglplatformcommon_eglHybrisNativeBufferHandle(EGLDisplay dpy, EGLClientBuffer buffer, void **handle)
+{
+ if (!buffer || !handle)
+ return EGL_FALSE;
+ ANativeWindowBuffer *anwb = (ANativeWindowBuffer *) buffer;
+ *handle = (void *) anwb->handle;
+ return EGL_TRUE;
+}
+
+extern "C" void eglplatformcommon_eglHybrisGetNativeBufferInfo(EGLClientBuffer buffer, int *num_ints, int *num_fds)
+{
+ RemoteWindowBuffer *buf = static_cast<RemoteWindowBuffer *>((ANativeWindowBuffer *) buffer);
+ *num_ints = buf->handle->numInts;
+ *num_fds = buf->handle->numFds;
+}
+
+extern "C" void eglplatformcommon_eglHybrisSerializeNativeBuffer(EGLClientBuffer buffer, int *ints, int *fds)
+{
+ RemoteWindowBuffer *buf = static_cast<RemoteWindowBuffer *>((ANativeWindowBuffer *) buffer);
+ memcpy(ints, buf->handle->data + buf->handle->numFds, buf->handle->numInts * sizeof(int));
+ memcpy(fds, buf->handle->data, buf->handle->numFds * sizeof(int));
+}
+
+extern "C" EGLBoolean eglplatformcommon_eglHybrisCreateRemoteBuffer(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint stride,
+ int num_ints, int *ints, int num_fds, int *fds, EGLClientBuffer *buffer)
+{
+ assert(my_gralloc != NULL);
+
+ native_handle_t *native = native_handle_create(num_fds, num_ints);
+ memcpy(&native->data[0], fds, num_fds * sizeof(int));
+ memcpy(&native->data[num_fds], ints, num_ints * sizeof(int));
+
+ int ret = my_gralloc->registerBuffer(my_gralloc, (buffer_handle_t)native);
+
+ if (ret == 0)
+ {
+ RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, stride, format, usage, (buffer_handle_t)native, my_gralloc, my_alloc);
+ buf->common.incRef(&buf->common);
+ *buffer = (EGLClientBuffer) static_cast<ANativeWindowBuffer *>(buf);
+ return EGL_TRUE;
+ }
+ else
+ return EGL_FALSE;
+}
+
extern "C" EGLBoolean eglplatformcommon_eglHybrisCreateNativeBuffer(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint *stride, EGLClientBuffer *buffer)
{
int ret;
@@ -147,8 +214,9 @@
if (ret == 0)
{
- RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, _stride, format, usage, _handle, my_gralloc);
+ RemoteWindowBuffer *buf = new RemoteWindowBuffer(width, height, _stride, format, usage, _handle, my_gralloc, my_alloc);
buf->common.incRef(&buf->common);
+ buf->setAllocated(true);
*buffer = (EGLClientBuffer) static_cast<ANativeWindowBuffer *>(buf);
*stride = _stride;
return EGL_TRUE;
@@ -203,9 +271,9 @@
static int debugenvchecked = 0;
if (*target == EGL_WAYLAND_BUFFER_WL)
{
- server_wlegl_buffer *buf = server_wlegl_buffer_from((struct wl_buffer *)*buffer);
- HYBRIS_TRACE_BEGIN("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", ((struct wl_buffer *)*buffer)->resource.object.id);
- HYBRIS_TRACE_END("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", ((struct wl_buffer *)*buffer)->resource.object.id);
+ server_wlegl_buffer *buf = server_wlegl_buffer_from((struct wl_resource *)*buffer);
+ HYBRIS_TRACE_BEGIN("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", wl_resource_get_id((struct wl_resource *)*buffer));
+ HYBRIS_TRACE_END("eglplatformcommon", "Wayland_eglImageKHR", "-resource@%i", wl_resource_get_id((struct wl_resource *)*buffer));
if (debugenvchecked == 0)
{
if (getenv("HYBRIS_WAYLAND_KHR_DUMP_BUFFERS") != NULL)
@@ -241,6 +309,11 @@
return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglQueryWaylandBufferWL;
}
else
+ if (strcmp(procname, "eglHybrisAcquireNativeBufferWL") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType) eglplatformcommon_eglHybrisAcquireNativeBufferWL;
+ }
+ else
#endif
if (strcmp(procname, "eglHybrisCreateNativeBuffer") == 0)
{
@@ -261,6 +334,26 @@
{
return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisReleaseNativeBuffer;
}
+ else
+ if (strcmp(procname, "eglHybrisGetNativeBufferInfo") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisGetNativeBufferInfo;
+ }
+ else
+ if (strcmp(procname, "eglHybrisSerializeNativeBuffer") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisSerializeNativeBuffer;
+ }
+ else
+ if (strcmp(procname, "eglHybrisCreateRemoteBuffer") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisCreateRemoteBuffer;
+ }
+ else
+ if (strcmp(procname, "eglHybrisNativeBufferHandle") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglHybrisNativeBufferHandle;
+ }
return NULL;
}
@@ -271,8 +364,7 @@
{
const char *ret = (*real_eglQueryString)(dpy, name);
static char eglextensionsbuf[512];
- assert(ret != NULL);
- snprintf(eglextensionsbuf, 510, "%sEGL_HYBRIS_native_buffer %s", ret,
+ snprintf(eglextensionsbuf, 510, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
#ifdef WANT_WAYLAND
"EGL_WL_bind_wayland_display "
#else
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/hybris_nativebufferext.h
^
|
@@ -24,6 +24,12 @@
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISUNLOCKNATIVEBUFFERPROC)(EGLClientBuffer buffer);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISRELEASENATIVEBUFFERPROC)(EGLClientBuffer buffer);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISGETNATIVEBUFFERINFOPROC)(EGLClientBuffer buffer, int *num_ints, int *num_fds);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC)(EGLClientBuffer buffer, int *ints, int *fds);
+
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLHYBRISCREATEREMOTEBUFFERPROC)(EGLint width, EGLint height, EGLint usage, EGLint format, EGLint stride,
+ int num_ints, int *ints, int num_fds, int *fds, EGLClientBuffer *buffer);
+
enum {
/* buffer is never read in software */
HYBRIS_USAGE_SW_READ_NEVER = 0x00000000,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/nativewindowbase.cpp
^
|
@@ -5,7 +5,7 @@
#include "support.h"
#include <stdarg.h>
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
extern "C" {
#include <sync/sync.h>
}
@@ -99,7 +99,7 @@
ANativeWindow::setSwapInterval = _setSwapInterval;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
ANativeWindow::lockBuffer_DEPRECATED = &_lockBuffer_DEPRECATED;
ANativeWindow::dequeueBuffer_DEPRECATED = &_dequeueBuffer_DEPRECATED;
ANativeWindow::queueBuffer_DEPRECATED = &_queueBuffer_DEPRECATED;
@@ -164,7 +164,7 @@
*buffer = static_cast<ANativeWindowBuffer*>(temp);
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
if (fenceFd >= 0)
{
sync_wait(fenceFd, -1);
@@ -257,7 +257,7 @@
case NATIVE_WINDOW_DEFAULT_WIDTH: return "NATIVE_WINDOW_DEFAULT_WIDTH";
case NATIVE_WINDOW_DEFAULT_HEIGHT: return "NATIVE_WINDOW_DEFAULT_HEIGHT";
case NATIVE_WINDOW_TRANSFORM_HINT: return "NATIVE_WINDOW_TRANSFORM_HINT";
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1 || ANDROID_VERSION_MAJOR>=5
case NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND: return "NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND";
#endif
default: return "NATIVE_UNKNOWN_QUERY";
@@ -371,7 +371,7 @@
case NATIVE_WINDOW_API_DISCONNECT : // 14, /* private */
TRACE("api disconnect");
break;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=1 || ANDROID_VERSION_MAJOR>=5
case NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS : // 15, /* private */
TRACE("set buffers user dimensions");
break;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/server_wlegl.cpp
^
|
@@ -39,7 +39,7 @@
static inline server_wlegl *
server_wlegl_from(struct wl_resource *resource)
{
- return reinterpret_cast<server_wlegl *>(resource->data);
+ return reinterpret_cast<server_wlegl *>(wl_resource_get_user_data(resource));
}
static void
@@ -97,7 +97,7 @@
return;
}
- buffer = server_wlegl_buffer_create(id, width, height, stride,
+ buffer = server_wlegl_buffer_create(client, id, width, height, stride,
format, usage, native, wlegl);
if (!buffer) {
native_handle_close((native_handle_t *)native);
@@ -107,13 +107,49 @@
"invalid native handle");
return;
}
+}
+
+static void
+server_wlegl_get_server_buffer_handle(wl_client *client, wl_resource *res, uint32_t id, int32_t width, int32_t height, int32_t format, int32_t usage)
+{
+ if (width == 0 || height == 0) {
+ wl_resource_post_error(res, 0, "invalid buffer size: %u,%u\n", width, height);
+ return;
+ }
+
+ server_wlegl *wlegl = server_wlegl_from(res);
+
+ wl_resource *resource = wl_resource_create(client, &android_wlegl_server_buffer_handle_interface, wl_resource_get_version(res), id);
+
+ buffer_handle_t _handle;
+ int _stride;
+
+ usage |= GRALLOC_USAGE_HW_COMPOSER;
+
+ int ret = wlegl->alloc->alloc(wlegl->alloc, width, height, format, usage, &_handle, &_stride);
+ server_wlegl_buffer *buffer = server_wlegl_buffer_create_server(client, width, height, _stride, format, usage, _handle, wlegl);
+
+ struct wl_array ints;
+ int *ints_data;
+ wl_array_init(&ints);
+ ints_data = (int*) wl_array_add(&ints, _handle->numInts * sizeof(int));
+ memcpy(ints_data, _handle->data + _handle->numFds, _handle->numInts * sizeof(int));
+
+ android_wlegl_server_buffer_handle_send_buffer_ints(resource, &ints);
+ wl_array_release(&ints);
+
+ for (int i = 0; i < _handle->numFds; i++) {
+ android_wlegl_server_buffer_handle_send_buffer_fd(resource, _handle->data[i]);
+ }
- wl_client_add_resource(client, &buffer->base.resource);
+ android_wlegl_server_buffer_handle_send_buffer(resource, buffer->resource, format, _stride);
+ wl_resource_destroy(resource);
}
static const struct android_wlegl_interface server_wlegl_impl = {
server_wlegl_create_handle,
server_wlegl_create_buffer,
+ server_wlegl_get_server_buffer_handle,
};
static void
@@ -123,12 +159,12 @@
server_wlegl *wlegl = reinterpret_cast<server_wlegl *>(data);
struct wl_resource *resource;
- resource = wl_client_add_object(client, &android_wlegl_interface,
- &server_wlegl_impl, id, wlegl);
+ resource = wl_resource_create(client, &android_wlegl_interface, version, id);
+ wl_resource_set_implementation(resource, &server_wlegl_impl, wlegl, 0);
}
server_wlegl *
-server_wlegl_create(struct wl_display *display, gralloc_module_t *gralloc)
+server_wlegl_create(struct wl_display *display, gralloc_module_t *gralloc, alloc_device_t *alloc)
{
struct server_wlegl *wlegl;
int ret;
@@ -136,10 +172,10 @@
wlegl = new server_wlegl;
wlegl->display = display;
- wlegl->global = wl_display_add_global(display,
- &android_wlegl_interface,
+ wlegl->global = wl_global_create(display, &android_wlegl_interface, 2,
wlegl, server_wlegl_bind);
wlegl->gralloc = (const gralloc_module_t *)gralloc;
+ wlegl->alloc = alloc;
return wlegl;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/server_wlegl.h
^
|
@@ -37,7 +37,7 @@
struct server_wlegl;
server_wlegl *
-server_wlegl_create(struct wl_display *wldpy, gralloc_module_t *gralloc);
+server_wlegl_create(struct wl_display *wldpy, gralloc_module_t *gralloc, alloc_device_t *alloc);
void
server_wlegl_destroy(server_wlegl *wlegl);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/server_wlegl_buffer.cpp
^
|
@@ -38,27 +38,22 @@
};
server_wlegl_buffer *
-server_wlegl_buffer_from(struct wl_buffer *buffer)
+server_wlegl_buffer_from(struct wl_resource *buffer)
{
- if (buffer->resource.object.implementation !=
- (void (**)(void)) &server_wlegl_buffer_impl)
- return NULL;
-
- return container_of(buffer, server_wlegl_buffer, base);
+ return static_cast<server_wlegl_buffer *>(wl_resource_get_user_data(buffer));
}
static void
server_wlegl_buffer_dtor(struct wl_resource *resource)
{
- struct wl_buffer *base =
- reinterpret_cast<struct wl_buffer*>(resource->data);
- server_wlegl_buffer *buffer = server_wlegl_buffer_from(base);
+ server_wlegl_buffer *buffer = server_wlegl_buffer_from(resource);
buffer->buf->common.decRef(&buffer->buf->common);
delete buffer;
}
server_wlegl_buffer *
-server_wlegl_buffer_create(uint32_t id,
+server_wlegl_buffer_create(wl_client *client,
+ uint32_t id,
int32_t width,
int32_t height,
int32_t stride,
@@ -70,29 +65,42 @@
server_wlegl_buffer *buffer = new server_wlegl_buffer;
int ret;
- memset(buffer, 0, sizeof(*buffer));
-
buffer->wlegl = wlegl;
-
- buffer->base.resource.object.id = id;
- buffer->base.resource.object.interface = &wl_buffer_interface;
- buffer->base.resource.object.implementation =
- (void (**)(void)) &server_wlegl_buffer_impl;
-
- buffer->base.resource.data = &buffer->base;
- buffer->base.resource.destroy = server_wlegl_buffer_dtor;
-
- buffer->base.width = width;
- buffer->base.height = height;
+ buffer->resource = wl_resource_create(client, &wl_buffer_interface, 1, id);
+ wl_resource_set_implementation(buffer->resource, &server_wlegl_buffer_impl, buffer, server_wlegl_buffer_dtor);
ret = wlegl->gralloc->registerBuffer(wlegl->gralloc, handle);
if (ret) {
delete buffer;
return NULL;
}
-
+
+ buffer->buf = new RemoteWindowBuffer(
+ width, height, stride, format, usage, handle, wlegl->gralloc, NULL);
+ buffer->buf->common.incRef(&buffer->buf->common);
+ return buffer;
+}
+
+server_wlegl_buffer *
+server_wlegl_buffer_create_server(wl_client *client,
+ int32_t width,
+ int32_t height,
+ int32_t stride,
+ int32_t format,
+ int32_t usage,
+ buffer_handle_t handle,
+ server_wlegl *wlegl)
+{
+ server_wlegl_buffer *buffer = new server_wlegl_buffer;
+ int ret;
+
+ buffer->wlegl = wlegl;
+ buffer->resource = wl_resource_create(client, &wl_buffer_interface, 1, 0);
+ wl_resource_set_implementation(buffer->resource, &server_wlegl_buffer_impl, buffer, server_wlegl_buffer_dtor);
+
buffer->buf = new RemoteWindowBuffer(
- width, height, stride, format, usage, handle, wlegl->gralloc);
+ width, height, stride, format, usage, handle, wlegl->gralloc, wlegl->alloc);
+ buffer->buf->setAllocated(true);
buffer->buf->common.incRef(&buffer->buf->common);
return buffer;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/server_wlegl_buffer.h
^
|
@@ -33,18 +33,23 @@
struct server_wlegl;
struct server_wlegl_buffer {
- struct wl_buffer base;
+ struct wl_resource *resource;
server_wlegl *wlegl;
RemoteWindowBuffer *buf;
};
server_wlegl_buffer *
-server_wlegl_buffer_create(uint32_t id, int32_t width, int32_t height,
+server_wlegl_buffer_create(wl_client *client, uint32_t id, int32_t width, int32_t height,
int32_t stride, int32_t format, int32_t usage,
buffer_handle_t handle, server_wlegl *wlegl);
server_wlegl_buffer *
-server_wlegl_buffer_from(struct wl_buffer *);
+server_wlegl_buffer_create_server(wl_client *client, int32_t width, int32_t height,
+ int32_t stride, int32_t format, int32_t usage,
+ buffer_handle_t handle, server_wlegl *wlegl);
+
+server_wlegl_buffer *
+server_wlegl_buffer_from(struct wl_resource *);
#endif /* SERVER_WLEGL_BUFFER_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/server_wlegl_private.h
^
|
@@ -34,6 +34,7 @@
struct wl_global *global;
const gralloc_module_t *gralloc;
+ alloc_device_t *alloc;
};
#endif /* SERVER_WLEGL_PRIVATE_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/wayland-android.xml
^
|
@@ -26,7 +26,7 @@
THIS SOFTWARE.
</copyright>
- <interface name="android_wlegl" version="1">
+ <interface name="android_wlegl" version="2">
<description summary="Android EGL graphics buffer support">
Interface used in the Android wrapper libEGL to share
graphics buffers between the server and the client.
@@ -67,6 +67,15 @@
<arg name="native_handle" type="object" interface="android_wlegl_handle" />
</request>
+
+ <request name="get_server_buffer_handle" since="2">
+ <arg name="id" type="new_id" interface="android_wlegl_server_buffer_handle"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="format" type="int"/>
+ <arg name="usage" type="int"/>
+ </request>
+
</interface>
<interface name="android_wlegl_handle" version="1">
@@ -91,4 +100,28 @@
</interface>
+
+ <interface name="android_wlegl_server_buffer_handle" version="1">
+ <description summary="a server allocated buffer">
+ On creation a server_side_buffer object will immediately send
+ the "buffer_fd" and "buffer_ints" events needed by the client to
+ reference the gralloc buffer, followed by the "buffer" event carrying
+ the wl_buffer object.
+ </description>
+ <event name="buffer_fd">
+ <arg name="fd" type="fd"/>
+ </event>
+ <event name="buffer_ints">
+ <arg name="ints" type="array"/>
+ </event>
+ <event name="buffer">
+ <description summary="the wl_buffer">
+ This event will be sent after the ints and all the fds have been sent
+ </description>
+ <arg name="buffer" type="new_id" interface="wl_buffer"/>
+ <arg name="format" type="int"/>
+ <arg name="stride" type="int"/>
+ </event>
+ </interface>
+
</protocol>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/wayland-egl-priv.h
^
|
@@ -27,6 +27,7 @@
void *nativewindow;
void (*resize_callback)(struct wl_egl_window *, void *);
+ void (*free_callback)(struct wl_egl_window *, void *);
};
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/wayland-egl.c
^
|
@@ -31,6 +31,7 @@
egl_window->surface = surface;
egl_window->resize_callback = NULL;
+ egl_window->free_callback = NULL;
wl_egl_window_resize(egl_window, width, height, 0, 0);
egl_window->attached_width = 0;
egl_window->attached_height = 0;
@@ -43,6 +44,8 @@
WL_EGL_EXPORT void
wl_egl_window_destroy(struct wl_egl_window *egl_window)
{
+ if (egl_window->free_callback)
+ egl_window->free_callback(egl_window, NULL);
free(egl_window);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/windowbuffer.cpp
^
|
@@ -27,7 +27,11 @@
RemoteWindowBuffer::~RemoteWindowBuffer()
{
+ if (!m_allocated) {
this->m_gralloc->unregisterBuffer(this->m_gralloc, this->handle);
native_handle_close(this->handle);
native_handle_delete(const_cast<native_handle_t*>(this->handle));
+ } else if (this->m_alloc) {
+ this->m_alloc->free((alloc_device_t *)this->m_alloc, this->handle);
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/common/windowbuffer.h
^
|
@@ -38,7 +38,8 @@
unsigned int format,
unsigned int usage,
buffer_handle_t handle,
- const gralloc_module_t *gralloc
+ const gralloc_module_t *gralloc,
+ const alloc_device_t *alloc = NULL
) {
// Base members
ANativeWindowBuffer::width = width;
@@ -48,9 +49,17 @@
ANativeWindowBuffer::stride = stride;
ANativeWindowBuffer::handle = handle;
this->m_gralloc = gralloc;
+ this->m_alloc = alloc;
+ this->m_allocated = false;
};
~RemoteWindowBuffer();
+
+ void setAllocated(bool allocated) { m_allocated = allocated; }
+ bool isAllocated() const { return m_allocated; }
+
private:
const gralloc_module_t *m_gralloc;
+ const alloc_device_t *m_alloc;
+ bool m_allocated;
};
#endif /* WINDOWBUFFER_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/fbdev/eglplatform_fbdev.cpp
^
|
@@ -44,13 +44,23 @@
eglplatformcommon_init(egl_iface, gralloc, alloc);
}
-extern "C" int fbdevws_IsValidDisplay(EGLNativeDisplayType display)
+extern "C" _EGLDisplay *fbdevws_GetDisplay(EGLNativeDisplayType display)
{
assert (gralloc != NULL);
- return display == EGL_DEFAULT_DISPLAY;
+
+ _EGLDisplay *dpy = 0;
+ if (display == EGL_DEFAULT_DISPLAY) {
+ dpy = new _EGLDisplay;
+ }
+ return dpy;
+}
+
+extern "C" void fbdevws_Terminate(_EGLDisplay *dpy)
+{
+ delete dpy;
}
-extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+extern "C" EGLNativeWindowType fbdevws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
{
assert (gralloc != NULL);
assert (_nativewindow == NULL);
@@ -80,14 +90,24 @@
eglplatformcommon_passthroughImageKHR(ctx, target, buffer, attrib_list);
}
+extern "C" void fbdevws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval)
+{
+ FbDevNativeWindow *window = static_cast<FbDevNativeWindow *>((struct ANativeWindow *)win);
+ window->setSwapInterval(interval);
+}
+
struct ws_module ws_module_info = {
fbdevws_init_module,
- fbdevws_IsValidDisplay,
+ fbdevws_GetDisplay,
+ fbdevws_Terminate,
fbdevws_CreateWindow,
fbdevws_DestroyWindow,
fbdevws_eglGetProcAddress,
fbdevws_passthroughImageKHR,
- eglplatformcommon_eglQueryString
+ eglplatformcommon_eglQueryString,
+ NULL,
+ NULL,
+ fbdevws_setSwapInterval,
};
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/fbdev/fbdev_window.cpp
^
|
@@ -71,8 +71,10 @@
m_fbDev = fbDev;
m_bufFormat = m_fbDev->format;
m_usage = GRALLOC_USAGE_HW_FB;
+ m_bufferCount = 0;
+ m_allocateBuffers = true;
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
if (m_fbDev->numFramebuffers>0)
setBufferCount(m_fbDev->numFramebuffers);
else
@@ -149,6 +151,9 @@
pthread_mutex_lock(&_mutex);
+ if (m_allocateBuffers)
+ reallocateBuffers();
+
HYBRIS_TRACE_BEGIN("fbdev-platform", "dequeueBuffer-wait", "");
#if defined(DEBUG)
@@ -451,12 +456,9 @@
*/
int FbDevNativeWindow::setUsage(int usage)
{
- int need_realloc = (m_usage != usage);
- TRACE("usage=x%x realloc=%d", usage, need_realloc);
+ m_allocateBuffers = (m_usage != usage);
+ TRACE("usage=x%x m_allocateBuffers=%d", usage, m_allocateBuffers);
m_usage = usage;
- if (need_realloc)
- this->setBufferCount(m_bufList.size());
-
return NO_ERROR;
}
@@ -469,11 +471,9 @@
*/
int FbDevNativeWindow::setBuffersFormat(int format)
{
- int need_realloc = (format != m_bufFormat);
- TRACE("format=x%x realloc=%d", format, need_realloc);
+ m_allocateBuffers |= (format != m_bufFormat);
+ TRACE("format=x%x m_allocateBuffers=%d", format, m_allocateBuffers);
m_bufFormat = format;
- if (need_realloc)
- this->setBufferCount(m_bufList.size());
return NO_ERROR;
}
@@ -485,12 +485,18 @@
int FbDevNativeWindow::setBufferCount(int cnt)
{
TRACE("cnt=%d", cnt);
- int err=NO_ERROR;
- pthread_mutex_lock(&_mutex);
+ if (m_bufferCount != cnt) {
+ m_bufferCount = cnt;
+ m_allocateBuffers = true;
+ }
+ return NO_ERROR;
+}
+void FbDevNativeWindow::reallocateBuffers()
+{
destroyBuffers();
- for(unsigned int i = 0; i < cnt; i++)
+ for(unsigned int i = 0; i < m_bufferCount; i++)
{
FbDevNativeWindowBuffer *fbnb = new FbDevNativeWindowBuffer(m_alloc,
m_fbDev->width, m_fbDev->height, m_fbDev->format,
@@ -505,16 +511,15 @@
if (fbnb->status)
{
fbnb->common.decRef(&fbnb->common);
- fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", __PRETTY_FUNCTION__, m_freeBufs, cnt);
+ fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", __PRETTY_FUNCTION__, m_freeBufs, m_bufferCount);
break;
}
m_freeBufs++;
m_bufList.push_back(fbnb);
}
- pthread_mutex_unlock(&_mutex);
- return err;
+ m_allocateBuffers = false;
}
/*
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/fbdev/fbdev_window.h
^
|
@@ -48,9 +48,9 @@
framebuffer_device_t* fbDev);
~FbDevNativeWindow();
-protected:
// overloads from BaseNativeWindow
virtual int setSwapInterval(int interval);
+protected:
virtual int dequeueBuffer(BaseNativeWindowBuffer** buffer, int* fenceFd);
virtual int queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
@@ -73,13 +73,17 @@
private:
void destroyBuffers();
+ void reallocateBuffers();
private:
framebuffer_device_t* m_fbDev;
alloc_device_t* m_alloc;
unsigned int m_usage;
unsigned int m_bufFormat;
+ unsigned int m_bufferCount;
int m_freeBufs;
+ bool m_allocateBuffers;
+
std::list<FbDevNativeWindowBuffer*> m_bufList;
FbDevNativeWindowBuffer* m_frontBuf;
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/hwcomposer/eglplatform_hwcomposer.cpp
^
|
@@ -36,13 +36,22 @@
eglplatformcommon_init(egl_iface, gralloc, alloc);
}
-extern "C" int hwcomposerws_IsValidDisplay(EGLNativeDisplayType display)
+extern "C" _EGLDisplay *hwcomposerws_GetDisplay(EGLNativeDisplayType display)
{
assert (gralloc != NULL);
- return display == EGL_DEFAULT_DISPLAY;
+ _EGLDisplay *dpy = 0;
+ if (display == EGL_DEFAULT_DISPLAY) {
+ dpy = new _EGLDisplay;
+ }
+ return dpy;
}
-extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+extern "C" void hwcomposerws_Terminate(_EGLDisplay *dpy)
+{
+ delete dpy;
+}
+
+extern "C" EGLNativeWindowType hwcomposerws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
{
assert (gralloc != NULL);
assert (_nativewindow == NULL);
@@ -76,7 +85,8 @@
struct ws_module ws_module_info = {
hwcomposerws_init_module,
- hwcomposerws_IsValidDisplay,
+ hwcomposerws_GetDisplay,
+ hwcomposerws_Terminate,
hwcomposerws_CreateWindow,
hwcomposerws_DestroyWindow,
hwcomposerws_eglGetProcAddress,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/null/Makefile.am
^
|
@@ -2,8 +2,25 @@
eglplatform_null_la_SOURCES = eglplatform_null.c
-eglplatform_null_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -I$(top_srcdir)/egl
+eglplatform_null_la_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/egl \
+ -I$(top_srcdir)/egl/platforms/common \
+ $(ANDROID_HEADERS_CFLAGS) \
+ $(WAYLAND_SERVER_CFLAGS)
-eglplatform_null_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+eglplatform_null_la_LDFLAGS = \
+ -avoid-version -module -shared -export-dynamic \
+ $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
+ $(top_builddir)/hardware/libhardware.la \
+ $(WAYLAND_SERVER_LIBS)
+if WANT_DEBUG
+eglplatform_null_la_CFLAGS += -I$(top_srcdir)/common -ggdb -O0
+endif
+if WANT_TRACE
+eglplatform_null_la_CFLAGS += -DDEBUG
+endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/null/eglplatform_null.c
^
|
@@ -3,12 +3,17 @@
#include <dlfcn.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
+#include <eglplatformcommon.h>
+#include "logging.h"
static void * (*_androidCreateDisplaySurface)();
static void *_libui = NULL;
+static gralloc_module_t *gralloc = 0;
+static alloc_device_t *alloc = 0;
+
static void _init_androidui()
{
_libui = (void *) android_dlopen("/system/lib/libui.so", RTLD_LAZY);
@@ -25,14 +30,25 @@
static void nullws_init_module(struct ws_egl_interface *egl_iface)
{
+ int err;
+ hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const hw_module_t **) &gralloc);
+ err = gralloc_open((const hw_module_t *) gralloc, &alloc);
+ TRACE("++ %lu wayland: got gralloc %p err:%s", pthread_self(), gralloc, strerror(-err));
+ eglplatformcommon_init(egl_iface, gralloc, alloc);
+
+}
+
+static struct _EGLDisplay *nullws_GetDisplay(EGLNativeDisplayType display)
+{
+ return malloc(sizeof(struct _EGLDisplay));
}
-static int nullws_IsValidDisplay(EGLNativeDisplayType display)
+static void nullws_Terminate(struct _EGLDisplay *dpy)
{
- return 1;
+ free(dpy);
}
-static EGLNativeWindowType nullws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+static EGLNativeWindowType nullws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display)
{
if (win == 0)
{
@@ -47,28 +63,14 @@
// TODO: Cleanup?
}
-static __eglMustCastToProperFunctionPointerType nullws_eglGetProcAddress(const char *procname)
-{
- return NULL;
-}
-
-static void nullws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list)
-{
-}
-
-const char *nullws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name))
-{
- return (*real_eglQueryString)(dpy, name);
-}
-
-
struct ws_module ws_module_info = {
nullws_init_module,
- nullws_IsValidDisplay,
+ nullws_GetDisplay,
+ nullws_Terminate,
nullws_CreateWindow,
nullws_DestroyWindow,
- nullws_eglGetProcAddress,
- nullws_passthroughImageKHR,
- nullws_eglQueryString
+ eglplatformcommon_eglGetProcAddress,
+ eglplatformcommon_passthroughImageKHR,
+ eglplatformcommon_eglQueryString
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/wayland/Makefile.am
^
|
@@ -21,6 +21,10 @@
eglplatform_wayland_la_CXXFLAGS += -ggdb -O0
endif
+if !WANT_WL_SERVERSIDE_BUFFERS
+eglplatform_wayland_la_CXXFLAGS += -DHYBRIS_NO_SERVER_SIDE_BUFFERS
+endif
+
eglplatform_wayland_la_LDFLAGS = \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/wayland/eglplatform_wayland.cpp
^
|
@@ -16,12 +16,12 @@
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file license.lgpl included in the packaging
** of this file.
- **
+ **
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
- **
+ **
****************************************************************************************/
#include <android-config.h>
@@ -30,9 +30,11 @@
#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <assert.h>
+#include <stdlib.h>
extern "C" {
#include <eglplatformcommon.h>
};
@@ -48,6 +50,8 @@
#include "wayland_window.h"
#include "logging.h"
#include "wayland-egl-priv.h"
+#include "server_wlegl_buffer.h"
+#include "wayland-android-client-protocol.h"
static gralloc_module_t *gralloc = 0;
static alloc_device_t *alloc = 0;
@@ -59,6 +63,15 @@
static EGLBoolean (*_eglDestroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync) = NULL;
static EGLint (*_eglClientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) = NULL;
+struct WaylandDisplay {
+ _EGLDisplay base;
+
+ wl_display *wl_dpy;
+ wl_event_queue *queue;
+ wl_registry *registry;
+ android_wlegl *wlegl;
+};
+
extern "C" void waylandws_init_module(struct ws_egl_interface *egl_iface)
{
int err;
@@ -95,14 +108,88 @@
}
}
-extern "C" int waylandws_IsValidDisplay(EGLNativeDisplayType display)
+static void registry_handle_global(void *data, wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
+{
+ WaylandDisplay *dpy = (WaylandDisplay *)data;
+
+ if (strcmp(interface, "android_wlegl") == 0) {
+ dpy->wlegl = static_cast<struct android_wlegl *>(wl_registry_bind(registry, name, &android_wlegl_interface, std::min(2u, version)));
+ }
+}
+
+static const wl_registry_listener registry_listener = {
+ registry_handle_global
+};
+
+static void callback_done(void *data, wl_callback *cb, uint32_t d)
{
- return 1;
+ WaylandDisplay *dpy = (WaylandDisplay *)data;
+
+ wl_callback_destroy(cb);
+ if (!dpy->wlegl) {
+ fprintf(stderr, "Fatal: the server doesn't advertise the android_wlegl global!");
+ abort();
+ }
}
-extern "C" EGLNativeWindowType waylandws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+static const wl_callback_listener callback_listener = {
+ callback_done
+};
+
+extern "C" _EGLDisplay *waylandws_GetDisplay(EGLNativeDisplayType display)
{
- WaylandNativeWindow *window = new WaylandNativeWindow((struct wl_egl_window *) win, (struct wl_display *) display, alloc);
+ WaylandDisplay *wdpy = new WaylandDisplay;
+ wdpy->wl_dpy = (wl_display *)display;
+ wdpy->wlegl = NULL;
+ wdpy->queue = wl_display_create_queue(wdpy->wl_dpy);
+ wdpy->registry = wl_display_get_registry(wdpy->wl_dpy);
+ wl_proxy_set_queue((wl_proxy *) wdpy->registry, wdpy->queue);
+ wl_registry_add_listener(wdpy->registry, ®istry_listener, wdpy);
+
+ wl_callback *cb = wl_display_sync(wdpy->wl_dpy);
+ wl_proxy_set_queue((wl_proxy *) cb, wdpy->queue);
+ wl_callback_add_listener(cb, &callback_listener, wdpy);
+
+ return &wdpy->base;
+}
+
+extern "C" void waylandws_Terminate(_EGLDisplay *dpy)
+{
+ WaylandDisplay *wdpy = (WaylandDisplay *)dpy;
+ int ret = 0;
+ // We still have the sync callback on flight, wait for it to arrive
+ while (ret == 0 && !wdpy->wlegl) {
+ ret = wl_display_dispatch_queue(wdpy->wl_dpy, wdpy->queue);
+ }
+ assert(ret >= 0);
+ android_wlegl_destroy(wdpy->wlegl);
+ wl_registry_destroy(wdpy->registry);
+ wl_event_queue_destroy(wdpy->queue);
+ delete wdpy;
+}
+
+extern "C" EGLNativeWindowType waylandws_CreateWindow(EGLNativeWindowType win, _EGLDisplay *display)
+{
+ struct wl_egl_window *wl_window = (struct wl_egl_window*) win;
+ struct wl_display *wl_display = (struct wl_display*) display;
+
+ if (wl_window == 0 || wl_display == 0) {
+ HYBRIS_ERROR("Running with EGL_PLATFORM=wayland without setup wayland environment is not possible");
+ HYBRIS_ERROR("If you want to run a standlone EGL client do it like this:");
+ HYBRIS_ERROR(" $ export EGL_PLATFORM=null");
+ HYBRIS_ERROR(" $ test_glevs2");
+ abort();
+ }
+
+ WaylandDisplay *wdpy = (WaylandDisplay *)display;
+
+ int ret = 0;
+ while (ret == 0 && !wdpy->wlegl) {
+ ret = wl_display_dispatch_queue(wdpy->wl_dpy, wdpy->queue);
+ }
+ assert(ret >= 0);
+
+ WaylandNativeWindow *window = new WaylandNativeWindow((struct wl_egl_window *) win, wdpy->wl_dpy, wdpy->wlegl, alloc, gralloc);
window->common.incRef(&window->common);
return (EGLNativeWindowType) static_cast<struct ANativeWindow *>(window);
}
@@ -120,12 +207,37 @@
return ((WaylandNativeWindow *) eglwin->nativewindow)->postBuffer((ANativeWindowBuffer *) buffer);
}
-extern "C" __eglMustCastToProperFunctionPointerType waylandws_eglGetProcAddress(const char *procname)
+extern "C" wl_buffer *waylandws_createWlBuffer(EGLDisplay dpy, EGLImageKHR image)
+{
+ egl_image *img = reinterpret_cast<egl_image *>(image);
+ if (!img) {
+ // The spec says we should send a EGL_BAD_PARAMETER error here, but we don't have the
+ // means, as of now.
+ return NULL;
+ }
+ if (img->target == EGL_WAYLAND_BUFFER_WL) {
+ WaylandDisplay *wdpy = (WaylandDisplay *)hybris_egl_display_get_mapping(dpy);
+ server_wlegl_buffer *buf = server_wlegl_buffer_from((wl_resource *)img->egl_buffer);
+ WaylandNativeWindowBuffer wnb(buf->buf);
+ // The buffer will be managed by the app, so pass NULL as the queue so that
+ // it will be assigned to the default queue
+ wnb.wlbuffer_from_native_handle(wdpy->wlegl, wdpy->wl_dpy, NULL);
+ return wnb.wlbuffer;
+ }
+ // EGL_BAD_MATCH
+ return NULL;
+}
+
+extern "C" __eglMustCastToProperFunctionPointerType waylandws_eglGetProcAddress(const char *procname)
{
if (strcmp(procname, "eglHybrisWaylandPostBuffer") == 0)
{
return (__eglMustCastToProperFunctionPointerType) waylandws_post;
}
+ else if (strcmp(procname, "eglCreateWaylandBufferFromImageWL") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType) waylandws_createWlBuffer;
+ }
else
return eglplatformcommon_eglGetProcAddress(procname);
}
@@ -138,12 +250,11 @@
extern "C" const char *waylandws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name))
{
const char *ret = eglplatformcommon_eglQueryString(dpy, name, real_eglQueryString);
- if (name == EGL_EXTENSIONS)
+ if (ret && name == EGL_EXTENSIONS)
{
- assert(ret != NULL);
static char eglextensionsbuf[512];
snprintf(eglextensionsbuf, 510, "%s %s", ret,
- "EGL_EXT_swap_buffers_with_damage "
+ "EGL_EXT_swap_buffers_with_damage EGL_WL_create_wayland_buffer_from_image"
);
ret = eglextensionsbuf;
}
@@ -162,15 +273,22 @@
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/wayland/wayland_window.cpp
^
|
@@ -35,15 +35,27 @@
#include "logging.h"
#include <eglhybris.h>
-#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2
+#if ANDROID_VERSION_MAJOR>=4 && ANDROID_VERSION_MINOR>=2 || ANDROID_VERSION_MAJOR>=5
extern "C" {
#include <sync/sync.h>
}
#endif
+static void
+buffer_create_sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
+{
+ struct wl_callback **created_callback = static_cast<struct wl_callback **>(data);
+
+ *created_callback = NULL;
+ wl_callback_destroy(callback);
+}
+static const struct wl_callback_listener buffer_create_sync_listener = {
+ buffer_create_sync_callback
+};
-void WaylandNativeWindowBuffer::wlbuffer_from_native_handle(struct android_wlegl *android_wlegl)
+void WaylandNativeWindowBuffer::wlbuffer_from_native_handle(struct android_wlegl *android_wlegl,
+ struct wl_display *display, struct wl_event_queue *queue)
{
struct wl_array ints;
int *ints_data;
@@ -64,16 +76,32 @@
wlbuffer = android_wlegl_create_buffer(android_wlegl,
width, height, stride,
format, usage, wlegl_handle);
+ wl_proxy_set_queue((struct wl_proxy *) wlbuffer, queue);
android_wlegl_handle_destroy(wlegl_handle);
+
+ creation_callback = wl_display_sync(display);
+ wl_callback_add_listener(creation_callback, &buffer_create_sync_listener, &creation_callback);
+ wl_proxy_set_queue((struct wl_proxy *)creation_callback, queue);
+}
+
+void WaylandNativeWindow::resize(unsigned int width, unsigned int height)
+{
+ lock();
+ this->m_defaultWidth = width;
+ this->m_defaultHeight = height;
+ unlock();
}
void WaylandNativeWindow::resize_callback(struct wl_egl_window *egl_window, void *)
{
TRACE("%dx%d",egl_window->width,egl_window->height);
- native_window_set_buffers_dimensions(
- (WaylandNativeWindow*)egl_window->nativewindow,
- egl_window->width,egl_window->height);
+ ((WaylandNativeWindow *) egl_window->nativewindow)->resize(egl_window->width, egl_window->height);
+}
+
+void WaylandNativeWindow::free_callback(struct wl_egl_window *egl_window, void *)
+{
+ ((WaylandNativeWindow*)(egl_window->nativewindow))->m_window = 0;
}
void WaylandNativeWindow::lock()
@@ -86,23 +114,7 @@
pthread_mutex_unlock(&this->mutex);
}
- void
-WaylandNativeWindow::registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
- const char *interface, uint32_t version)
-{
- WaylandNativeWindow *nw = static_cast<WaylandNativeWindow *>(data);
-
- if (strcmp(interface, "android_wlegl") == 0) {
- nw->m_android_wlegl = static_cast<struct android_wlegl *>(wl_registry_bind(registry, name, &android_wlegl_interface, 1));
- }
-}
-
-static const struct wl_registry_listener registry_listener = {
- WaylandNativeWindow::registry_handle_global
-};
-
-
- void
+void
WaylandNativeWindow::sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
int *done = static_cast<int *>(data);
@@ -115,7 +127,7 @@
WaylandNativeWindow::sync_callback
};
- int
+int
WaylandNativeWindow::wayland_roundtrip(WaylandNativeWindow *display)
{
struct wl_callback *callback;
@@ -125,7 +137,7 @@
callback = wl_display_sync(display->m_display);
wl_callback_add_listener(callback, &sync_listener, &done);
wl_proxy_set_queue((struct wl_proxy *) callback, display->wl_queue);
- while (ret == 0 && !done)
+ while (ret >= 0 && !done)
ret = wl_display_dispatch_queue(display->m_display, display->wl_queue);
return ret;
@@ -147,7 +159,20 @@
abort();
}
-WaylandNativeWindow::WaylandNativeWindow(struct wl_egl_window *window, struct wl_display *display, alloc_device_t* alloc_device)
+static void
+wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
+{
+ WaylandNativeWindow *surface = static_cast<WaylandNativeWindow *>(data);
+ surface->frame();
+ wl_callback_destroy(callback);
+}
+
+static const struct wl_callback_listener frame_listener = {
+ wayland_frame_callback
+};
+
+WaylandNativeWindow::WaylandNativeWindow(struct wl_egl_window *window, struct wl_display *display, android_wlegl *wlegl, alloc_device_t* alloc_device, gralloc_module_t *gralloc)
+ : m_android_wlegl(wlegl)
{
int wayland_ok;
@@ -160,25 +185,27 @@
this->m_defaultWidth = window->width;
this->m_defaultHeight = window->height;
this->m_window->resize_callback = resize_callback;
- this->m_format = 1;
+ this->m_window->free_callback = free_callback;
+ this->frame_callback = NULL;
this->wl_queue = wl_display_create_queue(display);
- this->registry = wl_display_get_registry(display);
- wl_proxy_set_queue((struct wl_proxy *) this->registry,
- this->wl_queue);
- wl_registry_add_listener(this->registry, ®istry_listener, this);
-
- wayland_ok = wayland_roundtrip(this);
- assert(wayland_ok >= 0);
- assert(this->m_android_wlegl != NULL);
+ this->m_format = 1;
+
+ const_cast<int&>(ANativeWindow::minSwapInterval) = 0;
+ const_cast<int&>(ANativeWindow::maxSwapInterval) = 1;
+ // This is the default as per the EGL documentation
+ this->m_swap_interval = 1;
this->m_alloc = alloc_device;
+ m_gralloc = gralloc;
m_usage=GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&cond, NULL);
+ m_queueReads = 0;
m_freeBufs = 0;
m_damage_rects = NULL;
m_damage_n_rects = 0;
+ m_lastBuffer = 0;
setBufferCount(3);
HYBRIS_TRACE_END("wayland-platform", "create_window", "");
}
@@ -186,22 +213,42 @@
WaylandNativeWindow::~WaylandNativeWindow()
{
std::list<WaylandNativeWindowBuffer *>::iterator it = m_bufList.begin();
- for (; it != m_bufList.end(); it++)
- {
- WaylandNativeWindowBuffer* buf=*it;
- if (buf->wlbuffer)
- wl_buffer_destroy(buf->wlbuffer);
- buf->wlbuffer = NULL;
- buf->common.decRef(&buf->common);
- }
- wl_registry_destroy(registry);
+ destroyBuffers();
+ if (frame_callback)
+ wl_callback_destroy(frame_callback);
wl_event_queue_destroy(wl_queue);
- android_wlegl_destroy(m_android_wlegl);
+ if (m_window) {
+ m_window->nativewindow = NULL;
+ m_window->resize_callback = NULL;
+ m_window->free_callback = NULL;
+ }
+}
+
+void WaylandNativeWindow::frame() {
+ HYBRIS_TRACE_BEGIN("wayland-platform", "frame_event", "");
+
+ this->frame_callback = NULL;
+
+ HYBRIS_TRACE_END("wayland-platform", "frame_event", "");
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/platforms/wayland/wayland_window.h
^
|
@@ -24,7 +24,6 @@
**
****************************************************************************************/
-
#ifndef Wayland_WINDOW_H
#define Wayland_WINDOW_H
#include "nativewindowbase.h"
@@ -38,12 +37,53 @@
#include <pthread.h>
}
#include <list>
+#include <deque>
class WaylandNativeWindowBuffer : public BaseNativeWindowBuffer
{
+public:
+ WaylandNativeWindowBuffer() : wlbuffer(0), busy(0), youngest(0), other(0), creation_callback(0) {}
+ WaylandNativeWindowBuffer(ANativeWindowBuffer *other)
+ {
+ ANativeWindowBuffer::width = other->width;
+ ANativeWindowBuffer::height = other->height;
+ ANativeWindowBuffer::format = other->format;
+ ANativeWindowBuffer::usage = other->usage;
+ ANativeWindowBuffer::handle = other->handle;
+ ANativeWindowBuffer::stride = other->stride;
+ this->wlbuffer = NULL;
+ this->creation_callback = NULL;
+ this->busy = 0;
+ this->other = other;
+ this->youngest = 0;
+ }
+
+ struct wl_buffer *wlbuffer;
+ int busy;
+ int youngest;
+ ANativeWindowBuffer *other;
+ struct wl_callback *creation_callback;
+
+ void wlbuffer_from_native_handle(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
+
+ virtual void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue) {}
+};
+
+#ifdef HYBRIS_NO_SERVER_SIDE_BUFFERS
+
+class ClientWaylandBuffer : public WaylandNativeWindowBuffer
+{
friend class WaylandNativeWindow;
protected:
- WaylandNativeWindowBuffer(alloc_device_t* alloc_device,
+ ClientWaylandBuffer()
+ : m_alloc(0)
+ {}
+
+ ClientWaylandBuffer(alloc_device_t* alloc_device,
unsigned int width,
unsigned int height,
unsigned int format,
@@ -55,6 +95,7 @@
ANativeWindowBuffer::format = format;
ANativeWindowBuffer::usage = usage;
this->wlbuffer = NULL;
+ this->creation_callback = NULL;
this->busy = 0;
this->other = NULL;
this->m_alloc = alloc_device;
@@ -64,50 +105,59 @@
&this->handle, &this->stride);
assert(alloc_ok == 0);
this->youngest = 0;
+ this->common.incRef(&this->common);
}
- WaylandNativeWindowBuffer(ANativeWindowBuffer *other)
- {
- ANativeWindowBuffer::width = other->width;
- ANativeWindowBuffer::height = other->height;
- ANativeWindowBuffer::format = other->format;
- ANativeWindowBuffer::usage = other->usage;
- ANativeWindowBuffer::handle = other->handle;
- ANativeWindowBuffer::stride = other->stride;
- this->wlbuffer = NULL;
- this->busy = 0;
- this->other = other;
- this->m_alloc = NULL;
- this->youngest = 0;
- }
- ~WaylandNativeWindowBuffer()
+
+ ~ClientWaylandBuffer()
{
if (this->m_alloc)
m_alloc->free(m_alloc, this->handle);
}
- void wlbuffer_from_native_handle(struct android_wlegl *android_wlegl);
+
+ void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
protected:
void* vaddr;
alloc_device_t* m_alloc;
public:
- struct wl_buffer *wlbuffer;
- int busy;
- int youngest;
- ANativeWindowBuffer *other;
+
};
+#else
+
+class ServerWaylandBuffer : public WaylandNativeWindowBuffer
+{
+public:
+ ServerWaylandBuffer(unsigned int w, unsigned int h, int format, int usage, gralloc_module_t *gralloc, android_wlegl *android_wlegl, struct wl_event_queue *queue);
+ ~ServerWaylandBuffer();
+ void init(struct android_wlegl *android_wlegl,
+ struct wl_display *display,
+ struct wl_event_queue *queue);
+
+ struct wl_array ints;
+ struct wl_array fds;
+ gralloc_module_t *m_gralloc;
+ wl_buffer *m_buf;
+};
+
+#endif // HYBRIS_NO_SERVER_SIDE_BUFFERS
class WaylandNativeWindow : public BaseNativeWindow {
public:
- WaylandNativeWindow(struct wl_egl_window *win, struct wl_display *display, alloc_device_t* alloc_device);
+ WaylandNativeWindow(struct wl_egl_window *win, struct wl_display *display, android_wlegl *wlegl, alloc_device_t* alloc_device, gralloc_module_t *gralloc);
~WaylandNativeWindow();
void lock();
void unlock();
+ void frame();
+ void resize(unsigned int width, unsigned int height);
void releaseBuffer(struct wl_buffer *buffer);
int postBuffer(ANativeWindowBuffer *buffer);
+ virtual int setSwapInterval(int interval);
void prepareSwap(EGLint *damage_rects, EGLint damage_n_rects);
void finishSwap();
@@ -115,11 +165,11 @@
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
const char *interface, uint32_t version);
static void resize_callback(struct wl_egl_window *egl_window, void *);
+ static void free_callback(struct wl_egl_window *egl_window, void *);
struct wl_event_queue *wl_queue;
protected:
// overloads from BaseNativeWindow
- virtual int setSwapInterval(int interval);
virtual int dequeueBuffer(BaseNativeWindowBuffer **buffer, int *fenceFd);
virtual int lockBuffer(BaseNativeWindowBuffer* buffer);
virtual int queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
@@ -142,12 +192,16 @@
WaylandNativeWindowBuffer *addBuffer();
void destroyBuffer(WaylandNativeWindowBuffer *);
void destroyBuffers();
+ int readQueue(bool block);
+
std::list<WaylandNativeWindowBuffer *> m_bufList;
std::list<WaylandNativeWindowBuffer *> fronted;
std::list<WaylandNativeWindowBuffer *> posted;
std::list<WaylandNativeWindowBuffer *> post_registered;
+ std::deque<WaylandNativeWindowBuffer *> queue;
struct wl_egl_window *m_window;
struct wl_display *m_display;
+ WaylandNativeWindowBuffer *m_lastBuffer;
unsigned int m_width;
unsigned int m_height;
unsigned int m_format;
@@ -156,14 +210,15 @@
unsigned int m_usage;
struct android_wlegl *m_android_wlegl;
alloc_device_t* m_alloc;
- struct wl_registry *registry;
pthread_mutex_t mutex;
pthread_cond_t cond;
+ int m_queueReads;
int m_freeBufs;
- bool m_buffer_committed;
EGLint *m_damage_rects, m_damage_n_rects;
struct wl_callback *frame_callback;
+ int m_swap_interval;
static int wayland_roundtrip(WaylandNativeWindow *display);
+ gralloc_module_t *m_gralloc;
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/ws.c
^
|
@@ -55,13 +55,19 @@
}
-int ws_IsValidDisplay(EGLNativeDisplayType display)
+struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType display)
{
_init_ws();
- return ws->IsValidDisplay(display);
+ return ws->GetDisplay(display);
}
-EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display)
+void ws_Terminate(struct _EGLDisplay *dpy)
+{
+ _init_ws();
+ ws->Terminate(dpy);
+}
+
+EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display)
{
_init_ws();
return ws->CreateWindow(win, display);
@@ -105,4 +111,11 @@
ws->finishSwap(dpy, win);
}
+void ws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval)
+{
+ _init_ws();
+ if (ws->setSwapInterval)
+ ws->setSwapInterval(dpy, win, interval);
+}
+
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/egl/ws.h
^
|
@@ -1,6 +1,7 @@
#ifndef __LIBHYBRIS_WS_H
#define __LIBHYBRIS_WS_H
#include <EGL/egl.h>
+#include <EGL/eglext.h>
struct ws_egl_interface {
void * (*android_egl_dlsym)(const char *symbol);
@@ -9,28 +10,44 @@
EGLNativeWindowType (*get_mapping)(EGLSurface surface);
};
+struct egl_image
+{
+ EGLImageKHR egl_image;
+ EGLClientBuffer egl_buffer;
+ EGLenum target;
+};
+
/* Defined in egl.c */
extern struct ws_egl_interface hybris_egl_interface;
+struct _EGLDisplay {
+ EGLDisplay dpy;
+};
+
struct ws_module {
void (*init_module)(struct ws_egl_interface *egl_interface);
- int (*IsValidDisplay)(EGLNativeDisplayType display_id);
- EGLNativeWindowType (*CreateWindow)(EGLNativeWindowType win, EGLNativeDisplayType display);
+
+ struct _EGLDisplay *(*GetDisplay)(EGLNativeDisplayType native);
+ void (*Terminate)(struct _EGLDisplay *display);
+ EGLNativeWindowType (*CreateWindow)(EGLNativeWindowType win, struct _EGLDisplay *display);
void (*DestroyWindow)(EGLNativeWindowType win);
__eglMustCastToProperFunctionPointerType (*eglGetProcAddress)(const char *procname);
void (*passthroughImageKHR)(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list);
const char *(*eglQueryString)(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name));
void (*prepareSwap)(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects);
void (*finishSwap)(EGLDisplay dpy, EGLNativeWindowType win);
+ void (*setSwapInterval)(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval);
};
-int ws_IsValidDisplay(EGLNativeDisplayType display);
-EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, EGLNativeDisplayType display);
+struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType native);
+void ws_Terminate(struct _EGLDisplay *dpy);
+EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display);
void ws_DestroyWindow(EGLNativeWindowType win);
__eglMustCastToProperFunctionPointerType ws_eglGetProcAddress(const char *procname);
void ws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list);
const char *ws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name));
void ws_prepareSwap(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects);
void ws_finishSwap(EGLDisplay dpy, EGLNativeWindowType win);
+void ws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval);
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/glesv1/glesv1_cm.c
^
|
@@ -24,7 +24,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#define GLESV1_CM_LIBRARY_PATH "/system/lib/libGLESv1_CM.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/glesv2/Makefile.am
^
|
@@ -2,7 +2,7 @@
libGLESv2.la
libGLESv2_la_SOURCES = glesv2.c
-libGLESv2_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+libGLESv2_la_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = glesv2.pc
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/glesv2/glesv2.c
^
|
@@ -22,1021 +22,406 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
-#include <hybris/internal/floating_point_abi.h>
+#include <egl/ws.h>
+#include <hybris/common/binding.h>
+#include <hybris/common/floating_point_abi.h>
static void *_libglesv2 = NULL;
-static void (*_glActiveTexture)(GLenum texture) = NULL;
-static void (*_glAttachShader)(GLuint program, GLuint shader) = NULL;
-static void (*_glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) = NULL;
-static void (*_glBindBuffer)(GLenum target, GLuint buffer) = NULL;
-static void (*_glBindFramebuffer)(GLenum target, GLuint framebuffer) = NULL;
-static void (*_glBindRenderbuffer)(GLenum target, GLuint renderbuffer) = NULL;
-static void (*_glBindTexture)(GLenum target, GLuint texture) = NULL;
+/* Only functions with floating point argument need a wrapper to change the call convention correctly */
+
static void (*_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = NULL;
-static void (*_glBlendEquation)(GLenum mode ) = NULL;
-static void (*_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) = NULL;
-static void (*_glBlendFunc)(GLenum sfactor, GLenum dfactor) = NULL;
-static void (*_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) = NULL;
-static void (*_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) = NULL;
-static void (*_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) = NULL;
-static GLenum (*_glCheckFramebufferStatus)(GLenum target) = NULL;
-static void (*_glClear)(GLbitfield mask) = NULL;
static void (*_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = NULL;
static void (*_glClearDepthf)(GLclampf depth) FP_ATTRIB = NULL;
-static void (*_glClearStencil)(GLint s) = NULL;
-static void (*_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) = NULL;
-static void (*_glCompileShader)(GLuint shader) = NULL;
-static void (*_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) = NULL;
-static void (*_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) = NULL;
-static void (*_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = NULL;
-static void (*_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static GLuint (*_glCreateProgram)(void) = NULL;
-static GLuint (*_glCreateShader)(GLenum type) = NULL;
-static void (*_glCullFace)(GLenum mode) = NULL;
-static void (*_glDeleteBuffers)(GLsizei n, const GLuint* buffers) = NULL;
-static void (*_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers) = NULL;
-static void (*_glDeleteProgram)(GLuint program) = NULL;
-static void (*_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) = NULL;
-static void (*_glDeleteShader)(GLuint shader) = NULL;
-static void (*_glDeleteTextures)(GLsizei n, const GLuint* textures) = NULL;
-static void (*_glDepthFunc)(GLenum func) = NULL;
-static void (*_glDepthMask)(GLboolean flag) = NULL;
static void (*_glDepthRangef)(GLclampf zNear, GLclampf zFar) FP_ATTRIB = NULL;
-static void (*_glDetachShader)(GLuint program, GLuint shader) = NULL;
-static void (*_glDisable)(GLenum cap) = NULL;
-static void (*_glDisableVertexAttribArray)(GLuint index) = NULL;
-static void (*_glDrawArrays)(GLenum mode, GLint first, GLsizei count) = NULL;
-static void (*_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) = NULL;
-static void (*_glEnable)(GLenum cap) = NULL;
-static void (*_glEnableVertexAttribArray)(GLuint index) = NULL;
-static void (*_glFinish)(void) = NULL;
-static void (*_glFlush)(void) = NULL;
-static void (*_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
-static void (*_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
-static void (*_glFrontFace)(GLenum mode) = NULL;
-static void (*_glGenBuffers)(GLsizei n, GLuint* buffers) = NULL;
-static void (*_glGenerateMipmap)(GLenum target) = NULL;
-static void (*_glGenFramebuffers)(GLsizei n, GLuint* framebuffers) = NULL;
-static void (*_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) = NULL;
-static void (*_glGenTextures)(GLsizei n, GLuint* textures) = NULL;
-static void (*_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
-static void (*_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
-static void (*_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) = NULL;
-static int (*_glGetAttribLocation)(GLuint program, const GLchar* name) = NULL;
-static void (*_glGetBooleanv)(GLenum pname, GLboolean* params) = NULL;
-static void (*_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static GLenum (*_glGetError)(void) = NULL;
-static void (*_glGetFloatv)(GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) = NULL;
-static void (*_glGetIntegerv)(GLenum pname, GLint* params) = NULL;
-static void (*_glGetProgramiv)(GLuint program, GLenum pname, GLint* params) = NULL;
-static void (*_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
-static void (*_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static void (*_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) = NULL;
-static void (*_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
-static void (*_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) = NULL;
-static void (*_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) = NULL;
-static const GLubyte* (*_glGetString)(GLenum name) = NULL;
-static void (*_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
-static void (*_glGetUniformfv)(GLuint program, GLint location, GLfloat* params) = NULL;
-static void (*_glGetUniformiv)(GLuint program, GLint location, GLint* params) = NULL;
-static int (*_glGetUniformLocation)(GLuint program, const GLchar* name) = NULL;
-static void (*_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) = NULL;
-static void (*_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) = NULL;
-static void (*_glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) = NULL;
-static void (*_glHint)(GLenum target, GLenum mode) = NULL;
-static GLboolean (*_glIsBuffer)(GLuint buffer) = NULL;
-static GLboolean (*_glIsEnabled)(GLenum cap) = NULL;
-static GLboolean (*_glIsFramebuffer)(GLuint framebuffer) = NULL;
-static GLboolean (*_glIsProgram)(GLuint program) = NULL;
-static GLboolean (*_glIsRenderbuffer)(GLuint renderbuffer) = NULL;
-static GLboolean (*_glIsShader)(GLuint shader) = NULL;
-static GLboolean (*_glIsTexture)(GLuint texture) = NULL;
static void (*_glLineWidth)(GLfloat width) FP_ATTRIB = NULL;
-static void (*_glLinkProgram)(GLuint program) = NULL;
-static void (*_glPixelStorei)(GLenum pname, GLint param) = NULL;
static void (*_glPolygonOffset)(GLfloat factor, GLfloat units) FP_ATTRIB = NULL;
-static void (*_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) = NULL;
-static void (*_glReleaseShaderCompiler)(void) = NULL;
-static void (*_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
static void (*_glSampleCoverage)(GLclampf value, GLboolean invert) FP_ATTRIB = NULL;
-static void (*_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static void (*_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) = NULL;
-static void (*_glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) = NULL;
-static void (*_glStencilFunc)(GLenum func, GLint ref, GLuint mask) = NULL;
-static void (*_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) = NULL;
-static void (*_glStencilMask)(GLuint mask) = NULL;
-static void (*_glStencilMaskSeparate)(GLenum face, GLuint mask) = NULL;
-static void (*_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) = NULL;
-static void (*_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) = NULL;
-static void (*_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
static void (*_glTexParameterf)(GLenum target, GLenum pname, GLfloat param) FP_ATTRIB = NULL;
-static void (*_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) = NULL;
-static void (*_glTexParameteri)(GLenum target, GLenum pname, GLint param) = NULL;
-static void (*_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) = NULL;
-static void (*_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
static void (*_glUniform1f)(GLint location, GLfloat x) FP_ATTRIB = NULL;
-static void (*_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform1i)(GLint location, GLint x) = NULL;
-static void (*_glUniform1iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform2f)(GLint location, GLfloat x, GLfloat y) FP_ATTRIB = NULL;
-static void (*_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform2i)(GLint location, GLint x, GLint y) = NULL;
-static void (*_glUniform2iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = NULL;
-static void (*_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform3i)(GLint location, GLint x, GLint y, GLint z) = NULL;
-static void (*_glUniform3iv)(GLint location, GLsizei count, const GLint* v) = NULL;
static void (*_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
-static void (*_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
-static void (*_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) = NULL;
-static void (*_glUniform4iv)(GLint location, GLsizei count, const GLint* v) = NULL;
-static void (*_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
-static void (*_glUseProgram)(GLuint program) = NULL;
-static void (*_glValidateProgram)(GLuint program) = NULL;
static void (*_glVertexAttrib1f)(GLuint indx, GLfloat x) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib1fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib2fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib3fv)(GLuint indx, const GLfloat* values) = NULL;
static void (*_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib4fv)(GLuint indx, const GLfloat* values) = NULL;
-static void (*_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) = NULL;
-static void (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
-static void (*_glEGLImageTargetTexture2DOES) (GLenum target, GLeglImageOES image) = NULL;
+static void (*_glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) = NULL;
#define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
+/*
+This generates a function that when first called overwrites it's plt entry with new address. Subsequent calls jump directly at the target function in the android library. This means effectively 0 call overhead after the first call.
+*/
+
+#define GLES2_IDLOAD(sym) \
+ __asm__ (".type " #sym ", %gnu_indirect_function"); \
+typeof(sym) * sym ## _dispatch (void) __asm__ (#sym);\
+typeof(sym) * sym ## _dispatch (void) \
+{ \
+ if (!_libglesv2) \
+ _libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW); \
+ return (void *) android_dlsym(_libglesv2, #sym); \
+}
+
static void __attribute__((constructor)) _init_androidglesv2() {
_libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW);
- GLES2_LOAD(glActiveTexture);
- GLES2_LOAD(glAttachShader);
- GLES2_LOAD(glBindAttribLocation);
- GLES2_LOAD(glBindBuffer);
- GLES2_LOAD(glBindFramebuffer);
- GLES2_LOAD(glBindRenderbuffer);
- GLES2_LOAD(glBindTexture);
GLES2_LOAD(glBlendColor);
- GLES2_LOAD(glBlendEquation);
- GLES2_LOAD(glBlendEquationSeparate);
- GLES2_LOAD(glBlendFunc);
- GLES2_LOAD(glBlendFuncSeparate);
- GLES2_LOAD(glBufferData);
- GLES2_LOAD(glBufferSubData);
- GLES2_LOAD(glCheckFramebufferStatus);
- GLES2_LOAD(glClear);
GLES2_LOAD(glClearColor);
GLES2_LOAD(glClearDepthf);
- GLES2_LOAD(glClearStencil);
- GLES2_LOAD(glColorMask);
- GLES2_LOAD(glCompileShader);
- GLES2_LOAD(glCompressedTexImage2D);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/hardware/hardware.c
^
|
@@ -19,7 +19,7 @@
#include <dlfcn.h>
#include <stddef.h>
#include <hardware/hardware.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
static void *_libhardware = NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/EGL/eglext.h
^
|
@@ -456,6 +456,22 @@
#endif
#endif
+
+#ifndef EGL_EXT_swap_buffers_with_damage
+#define EGL_EXT_swap_buffers_with_damage 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT( EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif
+
+
+#ifndef EGL_EXT_buffer_age
+#define EGL_EXT_buffer_age 1
+#define EGL_BUFFER_AGE_EXT 0x313D
+#endif
+
+
#include <EGL/eglmesaext.h>
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/Makefile.am
^
|
@@ -68,3 +68,9 @@
dlfcnincludedir = $(includedir)/hybris/dlfcn
dlfcninclude_HEADERS = \
hybris/dlfcn/dlfcn.h
+
+commonincludedir = $(includedir)/hybris/common
+commoninclude_HEADERS = \
+ hybris/common/binding.h \
+ hybris/common/floating_point_abi.h \
+ hybris/common/dlfcn.h
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/hybris/common/binding.h
^
|
@@ -0,0 +1,448 @@
+
+/**
+ * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
+ * 2012 Canonical Ltd
+ * 2013 Jolla Ltd.
+ *
+ * Auto-generated via "generate_wrapper_macros.py"
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+
+#ifndef HYBRIS_BINDING_H_
+#define HYBRIS_BINDING_H_
+
+/* floating_point_abi.h defines FP_ATTRIB */
+#include <hybris/common/floating_point_abi.h>
+
+void *android_dlopen(const char *filename, int flag);
+void *android_dlsym(void *name, const char *symbol);
+int android_dlclose(void *handle);
+const char *android_dlerror(void);
+int android_dladdr(const void *addr, void *info);
+
+
+
+/**
+ * XXX AUTO-GENERATED FILE XXX
+ *
+ * Do not edit this file directly, but update the templates in
+ * utils/generate_wrapper_macros.py and run it again to build
+ * an updated version of this header file:
+ *
+ * python utils/generate_wrapper_macros.py > \
+ * hybris/include/hybris/common/binding.h
+ *
+ * If you need macros with more arguments, just customize the
+ * MAX_ARGS variable in generate_wrapper_macros.py.
+ *
+ * XXX AUTO-GENERATED FILE XXX
+ **/
+
+
+#define HYBRIS_DLSYSM(name, fptr, sym) \
+ if (!name##_handle) \
+ hybris_##name##_initialize(); \
+ if (*(fptr) == NULL) \
+ { \
+ *(fptr) = (void *) android_dlsym(name##_handle, sym); \
+ }
+
+#define HYBRIS_LIBRARY_INITIALIZE(name, path) \
+ void *name##_handle; \
+ void hybris_##name##_initialize() \
+ { \
+ name##_handle = android_dlopen(path, RTLD_LAZY); \
+ }
+
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
+ return_type symbol() \
+ { \
+ static return_type (*f)() FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION1(name, return_type, symbol, a1) \
+ return_type symbol(a1 n1) \
+ { \
+ static return_type (*f)(a1) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION2(name, return_type, symbol, a1, a2) \
+ return_type symbol(a1 n1, a2 n2) \
+ { \
+ static return_type (*f)(a1, a2) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION3(name, return_type, symbol, a1, a2, a3) \
+ return_type symbol(a1 n1, a2 n2, a3 n3) \
+ { \
+ static return_type (*f)(a1, a2, a3) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION4(name, return_type, symbol, a1, a2, a3, a4) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION5(name, return_type, symbol, a1, a2, a3, a4, a5) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION6(name, return_type, symbol, a1, a2, a3, a4, a5, a6) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION7(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION8(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION9(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION10(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION11(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION12(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION13(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) FP_ATTRIB = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13); \
+ }
+
+
+#define HYBRIS_IMPLEMENT_FUNCTION14(name, return_type, symbol, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) \
+ return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4, a5 n5, a6 n6, a7 n7, a8 n8, a9 n9, a10 n10, a11 n11, a12 n12, a13 n13, a14 n14) \
+ { \
+ static return_type (*f)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) FP_ATTRIB = NULL; \
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/hybris/common/dlfcn.h
^
|
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013 Intel Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _HYBRIS_DLFCN_H_
+#define _HYBRIS_DLFCN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *hybris_dlopen(const char *filename, int flag);
+void *hybris_dlsym(void *handle, const char *symbol);
+int hybris_dlclose(void *handle);
+char *hybris_dlerror(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _HYBRIS_DLFCN_H_
+
+// vim: noai:ts=4:sw=4:ss=4:expandtab
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/hybris/common/floating_point_abi.h
^
|
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Jolla Ltd.
+ * Contact: Thomas Perl <thomas.perl@jollamobile.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HYBRIS_FLOATING_POINT_ABI_H_
+#define HYBRIS_FLOATING_POINT_ABI_H_
+
+/**
+ * Make sure to use FP_ATTRIB on all functions that are loaded from
+ * Android (bionic libc) libraries to make sure floating point arguments
+ * are passed the right way.
+ *
+ * See: http://wiki.debian.org/ArmHardFloatPort/VfpComparison
+ * http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
+ *
+ * It doesn't hurt to have it added for non-floating point arguments and
+ * return types, even though it does not really have any effect.
+ *
+ * If you use the convenience macros in hybris/common/binding.h, your
+ * wrapper functions will automatically make use of this attribute.
+ **/
+
+#ifdef __ARM_PCS_VFP
+# define FP_ATTRIB __attribute__((pcs("aapcs")))
+#else
+# define FP_ATTRIB
+#endif
+
+#endif /* HYBRIS_FLOATING_POINT_ABI_H_ */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/include/hybris/dlfcn/dlfcn.h
^
|
@@ -15,22 +15,7 @@
*
*/
-#ifndef _HYBRIS_DLFCN_H_
-#define _HYBRIS_DLFCN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void *hybris_dlopen(const char *filename, int flag);
-void *hybris_dlsym(void *handle, const char *symbol);
-int hybris_dlclose(void *handle);
-char *hybris_dlerror(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _HYBRIS_DLFCN_H_
+/* File was moved. Just providing it here for compatibility */
+#include <hybris/common/dlfcn.h>
// vim: noai:ts=4:sw=4:ss=4:expandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/input/is.c
^
|
@@ -21,7 +21,7 @@
#include <stddef.h>
#include <stdbool.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/input/input_stack_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libis_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
^
|
@@ -32,7 +32,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(libnfc_ndef_so, "/system/lib/libnfc_ndef.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/libnfc_nxp/libnfc_nxp.c
^
|
@@ -54,7 +54,7 @@
#include <stddef.h>
#include <stdlib.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(libnfc_so, "/system/lib/libnfc.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/properties/cache.c
^
|
@@ -44,6 +44,7 @@
static int max_prop;
/* helpers */
+static void cache_update();
static int prop_qcmp(const void *a, const void *b);
static struct hybris_prop_value *cache_find_internal(const char *key);
static void cache_add_internal(const char *key, const char *value);
@@ -65,6 +66,37 @@
*/
char *hybris_propcache_find(const char *key)
{
+ char *ret = NULL;
+
+ cache_update();
+
+ /* then look up the key and do a copy if we get a result */
+ struct hybris_prop_value *prop = cache_find_internal(key);
+ if (prop)
+ return prop->value;
+
+out:
+ return ret;
+}
+
+void hybris_propcache_list(hybris_propcache_list_cb cb, void *cookie)
+{
+ int n;
+ struct hybris_prop_value *current;
+
+ if (!cb)
+ return;
+
+ cache_update();
+
+ for (n = 0; n < max_prop; n++) {
+ current = &prop_array[n];
+ cb(current->key, current->value, cookie);
+ }
+}
+
+static void cache_update()
+{
struct stat st;
FILE *f = fopen("/system/build.prop", "r");
char *ret = NULL;
@@ -98,14 +130,8 @@
qsort(prop_array, max_prop, sizeof(struct hybris_prop_value), prop_qcmp);
}
- /* then look up the key and do a copy if we get a result */
- struct hybris_prop_value *prop = cache_find_internal(key);
- if (prop)
- ret = strdup(prop->value);
-
out:
fclose(f);
- return ret;
}
/* private:
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/properties/properties.c
^
|
@@ -118,8 +118,7 @@
return result;
}
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
- void *cookie)
+int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie)
{
int err;
prop_msg_t msg;
@@ -128,9 +127,9 @@
msg.cmd = PROP_MSG_LISTPROP;
err = send_prop_msg(&msg, propfn, cookie);
- if (err < 0) {
- return err;
- }
+ if (err < 0)
+ /* fallback to property cache */
+ hybris_propcache_list((hybris_propcache_list_cb) propfn, cookie);
return 0;
}
@@ -176,7 +175,6 @@
if (ret) {
strcpy(value, ret);
- free(ret);
return strlen(value);
} else if (default_value != NULL) {
strcpy(value, default_value);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/properties/properties_p.h
^
|
@@ -18,6 +18,9 @@
#ifndef HYBRIS_PROPERTIES
#define HYBRIS_PROPERTIES
+typedef void (*hybris_propcache_list_cb)(const char *key, const char *value, void *cookie);
+
+void hybris_propcache_list(hybris_propcache_list_cb cb, void *cookie);
char *hybris_propcache_find(const char *key);
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/sf/sf.c
^
|
@@ -21,7 +21,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/tests/test_camera.c
^
|
@@ -120,6 +120,8 @@
char fn[256];
sprintf(fn, "/tmp/shot_%d.jpeg", shot_counter);
int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if(fd < 0)
+ return;
ssize_t ret = write(fd, data, data_size);
close(fd);
shot_counter++;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/tests/test_glesv2.c
^
|
@@ -148,8 +148,17 @@
//glViewport ( 0 , 0 , 800, 600); // commented out so it uses the initial window dimensions
glClearColor ( 1. , 1. , 1. , 1.); // background color
float phase = 0;
+ int frames = -1;
+ if(argc == 2) {
+ frames = atoi(argv[1]);
+ }
+ if(frames < 0) {
+ frames = 30 * 60;
+ }
+
int i;
- for (i=0; i<3*60; ++i) {
+ for (i = 0; i < frames; ++i) {
+ if(i % 60 == 0) printf("frame:%i\n", i);
glClear(GL_COLOR_BUFFER_BIT);
glUniform1f ( phase_loc , phase ); // write the value of phase to the shaders phase
phase = fmodf ( phase + 0.5f , 2.f * 3.141f ); // and update the local variable
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/tests/test_gps.c
^
|
@@ -38,6 +38,7 @@
const UlpPhoneContextInterface *UlpPhoneContext = NULL;
#endif /* HAVE_ULP */
char *apn = 0;
+char *agps_server = 0;
static const GpsInterface* get_gps_interface()
{
@@ -436,7 +437,7 @@
char *location = 0, *longitude, *latitude;
float accuracy = 100; /* Use 100m as location accuracy by default */
- while ((opt = getopt(argc, argv, "acl:p:rtux")) != -1)
+ while ((opt = getopt(argc, argv, "acl:p:s:rtux")) != -1)
{
switch (opt) {
case 'a':
@@ -463,6 +464,9 @@
case 'p':
apn = optarg;
break;
+ case 's':
+ agps_server = optarg;
+ break;
case 'u':
ulp = 1;
break;
@@ -475,6 +479,7 @@
\t-a for agps,\n \
\t-c for coldstarting the gps,\n \
\t-p <apn name> to specify an apn name,\n \
+ \t-s <agps_server:port> to specify a different supls server.\n \
\t-r for agpsril,\n \
\t-t to inject time,\n \
\t-u to use ULP (if available,\n \
@@ -514,7 +519,19 @@
fprintf(stdout, "*** set up agps interface\n");
AGps->init(&callbacks2);
fprintf(stdout, "*** set up agps server\n");
- AGps->set_server(AGPS_TYPE_SUPL, "supl.google.com", 7276);
+ if(agps_server)
+ {
+ char *server,*port = 0;
+
+ server = strdup(agps_server);
+ strtok_r (server, ":", &port);
+
+ fprintf(stdout, "SUPL server: %s at port number: %s\n", server, port);
+ AGps->set_server(AGPS_TYPE_SUPL, server, atoi(port));
+ free(server);
+ }
+ else
+ AGps->set_server(AGPS_TYPE_SUPL, "supl.google.com", 7276);
}
if(agpsril)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/ui/ui.c
^
|
@@ -17,7 +17,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
#include <hybris/ui/ui_compatibility_layer.h>
#define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/utils/getprop.c
^
|
@@ -33,7 +33,7 @@
char temp[PROP_VALUE_MAX + PROP_NAME_MAX + 16];
snprintf(temp, sizeof(temp), "[%s]: [%s]", key, name);
- list->items = realloc(list->items, (list->count + 1) * sizeof(char **));
+ list->items = realloc(list->items, (list->count + 1) * sizeof(char *));
list->items[list->count++] = strdup(temp);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/hybris/vibrator/vibrator.c
^
|
@@ -20,7 +20,7 @@
#include <stddef.h>
#include <stdbool.h>
-#include <hybris/internal/binding.h>
+#include <hybris/common/binding.h>
HYBRIS_LIBRARY_INITIALIZE(vibrator, "/system/lib/libhardware_legacy.so");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.5.tar.bz2/upstream/utils/generate_wrapper_macros.py
^
|
@@ -77,7 +77,7 @@
#define HYBRIS_BINDING_H_
/* floating_point_abi.h defines FP_ATTRIB */
-#include <hybris/internal/floating_point_abi.h>
+#include <hybris/common/floating_point_abi.h>
void *android_dlopen(const char *filename, int flag);
void *android_dlsym(void *name, const char *symbol);
|