[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/libhybris.git</param>
<param name="branch">master</param>
- <param name="revision">0.0.5.42</param>
+ <param name="revision">0.0.5.44</param>
<param name="token"></param>
<param name="debian"></param>
<param name="dumb"></param>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/.gitignore
^
|
@@ -32,6 +32,9 @@
hybris/camera/libcamera.pc
hybris/documentation.list
hybris/egl/egl.pc
+hybris/egl/glvnd/10_libhybris.json
+hybris/egl/glvnd/g_egldispatchstubs.h
+hybris/egl/glvnd/g_egldispatchstubs.c
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
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/compat/hwc2/Android.mk
^
|
@@ -10,7 +10,7 @@
LOCAL_MODULE := libhwc2_compat_layer
LOCAL_SRC_FILES := HWC2.cpp ComposerHal.cpp hwc2_compatibility_layer.cpp
-LOCAL_C_INCLUDES := ../hybris/include
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../hybris/include
ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 9 && echo true),true)
LOCAL_C_INCLUDES += \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/compat/hwc2/hwc2_compatibility_layer.cpp
^
|
@@ -132,6 +132,13 @@
return display;
}
+void hwc2_compat_device_destroy_display(hwc2_compat_device_t* device,
+ hwc2_compat_display_t* display)
+{
+ device->self->destroyDisplay(display->self->getId());
+ free(display);
+}
+
HWC2DisplayConfig* hwc2_compat_display_get_active_config(
hwc2_compat_display_t* display)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/compat/input/Android.mk
^
|
@@ -15,10 +15,17 @@
libinput \
libcutils \
libutils \
- libskia \
libgui \
libandroidfw
+ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 11 && echo true),true)
+static_libraries := \
+ libskia
+else
+LOCAL_SHARED_LIBRARIES += \
+ libskia
+endif
+
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include \
external/skia/include/core
@@ -70,7 +77,6 @@
libis_compat_layer \
libcutils \
libutils \
- libskia \
libgui \
libandroidfw
@@ -78,4 +84,13 @@
libgtest \
libgtest_main
+
+ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 11 && echo true),true)
+static_libraries += \
+ libskia
+else
+LOCAL_SHARED_LIBRARIES += \
+ libskia
+endif
+
include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -96,10 +96,11 @@
static hybris_hook_cb hook_callback = NULL;
#ifdef WANT_ARM_TRACING
-static void (*_android_linker_init)(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(_create_wrapper)(const char*, void*, int)) = NULL;
+static void (*_android_linker_init)(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(_create_wrapper)(const char*, void*, int), int wrapping_enabled) = NULL;
#else
static void (*_android_linker_init)(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) = NULL;
#endif
+static void* __hybris_get_hooked_symbol(const char *sym, const char *requester);
void *(*_android_dlopen)(const char* filename, int flag) = NULL;
char *(*_android_dlerror)() = NULL;
@@ -905,6 +906,13 @@
}
if (!hybris_is_pointer_in_shm((void*)realcond)) {
+ /* Bionic and glibc implementations of pthread_cond_destroy are different.
+ * Bionic implementation does not block whereas the glibc implementation
+ * requires that there are no threads waiting for the condition variable
+ * when it is destroyed and bionic code does not always follow this
+ * requirement. To prevent deadlocks reset the reference count of the
+ * condition variable. */
+ realcond->__data.__wrefs = 0;
ret = pthread_cond_destroy(realcond);
free(realcond);
}
@@ -1406,6 +1414,7 @@
#endif
typedef off_t bionic_fpos_t;
+typedef off64_t bionic_fpos64_t;
/* "struct __sFILE" from bionic/libc/include/stdio.h */
struct bionic_file {
@@ -1530,6 +1539,18 @@
return ret;
}
+static int _hybris_hook_fgetpos64(FILE *fp, bionic_fpos64_t *pos)
+{
+ TRACE_HOOK("fp %p pos %p", fp, pos);
+
+ fpos64_t my_fpos;
+ int ret = fgetpos64(_get_actual_fp(fp), &my_fpos);
+
+ *pos = my_fpos.__pos;
+
+ return ret;
+}
+
static char* _hybris_hook_fgets(char *s, int n, FILE *fp)
{
TRACE_HOOK("s %s n %d fp %p", s, n, fp);
@@ -1579,6 +1600,13 @@
return freopen(filename, mode, _get_actual_fp(fp));
}
+static FILE* _hybris_hook_freopen64(const char *filename, const char *mode, FILE *fp)
+{
+ TRACE_HOOK("filename '%s' mode '%s' fp %p", filename, mode, fp);
+
+ return freopen64(filename, mode, _get_actual_fp(fp));
+}
+
FP_ATTRIB static int _hybris_hook_fscanf(FILE *fp, const char *fmt, ...)
{
int ret = 0;
@@ -1607,6 +1635,13 @@
return fseeko(_get_actual_fp(fp), offset, whence);
}
+static int _hybris_hook_fseeko64(FILE *fp, off64_t offset, int whence)
+{
+ TRACE_HOOK("fp %p offset %ld whence %d", fp, offset, whence);
+
+ return fseeko64(_get_actual_fp(fp), offset, whence);
+}
+
static int _hybris_hook_fsetpos(FILE *fp, const bionic_fpos_t *pos)
{
TRACE_HOOK("fp %p pos %p", fp, pos);
@@ -1618,6 +1653,17 @@
return fsetpos(_get_actual_fp(fp), &my_fpos);
}
+static int _hybris_hook_fsetpos64(FILE *fp, const bionic_fpos64_t *pos)
+{
+ TRACE_HOOK("fp %p pos %p", fp, pos);
+
+ fpos64_t my_fpos;
+ my_fpos.__pos = *pos;
+ memset(&my_fpos.__state, 0, sizeof(mbstate_t));
+
+ return fsetpos64(_get_actual_fp(fp), &my_fpos);
+}
+
static long _hybris_hook_ftell(FILE *fp)
{
TRACE_HOOK("fp %p", fp);
@@ -1632,6 +1678,13 @@
return ftello(_get_actual_fp(fp));
}
+static off_t _hybris_hook_ftello64(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ return ftello64(_get_actual_fp(fp));
+}
+
static size_t _hybris_hook_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp)
{
TRACE_HOOK("ptr %p size %zu nmemb %zu fp %p", ptr, size, nmemb, fp);
@@ -1744,6 +1797,80 @@
return funlockfile(_get_actual_fp(fp));
}
+static void _hybris_hook_clearerr_unlocked(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ clearerr_unlocked(_get_actual_fp(fp));
+}
+
+static int _hybris_hook_feof_unlocked(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ return feof_unlocked(_get_actual_fp(fp));
+}
+
+static int _hybris_hook_ferror_unlocked(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ return ferror_unlocked(_get_actual_fp(fp));
+}
+
+static int _hybris_hook_fflush_unlocked(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ if(fileno_unlocked(_get_actual_fp(fp)) < 0) {
+ return 0;
+ }
+
+ return fflush_unlocked(_get_actual_fp(fp));
+}
+
+static int _hybris_hook_fgetc_unlocked(FILE *fp)
+{
+ TRACE_HOOK("fp %p", fp);
+
+ return fgetc_unlocked(_get_actual_fp(fp));
+}
+
+static char* _hybris_hook_fgets_unlocked(char *s, int n, FILE *fp)
+{
+ TRACE_HOOK("s %s n %d fp %p", s, n, fp);
+
+ return fgets_unlocked(s, n, _get_actual_fp(fp));
+}
+
+static int _hybris_hook_fputc_unlocked(int c, FILE *fp)
+{
+ TRACE_HOOK("c %d fp %p", c, fp);
+
+ return fputc_unlocked(c, _get_actual_fp(fp));
+}
+
+static int _hybris_hook_fputs_unlocked(const char *s, FILE *fp)
+{
+ TRACE_HOOK("s '%s' fp %p", s, fp);
+
+ return fputs_unlocked(s, _get_actual_fp(fp));
+}
+
+static size_t _hybris_hook_fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *fp)
+{
+ TRACE_HOOK("ptr %p size %zu nmemb %zu fp %p", ptr, size, nmemb, fp);
+
+ return fread_unlocked(ptr, size, nmemb, _get_actual_fp(fp));
+}
+
+static size_t _hybris_hook_fwrite_unlocked(const void *ptr, size_t size, size_t nmemb, FILE *fp)
+{
+ TRACE_HOOK("ptr %p size %zu nmemb %zu fp %p", ptr, size, nmemb, fp);
+
+ return fwrite_unlocked(ptr, size, nmemb, _get_actual_fp(fp));
+}
+
static int _hybris_hook_getc_unlocked(FILE *fp)
{
TRACE_HOOK("fp %p", fp);
@@ -1753,11 +1880,18 @@
static int _hybris_hook_putc_unlocked(int c, FILE *fp)
{
- TRACE_HOOK("fp %p", fp);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/jb/linker.c
^
|
@@ -87,6 +87,7 @@
#ifdef WANT_ARM_TRACING
void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+int _wrapping_enabled = 0;
#endif
static void* (*_get_hooked_symbol)(const char *symbol, const char *requester);
@@ -1386,15 +1387,17 @@
INFO("HYBRIS: '%s' hooked symbol %s to %x\n", si->name,
sym_name, sym_addr);
#ifdef WANT_ARM_TRACING
- s = _do_lookup(si, sym_name, &base);
- if(s != NULL) {
- switch(ELF32_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (unsigned)_create_wrapper(sym_name, (void*)sym_addr, WRAPPER_HOOKED);
- break;
+ if (_wrapping_enabled) {
+ s = _do_lookup(si, sym_name, &base);
+ if(s != NULL) {
+ switch(ELF32_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (unsigned)_create_wrapper(sym_name, (void*)sym_addr, WRAPPER_HOOKED);
+ break;
+ }
}
}
#endif
@@ -1469,17 +1472,21 @@
}
#endif
#ifdef WANT_ARM_TRACING
- switch(ELF32_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (unsigned)_create_wrapper(sym_name,
- (unsigned)(s->st_value + base), WRAPPER_UNHOOKED);
- break;
- default:
- sym_addr = (unsigned)(s->st_value + base);
- break;
+ if (_wrapping_enabled) {
+ switch(ELF32_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (unsigned)_create_wrapper(sym_name,
+ (unsigned)(s->st_value + base), WRAPPER_UNHOOKED);
+ break;
+ default:
+ sym_addr = (unsigned)(s->st_value + base);
+ break;
+ }
+ } else {
+ sym_addr = (unsigned)(s->st_value + base);
}
#else
sym_addr = (unsigned)(s->st_value + base);
@@ -2418,7 +2425,7 @@
}
#ifdef WANT_ARM_TRACING
-void android_linker_init(int sdk_version, void *(get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int)) {
+void android_linker_init(int sdk_version, void *(get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int), int wrapping_enabled) {
#else
void android_linker_init(int sdk_version, void *(get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) {
#endif
@@ -2426,6 +2433,7 @@
_get_hooked_symbol = get_hooked_symbol;
#ifdef WANT_ARM_TRACING
_create_wrapper = create_wrapper;
+ _wrapping_enabled = wrapping_enabled;
#endif
_linker_enable_gdb_support = enable_linker_gdb_support;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/mm/dlfcn.cpp
^
|
@@ -36,7 +36,7 @@
#endif
extern void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
-
+extern int _wrapping_enabled;
/* This file hijacks the symbols stubbed out in libdl.so. */
static __thread const char *dl_err_str;
@@ -139,14 +139,18 @@
if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) {
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(sym->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- return reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
- default:
- return reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(sym->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ return reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
+ default:
+ return reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ }
+ } else {
+ return reinterpret_cast<void*>(found->resolve_symbol_address(sym));
}
#else
return reinterpret_cast<void*>(found->resolve_symbol_address(sym));
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/mm/linker.cpp
^
|
@@ -152,6 +152,7 @@
#ifdef WANT_ARM_TRACING
void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+int _wrapping_enabled = 0;
#endif
static void insert_soinfo_into_debug_map(soinfo* info) {
@@ -1840,7 +1841,7 @@
}
}
#ifdef WANT_ARM_TRACING
- else
+ else if (_wrapping_enabled)
{
// this will be slower.
if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
@@ -1936,17 +1937,21 @@
#endif
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
- (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
- break;
- default:
- sym_addr = lsi->resolve_symbol_address(s);
- break;
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
+ (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
+ break;
+ default:
+ sym_addr = lsi->resolve_symbol_address(s);
+ break;
+ }
+ } else {
+ sym_addr = lsi->resolve_symbol_address(s);
}
#else
sym_addr = lsi->resolve_symbol_address(s);
@@ -3367,7 +3372,7 @@
}
#ifdef WANT_ARM_TRACING
-extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int)) {
+extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int), int wrapping_enabled) {
#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) {
#endif
@@ -3397,6 +3402,7 @@
_linker_enable_gdb_support = enable_linker_gdb_support;
#ifdef WANT_ARM_TRACING
_create_wrapper = create_wrapper;
+ _wrapping_enabled = wrapping_enabled;
#endif
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/n/linker.cpp
^
|
@@ -372,6 +372,7 @@
#ifdef WANT_ARM_TRACING
void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+static int _wrapping_enabled = 0;
#endif
static char __linker_dl_err_buf[768];
@@ -2648,14 +2649,20 @@
if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) {
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(sym->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
- default:
- *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(sym->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
+ break;
+ default:
+ *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ break;
+ }
+ } else {
+ *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
}
#else
*symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
@@ -2953,7 +2960,7 @@
}
}
#ifdef WANT_ARM_TRACING
- else
+ else if (_wrapping_enabled)
{
// this will be slower.
if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
@@ -3049,20 +3056,24 @@
#endif
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
- (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
- break;
- default:
- sym_addr = lsi->resolve_symbol_address(s);
- break;
+ if(_wrapping_enabled) {
+ switch(ELF_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
+ (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
+ break;
+ default:
+ sym_addr = lsi->resolve_symbol_address(s);
+ break;
+ }
+ } else {
+ sym_addr = lsi->resolve_symbol_address(s);
}
#else
- sym_addr = lsi->resolve_symbol_address(s);
+ sym_addr = lsi->resolve_symbol_address(s);
#endif
#if !defined(__LP64__)
@@ -4702,7 +4713,7 @@
}
#ifdef WANT_ARM_TRACING
-extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int)) {
+extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int), int wrapping_enabled) {
#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) {
#endif
@@ -4732,6 +4743,7 @@
_linker_enable_gdb_support = enable_linker_gdb_support;
#ifdef WANT_ARM_TRACING
_create_wrapper = create_wrapper;
+ _wrapping_enabled = wrapping_enabled;
#endif
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/o/linker.cpp
^
|
@@ -2205,14 +2205,20 @@
if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) {
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(sym->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
- default:
- *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(sym->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
+ break;
+ default:
+ *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ break;
+ }
+ } else {
+ *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
}
#else
*symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
@@ -2622,7 +2628,7 @@
}
}
#ifdef WANT_ARM_TRACING
- else
+ else if (_wrapping_enabled)
{
// this will be slower.
if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
@@ -2718,20 +2724,24 @@
#endif
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
- (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
- break;
- default:
- sym_addr = lsi->resolve_symbol_address(s);
- break;
+ if(_wrapping_enabled) {
+ switch(ELF_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
+ (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
+ break;
+ default:
+ sym_addr = lsi->resolve_symbol_address(s);
+ break;
+ }
+ } else {
+ sym_addr = lsi->resolve_symbol_address(s);
}
#else
- sym_addr = lsi->resolve_symbol_address(s);
+ sym_addr = lsi->resolve_symbol_address(s);
#endif
#if !defined(__LP64__)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/o/linker_globals.h
^
|
@@ -84,6 +84,7 @@
#ifdef WANT_ARM_TRACING
extern void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+extern int _wrapping_enabled;
#endif
#endif /* __LINKER_GLOBALS_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/o/linker_main.cpp
^
|
@@ -496,10 +496,10 @@
}
void* (*_get_hooked_symbol)(const char *sym, const char *requester);
-void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
-
#ifdef WANT_ARM_TRACING
-extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int)) {
+void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+int _wrapping_enabled = 0;
+extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int), int wrapping_enabled) {
#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) {
#endif
@@ -529,6 +529,7 @@
_linker_enable_gdb_support = enable_linker_gdb_support;
#ifdef WANT_ARM_TRACING
_create_wrapper = create_wrapper;
+ _wrapping_enabled = wrapping_enabled;
#endif
sonext = solist = get_libdl_info(kLinkerPath, linker_link_map);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/q/linker.cpp
^
|
@@ -2432,13 +2432,17 @@
*symbol = TLS_GET_ADDR(&ti);
} else {
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(sym->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
- default:
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(sym->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ *symbol = reinterpret_cast<void*>(_create_wrapper((char*)symbol, (void*)found->resolve_symbol_address(sym), WRAPPER_DYNHOOK));
+ default:
+ *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+ }
+ } else {
*symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
}
#else
@@ -2958,7 +2962,7 @@
}
}
#ifdef WANT_ARM_TRACING
- else
+ else if (_wrapping_enabled)
{
// this will be slower.
if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
@@ -3077,17 +3081,21 @@
return false;
}
#ifdef WANT_ARM_TRACING
- switch(ELF_ST_TYPE(s->st_info))
- {
- case STT_FUNC:
- case STT_GNU_IFUNC:
- case STT_ARM_TFUNC:
- sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
- (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
- break;
- default:
- sym_addr = lsi->resolve_symbol_address(s);
- break;
+ if (_wrapping_enabled) {
+ switch(ELF_ST_TYPE(s->st_info))
+ {
+ case STT_FUNC:
+ case STT_GNU_IFUNC:
+ case STT_ARM_TFUNC:
+ sym_addr = (ElfW(Addr))_create_wrapper(sym_name,
+ (void*)lsi->resolve_symbol_address(s), WRAPPER_UNHOOKED);
+ break;
+ default:
+ sym_addr = lsi->resolve_symbol_address(s);
+ break;
+ }
+ } else {
+ sym_addr = lsi->resolve_symbol_address(s);
}
#else
sym_addr = lsi->resolve_symbol_address(s);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/q/linker_globals.h
^
|
@@ -84,6 +84,7 @@
#ifdef WANT_ARM_TRACING
extern void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+extern int _wrapping_enabled;
#endif
class DlErrorRestorer {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/q/linker_main.cpp
^
|
@@ -766,9 +766,10 @@
}
void* (*_get_hooked_symbol)(const char *sym, const char *requester);
-void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
#ifdef WANT_ARM_TRACING
-extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int)) {
+void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+int _wrapping_enabled = 0;
+extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support, void *(create_wrapper)(const char*, void*, int), int wrapping_enabled) {
#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), int enable_linker_gdb_support) {
#endif
@@ -800,6 +801,7 @@
_linker_enable_gdb_support = enable_linker_gdb_support;
#ifdef WANT_ARM_TRACING
_create_wrapper = create_wrapper;
+ _wrapping_enabled = wrapping_enabled;
#endif
soinfo tmp_linker_so(nullptr, nullptr, nullptr, 0, 0);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/q/linker_phdr.cpp
^
|
@@ -651,6 +651,13 @@
add_dlwarning(name_.c_str(), "W+E load segments");
}
+ if ((prot & PROT_EXEC) != 0) {
+ // hybris: make sure executable code is mapped as readable to neutralize
+ // https://source.android.com/devices/tech/debug/execute-only-memory
+ // without this libgcc's unwind on host may crash
+ prot |= PROT_READ;
+ }
+
void* seg_addr = mmap64(reinterpret_cast<void*>(seg_page_start),
file_length,
prot,
@@ -717,6 +724,13 @@
prot &= ~PROT_EXEC;
}
+ if ((prot & PROT_EXEC) != 0) {
+ // hybris: make sure executable code is mapped as readable to neutralize
+ // https://source.android.com/devices/tech/debug/execute-only-memory
+ // without this libgcc's unwind on host may crash
+ prot |= PROT_READ;
+ }
+
int ret = mprotect(reinterpret_cast<void*>(seg_page_start),
seg_page_end - seg_page_start,
prot | extra_prot_flags);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/wrappers.c
^
|
@@ -30,6 +30,7 @@
static int trace_unhooked = 0;
static int trace_hooked = 0;
static int trace_env_checked = 0;
+static int tracing_enabled = 1;
struct wrapper {
char *name;
@@ -125,6 +126,7 @@
trace_unhooked = getenv("HYBRIS_TRACE_UNHOOKED") ? atoi(getenv("HYBRIS_TRACE_UNHOOKED")) : 0;
trace_dynhooked = getenv("HYBRIS_TRACE_DYNHOOKED") ? atoi(getenv("HYBRIS_TRACE_DYNHOOKED")) : 0;
+ tracing_enabled = trace_hooked || trace_unhooked || trace_dynhooked;
trace_env_checked = 1;
}
@@ -200,3 +202,8 @@
}
}
+int wrappers_enabled()
+{
+ return tracing_enabled;
+}
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/common/wrappers.h
^
|
@@ -41,6 +41,8 @@
void *create_wrapper(const char *symbol, void *function, int wrapper_type);
void release_all_wrappers();
+int wrappers_enabled();
+
// taken from <linux/elf.h>
#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -96,6 +96,24 @@
AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"])
AM_CONDITIONAL( [WANT_WAYLAND_EGL], [test x"$WANT_WAYLAND_EGL" = x"yes"])
+AC_ARG_ENABLE(glvnd,
+ [ --enable-glvnd Enable GLVND support])
+AM_CONDITIONAL( [WANT_GLVND], [test "$enable_glvnd" = "yes"])
+AS_IF( [test "$enable_glvnd" = "yes"], [
+ AM_PATH_PYTHON([3.0])
+ PKG_CHECK_MODULES(GLVND, libglvnd)
+ PKG_CHECK_MODULES(EGL, egl)
+ PKG_CHECK_MODULES(GLESV2, glesv2)
+
+ AC_DEFINE([WANT_GLVND], [], [Enable GLVND support])
+
+ AC_SUBST([GL_LIB_SUFFIX], ["_libhybris"])
+ AC_DEFINE([GL_LIB_SUFFIX], ["_libhybris"], [Suffix for GL-related libraries])
+], [
+ AC_SUBST([GL_LIB_SUFFIX], [""])
+ AC_DEFINE([GL_LIB_SUFFIX], [""], [Suffix for GL-related libraries])
+])
+
AC_ARG_ENABLE(wayland_serverside_buffers,
[ --enable-wayland_serverside_buffers Enable serverside buffer allocation for wayland (default=enabled)],
[wayland_serverside_buffers=$enableval],
@@ -242,6 +260,7 @@
AC_MSG_NOTICE("Android headers version is $android_headers_major.$android_headers_minor.$android_headers_patch")
# Add automake tests for version/API needs here that you need in code, including test .am's
+AM_CONDITIONAL([HAS_ANDROID_11_0_0],[test $android_headers_major -ge 11 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_10_0_0],[test $android_headers_major -ge 10 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_9_0_0], [test $android_headers_major -ge 9 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_8_0_0], [test $android_headers_major -ge 8 -a $android_headers_minor -ge 0 ])
@@ -281,6 +300,7 @@
common/q/Makefile
egl/egl.pc
egl/Makefile
+ egl/glvnd/10_libhybris.json
egl/platforms/Makefile
egl/platforms/common/Makefile
egl/platforms/common/hybris-egl-platform.pc
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/Makefile.am
^
|
@@ -1,42 +1,98 @@
SUBDIRS = platforms
lib_LTLIBRARIES = \
- libEGL.la
+ libEGL$(GL_LIB_SUFFIX).la
-libEGL_la_SOURCES = \
+libEGL__GL_LIB_SUFFIX__la_SOURCES = \
egl.c \
helper.cpp \
ws.c
+if WANT_GLVND
+libEGL__GL_LIB_SUFFIX__la_SOURCES += \
+ glvnd/eglglvnd.cpp \
+ glvnd/egldispatchstubs.h \
+ glvnd/egldispatchstubs.c
+
+nodist_libEGL__GL_LIB_SUFFIX__la_SOURCES = \
+ glvnd/g_egldispatchstubs.h \
+ glvnd/g_egldispatchstubs.c
+
+BUILT_SOURCES = \
+ glvnd/g_egldispatchstubs.h \
+ glvnd/g_egldispatchstubs.c
+
+CLEANFILES = \
+ glvnd/g_egldispatchstubs.h \
+ glvnd/g_egldispatchstubs.c
+
+DISPATCH_STUB_PY_FILES = \
+ $(srcdir)/glvnd/generate/static_data.py \
+ $(srcdir)/glvnd/generate/genCommon.py \
+ $(srcdir)/glvnd/generate/eglFunctionList.py \
+ $(srcdir)/glvnd/generate/gen_egl_dispatch.py
+
+DISPATCH_STUB_XML_FILES = \
+ $(srcdir)/glvnd/generate/egl.xml \
+ $(srcdir)/glvnd/generate/egl_other.xml \
+ $(srcdir)/glvnd/generate/egl_hybris.xml
+
+glvnd/g_egldispatchstubs.h: $(DISPATCH_STUB_PY_FILES) $(DISPATCH_STUB_XML_FILES)
+ $(PYTHON) $(srcdir)/glvnd/generate/gen_egl_dispatch.py header \
+ $(DISPATCH_STUB_XML_FILES) \
+ > $@
+
+glvnd/g_egldispatchstubs.c: $(DISPATCH_STUB_PY_FILES) $(DISPATCH_STUB_XML_FILES)
+ $(PYTHON) $(srcdir)/glvnd/generate/gen_egl_dispatch.py source \
+ $(DISPATCH_STUB_XML_FILES) \
+ > $@
+
+glvnd_icddir = $(datarootdir)/glvnd/egl_vendor.d
+glvnd_icd_DATA = glvnd/10_libhybris.json
+endif
+
+if !WANT_GLVND
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = egl.pc
+endif
-libEGL_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -DPKGLIBDIR="\"$(pkglibdir)/\"" -I$(top_srcdir)/common -DDEFAULT_EGL_PLATFORM="\"@DEFAULT_EGL_PLATFORM@\""
+libEGL__GL_LIB_SUFFIX__la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -DPKGLIBDIR="\"$(pkglibdir)/\"" -I$(top_srcdir)/common -DDEFAULT_EGL_PLATFORM="\"@DEFAULT_EGL_PLATFORM@\""
if WANT_MESA
-libEGL_la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+libEGL__GL_LIB_SUFFIX__la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
endif
if WANT_TRACE
-libEGL_la_CFLAGS += -DDEBUG
+libEGL__GL_LIB_SUFFIX__la_CFLAGS += -DDEBUG
endif
if WANT_DEBUG
-libEGL_la_CFLAGS += -ggdb -O0
+libEGL__GL_LIB_SUFFIX__la_CFLAGS += -ggdb -O0
+endif
+if WANT_GLVND
+libEGL__GL_LIB_SUFFIX__la_CFLAGS += $(GLVND_CFLAGS) -I$(srcdir)/glvnd -I$(builddir)/glvnd -fvisibility=hidden
endif
-libEGL_la_CXXFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -I$(top_srcdir)/common -DPKGLIBDIR="\"$(pkglibdir)/\""
+libEGL__GL_LIB_SUFFIX__la_CXXFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -I$(top_srcdir)/common -DPKGLIBDIR="\"$(pkglibdir)/\""
if WANT_MESA
-libEGL_la_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+libEGL__GL_LIB_SUFFIX__la_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
endif
if WANT_TRACE
-libEGL_la_CXXFLAGS += -DDEBUG
+libEGL__GL_LIB_SUFFIX__la_CXXFLAGS += -DDEBUG
endif
if WANT_DEBUG
-libEGL_la_CXXFLAGS += -ggdb -O0
+libEGL__GL_LIB_SUFFIX__la_CXXFLAGS += -ggdb -O0
+endif
+if WANT_GLVND
+libEGL__GL_LIB_SUFFIX__la_CXXFLAGS += $(GLVND_CFLAGS) -I$(srcdir)/glvnd -I$(builddir)/glvnd -fvisibility=hidden
endif
-libEGL_la_LDFLAGS = \
+
+libEGL__GL_LIB_SUFFIX__la_LDFLAGS = \
-ldl \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/hardware/libhardware.la \
- -version-info "1":"0":"0"
+ $(top_builddir)/hardware/libhardware.la
+if !WANT_GLVND
+libEGL__GL_LIB_SUFFIX__la_LDFLAGS += -version-info "1":"0":"0"
+else
+libEGL__GL_LIB_SUFFIX__la_LDFLAGS += -version-info "0":"0":"0"
+endif
eglincludedir = $(includedir)/EGL
eglinclude_HEADERS = \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/egl.c
^
|
@@ -25,6 +25,7 @@
#include <GLES2/gl2ext.h>
#include <dlfcn.h>
#include <stddef.h>
+#include <stdint.h>
#include <stdlib.h>
#include <malloc.h>
#include "ws.h"
@@ -33,6 +34,7 @@
#include <hybris/common/binding.h>
+#include <stdlib.h>
#include <string.h>
#include <system/window.h>
@@ -44,6 +46,8 @@
static void *_hybris_libgles2 = NULL;
static int _egl_context_client_version = 1;
+static EGLint (*_eglGetError)(void) = NULL;
+
static EGLDisplay (*_eglGetDisplay)(EGLNativeDisplayType display_id) = NULL;
static EGLBoolean (*_eglTerminate)(EGLDisplay dpy) = NULL;
@@ -103,7 +107,35 @@
egl_helper_get_mapping,
};
-HYBRIS_IMPLEMENT_FUNCTION0(egl, EGLint, eglGetError);
+static __thread EGLint __eglHybrisError = EGL_SUCCESS;
+
+void __eglHybrisSetError(EGLint error)
+{
+ __eglHybrisError = error;
+}
+
+EGLint eglGetError(void)
+{
+ /*
+ * EGL requires that eglGetError() reports only the "most recent" error
+ * and clear the error afterward. Because we don't hook every function,
+ * both us and Android can have a separated error and we won't know what
+ * is the most recent. But whatever error we report, we have to clear both
+ * error. So we report our error over Android's because it's easier this
+ * way.
+ */
+ HYBRIS_DLSYSM(egl, &_eglGetError, "eglGetError");
+
+ EGLint androidError = _eglGetError();
+
+ if (__eglHybrisError != EGL_SUCCESS) {
+ EGLint ourError = __eglHybrisError;
+ __eglHybrisError = EGL_SUCCESS;
+ return ourError;
+ }
+
+ return androidError;
+}
#define _EGL_MAX_DISPLAYS 100
@@ -139,9 +171,69 @@
return EGL_NO_DISPLAY;
}
-EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
+static const char * _defaultEglPlatform()
+{
+ char *egl_platform;
+
+ // Mesa uses EGL_PLATFORM for its own purposes.
+ // Add HYBRIS_EGLPLATFORM to avoid the conflicts
+ egl_platform = getenv("HYBRIS_EGLPLATFORM");
+
+ if (egl_platform == NULL)
+ egl_platform = getenv("EGL_PLATFORM");
+
+ // The env variables may be defined yet empty
+ if (egl_platform == NULL || strcmp(egl_platform, "") == 0)
+ egl_platform = DEFAULT_EGL_PLATFORM;
+
+ return egl_platform;
+}
+
+#ifndef WANT_GLVND
+static
+#endif
+EGLDisplay __eglHybrisGetPlatformDisplayCommon(EGLenum platform,
+ void *display_id, const EGLAttrib *attrib_list)
{
+ // We have nothing to do with attrib_list at the moment. Silence the unused
+ // variable warning.
+ (void) attrib_list;
+
HYBRIS_DLSYSM(egl, &_eglGetDisplay, "eglGetDisplay");
+
+ if (!_eglGetDisplay) {
+ __eglHybrisSetError(EGL_NOT_INITIALIZED);
+ return EGL_NO_DISPLAY;
+ }
+
+ const char * hybris_ws;
+ switch (platform) {
+ case EGL_NONE:
+ hybris_ws = _defaultEglPlatform();
+ break;
+
+ case EGL_PLATFORM_ANDROID_KHR:
+ // "null" ws passthrough everything, which essentially means
+ // the Android platform. Not to be confused with NULL (0) value.
+ hybris_ws = "null";
+ break;
+
+#ifdef WANT_WAYLAND
+ case EGL_PLATFORM_WAYLAND_KHR:
+ hybris_ws = "wayland";
+ break;
+#endif
+
+ default:
+ __eglHybrisSetError(EGL_BAD_PARAMETER);
+ return EGL_NO_DISPLAY;
+ }
+
+ if (ws_init(hybris_ws) == EGL_FALSE) { // Other ws already loaded.
+ __eglHybrisSetError(EGL_BAD_PARAMETER);
+ return EGL_NO_DISPLAY;
+ }
+
EGLNativeDisplayType real_display;
real_display = (*_eglGetDisplay)(EGL_DEFAULT_DISPLAY);
@@ -163,6 +255,22 @@
return real_display;
}
+EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
+{
+ return __eglHybrisGetPlatformDisplayCommon(EGL_NONE, display_id, NULL);
+}
+
+EGLDisplay eglGetPlatformDisplay(EGLenum platform,
+ void *display_id, const EGLAttrib *attrib_list)
+{
+ if (platform == EGL_NONE) {
+ __eglHybrisSetError(EGL_BAD_PARAMETER);
+ return EGL_NO_DISPLAY;
+ }
+
+ return __eglHybrisGetPlatformDisplayCommon(platform, display_id, attrib_list);
+}
+
HYBRIS_IMPLEMENT_FUNCTION3(egl, EGLBoolean, eglInitialize, EGLDisplay, EGLint *, EGLint *);
EGLBoolean eglTerminate(EGLDisplay dpy)
@@ -208,6 +316,21 @@
return result;
}
+static EGLSurface _my_eglCreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config,
+ void *native_window, const EGLint *attrib_list)
+{
+ /*
+ * TODO: Convert type of parameters here if semantics for native_window
+ * differs from EGLNativeWindowType. Both Android(-based) platform and
+ * Wayland platform doesn't have this problem (they both accept a pointer).
+ * However, a patch for X11 exists, and for X11 platform you pass a pointer
+ * to Window in this function, but the Window itself (which is an XID) as
+ * EGLNativeWindowType. The patch probably have to patch this function.
+ */
+
+ return eglCreateWindowSurface(dpy, config, (uintptr_t) native_window, attrib_list);
+}
+
HYBRIS_IMPLEMENT_FUNCTION3(egl, EGLSurface, eglCreatePbufferSurface, EGLDisplay, EGLConfig, const EGLint *);
HYBRIS_IMPLEMENT_FUNCTION4(egl, EGLSurface, eglCreatePixmapSurface, EGLDisplay, EGLConfig, EGLNativePixmapType, const EGLint *);
@@ -349,39 +472,131 @@
(*_glEGLImageTargetTexture2DOES)(target, img ? img->egl_image : NULL);
}
+EGLBoolean _my_eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
+{
+ HYBRIS_DLSYSM(egl, &_eglDestroyImageKHR, "eglDestroyImageKHR");
+ struct egl_image *img = image;
+ EGLBoolean ret = (*_eglDestroyImageKHR)(dpy, img ? img->egl_image : NULL);
+ if (ret == EGL_TRUE) {
+ free(img);
+ return EGL_TRUE;
+ }
+ return ret;
+}
+
+struct FuncNamePair {
+ const char * name;
+ __eglMustCastToProperFunctionPointerType func;
+};
+
+#define OVERRIDE_SAMENAME(function) { .name = #function, .func = (__eglMustCastToProperFunctionPointerType) function }
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/eglhybris.h
^
|
@@ -26,6 +26,8 @@
extern "C" {
#endif
+void __eglHybrisSetError(EGLint error);
+
void hybris_dump_buffer_to_file(struct ANativeWindowBuffer *buf);
void *hybris_android_egl_dlsym(const char *symbol);
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/.gitignore
^
|
@@ -0,0 +1,3 @@
+generate/__pycache__/
+g_*.c
+g_*.h
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/10_libhybris.json.in
^
|
@@ -0,0 +1,6 @@
+{
+ "file_format_version" : "1.0.0",
+ "ICD" : {
+ "library_path" : "libEGL@GL_LIB_SUFFIX@.so.0"
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/egldispatchstubs.c
^
|
@@ -0,0 +1,139 @@
+/*
+ * (C) Copyright 2016, NVIDIA CORPORATION.
+ * (C) Copyright 2021 UBports Foundation.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Kyle Brenneman <kbrenneman@nvidia.com>
+ */
+
+#include "egldispatchstubs.h"
+#include "g_egldispatchstubs.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "eglhybris.h"
+
+static const __EGLapiExports *exports;
+
+const int __EGL_DISPATCH_FUNC_COUNT = __EGL_DISPATCH_COUNT;
+int __EGL_DISPATCH_FUNC_INDICES[__EGL_DISPATCH_COUNT + 1];
+
+static int Compare(const void *l, const void *r)
+{
+ const char *s = *(const char **)r;
+ return strcmp(l, s);
+}
+
+static int FindProcIndex(const char *name)
+{
+ const char **match = bsearch(name, __EGL_DISPATCH_FUNC_NAMES,
+ __EGL_DISPATCH_COUNT, sizeof(const char *), Compare);
+
+ if (match == NULL)
+ return __EGL_DISPATCH_COUNT;
+
+ return match - __EGL_DISPATCH_FUNC_NAMES;
+}
+
+void __eglInitDispatchStubs(const __EGLapiExports *exportsTable)
+{
+ int i;
+ exports = exportsTable;
+ for (i=0; i<__EGL_DISPATCH_FUNC_COUNT; i++) {
+ __EGL_DISPATCH_FUNC_INDICES[i] = -1;
+ }
+}
+
+void __eglSetDispatchIndex(const char *name, int dispatchIndex)
+{
+ int index = FindProcIndex(name);
+ __EGL_DISPATCH_FUNC_INDICES[index] = dispatchIndex;
+}
+
+void *__eglDispatchFindDispatchFunction(const char *name)
+{
+ int index = FindProcIndex(name);
+ return (void *) __EGL_DISPATCH_FUNCS[index];
+}
+
+static __eglMustCastToProperFunctionPointerType FetchVendorFunc(__EGLvendorInfo *vendor,
+ int index, EGLint errorCode)
+{
+ __eglMustCastToProperFunctionPointerType func = NULL;
+
+ if (vendor != NULL) {
+ func = exports->fetchDispatchEntry(vendor, __EGL_DISPATCH_FUNC_INDICES[index]);
+ }
+ if (func == NULL) {
+ if (errorCode != EGL_SUCCESS) {
+ // Since we have no vendor, the follow-up eglGetError() call will
+ // end up using the GLVND error code. Set it here.
+ if (vendor == NULL) {
+ exports->setEGLError(errorCode);
+ }
+ __eglHybrisSetError(errorCode);
+ }
+ return NULL;
+ }
+
+ if (!exports->setLastVendor(vendor)) {
+ // Don't bother trying to set an error code in libglvnd. If
+ // setLastVendor failed, then setEGLError would also fail.
+ __eglHybrisSetError(errorCode);
+ return NULL;
+ }
+
+ return func;
+}
+
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByCurrent(int index)
+{
+ __EGLvendorInfo *vendor;
+
+ // Note: This is only used for the eglWait* functions. For those, if
+ // there's no current context, then they're supposed to do nothing but
+ // return success.
+ exports->threadInit();
+ vendor = exports->getCurrentVendor();
+ return FetchVendorFunc(vendor, index, EGL_SUCCESS);
+}
+
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByDisplay(EGLDisplay dpy, int index)
+{
+ __EGLvendorInfo *vendor;
+
+ exports->threadInit();
+ vendor = exports->getVendorFromDisplay(dpy);
+ return FetchVendorFunc(vendor, index, EGL_BAD_DISPLAY);
+}
+
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByDevice(EGLDeviceEXT dev, int index)
+{
+ __EGLvendorInfo *vendor;
+
+ exports->threadInit();
+ vendor = exports->getVendorFromDevice(dev);
+ return FetchVendorFunc(vendor, index, EGL_BAD_DEVICE_EXT);
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/egldispatchstubs.h
^
|
@@ -0,0 +1,61 @@
+/*
+ * (C) Copyright 2016, NVIDIA CORPORATION.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Kyle Brenneman <kbrenneman@nvidia.com>
+ */
+
+#ifndef EGLDISPATCHSTUBS_H
+#define EGLDISPATCHSTUBS_H
+
+#include "glvnd/libeglabi.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+// These variables are all generated along with the dispatch stubs.
+extern const int __EGL_DISPATCH_FUNC_COUNT;
+extern const char * const __EGL_DISPATCH_FUNC_NAMES[];
+extern int __EGL_DISPATCH_FUNC_INDICES[];
+extern const __eglMustCastToProperFunctionPointerType __EGL_DISPATCH_FUNCS[];
+
+void __eglInitDispatchStubs(const __EGLapiExports *exportsTable);
+void __eglSetDispatchIndex(const char *name, int index);
+
+/**
+ * Returns the dispatch function for the given name, or \c NULL if the function
+ * isn't supported.
+ */
+void *__eglDispatchFindDispatchFunction(const char *name);
+
+// Helper functions used by the generated stubs.
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByDisplay(EGLDisplay dpy, int index);
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByDevice(EGLDeviceEXT dpy, int index);
+__eglMustCastToProperFunctionPointerType __eglDispatchFetchByCurrent(int index);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // EGLDISPATCHSTUBS_H
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/eglglvnd.cpp
^
|
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2020 UBports Foundation.
+ *
+ * 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.
+ *
+ */
+
+#include "config.h"
+
+#include <string>
+#include <cstring>
+
+#include <EGL/egl.h>
+#include <glvnd/libeglabi.h>
+
+#include "eglhybris.h"
+#include "ws.h"
+#include "egldispatchstubs.h"
+
+// Implemented in egl.c
+extern "C" EGLDisplay __eglHybrisGetPlatformDisplayCommon(EGLenum platform,
+ void *display_id, const EGLAttrib *attrib_list);
+
+static const __EGLapiExports *__eglGLVNDApiExports = NULL;
+
+/*
+ * According to Mesa, the normal eglQueryString shouldn't include platform
+ * extensions, so we use this to our advantage. We'll strip any platform
+ * presents in normal string. Then, when we're queried supported platfrom
+ * in glvnd's GetVendorString(), we check what a window system is loaded and
+ * reply only the coresponding extensions.
+ */
+
+static std::string clientExtensionNoPlatform()
+{
+ std::string clientExts;
+ const char * clientExtsOrigCStr = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+
+ if (!clientExtsOrigCStr || clientExtsOrigCStr[0] == '\0')
+ return clientExts;
+
+ const std::string clientExtsOrig(clientExtsOrigCStr);
+
+ std::size_t start = 0, end;
+ do {
+ end = clientExtsOrig.find(' ', start);
+ // end might be string::npos, but removing start from ::npos shouldn't
+ // cause any issue.
+ auto ext = clientExtsOrig.substr(start, end - start);
+ if (ext.find("_platform_") == std::string::npos) {
+ if (clientExts.empty()) {
+ clientExts = ext;
+ } else {
+ clientExts += ' ';
+ clientExts += ext;
+ }
+ }
+
+ start = end + 1; // Skip the space.
+ // If end is npos then this value won't be used anyway.
+ } while (end != std::string::npos);
+
+ return clientExts;
+}
+
+static const char * EGLAPIENTRY
+__eglGLVNDQueryString(EGLDisplay dpy, EGLenum name)
+{
+ if (dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS) {
+ // Rely on C++11's static initialization guarantee.
+ static const std::string clientExts = clientExtensionNoPlatform();
+
+ // We can do this because if Android's EGL support client
+ // extensions, it will at least have EGL_EXT_client_extensions.
+ if (clientExts.empty())
+ return NULL;
+ else
+ return clientExts.c_str();
+ }
+
+ // Use libhybris's normal eglQueryString() otherwise.
+ return eglQueryString(dpy, name);
+}
+
+static const char *
+__eglGLVNDGetVendorString(int name)
+{
+ if (name == __EGL_VENDOR_STRING_PLATFORM_EXTENSIONS) {
+ return
+ "EGL_KHR_platform_android"
+#ifdef WANT_WAYLAND
+ " EGL_EXT_platform_wayland EGL_KHR_platform_wayland"
+#endif
+ ;
+ }
+
+ return NULL;
+}
+
+static EGLBoolean __eglGLVNDgetSupportsAPI (EGLenum api)
+{
+ return api == EGL_OPENGL_ES_API;
+}
+
+static void *
+__eglGLVNDGetProcAddress(const char *procName)
+{
+ if (strcmp(procName, "eglQueryString") == 0)
+ return (void *) __eglGLVNDQueryString;
+ else
+ return (void *) eglGetProcAddress(procName);
+}
+
+/* For glvnd-supported libEGL, every symbols except for the entry point,
+ * __egl_Main(), must be hidden. In our case, we pass -fvisibility=hidden
+ * flag, then explicitly set this function visible.
+ */
+
+__attribute__ ((visibility ("default")))
+EGLBoolean
+__egl_Main(uint32_t version, const __EGLapiExports *exports,
+ __EGLvendorInfo *vendor, __EGLapiImports *imports)
+{
+ if (EGL_VENDOR_ABI_GET_MAJOR_VERSION(version) !=
+ EGL_VENDOR_ABI_MAJOR_VERSION)
+ return EGL_FALSE;
+
+ __eglGLVNDApiExports = exports;
+ __eglInitDispatchStubs(exports);
+
+ imports->getPlatformDisplay = __eglHybrisGetPlatformDisplayCommon;
+ imports->getSupportsAPI = __eglGLVNDgetSupportsAPI;
+ imports->getVendorString = __eglGLVNDGetVendorString;
+ imports->getProcAddress = __eglGLVNDGetProcAddress;
+ imports->getDispatchAddress = __eglDispatchFindDispatchFunction;
+ imports->setDispatchIndex = __eglSetDispatchIndex;
+
+ return EGL_TRUE;
+}
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/egl.xml
^
|
@@ -0,0 +1,3368 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <!--
+ Copyright (c) 2013-2017 The Khronos Group Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and/or associated documentation files (the
+ "Materials"), to deal in the Materials without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Materials, and to
+ permit persons to whom the Materials are furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Materials.
+
+ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ -->
+ <!--
+ This file, egl.xml, is the EGL API Registry. The older ".spec" file
+ format has been retired and will no longer be updated with new
+ extensions and API versions. The canonical version of the registry,
+ together with documentation, schema, and Python generator scripts used
+ to generate C header files for EGL, can be found in the Khronos Registry
+ at
+ https://www.github.com/KhronosGroup/EGL-Registry
+ -->
+
+ <!-- SECTION: EGL type definitions. Does not include GL types. -->
+ <types>
+ <!-- These are dependencies EGL types require to be declared legally -->
+ <type name="khrplatform">#include <KHR/khrplatform.h></type>
+ <type name="eglplatform" requires="khrplatform">#include <EGL/eglplatform.h></type>
+ <type name="khronos_utime_nanoseconds_t" requires="khrplatform"/>
+ <type name="khronos_stime_nanoseconds_t" requires="khrplatform"/>
+ <type name="khronos_uint64_t" requires="khrplatform"/>
+ <type name="khronos_ssize_t" requires="khrplatform"/>
+ <type name="EGLNativeDisplayType" requires="eglplatform"/>
+ <type name="EGLNativePixmapType" requires="eglplatform"/>
+ <type name="EGLNativeWindowType" requires="eglplatform"/>
+ <type name="EGLint" requires="eglplatform"/>
+ <type name="NativeDisplayType" requires="eglplatform"/>
+ <type name="NativePixmapType" requires="eglplatform"/>
+ <type name="NativeWindowType" requires="eglplatform"/>
+ <type>struct <name>AHardwareBuffer</name>;</type>
+ <type>struct <name>wl_buffer</name>;</type>
+ <type>struct <name>wl_display</name>;</type>
+ <type>struct <name>wl_resource</name>;</type>
+ <!-- Dummy placeholders for non-EGL types -->
+ <type name="Bool"/>
+ <!-- These are actual EGL types. -->
+ <type>typedef unsigned int <name>EGLBoolean</name>;</type>
+ <type>typedef unsigned int <name>EGLenum</name>;</type>
+ <type requires="khrplatform">typedef intptr_t <name>EGLAttribKHR</name>;</type>
+ <type requires="khrplatform">typedef intptr_t <name>EGLAttrib</name>;</type>
+ <type>typedef void *<name>EGLClientBuffer</name>;</type>
+ <type>typedef void *<name>EGLConfig</name>;</type>
+ <type>typedef void *<name>EGLContext</name>;</type>
+ <type>typedef void *<name>EGLDeviceEXT</name>;</type>
+ <type>typedef void *<name>EGLDisplay</name>;</type>
+ <type>typedef void *<name>EGLImage</name>;</type>
+ <type>typedef void *<name>EGLImageKHR</name>;</type>
+ <type>typedef void *<name>EGLLabelKHR</name>;</type>
+ <type>typedef void *<name>EGLObjectKHR</name>;</type>
+ <type>typedef void *<name>EGLOutputLayerEXT</name>;</type>
+ <type>typedef void *<name>EGLOutputPortEXT</name>;</type>
+ <type>typedef void *<name>EGLStreamKHR</name>;</type>
+ <type>typedef void *<name>EGLSurface</name>;</type>
+ <type>typedef void *<name>EGLSync</name>;</type>
+ <type>typedef void *<name>EGLSyncKHR</name>;</type>
+ <type>typedef void *<name>EGLSyncNV</name>;</type>
+ <type>typedef void (*<name>__eglMustCastToProperFunctionPointerType</name>)(void);</type>
+ <type requires="khrplatform">typedef khronos_utime_nanoseconds_t <name>EGLTimeKHR</name>;</type>
+ <type requires="khrplatform">typedef khronos_utime_nanoseconds_t <name>EGLTime</name>;</type>
+ <type requires="khrplatform">typedef khronos_utime_nanoseconds_t <name>EGLTimeNV</name>;</type>
+ <type requires="khrplatform">typedef khronos_utime_nanoseconds_t <name>EGLuint64NV</name>;</type>
+ <type requires="khrplatform">typedef khronos_uint64_t <name>EGLuint64KHR</name>;</type>
+ <type requires="khrplatform">typedef khronos_stime_nanoseconds_t <name>EGLnsecsANDROID</name>;</type>
+ <type>typedef int <name>EGLNativeFileDescriptorKHR</name>;</type>
+ <type requires="khrplatform">typedef khronos_ssize_t <name>EGLsizeiANDROID</name>;</type>
+ <type requires="EGLsizeiANDROID">typedef void (*<name>EGLSetBlobFuncANDROID</name>) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);</type>
+ <type requires="EGLsizeiANDROID">typedef EGLsizeiANDROID (*<name>EGLGetBlobFuncANDROID</name>) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);</type>
+ <type>struct <name>EGLClientPixmapHI</name> {
+ void *pData;
+ EGLint iWidth;
+ EGLint iHeight;
+ EGLint iStride;
+};</type>
+ <!-- Backwards-compatibility hack: Downstream implementations shipped
+ incorrect function pointer names for some years. -->
+ <type>typedef void (<apientry/> *<name>EGLDEBUGPROCKHR</name>)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message);</type>
+ <type>#define <name>PFNEGLBINDWAYLANDDISPLAYWL</name> PFNEGLBINDWAYLANDDISPLAYWLPROC</type>
+ <type>#define <name>PFNEGLUNBINDWAYLANDDISPLAYWL</name> PFNEGLUNBINDWAYLANDDISPLAYWLPROC</type>
+ <type>#define <name>PFNEGLQUERYWAYLANDBUFFERWL</name> PFNEGLQUERYWAYLANDBUFFERWLPROC</type>
+ <type>#define <name>PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL</name> PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC</type>
+ </types>
+
+ <!-- SECTION: EGL enumerant (token) definitions. -->
+
+ <!-- Bitmasks each have their own namespace, as do a few other
+ categories of enumeration -->
+
+ <enums namespace="EGLSurfaceTypeMask" type="bitmask" comment="EGL_SURFACE_TYPE bits">
+ <enum value="0x0001" name="EGL_PBUFFER_BIT"/>
+ <enum value="0x0002" name="EGL_PIXMAP_BIT"/>
+ <enum value="0x0004" name="EGL_WINDOW_BIT"/>
+ <enum value="0x0008" name="EGL_PBUFFER_IMAGE_BIT_TAO" comment="Unreleased TAO extension"/>
+ <enum value="0x0010" name="EGL_PBUFFER_PALETTE_IMAGE_BIT_TAO" comment="Unreleased TAO extension"/>
+ <enum value="0x0020" name="EGL_VG_COLORSPACE_LINEAR_BIT"/>
+ <enum value="0x0020" name="EGL_VG_COLORSPACE_LINEAR_BIT_KHR"/>
+ <enum value="0x0040" name="EGL_VG_ALPHA_FORMAT_PRE_BIT"/>
+ <enum value="0x0040" name="EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR"/>
+ <enum value="0x0080" name="EGL_LOCK_SURFACE_BIT_KHR"/>
+ <enum value="0x0100" name="EGL_OPTIMAL_FORMAT_BIT_KHR"/>
+ <enum value="0x0200" name="EGL_MULTISAMPLE_RESOLVE_BOX_BIT"/>
+ <enum value="0x0400" name="EGL_SWAP_BEHAVIOR_PRESERVED_BIT"/>
+ <enum value="0x0800" name="EGL_STREAM_BIT_KHR"/>
+ <!--
+ <enum value="0x0800" name="EGL_STREAM_BIT_NV" comment="Draft EGL_NV_stream_producer_eglsurface extension (bug 8064)"/>
+ -->
+ <enum value="0x1000" name="EGL_MUTABLE_RENDER_BUFFER_BIT_KHR"/>
+ </enums>
+
+ <enums namespace="EGLRenderableTypeMask" type="bitmask" comment="EGL_RENDERABLE_TYPE bits">
+ <enum value="0x0001" name="EGL_OPENGL_ES_BIT"/>
+ <enum value="0x0002" name="EGL_OPENVG_BIT"/>
+ <enum value="0x0004" name="EGL_OPENGL_ES2_BIT"/>
+ <enum value="0x0008" name="EGL_OPENGL_BIT"/>
+ <enum value="0x0010" name="EGL_INTEROP_BIT_KHR" comment="EGL_KHR_interop"/>
+ <enum value="0x0020" name="EGL_OPENMAX_IL_BIT_KHR" comment="EGL_KHR_interop"/>
+ <enum value="0x00000040" name="EGL_OPENGL_ES3_BIT"/>
+ <enum value="0x00000040" name="EGL_OPENGL_ES3_BIT_KHR" alias="EGL_OPENGL_ES3_BIT"/>
+ </enums>
+
+ <enums namespace="EGLLockUsageHintKHRMask" type="bitmask" comment="EGL_LOCK_USAGE_HINT_KHR bits">
+ <enum value="0x0001" name="EGL_READ_SURFACE_BIT_KHR"/>
+ <enum value="0x0002" name="EGL_WRITE_SURFACE_BIT_KHR"/>
+ </enums>
+
+ <enums namespace="EGLNativeBufferUsageFlags" type="bitmask" comment="EGL_NATIVE_BUFFER_USAGE_ANDROID bits">
+ <enum value="0x00000001" name="EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID"/>
+ <enum value="0x00000002" name="EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID"/>
+ <enum value="0x00000004" name="EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID"/>
+ </enums>
+
+ <enums namespace="EGLSyncFlagsKHR" type="bitmask" comment="Fence/reusable sync wait bits">
+ <enum value="0x0001" name="EGL_SYNC_FLUSH_COMMANDS_BIT"/>
+ <enum value="0x0001" name="EGL_SYNC_FLUSH_COMMANDS_BIT_KHR" alias="EGL_SYNC_FLUSH_COMMANDS_BIT"/>
+ <enum value="0x0001" name="EGL_SYNC_FLUSH_COMMANDS_BIT_NV" alias="EGL_SYNC_FLUSH_COMMANDS_BIT"/>
+ </enums>
+
+ <enums namespace="EGLDRMBufferUseMESAMask" type="bitmask" comment="EGL_DRM_BUFFER_USE_MESA bits">
+ <enum value="0x00000001" name="EGL_DRM_BUFFER_USE_SCANOUT_MESA"/>
+ <enum value="0x00000002" name="EGL_DRM_BUFFER_USE_SHARE_MESA"/>
+ <enum value="0x00000004" name="EGL_DRM_BUFFER_USE_CURSOR_MESA"/>
+ </enums>
+
+ <!-- Should be shared with GL, but aren't aren't since the
+ FORWARD_COMPATIBLE and DEBUG_BIT values are swapped in the
+ corresponding GL enums. Oops :-( -->
+ <enums namespace="EGLContextFlagMask" type="bitmask" comment="EGL_CONTEXT_FLAGS_KHR bits">
+ <enum value="0x00000001" name="EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR"/>
+ <enum value="0x00000002" name="EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR"/>
+ <enum value="0x00000004" name="EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR"/>
+ </enums>
+
+ <enums namespace="EGLContextProfileMask" type="bitmask" comment="Shared with GL">
+ <enum value="0x00000001" name="EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT"/>
+ <enum value="0x00000001" name="EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR" alias="EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT"/>
+ <enum value="0x00000002" name="EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT"/>
+ <enum value="0x00000002" name="EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR" alias="EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT"/>
+ </enums>
+
+ <!-- The default ("API") enum namespace starts here. While some
+ assigned values may overlap, and different parts of the
+ namespace are reserved for different purposes, it is a single
+ namespace. The "class" attribute indicates some of the reserved
+ purposes but is by no means complete (and cannot be, since many
+ tokens are reused for different purposes in different
+ extensions and API versions). -->
+
+ <enums namespace="EGL" start="0x0000" end="0x2FFF" vendor="KHR" comment="Reserved for enumerants shared with WGL, GLX, and GL">
+ <enum value="0" name="EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR"/>
+ <enum value="0x2097" name="EGL_CONTEXT_RELEASE_BEHAVIOR_KHR"/>
+ <enum value="0x2098" name="EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR"/>
+ </enums>
+
+ <enums namespace="EGL" group="Boolean" vendor="ARB">
+ <enum value="0" name="EGL_FALSE"/>
+ <enum value="1" name="EGL_TRUE"/>
+ </enums>
+
+ <enums namespace="EGL" group="SpecialNumbers" vendor="ARB" comment="Tokens whose numeric value is intrinsically meaningful">
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/eglFunctionList.py
^
|
@@ -0,0 +1,264 @@
+# (C) Copyright 2016, NVIDIA CORPORATION.
+# (C) Copyright 2021 UBports Foundation.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# Authors:
+# Kyle Brenneman <kbrenneman@nvidia.com>
+
+"""
+Contains a list of EGL functions to generate dispatch functions for.
+
+This is used from gen_egl_dispatch.py.
+
+EGL_FUNCTIONS is a sequence of (name, eglData) pairs, where name is the name
+of the function, and eglData is a dictionary containing data about that
+function.
+
+The values in the eglData dictionary are:
+- method (string):
+ How to select a vendor library. See "Method values" below.
+
+- prefix (string):
+ This string is prepended to the name of the dispatch function. If
+ unspecified, the default is "" (an empty string).
+
+- static (boolean)
+ If True, this function should be declared static.
+
+- "public" (boolean)
+ If True, the function should be exported from the library. Vendor libraries
+ generally should not use this.
+
+- extension (string):
+ If specified, this is the name of a macro to check for before defining a
+ function. Used for checking for extension macros and such.
+
+- retval (string):
+ If specified, this is a C expression with the default value to return if we
+ can't find a function to call. By default, it will try to guess from the
+ return type: EGL_NO_whatever for the various handle types, NULL for
+ pointers, and zero for everything else.
+
+method values:
+- "custom"
+ The dispatch stub will be hand-written instead of generated.
+
+- "none"
+ No dispatch function exists at all, but the function should still have an
+ entry in the index array. This is for other functions that a stub may need
+ to call that are implemented in libEGL itself.
+
+- "display"
+ Select a vendor from an EGLDisplay argument.
+
+- "device"
+ Select a vendor from an EGLDeviceEXT argument.
+
+- "current"
+ Select the vendor that owns the current context.
+"""
+
+def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dispatch_", extension=None, retval=None):
+ """
+ A convenience function to define an entry in the EGL function list.
+ """
+ if static is None:
+ static = (not public and method != "custom")
+ if inheader is None:
+ inheader = (not static)
+ values = {
+ "method" : method,
+ "prefix" : prefix,
+ "extension" : extension,
+ "retval" : retval,
+ "static" : static,
+ "public" : public,
+ "inheader" : inheader,
+ }
+ return (name, values)
+
+EGL_FUNCTIONS = (
+ # EGL_VERSION_1_0
+ _eglFunc("eglChooseConfig", "none"),
+ _eglFunc("eglCopyBuffers", "none"),
+ _eglFunc("eglCreateContext", "none"),
+ _eglFunc("eglCreatePbufferSurface", "none"),
+ _eglFunc("eglCreatePixmapSurface", "none"),
+ _eglFunc("eglCreateWindowSurface", "none"),
+ _eglFunc("eglDestroyContext", "none"),
+ _eglFunc("eglDestroySurface", "none"),
+ _eglFunc("eglGetConfigAttrib", "none"),
+ _eglFunc("eglGetConfigs", "none"),
+ _eglFunc("eglQueryContext", "none"),
+ _eglFunc("eglQuerySurface", "none"),
+ _eglFunc("eglSwapBuffers", "none"),
+ _eglFunc("eglWaitGL", "none"),
+ _eglFunc("eglWaitNative", "none"),
+ _eglFunc("eglTerminate", "none"),
+ _eglFunc("eglInitialize", "none"),
+
+ _eglFunc("eglGetCurrentDisplay", "none"),
+ _eglFunc("eglGetCurrentSurface", "none"),
+ _eglFunc("eglGetDisplay", "none"),
+ _eglFunc("eglGetError", "none"),
+ _eglFunc("eglGetProcAddress", "none"),
+ _eglFunc("eglMakeCurrent", "none"),
+ _eglFunc("eglQueryString", "none"),
+
+ # EGL_VERSION_1_1
+ _eglFunc("eglBindTexImage", "none"),
+ _eglFunc("eglReleaseTexImage", "none"),
+ _eglFunc("eglSurfaceAttrib", "none"),
+ _eglFunc("eglSwapInterval", "none"),
+
+ # EGL_VERSION_1_2
+ _eglFunc("eglCreatePbufferFromClientBuffer", "none"),
+ _eglFunc("eglWaitClient", "none"),
+ _eglFunc("eglBindAPI", "none"),
+ _eglFunc("eglQueryAPI", "none"),
+ _eglFunc("eglReleaseThread", "none"),
+
+ # EGL_VERSION_1_4
+ _eglFunc("eglGetCurrentContext", "none"),
+
+ # EGL_VERSION_1_5
+ _eglFunc("eglCreateSync", "none"),
+ _eglFunc("eglDestroySync", "none"),
+ _eglFunc("eglClientWaitSync", "none"),
+ _eglFunc("eglGetSyncAttrib", "none"),
+ _eglFunc("eglCreateImage", "none"),
+ _eglFunc("eglDestroyImage", "none"),
+ _eglFunc("eglCreatePlatformWindowSurface", "none"),
+ _eglFunc("eglCreatePlatformPixmapSurface", "none"),
+ _eglFunc("eglWaitSync", "none"),
+ _eglFunc("eglGetPlatformDisplay", "none"),
+
+ # EGL_EXT_platform_base
+ _eglFunc("eglCreatePlatformWindowSurfaceEXT", "display"),
+ _eglFunc("eglCreatePlatformPixmapSurfaceEXT", "display"),
+ _eglFunc("eglGetPlatformDisplayEXT", "none"),
+
+ # TODO: Most of these extensions should be provided by the vendor
+ # libraries, not by libEGL. They're here now to make testing everything
+ # else easier.
+
+ # EGL_EXT_swap_buffers_with_damage
+ _eglFunc("eglSwapBuffersWithDamageEXT", "display"),
+
+ # KHR_EXT_swap_buffers_with_damage
+ _eglFunc("eglSwapBuffersWithDamageKHR", "display"),
+
+ # EGL_KHR_cl_event2
+ _eglFunc("eglCreateSync64KHR", "display"),
+
+ # EGL_KHR_fence_sync
+ _eglFunc("eglCreateSyncKHR", "display"),
+ _eglFunc("eglDestroySyncKHR", "display"),
+ _eglFunc("eglClientWaitSyncKHR", "display"),
+ _eglFunc("eglGetSyncAttribKHR", "display"),
+
+ # EGL_KHR_image
+ _eglFunc("eglCreateImageKHR", "display"),
+ _eglFunc("eglDestroyImageKHR", "display"),
+
+ # EGL_KHR_image_base
+ # eglCreateImageKHR already defined in EGL_KHR_image
+ # eglDestroyImageKHR already defined in EGL_KHR_image
+
+ # EGL_KHR_reusable_sync
+ _eglFunc("eglSignalSyncKHR", "display"),
+ # eglCreateSyncKHR already defined in EGL_KHR_fence_sync
+ # eglDestroySyncKHR already defined in EGL_KHR_fence_sync
+ # eglClientWaitSyncKHR already defined in EGL_KHR_fence_sync
+ # eglGetSyncAttribKHR already defined in EGL_KHR_fence_sync
+
+ # EGL_KHR_wait_sync
+ _eglFunc("eglWaitSyncKHR", "display"),
+
+ # EGL_NOK_swap_region
+ _eglFunc("eglSwapBuffersRegionNOK", "display"),
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/egl_hybris.xml
^
|
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <!--
+ Copyright (c) 2021 UBports Foundation.
+
+ 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.
+ -->
+ <comment>
+ This file contains libhybris-specific functions.
+ </comment>
+ <commands namespace="EGL">
+ <!-- EGL_HYBRIS_native_buffer2 -->
+ <command>
+ <proto>EGLBoolean <name>eglHybrisNativeBufferHandle</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ <param><ptype>void **</ptype> <name>handle</name></param>
+ </command>
+
+ <command>
+ <proto>void <name>eglHybrisGetNativeBufferInfo</name></proto>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ <param><ptype>int *</ptype> <name>num_ints</name></param>
+ <param><ptype>int *</ptype> <name>num_fds</name></param>
+ </command>
+
+ <command>
+ <proto>void <name></name>eglHybrisSerializeNativeBuffer</proto>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ <param><ptype>int *</ptype> <name>ints</name></param>
+ <param><ptype>int *</ptype> <name>fds</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglHybrisCreateRemoteBuffer</name></proto>
+ <param><ptype>EGLint</ptype> <name>width</name></param>
+ <param><ptype>EGLint</ptype> <name>height</name></param>
+ <param><ptype>EGLint</ptype> <name>usage</name></param>
+ <param><ptype>EGLint</ptype> <name>format</name></param>
+ <param><ptype>EGLint</ptype> <name>stride</name></param>
+ <param><ptype>int</ptype> <name>num_ints</name></param>
+ <param><ptype>int *</ptype> <name>ints</name></param>
+ <param><ptype>int</ptype> <name>num_fds</name></param>
+ <param><ptype>int *</ptype> <name>fds</name></param>
+ <param><ptype>EGLClientBuffer *</ptype> <name>buffer</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglHybrisCreateNativeBuffer</name></proto>
+ <param><ptype>EGLint</ptype> <name>width</name></param>
+ <param><ptype>EGLint</ptype> <name>height</name></param>
+ <param><ptype>EGLint</ptype> <name>usage</name></param>
+ <param><ptype>EGLint</ptype> <name>format</name></param>
+ <param><ptype>EGLint *</ptype> <name>stride</name></param>
+ <param><ptype>EGLClientBuffer *</ptype> <name>buffer</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglHybrisLockNativeBuffer</name></proto>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ <param>EGLint<ptype></ptype> <name>usage</name></param>
+ <param>EGLint<ptype></ptype> <name>l</name></param>
+ <param>EGLint<ptype></ptype> <name>t</name></param>
+ <param>EGLint<ptype></ptype> <name>w</name></param>
+ <param>EGLint<ptype></ptype> <name>h</name></param>
+ <param>void **<ptype></ptype> <name>vaddr</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglHybrisUnlockNativeBuffer</name></proto>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglHybrisReleaseNativeBuffer</name></proto>
+ <param><ptype>EGLClientBuffer</ptype> <name>buffer</name></param>
+ </command>
+
+ <!-- EGL_HYBRIS_WL_acquire_native_buffer -->
+ <command>
+ <proto>EGLBoolean <name>eglHybrisAcquireNativeBufferWL</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>struct wl_resource *</ptype> <name>wlBuffer</name></param>
+ <param><ptype>EGLClientBuffer *</ptype> <name>buffer</name></param>
+ </command>
+
+ <!--
+ ??? No associated extension ???
+ The function is implemented in eglplatform_wayland.cpp. The only
+ reference I found outside of libhybris is at [1]. And that's the
+ old version; the newer version no longer uses this function.
+
+ [1] https://github.com/krnlyng/sfdroid_renderer
+ -->
+
+ <command>
+ <proto>int <name>eglHybrisWaylandPostBuffer</name></proto>
+ <param><ptype>EGLNativeWindowType</ptype> <name>win</name></param>
+ <param><ptype>void *</ptype> <name>buffer</name></param>
+ </command>
+ </commands>
+</registry>
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/egl_other.xml
^
|
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <!--
+ (C) Copyright 2016, NVIDIA CORPORATION.
+ All Rights Reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ on the rights to use, copy, modify, merge, publish, distribute, sub
+ license, and/or sell copies of the Software, and to permit persons to whom
+ the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+
+ Authors:
+ Kyle Brenneman <kbrenneman@nvidia.com>
+ -->
+
+ <comment>
+ This file contains any EGL extension functions that are missing from
+ the normal egl.xml list.
+ </comment>
+ <commands namespace="EGL">
+ <!-- EGL_WL_bind_wayland_display -->
+ <command>
+ <proto>struct wl_buffer * <name>eglCreateWaylandBufferFromImageWL</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>EGLImage</ptype> <name>image</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglUnbindWaylandDisplayWL</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>struct wl_display *</ptype> <name>display</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglQueryWaylandBufferWL</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>struct wl_resource *</ptype> <name>buffer</name></param>
+ <param><ptype>EGLint</ptype> <name>attribute</name></param>
+ <param><ptype>EGLint *</ptype> <name>value</name></param>
+ </command>
+
+ <command>
+ <proto>EGLBoolean <name>eglBindWaylandDisplayWL</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
+ <param><ptype>struct wl_display *</ptype> <name>display</name></param>
+ </command>
+
+ <!-- EGL_CHROMIUM_get_sync_values -->
+ <command>
+ <proto>EGLBoolean <name>eglGetSyncValuesCHROMIUM</name></proto>
+ <param><ptype>EGLDisplay</ptype> <name>display</name></param>
+ <param><ptype>EGLSurface</ptype> <name>surface</name></param>
+ <param><ptype>EGLuint64KHR *</ptype> <name>ust</name></param>
+ <param><ptype>EGLuint64KHR *</ptype> <name>msc</name></param>
+ <param><ptype>EGLuint64KHR *</ptype> <name>sbc</name></param>
+ </command>
+ </commands>
+</registry>
+
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/genCommon.py
^
|
@@ -0,0 +1,239 @@
+#!/usr/bin/env python
+
+# (C) Copyright 2015, NVIDIA CORPORATION.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# Authors:
+# Kyle Brenneman <kbrenneman@nvidia.com>
+
+import collections
+import re
+import sys
+import xml.etree.ElementTree as etree
+
+import os
+import static_data
+
+MAPI_TABLE_NUM_DYNAMIC = 4096
+
+_LIBRARY_FEATURE_NAMES = {
+ # libGL and libGLdiapatch both include every function.
+ "gl" : None,
+ "gldispatch" : None,
+ "opengl" : frozenset(( "GL_VERSION_1_0", "GL_VERSION_1_1",
+ "GL_VERSION_1_2", "GL_VERSION_1_3", "GL_VERSION_1_4", "GL_VERSION_1_5",
+ "GL_VERSION_2_0", "GL_VERSION_2_1", "GL_VERSION_3_0", "GL_VERSION_3_1",
+ "GL_VERSION_3_2", "GL_VERSION_3_3", "GL_VERSION_4_0", "GL_VERSION_4_1",
+ "GL_VERSION_4_2", "GL_VERSION_4_3", "GL_VERSION_4_4", "GL_VERSION_4_5",
+ )),
+ "glesv1" : frozenset(("GL_VERSION_ES_CM_1_0", "GL_OES_point_size_array")),
+ "glesv2" : frozenset(("GL_ES_VERSION_2_0", "GL_ES_VERSION_3_0",
+ "GL_ES_VERSION_3_1", "GL_ES_VERSION_3_2",
+ )),
+}
+
+def getFunctions(xmlFiles):
+ """
+ Reads an XML file and returns all of the functions defined in it.
+
+ xmlFile should be the path to Khronos's gl.xml file. The return value is a
+ sequence of FunctionDesc objects, ordered by slot number.
+ """
+ roots = [ etree.parse(xmlFile).getroot() for xmlFile in xmlFiles ]
+ return getFunctionsFromRoots(roots)
+
+def getFunctionsFromRoots(roots):
+ functions = {}
+ for root in roots:
+ for func in _getFunctionList(root):
+ functions[func.name] = func
+ functions = functions.values()
+
+ # Sort the function list by name.
+ functions = sorted(functions, key=lambda f: f.name)
+
+ # Lookup for fixed offset/slot functions and use it if available.
+ # Assign a slot number to each function. This isn't strictly necessary,
+ # since you can just look at the index in the list, but it makes it easier
+ # to include the slot when formatting output.
+
+ next_slot = 0
+ for i in range(len(functions)):
+ name = functions[i].name[2:]
+
+ if name in static_data.offsets:
+ functions[i] = functions[i]._replace(slot=static_data.offsets[name])
+ elif not name.endswith("ARB") and name + "ARB" in static_data.offsets:
+ functions[i] = functions[i]._replace(slot=static_data.offsets[name + "ARB"])
+ elif not name.endswith("EXT") and name + "EXT" in static_data.offsets:
+ functions[i] = functions[i]._replace(slot=static_data.offsets[name + "EXT"])
+ else:
+ functions[i] = functions[i]._replace(slot=next_slot)
+ next_slot += 1
+
+ return functions
+
+def getExportNamesFromRoots(target, roots):
+ """
+ Goes through the <feature> tags from gl.xml and returns a set of OpenGL
+ functions that a library should export.
+
+ target should be one of "gl", "gldispatch", "opengl", "glesv1", or
+ "glesv2".
+ """
+ featureNames = _LIBRARY_FEATURE_NAMES[target]
+ if featureNames is None:
+ return set(func.name for func in getFunctionsFromRoots(roots))
+
+ names = set()
+ for root in roots:
+ features = []
+ for featElem in root.findall("feature"):
+ if featElem.get("name") in featureNames:
+ features.append(featElem)
+ for featElem in root.findall("extensions/extension"):
+ if featElem.get("name") in featureNames:
+ features.append(featElem)
+ for featElem in features:
+ for commandElem in featElem.findall("require/command"):
+ names.add(commandElem.get("name"))
+ return names
+
+class FunctionArg(collections.namedtuple("FunctionArg", "type name")):
+ @property
+ def dec(self):
+ """
+ Returns a "TYPE NAME" string, suitable for a function prototype.
+ """
+ rv = str(self.type)
+ if not rv.endswith("*"):
+ rv += " "
+ rv += self.name
+ return rv
+
+class FunctionDesc(collections.namedtuple("FunctionDesc", "name rt args slot")):
+ def hasReturn(self):
+ """
+ Returns true if the function returns a value.
+ """
+ return (self.rt != "void")
+
+ @property
+ def decArgs(self):
+ """
+ Returns a string with the types and names of the arguments, as you
+ would use in a function declaration.
+ """
+ if not self.args:
+ return "void"
+ else:
+ return ", ".join(arg.dec for arg in self.args)
+
+ @property
+ def callArgs(self):
+ """
+ Returns a string with the names of the arguments, as you would use in a
+ function call.
+ """
+ return ", ".join(arg.name for arg in self.args)
+
+ @property
+ def basename(self):
+ assert self.name.startswith("gl")
+ return self.name[2:]
+
+def _getFunctionList(root):
+ for elem in root.findall("commands/command"):
+ yield _parseCommandElem(elem)
+
+def _parseCommandElem(elem):
+ protoElem = elem.find("proto")
+ (rt, name) = _parseProtoElem(protoElem)
+
+ args = []
+ for ch in elem.findall("param"):
+ # <param> tags have the same format as a <proto> tag.
+ args.append(FunctionArg(*_parseProtoElem(ch)))
+ func = FunctionDesc(name, rt, tuple(args), slot=None)
+
+ return func
+
+def _parseProtoElem(elem):
+ # If I just remove the tags and string the text together, I'll get valid C code.
+ text = _flattenText(elem)
+ text = text.strip()
+ m = re.match(r"^(.+)\b(\w+)(?:\s*\[\s*(\d*)\s*\])?$", text, re.S)
+ if m:
+ typename = _fixupTypeName(m.group(1))
+ name = m.group(2)
+ if m.group(3):
+ # HACK: glPathGlyphIndexRangeNV defines an argument like this:
+ # GLuint baseAndCount[2]
+ # Convert it to a pointer and hope for the best.
+ typename += "*"
+ return (typename, name)
+ else:
+ raise ValueError("Can't parse element %r -> %r" % (elem, text))
+
+def _flattenText(elem):
+ """
+ Returns the text in an element and all child elements, with the tags
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/gen_egl_dispatch.py
^
|
@@ -0,0 +1,248 @@
+#!/usr/bin/env python
+
+# (C) Copyright 2016, NVIDIA CORPORATION.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# Authors:
+# Kyle Brenneman <kbrenneman@nvidia.com>
+
+"""
+Generates dispatch functions for EGL.
+
+The list of functions and arguments is read from the Khronos's XML files, with
+additional information defined in the module eglFunctionList.
+"""
+
+import argparse
+import collections
+import eglFunctionList
+import sys
+import textwrap
+
+import os
+import genCommon
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("target", choices=("header", "source"),
+ help="Whether to build the source or header file.")
+ parser.add_argument("xml_files", nargs="+", help="The XML files with the EGL function lists.")
+
+ args = parser.parse_args()
+
+ xmlFunctions = genCommon.getFunctions(args.xml_files)
+ xmlByName = dict((f.name, f) for f in xmlFunctions)
+ functions = []
+ for (name, eglFunc) in eglFunctionList.EGL_FUNCTIONS:
+ func = xmlByName[name]
+ eglFunc = fixupEglFunc(func, eglFunc)
+ functions.append((func, eglFunc))
+
+ # Sort the function list by name.
+ functions = sorted(functions, key=lambda f: f[0].name)
+
+ if args.target == "header":
+ text = generateHeader(functions)
+ elif args.target == "source":
+ text = generateSource(functions)
+ sys.stdout.write(text)
+
+def fixupEglFunc(func, eglFunc):
+ result = dict(eglFunc)
+ if result.get("prefix") is None:
+ result["prefix"] = ""
+
+ if result.get("extension") is not None:
+ text = "defined(" + result["extension"] + ")"
+ result["extension"] = text
+
+ if result["method"] in ("none", "custom"):
+ return result
+
+ if result["method"] not in ("display", "device", "current"):
+ raise ValueError("Invalid dispatch method %r for function %r" % (result["method"], func.name))
+
+ if func.hasReturn():
+ if result.get("retval") is None:
+ result["retval"] = getDefaultReturnValue(func.rt)
+
+ return result
+
+def generateHeader(functions):
+ text = textwrap.dedent(r"""
+ #ifndef G_EGLDISPATCH_STUBS_H
+ #define G_EGLDISPATCH_STUBS_H
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
+ #include <EGL/eglmesaext.h>
+ #include "glvnd/libeglabi.h"
+
+ """.lstrip("\n"))
+
+ text += "enum {\n"
+ for (func, eglFunc) in functions:
+ text += generateGuardBegin(func, eglFunc)
+ text += " __EGL_DISPATCH_" + func.name + ",\n"
+ text += generateGuardEnd(func, eglFunc)
+ text += " __EGL_DISPATCH_COUNT\n"
+ text += "};\n"
+
+ for (func, eglFunc) in functions:
+ if eglFunc["inheader"]:
+ text += generateGuardBegin(func, eglFunc)
+ text += "{f.rt} EGLAPIENTRY {ex[prefix]}{f.name}({f.decArgs});\n".format(f=func, ex=eglFunc)
+ text += generateGuardEnd(func, eglFunc)
+
+ text += textwrap.dedent(r"""
+ #ifdef __cplusplus
+ }
+ #endif
+ #endif // G_EGLDISPATCH_STUBS_H
+ """)
+ return text
+
+def generateSource(functions):
+ # First, sort the function list by name.
+ text = ""
+ text += '#include "egldispatchstubs.h"\n'
+ text += '#include "g_egldispatchstubs.h"\n'
+ text += '#include <stddef.h>\n'
+ text += "\n"
+
+ for (func, eglFunc) in functions:
+ if eglFunc["method"] not in ("custom", "none"):
+ text += generateGuardBegin(func, eglFunc)
+ text += generateDispatchFunc(func, eglFunc)
+ text += generateGuardEnd(func, eglFunc)
+
+ text += "\n"
+ text += "const char * const __EGL_DISPATCH_FUNC_NAMES[__EGL_DISPATCH_COUNT + 1] = {\n"
+ for (func, eglFunc) in functions:
+ text += generateGuardBegin(func, eglFunc)
+ text += ' "' + func.name + '",\n'
+ text += generateGuardEnd(func, eglFunc)
+ text += " NULL\n"
+ text += "};\n"
+
+ text += "const __eglMustCastToProperFunctionPointerType __EGL_DISPATCH_FUNCS[__EGL_DISPATCH_COUNT + 1] = {\n"
+ for (func, eglFunc) in functions:
+ text += generateGuardBegin(func, eglFunc)
+ if eglFunc["method"] != "none":
+ text += " (__eglMustCastToProperFunctionPointerType) " + eglFunc.get("prefix", "") + func.name + ",\n"
+ else:
+ text += " NULL, // " + func.name + "\n"
+ text += generateGuardEnd(func, eglFunc)
+ text += " NULL\n"
+ text += "};\n"
+
+ return text
+
+def generateGuardBegin(func, eglFunc):
+ ext = eglFunc.get("extension")
+ if ext is not None:
+ return "#if " + ext + "\n"
+ else:
+ return ""
+
+def generateGuardEnd(func, eglFunc):
+ if eglFunc.get("extension") is not None:
+ return "#endif\n"
+ else:
+ return ""
+
+def generateDispatchFunc(func, eglFunc):
+ text = ""
+
+ if eglFunc.get("static"):
+ text += "static "
+ elif eglFunc.get("public"):
+ text += "PUBLIC "
+ text += textwrap.dedent(
+ r"""
+ {f.rt} EGLAPIENTRY {ef[prefix]}{f.name}({f.decArgs})
+ {{
+ typedef {f.rt} EGLAPIENTRY (* _pfn_{f.name})({f.decArgs});
+ """).lstrip("\n").format(f=func, ef=eglFunc)
+
+ if func.hasReturn():
+ text += " {f.rt} _ret = {ef[retval]};\n".format(f=func, ef=eglFunc)
+
+ text += " _pfn_{f.name} _ptr_{f.name} = (_pfn_{f.name}) ".format(f=func)
+ if eglFunc["method"] == "current":
+ text += "__eglDispatchFetchByCurrent(__EGL_DISPATCH_{f.name});\n".format(f=func)
+
+ elif eglFunc["method"] in ("display", "device"):
+ if eglFunc["method"] == "display":
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/glvnd/generate/static_data.py
^
|
@@ -0,0 +1,3035 @@
+
+# Copyright (C) 2015 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+
+"""The maximum entries of actual static data required by indirect GLX."""
+
+
+MAX_OFFSETS = 407
+
+"""Table of functions that have ABI-mandated offsets in the dispatch table.
+
+The first MAX_OFFSETS entries are required by indirect GLX. The rest are
+required to preserve the glapi <> GL/GLES ABI. This is to be addressed shortly.
+
+This list will never change."""
+offsets = {
+ "NewList": 0,
+ "EndList": 1,
+ "CallList": 2,
+ "CallLists": 3,
+ "DeleteLists": 4,
+ "GenLists": 5,
+ "ListBase": 6,
+ "Begin": 7,
+ "Bitmap": 8,
+ "Color3b": 9,
+ "Color3bv": 10,
+ "Color3d": 11,
+ "Color3dv": 12,
+ "Color3f": 13,
+ "Color3fv": 14,
+ "Color3i": 15,
+ "Color3iv": 16,
+ "Color3s": 17,
+ "Color3sv": 18,
+ "Color3ub": 19,
+ "Color3ubv": 20,
+ "Color3ui": 21,
+ "Color3uiv": 22,
+ "Color3us": 23,
+ "Color3usv": 24,
+ "Color4b": 25,
+ "Color4bv": 26,
+ "Color4d": 27,
+ "Color4dv": 28,
+ "Color4f": 29,
+ "Color4fv": 30,
+ "Color4i": 31,
+ "Color4iv": 32,
+ "Color4s": 33,
+ "Color4sv": 34,
+ "Color4ub": 35,
+ "Color4ubv": 36,
+ "Color4ui": 37,
+ "Color4uiv": 38,
+ "Color4us": 39,
+ "Color4usv": 40,
+ "EdgeFlag": 41,
+ "EdgeFlagv": 42,
+ "End": 43,
+ "Indexd": 44,
+ "Indexdv": 45,
+ "Indexf": 46,
+ "Indexfv": 47,
+ "Indexi": 48,
+ "Indexiv": 49,
+ "Indexs": 50,
+ "Indexsv": 51,
+ "Normal3b": 52,
+ "Normal3bv": 53,
+ "Normal3d": 54,
+ "Normal3dv": 55,
+ "Normal3f": 56,
+ "Normal3fv": 57,
+ "Normal3i": 58,
+ "Normal3iv": 59,
+ "Normal3s": 60,
+ "Normal3sv": 61,
+ "RasterPos2d": 62,
+ "RasterPos2dv": 63,
+ "RasterPos2f": 64,
+ "RasterPos2fv": 65,
+ "RasterPos2i": 66,
+ "RasterPos2iv": 67,
+ "RasterPos2s": 68,
+ "RasterPos2sv": 69,
+ "RasterPos3d": 70,
+ "RasterPos3dv": 71,
+ "RasterPos3f": 72,
+ "RasterPos3fv": 73,
+ "RasterPos3i": 74,
+ "RasterPos3iv": 75,
+ "RasterPos3s": 76,
+ "RasterPos3sv": 77,
+ "RasterPos4d": 78,
+ "RasterPos4dv": 79,
+ "RasterPos4f": 80,
+ "RasterPos4fv": 81,
+ "RasterPos4i": 82,
+ "RasterPos4iv": 83,
+ "RasterPos4s": 84,
+ "RasterPos4sv": 85,
+ "Rectd": 86,
+ "Rectdv": 87,
+ "Rectf": 88,
+ "Rectfv": 89,
+ "Recti": 90,
+ "Rectiv": 91,
+ "Rects": 92,
+ "Rectsv": 93,
+ "TexCoord1d": 94,
+ "TexCoord1dv": 95,
+ "TexCoord1f": 96,
+ "TexCoord1fv": 97,
+ "TexCoord1i": 98,
+ "TexCoord1iv": 99,
+ "TexCoord1s": 100,
+ "TexCoord1sv": 101,
+ "TexCoord2d": 102,
+ "TexCoord2dv": 103,
+ "TexCoord2f": 104,
+ "TexCoord2fv": 105,
+ "TexCoord2i": 106,
+ "TexCoord2iv": 107,
+ "TexCoord2s": 108,
+ "TexCoord2sv": 109,
+ "TexCoord3d": 110,
+ "TexCoord3dv": 111,
+ "TexCoord3f": 112,
+ "TexCoord3fv": 113,
+ "TexCoord3i": 114,
+ "TexCoord3iv": 115,
+ "TexCoord3s": 116,
+ "TexCoord3sv": 117,
+ "TexCoord4d": 118,
+ "TexCoord4dv": 119,
+ "TexCoord4f": 120,
+ "TexCoord4fv": 121,
+ "TexCoord4i": 122,
+ "TexCoord4iv": 123,
+ "TexCoord4s": 124,
+ "TexCoord4sv": 125,
+ "Vertex2d": 126,
+ "Vertex2dv": 127,
+ "Vertex2f": 128,
+ "Vertex2fv": 129,
+ "Vertex2i": 130,
+ "Vertex2iv": 131,
+ "Vertex2s": 132,
+ "Vertex2sv": 133,
+ "Vertex3d": 134,
+ "Vertex3dv": 135,
+ "Vertex3f": 136,
+ "Vertex3fv": 137,
+ "Vertex3i": 138,
+ "Vertex3iv": 139,
+ "Vertex3s": 140,
+ "Vertex3sv": 141,
+ "Vertex4d": 142,
+ "Vertex4dv": 143,
+ "Vertex4f": 144,
+ "Vertex4fv": 145,
+ "Vertex4i": 146,
+ "Vertex4iv": 147,
+ "Vertex4s": 148,
+ "Vertex4sv": 149,
+ "ClipPlane": 150,
+ "ColorMaterial": 151,
+ "CullFace": 152,
+ "Fogf": 153,
+ "Fogfv": 154,
+ "Fogi": 155,
+ "Fogiv": 156,
+ "FrontFace": 157,
+ "Hint": 158,
+ "Lightf": 159,
+ "Lightfv": 160,
+ "Lighti": 161,
+ "Lightiv": 162,
+ "LightModelf": 163,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/ws.c
^
|
@@ -27,117 +27,135 @@
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static struct ws_module *ws = NULL;
+static char ws_name[32] = { 0 };
-static void _init_ws()
+static EGLBoolean ensureCorrectWs(const char * egl_platform)
{
- if (ws == NULL)
- {
- pthread_mutex_lock(&mutex);
- if (ws != NULL) {
- pthread_mutex_unlock(&mutex);
- return;
- }
-
- char ws_name[2048];
- char *egl_platform;
-
- // Mesa uses EGL_PLATFORM for its own purposes.
- // Add HYBRIS_EGLPLATFORM to avoid the conflicts
- egl_platform=getenv("HYBRIS_EGLPLATFORM");
-
- if (egl_platform == NULL)
- egl_platform=getenv("EGL_PLATFORM");
-
- if (egl_platform == NULL)
- egl_platform = DEFAULT_EGL_PLATFORM;
-
- // The env variables may be defined yet empty
- if (!strcmp(egl_platform, ""))
- egl_platform = DEFAULT_EGL_PLATFORM;
-
- const char *eglplatform_dir = PKGLIBDIR;
- const char *user_eglplatform_dir = getauxval(AT_SECURE)
- ? NULL
- : getenv("HYBRIS_EGLPLATFORM_DIR");
- if (user_eglplatform_dir)
- eglplatform_dir = user_eglplatform_dir;
-
- snprintf(ws_name, 2048, "%s/eglplatform_%s.so", eglplatform_dir, egl_platform);
-
- void *wsmod = (void *) dlopen(ws_name, RTLD_LAZY);
- if (wsmod==NULL)
- {
- fprintf(stderr, "ERROR: %s\n\t%s\n", ws_name, dlerror());
- assert(0);
- }
- ws = dlsym(wsmod, "ws_module_info");
- assert(ws != NULL);
- ws->init_module(&hybris_egl_interface);
+ return strcmp(egl_platform, ws_name) == 0;
+}
+
+/*
+ * ws_init() will be called from __eglHybrisGetPlatformDisplayCommon() to
+ * load the selected platform. That means the loading of ws is postponed until
+ * a display is opened. Ws functions which doesn't depend on having a display
+ * opened must cope with not having a ws.
+ *
+ * The function will return EGL_FALSE if the opened ws is not the requested
+ * one. It doesn't make sense to have multiple ws'es opened; Android EGL (and
+ * by extension our implementation) allow only one display to be opened.
+ */
+EGLBoolean ws_init(const char * egl_platform)
+{
+ if (ws != NULL)
+ return ensureCorrectWs(egl_platform);
+ pthread_mutex_lock(&mutex);
+ if (ws != NULL) {
pthread_mutex_unlock(&mutex);
+ return ensureCorrectWs(egl_platform);
+ }
+
+ char ws_lib_path[2048];
+
+ const char *eglplatform_dir = PKGLIBDIR;
+ const char *user_eglplatform_dir = getauxval(AT_SECURE)
+ ? NULL
+ : getenv("HYBRIS_EGLPLATFORM_DIR");
+ if (user_eglplatform_dir)
+ eglplatform_dir = user_eglplatform_dir;
+
+ snprintf(ws_lib_path, 2048, "%s/eglplatform_%s.so", eglplatform_dir, egl_platform);
+
+ void *wsmod = (void *) dlopen(ws_lib_path, RTLD_LAZY);
+ if (wsmod==NULL)
+ {
+ fprintf(stderr, "ERROR: %s\n\t%s\n", ws_lib_path, dlerror());
+ assert(0);
}
+ ws = dlsym(wsmod, "ws_module_info");
+ assert(ws != NULL);
+ ws->init_module(&hybris_egl_interface);
+
+ // Keep the name of chosen ws so that future calls can check.
+ strncpy(ws_name, egl_platform, sizeof(ws_name));
+
+ pthread_mutex_unlock(&mutex);
+ return EGL_TRUE;
}
struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType display)
{
- _init_ws();
+ assert(ws != NULL);
return ws->GetDisplay(display);
}
void ws_Terminate(struct _EGLDisplay *dpy)
{
- _init_ws();
+ assert(ws != NULL);
ws->Terminate(dpy);
}
EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display)
{
- _init_ws();
+ assert(ws != NULL);
return ws->CreateWindow(win, display);
}
void ws_DestroyWindow(EGLNativeWindowType win)
{
- _init_ws();
+ assert(ws != NULL);
return ws->DestroyWindow(win);
}
__eglMustCastToProperFunctionPointerType ws_eglGetProcAddress(const char *procname)
{
- _init_ws();
+ /*
+ * eglGetProcAddress is special; it must be able to provide address very early.
+ * Thus it cannot just assert() like other functions. Instead, we'll return NULL
+ * if ws is not initialized. The side effect is that ws cannot hook functions
+ * that are loaded early. So far functions that glvnd loads early are core functions
+ * that shouldn't be hooked by ws anyway.
+ */
+ if (ws == NULL)
+ return NULL;
+
return ws->eglGetProcAddress(procname);
}
void ws_passthroughImageKHR(EGLContext *ctx, EGLenum *target, EGLClientBuffer *buffer, const EGLint **attrib_list)
{
- _init_ws();
+ assert(ws != NULL);
return ws->passthroughImageKHR(ctx, target, buffer, attrib_list);
}
const char *ws_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name))
{
- _init_ws();
+ if (dpy == EGL_NO_DISPLAY)
+ // Querying client strings doesn't depend on having a ws.
+ return real_eglQueryString(dpy, name);
+
+ assert(ws != NULL);
return ws->eglQueryString(dpy, name, real_eglQueryString);
}
void ws_prepareSwap(EGLDisplay dpy, EGLNativeWindowType win, EGLint *damage_rects, EGLint damage_n_rects)
{
- _init_ws();
+ assert(ws != NULL);
if (ws->prepareSwap)
ws->prepareSwap(dpy, win, damage_rects, damage_n_rects);
}
void ws_finishSwap(EGLDisplay dpy, EGLNativeWindowType win)
{
- _init_ws();
+ assert(ws != NULL);
if (ws->finishSwap)
ws->finishSwap(dpy, win);
}
void ws_setSwapInterval(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval)
{
- _init_ws();
+ assert(ws != NULL);
if (ws->setSwapInterval)
ws->setSwapInterval(dpy, win, interval);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/egl/ws.h
^
|
@@ -39,6 +39,8 @@
void (*setSwapInterval)(EGLDisplay dpy, EGLNativeWindowType win, EGLint interval);
};
+EGLBoolean ws_init(const char * egl_platform);
+
struct _EGLDisplay *ws_GetDisplay(EGLNativeDisplayType native);
void ws_Terminate(struct _EGLDisplay *dpy);
EGLNativeWindowType ws_CreateWindow(EGLNativeWindowType win, struct _EGLDisplay *display);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/glesv1/Makefile.am
^
|
@@ -1,21 +1,23 @@
lib_LTLIBRARIES = \
- libGLESv1_CM.la
+ libGLESv1_CM$(GL_LIB_SUFFIX).la
-libGLESv1_CM_la_SOURCES = glesv1_cm.c
-libGLESv1_CM_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+libGLESv1_CM__GL_LIB_SUFFIX__la_SOURCES = glesv1_cm.c
+libGLESv1_CM__GL_LIB_SUFFIX__la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+if !WANT_GLVND
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = glesv1_cm.pc
+endif
if WANT_MESA
-libGLESv1_CM_la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+libGLESv1_CM__GL_LIB_SUFFIX__la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
endif
if WANT_TRACE
-libGLESv1_CM_la_CFLAGS += -DDEBUG
+libGLESv1_CM__GL_LIB_SUFFIX__la_CFLAGS += -DDEBUG
endif
if WANT_DEBUG
-libGLESv1_CM_la_CFLAGS += -ggdb -O0
+libGLESv1_CM__GL_LIB_SUFFIX__la_CFLAGS += -ggdb -O0
endif
-libGLESv1_CM_la_LDFLAGS = \
+libGLESv1_CM__GL_LIB_SUFFIX__la_LDFLAGS = \
$(top_builddir)/common/libhybris-common.la \
-version-info "1":"1":"0"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/glesv2/Makefile.am
^
|
@@ -1,21 +1,23 @@
lib_LTLIBRARIES = \
- libGLESv2.la
+ libGLESv2$(GL_LIB_SUFFIX).la
-libGLESv2_la_SOURCES = glesv2.c
-libGLESv2_la_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+libGLESv2__GL_LIB_SUFFIX__la_SOURCES = glesv2.c
+libGLESv2__GL_LIB_SUFFIX__la_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
+if !WANT_GLVND
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = glesv2.pc
+endif
if WANT_MESA
-libGLESv2_la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+libGLESv2__GL_LIB_SUFFIX__la_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
endif
if WANT_TRACE
-libGLESv2_la_CFLAGS += -DDEBUG
+libGLESv2__GL_LIB_SUFFIX__la_CFLAGS += -DDEBUG
endif
if WANT_DEBUG
-libGLESv2_la_CFLAGS += -ggdb -O0
+libGLESv2__GL_LIB_SUFFIX__la_CFLAGS += -ggdb -O0
endif
-libGLESv2_la_LDFLAGS = \
+libGLESv2__GL_LIB_SUFFIX__la_LDFLAGS = \
$(top_builddir)/common/libhybris-common.la \
-version-info "2":"0":"0"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/hwc2/hwc2.c
^
|
@@ -40,6 +40,9 @@
hwc2_compat_device_t*,
hwc2_display_t);
+HYBRIS_IMPLEMENT_VOID_FUNCTION2(hwc2, hwc2_compat_device_destroy_display,
+ hwc2_compat_device_t*, hwc2_compat_display_t*);
+
HYBRIS_IMPLEMENT_FUNCTION1(hwc2, HWC2DisplayConfig*,
hwc2_compat_display_get_active_config,
hwc2_compat_display_t*);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/include/EGL/egl.h
^
|
@@ -1,253 +1,273 @@
-/* -*- mode: c; tab-width: 8; -*- */
-/* vi: set sw=4 ts=8: */
-/* Reference version of egl.h for EGL 1.4.
- * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
- */
+#ifndef __egl_h_
+#define __egl_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
+** Copyright 2013-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: Apache-2.0
**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
+** This header is generated from the Khronos EGL XML API Registry.
+** The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.khronos.org/registry/egl
**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+** Khronos $Git commit SHA1: 5a9a7e3fcb $ on $Git commit date: 2020-08-24 11:05:32 -0700 $
*/
-#ifndef __egl_h_
-#define __egl_h_
-
-/* All platform-dependent types and macro boilerplate (such as EGLAPI
- * and EGLAPIENTRY) should go in eglplatform.h.
- */
#include <EGL/eglplatform.h>
-#ifdef __cplusplus
-extern "C" {
+#ifndef EGL_EGL_PROTOTYPES
+#define EGL_EGL_PROTOTYPES 1
#endif
-/* EGL Types */
-/* EGLint is defined in eglplatform.h */
-typedef intptr_t EGLAttrib;
-typedef khronos_utime_nanoseconds_t EGLTime;
-typedef unsigned int EGLBoolean;
-typedef unsigned int EGLenum;
-typedef void *EGLConfig;
-typedef void *EGLContext;
-typedef void *EGLDisplay;
-typedef void *EGLSurface;
-typedef void *EGLClientBuffer;
-typedef void *EGLSync;
-typedef void *EGLImage;
-
-/* EGL Versioning */
-#define EGL_VERSION_1_0 1
-#define EGL_VERSION_1_1 1
-#define EGL_VERSION_1_2 1
-#define EGL_VERSION_1_3 1
-#define EGL_VERSION_1_4 1
-#define EGL_VERSION_1_5 1
+/* Generated on date 20201001 */
-/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
- * enums are assigned unique values starting at 0x3000.
+/* Generated C header for:
+ * API: egl
+ * Versions considered: .*
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
*/
-/* EGL aliases */
-#define EGL_FALSE 0
-#define EGL_TRUE 1
-
-/* Out-of-band handle values */
-#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
-#define EGL_NO_CONTEXT ((EGLContext)0)
-#define EGL_NO_DISPLAY ((EGLDisplay)0)
-#define EGL_NO_SURFACE ((EGLSurface)0)
-
-/* Out-of-band attribute value */
-#define EGL_DONT_CARE ((EGLint)-1)
-
-/* Errors / GetError return values */
-#define EGL_SUCCESS 0x3000
-#define EGL_NOT_INITIALIZED 0x3001
-#define EGL_BAD_ACCESS 0x3002
-#define EGL_BAD_ALLOC 0x3003
-#define EGL_BAD_ATTRIBUTE 0x3004
-#define EGL_BAD_CONFIG 0x3005
-#define EGL_BAD_CONTEXT 0x3006
-#define EGL_BAD_CURRENT_SURFACE 0x3007
-#define EGL_BAD_DISPLAY 0x3008
-#define EGL_BAD_MATCH 0x3009
-#define EGL_BAD_NATIVE_PIXMAP 0x300A
-#define EGL_BAD_NATIVE_WINDOW 0x300B
-#define EGL_BAD_PARAMETER 0x300C
-#define EGL_BAD_SURFACE 0x300D
-#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
-
-/* Reserved 0x300F-0x301F for additional errors */
-
-/* Config attributes */
-#define EGL_BUFFER_SIZE 0x3020
-#define EGL_ALPHA_SIZE 0x3021
-#define EGL_BLUE_SIZE 0x3022
-#define EGL_GREEN_SIZE 0x3023
-#define EGL_RED_SIZE 0x3024
-#define EGL_DEPTH_SIZE 0x3025
-#define EGL_STENCIL_SIZE 0x3026
-#define EGL_CONFIG_CAVEAT 0x3027
-#define EGL_CONFIG_ID 0x3028
-#define EGL_LEVEL 0x3029
-#define EGL_MAX_PBUFFER_HEIGHT 0x302A
-#define EGL_MAX_PBUFFER_PIXELS 0x302B
-#define EGL_MAX_PBUFFER_WIDTH 0x302C
-#define EGL_NATIVE_RENDERABLE 0x302D
-#define EGL_NATIVE_VISUAL_ID 0x302E
-#define EGL_NATIVE_VISUAL_TYPE 0x302F
-#define EGL_SAMPLES 0x3031
-#define EGL_SAMPLE_BUFFERS 0x3032
-#define EGL_SURFACE_TYPE 0x3033
-#define EGL_TRANSPARENT_TYPE 0x3034
-#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
-#define EGL_TRANSPARENT_RED_VALUE 0x3037
-#define EGL_NONE 0x3038 /* Attrib list terminator */
-#define EGL_BIND_TO_TEXTURE_RGB 0x3039
-#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
-#define EGL_MIN_SWAP_INTERVAL 0x303B
-#define EGL_MAX_SWAP_INTERVAL 0x303C
-#define EGL_LUMINANCE_SIZE 0x303D
-#define EGL_ALPHA_MASK_SIZE 0x303E
-#define EGL_COLOR_BUFFER_TYPE 0x303F
-#define EGL_RENDERABLE_TYPE 0x3040
-#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
-#define EGL_CONFORMANT 0x3042
-
-/* Reserved 0x3041-0x304F for additional config attributes */
-
-/* Config attribute values */
-#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
-#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
-#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
-#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
-#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
-
-/* More config attribute values, for EGL_TEXTURE_FORMAT */
-#define EGL_NO_TEXTURE 0x305C
-#define EGL_TEXTURE_RGB 0x305D
-#define EGL_TEXTURE_RGBA 0x305E
-#define EGL_TEXTURE_2D 0x305F
-
-/* Config attribute mask bits */
-#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
-#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
-
-#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
-#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
-
-/* QueryString targets */
-#define EGL_VENDOR 0x3053
-#define EGL_VERSION 0x3054
-#define EGL_EXTENSIONS 0x3055
-#define EGL_CLIENT_APIS 0x308D
-
-/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
-#define EGL_HEIGHT 0x3056
-#define EGL_WIDTH 0x3057
-#define EGL_LARGEST_PBUFFER 0x3058
-#define EGL_TEXTURE_FORMAT 0x3080
-#define EGL_TEXTURE_TARGET 0x3081
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/include/EGL/eglext.h
^
|
@@ -1,476 +1,1416 @@
#ifndef __eglext_h_
-#define __eglext_h_
+#define __eglext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
-** Copyright (c) 2007-2012 The Khronos Group Inc.
+** Copyright 2013-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: Apache-2.0
**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
+** This header is generated from the Khronos EGL XML API Registry.
+** The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.khronos.org/registry/egl
**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+** Khronos $Git commit SHA1: 5a9a7e3fcb $ on $Git commit date: 2020-08-24 11:05:32 -0700 $
*/
#include <EGL/eglplatform.h>
-/*************************************************************/
+#define EGL_EGLEXT_VERSION 20201001
+
+/* Generated C header for:
+ * API: egl
+ * Versions considered: .*
+ * Versions emitted: _nomatch_^
+ * Default extensions included: egl
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef EGL_KHR_cl_event
+#define EGL_KHR_cl_event 1
+#define EGL_CL_EVENT_HANDLE_KHR 0x309C
+#define EGL_SYNC_CL_EVENT_KHR 0x30FE
+#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF
+#endif /* EGL_KHR_cl_event */
+
+#ifndef EGL_KHR_cl_event2
+#define EGL_KHR_cl_event2 1
+typedef void *EGLSyncKHR;
+typedef intptr_t EGLAttribKHR;
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
+#endif
+#endif /* EGL_KHR_cl_event2 */
-/* Header file version number */
-/* Current version at http://www.khronos.org/registry/egl/ */
-/* $Revision: 18699 $ on $Date: 2012-07-31 03:04:59 -0700 (Tue, 31 Jul 2012) $ */
-#define EGL_EGLEXT_VERSION 14
+#ifndef EGL_KHR_client_get_all_proc_addresses
+#define EGL_KHR_client_get_all_proc_addresses 1
+#endif /* EGL_KHR_client_get_all_proc_addresses */
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
-#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
-#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
-#endif
+#define EGL_CONFORMANT_KHR 0x3042
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040
+#endif /* EGL_KHR_config_attribs */
+
+#ifndef EGL_KHR_context_flush_control
+#define EGL_KHR_context_flush_control 1
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098
+#endif /* EGL_KHR_context_flush_control */
-#ifndef EGL_KHR_lock_surface
-#define EGL_KHR_lock_surface 1
-#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
-#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
-#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
-#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
-#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
-#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
-#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
-#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
-#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
-#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
-#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
-#endif /* EGL_EGLEXT_PROTOTYPES */
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#ifndef EGL_KHR_create_context
+#define EGL_KHR_create_context 1
+#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098
+#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
+#define EGL_CONTEXT_FLAGS_KHR 0x30FC
+#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
+#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
+#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
+#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
+#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
+#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
+#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
+#endif /* EGL_KHR_create_context */
+
+#ifndef EGL_KHR_create_context_no_error
+#define EGL_KHR_create_context_no_error 1
+#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3
+#endif /* EGL_KHR_create_context_no_error */
+
+#ifndef EGL_KHR_debug
+#define EGL_KHR_debug 1
+typedef void *EGLLabelKHR;
+typedef void *EGLObjectKHR;
+typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message);
+#define EGL_OBJECT_THREAD_KHR 0x33B0
+#define EGL_OBJECT_DISPLAY_KHR 0x33B1
+#define EGL_OBJECT_CONTEXT_KHR 0x33B2
+#define EGL_OBJECT_SURFACE_KHR 0x33B3
+#define EGL_OBJECT_IMAGE_KHR 0x33B4
+#define EGL_OBJECT_SYNC_KHR 0x33B5
+#define EGL_OBJECT_STREAM_KHR 0x33B6
+#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9
+#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA
+#define EGL_DEBUG_MSG_WARN_KHR 0x33BB
+#define EGL_DEBUG_MSG_INFO_KHR 0x33BC
+#define EGL_DEBUG_CALLBACK_KHR 0x33B8
+typedef EGLint (EGLAPIENTRYP PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib *value);
+typedef EGLint (EGLAPIENTRYP PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglDebugMessageControlKHR (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryDebugKHR (EGLint attribute, EGLAttrib *value);
+EGLAPI EGLint EGLAPIENTRY eglLabelObjectKHR (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label);
+#endif
+#endif /* EGL_KHR_debug */
+
+#ifndef EGL_KHR_display_reference
+#define EGL_KHR_display_reference 1
+#define EGL_TRACK_REFERENCES_KHR 0x3352
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBKHRPROC) (EGLDisplay dpy, EGLint name, EGLAttrib *value);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribKHR (EGLDisplay dpy, EGLint name, EGLAttrib *value);
#endif
+#endif /* EGL_KHR_display_reference */
-#ifndef EGL_KHR_image
-#define EGL_KHR_image 1
-#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
-typedef void *EGLImageKHR;
-#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+typedef khronos_utime_nanoseconds_t EGLTimeKHR;
+#ifdef KHRONOS_SUPPORT_INT64
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
+#define EGL_SYNC_CONDITION_KHR 0x30F8
+#define EGL_SYNC_FENCE_KHR 0x30F9
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#ifdef EGL_EGLEXT_PROTOTYPES
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/include/EGL/eglplatform.h
^
|
@@ -2,36 +2,17 @@
#define __eglplatform_h_
/*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+** Copyright 2007-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: Apache-2.0
*/
/* Platform-specific types and definitions for egl.h
- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "EGL" component "Registry".
+ * by filing an issue or pull request on the public Khronos EGL Registry, at
+ * https://www.github.com/KhronosGroup/EGL-Registry/
*/
#include <KHR/khrplatform.h>
@@ -47,7 +28,7 @@
*/
#ifndef LIBHYBRIS_WANTS_MESA_X11_HEADERS
-#define MESA_EGL_NO_X11_HEADERS
+#define EGL_NO_X11
#endif
#ifndef EGLAPI
@@ -71,7 +52,13 @@
* implementations.
*/
-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
+#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
+
+typedef void *EGLNativeDisplayType;
+typedef void *EGLNativePixmapType;
+typedef void *EGLNativeWindowType;
+
+#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
@@ -81,11 +68,17 @@
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
+#elif defined(__EMSCRIPTEN__)
+
+typedef int EGLNativeDisplayType;
+typedef int EGLNativePixmapType;
+typedef int EGLNativeWindowType;
+
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
typedef int EGLNativeDisplayType;
-typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
+typedef void *EGLNativeWindowType;
#elif defined(WL_EGL_PLATFORM)
@@ -99,24 +92,28 @@
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
-#elif defined(ANDROID) /* Android */
+#elif defined(__ANDROID__) || defined(ANDROID)
struct ANativeWindow;
struct egl_native_pixmap_t;
-typedef struct ANativeWindow *EGLNativeWindowType;
-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
-typedef void *EGLNativeDisplayType;
+typedef void* EGLNativeDisplayType;
+typedef struct egl_native_pixmap_t* EGLNativePixmapType;
+typedef struct ANativeWindow* EGLNativeWindowType;
+
+#elif defined(USE_OZONE)
-#elif defined(__unix__)
+typedef intptr_t EGLNativeDisplayType;
+typedef intptr_t EGLNativePixmapType;
+typedef intptr_t EGLNativeWindowType;
-#ifdef MESA_EGL_NO_X11_HEADERS
+#elif defined(__unix__) && defined(EGL_NO_X11)
-typedef void *EGLNativeDisplayType;
+typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;
-#else
+#elif defined(__unix__) || defined(USE_X11)
/* X11 (tentative) */
#include <X11/Xlib.h>
@@ -126,7 +123,25 @@
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
-#endif /* MESA_EGL_NO_X11_HEADERS */
+#elif defined(__APPLE__)
+
+typedef int EGLNativeDisplayType;
+typedef void *EGLNativePixmapType;
+typedef void *EGLNativeWindowType;
+
+#elif defined(__HAIKU__)
+
+#include <kernel/image.h>
+
+typedef void *EGLNativeDisplayType;
+typedef khronos_uintptr_t EGLNativePixmapType;
+typedef khronos_uintptr_t EGLNativeWindowType;
+
+#elif defined(__Fuchsia__)
+
+typedef void *EGLNativeDisplayType;
+typedef khronos_uintptr_t EGLNativePixmapType;
+typedef khronos_uintptr_t EGLNativeWindowType;
#else
#error "Platform not recognized"
@@ -147,4 +162,12 @@
*/
typedef khronos_int32_t EGLint;
+
+/* C++ / C typecast macros for special EGL handle values */
+#if defined(__cplusplus)
+#define EGL_CAST(type, value) (static_cast<type>(value))
+#else
+#define EGL_CAST(type, value) ((type) (value))
+#endif
+
#endif /* __eglplatform_h */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/include/KHR/khrplatform.h
^
|
@@ -2,7 +2,7 @@
#define __khrplatform_h_
/*
-** Copyright (c) 2008-2009 The Khronos Group Inc.
+** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -26,18 +26,16 @@
/* Khronos platform-specific types and definitions.
*
- * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
- * Please submit changes by sending them to the public Khronos Bugzilla
- * (http://khronos.org/bugzilla) by filing a bug against product
- * "Khronos (general)" component "Registry".
- *
- * A predefined template which fills in some of the bug fields can be
- * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
- * must create a Bugzilla login first.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
@@ -92,23 +90,25 @@
* int arg2) KHRONOS_APIATTRIBUTES;
*/
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+# define KHRONOS_STATIC 1
+#endif
+
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
-#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
-# if defined(KHRONOS_DLL_EXPORTS)
-# define KHRONOS_APICALL __declspec(dllexport)
-# else
-# define KHRONOS_APICALL __declspec(dllimport)
-# endif
+#if defined(KHRONOS_STATIC)
+ /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+ * header compatible with static linking. */
+# define KHRONOS_APICALL
+#elif defined(_WIN32)
+# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
-#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
- || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-/* KHRONOS_APIATTRIBUTES is not used by the client API headers yet */
-# define KHRONOS_APICALL __attribute__((visibility("default")))
+#elif defined(__ANDROID__)
+# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
@@ -229,10 +229,23 @@
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
+
+/*
+ * Types that differ between LLP64 and LP64 architectures - in LLP64,
+ * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
+ * to be the only LLP64 architecture in current use.
+ */
+#ifdef _WIN64
+typedef signed long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
+#endif
#if KHRONOS_SUPPORT_FLOAT
/*
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/include/hybris/hwc2/hwc2_compatibility_layer.h
^
|
@@ -82,6 +82,9 @@
hwc2_compat_device_t* device,
hwc2_display_t id);
+ void hwc2_compat_device_destroy_display(hwc2_compat_device_t* device,
+ hwc2_compat_display_t* display);
+
HWC2DisplayConfig* hwc2_compat_display_get_active_config(
hwc2_compat_display_t* display);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.44.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -8,7 +8,6 @@
test_sensors \
test_input \
test_lights \
- test_camera \
test_vibrator \
test_media \
test_recorder \
@@ -19,6 +18,10 @@
test_nfc \
test_dlopen
+if WANT_WAYLAND
+bin_PROGRAMS += \
+ test_camera
+endif
test_dlopen_SOURCES = test_dlopen.c
test_dlopen_CFLAGS = \
@@ -29,6 +32,16 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/hardware/libhardware.la
+# When enabling glvnd support, we no longer build linkable libEGL,
+# thus, we link with the system version.
+if WANT_GLVND
+libegl = $(EGL_LIBS)
+libglesv2 = $(GLESV2_LIBS)
+else
+libegl = $(top_builddir)/egl/libEGL.la
+libglesv2 = $(top_builddir)/glesv2/libGLESv2.la
+endif
+
test_audio_SOURCES = test_audio.c
test_audio_CFLAGS = -std=c99\
-I$(top_srcdir)/include \
@@ -66,7 +79,7 @@
endif
test_egl_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la
+ $(libegl)
test_egl_configs_SOURCES = test_egl_configs.c
test_egl_configs_CFLAGS = \
@@ -74,7 +87,7 @@
$(ANDROID_HEADERS_CFLAGS)
test_egl_configs_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la
+ $(libegl)
test_glesv2_SOURCES = test_glesv2.cpp test_common.cpp
test_glesv2_CXXFLAGS = \
@@ -94,8 +107,8 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la \
$(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/hardware/libhardware.la \
$(top_builddir)/libsync/libsync.la
if HAS_HWCOMPOSER2_HEADERS
@@ -126,8 +139,8 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la \
$(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/hardware/libhardware.la \
$(top_builddir)/libsync/libsync.la
if HAS_HWCOMPOSER2_HEADERS
@@ -157,8 +170,8 @@
-lm \
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/hardware/libhardware.la
if HAS_HWCOMPOSER2_HEADERS
@@ -215,8 +228,8 @@
$(ANDROID_HEADERS_CFLAGS)
test_sf_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/sf/libsf.la
test_input_SOURCES = test_input.c
@@ -246,8 +259,8 @@
if WANT_WAYLAND_EGL
test_camera_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/camera/libcamera.la \
$(top_builddir)/input/libis.la \
$(top_builddir)/egl/platforms/common/libwayland-egl.la \
@@ -255,8 +268,8 @@
else
test_camera_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/camera/libcamera.la \
$(top_builddir)/input/libis.la \
$(WAYLAND_EGL_LIBS)
@@ -277,8 +290,8 @@
endif
test_media_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/media/libmedia.la \
$(top_builddir)/sf/libsf.la
@@ -296,8 +309,8 @@
endif
test_recorder_LDADD = \
$(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
+ $(libegl) \
+ $(libglesv2) \
$(top_builddir)/media/libmedia.la \
$(top_builddir)/camera/libcamera.la \
$(top_builddir)/input/libis.la \
|