[-]
[+]
|
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.24.3</param>
+ <param name="revision">0.0.5.30</param>
<param name="token"></param>
<param name="debian"></param>
<param name="dumb"></param>
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.24.3.tar.bz2/libhybris/compat/hwc2/tests/GrallocUsageConversion.cpp
^
|
@@ -1,67 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *
- * 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 <GrallocUsageConversion.h>
-
-#include <hardware/gralloc.h>
-#include <hardware/gralloc1.h>
-
-void android_convertGralloc0To1Usage(int32_t usage, uint64_t* producerUsage,
- uint64_t* consumerUsage) {
- constexpr uint64_t PRODUCER_MASK =
- GRALLOC1_PRODUCER_USAGE_CPU_READ |
- /* GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN | */
- GRALLOC1_PRODUCER_USAGE_CPU_WRITE |
- /* GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN | */
- GRALLOC1_PRODUCER_USAGE_GPU_RENDER_TARGET | GRALLOC1_PRODUCER_USAGE_PROTECTED |
- GRALLOC1_PRODUCER_USAGE_CAMERA | GRALLOC1_PRODUCER_USAGE_VIDEO_DECODER |
- GRALLOC1_PRODUCER_USAGE_SENSOR_DIRECT_DATA;
- constexpr uint64_t CONSUMER_MASK =
- GRALLOC1_CONSUMER_USAGE_CPU_READ |
- /* GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN | */
- GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE | GRALLOC1_CONSUMER_USAGE_HWCOMPOSER |
- GRALLOC1_CONSUMER_USAGE_CLIENT_TARGET | GRALLOC1_CONSUMER_USAGE_CURSOR |
- GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER | GRALLOC1_CONSUMER_USAGE_CAMERA |
- GRALLOC1_CONSUMER_USAGE_RENDERSCRIPT | GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER;
- *producerUsage = static_cast<uint64_t>(usage) & PRODUCER_MASK;
- *consumerUsage = static_cast<uint64_t>(usage) & CONSUMER_MASK;
- if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_READ_OFTEN) == GRALLOC_USAGE_SW_READ_OFTEN) {
- *producerUsage |= GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN;
- *consumerUsage |= GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN;
- }
- if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_WRITE_OFTEN) ==
- GRALLOC_USAGE_SW_WRITE_OFTEN) {
- *producerUsage |= GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN;
- }
-}
-
-int32_t android_convertGralloc1To0Usage(uint64_t producerUsage, uint64_t consumerUsage) {
- static_assert(uint64_t(GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN) ==
- uint64_t(GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN),
- "expected ConsumerUsage and ProducerUsage CPU_READ_OFTEN bits to match");
- uint64_t merged = producerUsage | consumerUsage;
- if ((merged & (GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN)) ==
- GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN) {
- merged &= ~uint64_t(GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN);
- merged |= GRALLOC_USAGE_SW_READ_OFTEN;
- }
- if ((merged & (GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN)) ==
- GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN) {
- merged &= ~uint64_t(GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN);
- merged |= GRALLOC_USAGE_SW_WRITE_OFTEN;
- }
- return static_cast<int32_t>(merged);
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.24.3.tar.bz2/libhybris/compat/hwc2/tests/GrallocUsageConversion.h
^
|
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_GRALLOCUSAGE_GRALLOC_USAGE_CONVERSION_H
-#define ANDROID_GRALLOCUSAGE_GRALLOC_USAGE_CONVERSION_H 1
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Conversion functions are out-of-line so that users don't have to be exposed to
-// android/hardware/graphics/allocator/2.0/types.h and link against
-// android.hardware.graphics.allocator@2.0 to get that in their search path.
-
-// Convert a 32-bit gralloc0 usage mask to a producer/consumer pair of 64-bit usage masks as used
-// by android.hardware.graphics.allocator@2.0 (and gralloc1). This conversion properly handles the
-// mismatch between a.h.g.allocator@2.0's CPU_{READ,WRITE}_OFTEN and gralloc0's
-// SW_{READ,WRITE}_OFTEN.
-void android_convertGralloc0To1Usage(int32_t usage, uint64_t* producerUsage,
- uint64_t* consumerUsage);
-
-// Convert a producer/consumer pair of 64-bit usage masks as used by
-// android.hardware.graphics.allocator@2.0 (and gralloc1) to a 32-bit gralloc0 usage mask. This
-// conversion properly handles the mismatch between a.h.g.allocator@2.0's CPU_{READ,WRITE}_OFTEN
-// and gralloc0's SW_{READ,WRITE}_OFTEN.
-int32_t android_convertGralloc1To0Usage(uint64_t producerUsage, uint64_t consumerUsage);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANDROID_GRALLOCUSAGE_GRALLOC_USAGE_CONVERSION_H
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/.gitmodules
^
|
@@ -1,3 +1,3 @@
[submodule "libhybris"]
path = libhybris
- url = https://github.com/krnlyng/libhybris
+ url = https://github.com/libhybris/libhybris
|
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/.gitmodules
^
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/Android.mk
^
|
@@ -10,9 +10,10 @@
LOCAL_MODULE := libhwc2_compat_layer
LOCAL_SRC_FILES := HWC2.cpp ComposerHal.cpp hwc2_compatibility_layer.cpp
+LOCAL_C_INCLUDES := ../hybris/include
+
LOCAL_STATIC_LIBRARIES := \
- libhwcomposer-command-buffer \
- libhwcnativewindow libhybris-gralloc
+ libhwcomposer-command-buffer
LOCAL_SHARED_LIBRARIES := \
android.frameworks.vr.composer@1.0 \
@@ -35,8 +36,7 @@
libui \
libgui \
libsync \
- libbase \
- libnativewindow
+ libbase
LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
android.hardware.graphics.allocator@2.0 \
@@ -56,14 +56,14 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libhybris-gralloc
LOCAL_SRC_FILES := tests/hybris-gralloc.c \
- tests/GrallocUsageConversion.cpp
+ GrallocUsageConversion.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests
-
LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_CFLAGS := \
-DANDROID_VERSION_MAJOR=$(ANDROID_VERSION_MAJOR) \
-DANDROID_VERSION_MINOR=$(ANDROID_VERSION_MINOR) \
- -DANDROID_VERSION_PATCH=$(ANDROID_VERSION_PATCH)
+ -DANDROID_VERSION_PATCH=$(ANDROID_VERSION_PATCH) \
+ -DANDROID_BUILD=1
LOCAL_CFLAGS += -Wno-unused-parameter -UNDEBUG -DHAS_GRALLOC1_HEADER=1
include $(BUILD_STATIC_LIBRARY)
@@ -75,7 +75,8 @@
LOCAL_CFLAGS := \
-DANDROID_VERSION_MAJOR=$(ANDROID_VERSION_MAJOR) \
-DANDROID_VERSION_MINOR=$(ANDROID_VERSION_MINOR) \
- -DANDROID_VERSION_PATCH=$(ANDROID_VERSION_PATCH)
+ -DANDROID_VERSION_PATCH=$(ANDROID_VERSION_PATCH) \
+ -DANDROID_BUILD=1
LOCAL_CFLAGS += -Wno-unused-parameter -UNDEBUG
include $(BUILD_STATIC_LIBRARY)
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/GrallocUsageConversion.cpp
^
|
+(symlink to ../../hybris/gralloc/GrallocUsageConversion.cpp)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/hwc2_compatibility_layer.cpp
^
|
@@ -220,7 +220,7 @@
hwc2_error_t hwc2_compat_display_set_client_target(hwc2_compat_display_t* display,
uint32_t slot,
- ANativeWindowBuffer* buffer,
+ struct ANativeWindowBuffer* buffer,
const int32_t acquireFenceFd,
android_dataspace_t dataspace)
{
@@ -266,7 +266,7 @@
hwc2_error_t hwc2_compat_layer_set_buffer(hwc2_compat_layer_t* layer,
uint32_t slot,
- ANativeWindowBuffer* buffer,
+ struct ANativeWindowBuffer* buffer,
const int32_t acquireFenceFd)
{
android::sp<android::GraphicBuffer> target(
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/hwc2_compatibility_layer.h
^
|
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2018 TheKit <nekit1000@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef HWC2_COMPATIBILITY_LAYER_H_
-#define HWC2_COMPATIBILITY_LAYER_H_
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <unistd.h>
-
-#include <hardware/hwcomposer2.h>
-#include <system/graphics.h>
-#include <system/window.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- struct HWC2EventListener;
- typedef struct HWC2EventListener HWC2EventListener;
-
- typedef void (*on_vsync_received_callback)(HWC2EventListener* listener,
- int32_t sequenceId, hwc2_display_t display,
- int64_t timestamp);
- typedef void (*on_hotplug_received_callback)(HWC2EventListener* listener,
- int32_t sequenceId, hwc2_display_t display,
- bool connected, bool primaryDisplay);
- typedef void (*on_refresh_received_callback)(HWC2EventListener* listener,
- int32_t sequenceId, hwc2_display_t display);
-
- struct HWC2EventListener
- {
- on_vsync_received_callback on_vsync_received;
- on_hotplug_received_callback on_hotplug_received;
- on_refresh_received_callback on_refresh_received;
- };
-
- typedef struct HWC2DisplayConfig {
- hwc2_config_t id;
- hwc2_display_t display;
- int32_t width;
- int32_t height;
- int64_t vsyncPeriod;
- float dpiX;
- float dpiY;
- } HWC2DisplayConfig;
-
- struct hwc2_compat_device;
- typedef struct hwc2_compat_device hwc2_compat_device_t;
-
- struct hwc2_compat_display;
- typedef struct hwc2_compat_display hwc2_compat_display_t;
-
- struct hwc2_compat_layer;
- typedef struct hwc2_compat_layer hwc2_compat_layer_t;
-
- struct hwc2_compat_out_fences;
- typedef struct hwc2_compat_out_fences hwc2_compat_out_fences_t;
-
- hwc2_compat_device_t* hwc2_compat_device_new(bool);
- void hwc2_compat_device_register_callback(hwc2_compat_device_t* device,
- HWC2EventListener* listener,
- int composerSequenceId);
-
- void hwc2_compat_device_on_hotplug(hwc2_compat_device_t* device,
- hwc2_display_t displayId,
- bool connected);
-
- hwc2_compat_display_t* hwc2_compat_device_get_display_by_id(
- hwc2_compat_device_t* device,
- hwc2_display_t id);
-
- HWC2DisplayConfig* hwc2_compat_display_get_active_config(
- hwc2_compat_display_t* display);
-
- hwc2_error_t hwc2_compat_display_accept_changes(hwc2_compat_display_t* display);
- hwc2_compat_layer_t* hwc2_compat_display_create_layer(hwc2_compat_display_t*
- display);
- void hwc2_compat_display_destroy_layer(hwc2_compat_display_t* display,
- hwc2_compat_layer_t* layer);
-
- hwc2_error_t hwc2_compat_display_get_release_fences(
- hwc2_compat_display_t* display,
- hwc2_compat_out_fences_t** outFences);
-
- hwc2_error_t hwc2_compat_display_present(hwc2_compat_display_t* display,
- int32_t* outPresentFence);
-
- hwc2_error_t hwc2_compat_display_set_client_target(hwc2_compat_display_t* display,
- uint32_t slot,
- ANativeWindowBuffer* buffer,
- const int32_t acquireFenceFd,
- android_dataspace_t dataspace);
-
- hwc2_error_t hwc2_compat_display_set_power_mode(hwc2_compat_display_t* display,
- int mode);
- hwc2_error_t hwc2_compat_display_set_vsync_enabled(hwc2_compat_display_t* display,
- int enabled);
-
- hwc2_error_t hwc2_compat_display_validate(hwc2_compat_display_t* display,
- uint32_t* outNumTypes,
- uint32_t* outNumRequests);
-
- hwc2_error_t hwc2_compat_display_present_or_validate(hwc2_compat_display_t* display,
- uint32_t* outNumTypes,
- uint32_t* outNumRequests,
- int32_t* outPresentFence,
- uint32_t* state);
-
- hwc2_error_t hwc2_compat_layer_set_buffer(hwc2_compat_layer_t* layer,
- uint32_t slot,
- ANativeWindowBuffer* buffer,
- const int32_t acquireFenceFd);
- hwc2_error_t hwc2_compat_layer_set_blend_mode(hwc2_compat_layer_t* layer, int mode);
- hwc2_error_t hwc2_compat_layer_set_color(hwc2_compat_layer_t* layer,
- hwc_color_t color);
- hwc2_error_t hwc2_compat_layer_set_composition_type(hwc2_compat_layer_t* layer,
- int type);
- hwc2_error_t hwc2_compat_layer_set_dataspace(hwc2_compat_layer_t* layer,
- android_dataspace_t dataspace);
- hwc2_error_t hwc2_compat_layer_set_display_frame(hwc2_compat_layer_t* layer,
- int32_t left, int32_t top,
- int32_t right, int32_t bottom);
- hwc2_error_t hwc2_compat_layer_set_plane_alpha(hwc2_compat_layer_t* layer,
- float alpha);
- hwc2_error_t hwc2_compat_layer_set_sideband_stream(hwc2_compat_layer_t* layer,
- native_handle_t* stream);
- hwc2_error_t hwc2_compat_layer_set_source_crop(hwc2_compat_layer_t* layer,
- float left, float top,
- float right, float bottom);
- hwc2_error_t hwc2_compat_layer_set_transform(hwc2_compat_layer_t* layer,
- int transform);
- hwc2_error_t hwc2_compat_layer_set_visible_region(hwc2_compat_layer_t* layer,
- int32_t left, int32_t top,
- int32_t right, int32_t bottom);
-
- int32_t hwc2_compat_out_fences_get_fence(hwc2_compat_out_fences_t* fences,
- hwc2_compat_layer_t* layer);
- void hwc2_compat_out_fences_destroy(hwc2_compat_out_fences_t* fences);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // HWC2_COMPATIBILITY_LAYER_H_
+(symlink to ../../../libhybris/hybris/include/hybris/hwc2/hwc2_compatibility_layer.h)
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/hybris/grallocusage/GrallocUsageConversion.h
^
|
+(symlink to ../../../../../libhybris/hybris/include/hybris/grallocusage/GrallocUsageConversion.h)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/hwcomposer_window.cpp
^
|
@@ -1,521 +0,0 @@
-/*
- * Copyright (C) 2013 libhybris
- *
- * 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 "hwcomposer_window.h"
-#include "hwcomposer.h"
-
-#include <errno.h>
-#include <assert.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-extern "C" {
-#include <sync/sync.h>
-};
-
-#include <android/log.h>
-//#define TRACE(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "HWCNativeWindow", fmt "\n--> %s\n----> %s:%d", ##__VA_ARGS__, __FILE__, __FUNCTION__, __LINE__)
-#define TRACE(fmt, ...)
-
-#include "hybris-gralloc.h"
-
-extern "C" struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format, HWCPresentCallback present, void *cb_data)
-{
- class Window : public HWComposerNativeWindow
- {
- public:
- Window(unsigned int w, unsigned int h, unsigned int f, HWCPresentCallback p, void *d)
- : HWComposerNativeWindow(w, h, f)
- , cb(p)
- , cb_data(d)
- {
- }
-
- void present(HWComposerNativeWindowBuffer *b)
- {
- cb(cb_data, static_cast<ANativeWindow *>(this), static_cast<ANativeWindowBuffer *>(b));
- }
-
- HWCPresentCallback cb;
- void *cb_data;
- };
-
- if (!present)
- return 0;
-
- Window *w = new Window(width, height, format, present, cb_data);
- return w;
-}
-
-extern "C" void HWCNativeWindowDestroy(struct ANativeWindow *window)
-{
- delete window;
-}
-
-struct _BufferFenceAccessor : public HWComposerNativeWindowBuffer {
- int get() { return fenceFd; }
- void set(int fd) { fenceFd = fd; };
-};
-
-extern "C" int HWCNativeBufferGetFence(struct ANativeWindowBuffer *buf)
-{
- return static_cast<_BufferFenceAccessor *>(buf)->get();
-}
-
-extern "C" void HWCNativeBufferSetFence(struct ANativeWindowBuffer *buf, int fd)
-{
- static_cast<_BufferFenceAccessor *>(buf)->set(fd);
-}
-
-static pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
-
-
-HWComposerNativeWindowBuffer::HWComposerNativeWindowBuffer(unsigned int width,
- unsigned int height,
- unsigned int format,
- unsigned int usage)
-{
- ANativeWindowBuffer::width = width;
- ANativeWindowBuffer::height = height;
- ANativeWindowBuffer::format = format;
- ANativeWindowBuffer::usage = usage;
- fenceFd = -1;
- busy = 0;
- status = 0;
-
- hybris_gralloc_allocate(width, height, format, usage, &handle, (uint32_t*)&stride);
-
- TRACE("width=%d height=%d stride=%d format=x%x usage=x%x status=%s this=%p",
- width, height, stride, format, usage, strerror(-status), this);
-}
-
-
-
-HWComposerNativeWindowBuffer::~HWComposerNativeWindowBuffer()
-{
- TRACE("%p", this);
- hybris_gralloc_release(handle, 1);
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-HWComposerNativeWindow::HWComposerNativeWindow(unsigned int width, unsigned int height, unsigned int format)
-{
- pthread_mutex_init(&m_mutex, 0);
- m_width = width;
- m_height = height;
- m_bufFormat = format;
- m_usage = GRALLOC_USAGE_HW_COMPOSER|GRALLOC_USAGE_HW_FB;
- m_bufferCount = 2;
- m_nextBuffer = 0;
-}
-
-HWComposerNativeWindow::~HWComposerNativeWindow()
-{
- destroyBuffers();
-}
-
-
-
-void HWComposerNativeWindow::destroyBuffers()
-{
- TRACE("");
-
- std::vector<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
- for (; it!=m_bufList.end(); ++it)
- {
- HWComposerNativeWindowBuffer* fbnb = *it;
- fbnb->common.decRef(&fbnb->common);
- }
- m_bufList.clear();
- m_nextBuffer = 0;
-}
-
-
-
-
-/*
- * Set the swap interval for this surface.
- *
- * Returns 0 on success or -errno on error.
- */
-int HWComposerNativeWindow::setSwapInterval(int interval)
-{
- TRACE("interval=%i WARN STUB", interval);
- return 0;
-}
-
-
-/*
- * Hook called by EGL to acquire a buffer. This call may block if no
- * buffers are available.
- *
- * The window holds a reference to the buffer between dequeueBuffer and
- * either queueBuffer or cancelBuffer, so clients only need their own
- * reference if they might use the buffer after queueing or canceling it.
- * Holding a reference to a buffer after queueing or canceling it is only
- * allowed if a specific buffer count has been set.
- *
- * The libsync fence file descriptor returned in the int pointed to by the
- * fenceFd argument will refer to the fence that must signal before the
- * dequeued buffer may be written to. A value of -1 indicates that the
- * caller may access the buffer immediately without waiting on a fence. If
- * a valid file descriptor is returned (i.e. any value except -1) then the
- * caller is responsible for closing the file descriptor.
- *
- * Returns 0 on success or -errno on error.
- */
-int HWComposerNativeWindow::dequeueBuffer(BaseNativeWindowBuffer** buffer, int *fenceFd)
-{
- //HYBRIS_TRACE_BEGIN("hwcomposer-platform", "dequeueBuffer", "");
-
- pthread_mutex_lock(&m_mutex);
-
- // Allocate buffers if the list is empty, typically on the first call
- if (m_bufList.empty())
- allocateBuffers();
- assert(!m_bufList.empty());
- assert(m_nextBuffer < m_bufList.size());
-
-
- // Grabe the next available buffer in the list and assign m_nextBuffer to
- // the next one.
+(symlink to ../../../../libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.cpp)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/hwcomposer_window.h
^
|
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2013 libhybris
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef FBDEV_WINDOW_H
-#define FBDEV_WINDOW_H
-
-#include "nativewindowbase.h"
-#include <linux/fb.h>
-#include <hardware/gralloc.h>
-#include <pthread.h>
-
-#include <vector>
-
-
-class HWComposerNativeWindowBuffer : public BaseNativeWindowBuffer {
-friend class HWComposerNativeWindow;
-
-protected:
- HWComposerNativeWindowBuffer(unsigned int width,
- unsigned int height,
- unsigned int format,
- unsigned int usage) ;
- virtual ~HWComposerNativeWindowBuffer() ;
-
-protected:
- int busy;
- int fenceFd;
- int status;
- alloc_device_t* m_alloc;
-};
-
-
-class HWComposerNativeWindow : public BaseNativeWindow {
-public:
- HWComposerNativeWindow(unsigned int width, unsigned int height, unsigned int format);
- ~HWComposerNativeWindow();
-
- int getFenceBufferFd(HWComposerNativeWindowBuffer *buffer);
- void setFenceBufferFd(HWComposerNativeWindowBuffer *buffer, int fd);
-protected:
- // overloads from BaseNativeWindow
- virtual int setSwapInterval(int interval);
-
- virtual int dequeueBuffer(BaseNativeWindowBuffer** buffer, int* fenceFd);
- virtual int queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
- virtual int cancelBuffer(BaseNativeWindowBuffer* buffer, int fenceFd);
- virtual int lockBuffer(BaseNativeWindowBuffer* buffer);
-
- virtual unsigned int type() const;
- virtual unsigned int width() const;
- virtual unsigned int height() const;
- virtual unsigned int format() const;
- virtual unsigned int defaultWidth() const;
- virtual unsigned int defaultHeight() const;
- virtual unsigned int queueLength() const;
- virtual unsigned int transformHint() const;
- virtual unsigned int getUsage() const;
- // perform calls
- virtual int setUsage(int usage);
- virtual int setBuffersFormat(int format);
- virtual int setBuffersDimensions(int width, int height);
- virtual int setBufferCount(int cnt);
- virtual void present(HWComposerNativeWindowBuffer *buffer) = 0;
-
-private:
- void destroyBuffers();
- void allocateBuffers();
-
-private:
- unsigned int m_usage;
- unsigned int m_bufFormat;
- std::vector<HWComposerNativeWindowBuffer*> m_bufList;
- unsigned int m_bufferCount;
- unsigned int m_nextBuffer;
-
- int m_width;
- int m_height;
-
- pthread_mutex_t m_mutex;
-};
-
-#endif
-// vim: noai:ts=4:sw=4:ss=4:expandtab
+(symlink to ../../../../libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.h)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/hybris-gralloc.c
^
|
@@ -1,337 +0,0 @@
-#include <hardware/hardware.h>
-
-#include <hardware/gralloc.h>
-#if HAS_GRALLOC1_HEADER
-#include <GrallocUsageConversion.h>
-#include <hardware/gralloc1.h>
-#endif
-#include <hardware/fb.h>
-
-#include "hybris-gralloc.h"
-//#include <hybris/common/binding.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#include <dlfcn.h>
-
-static int version = -1;
-static hw_module_t *gralloc_hardware_module = NULL;
-
-static framebuffer_device_t *framebuffer_device = NULL;
-static gralloc_module_t *gralloc0_module;
-static alloc_device_t *gralloc0_alloc;
-
-#if HAS_GRALLOC1_HEADER
-static gralloc1_device_t *gralloc1_device = NULL;
-static int gralloc1_release_implies_delete = 0;
-static GRALLOC1_PFN_CREATE_DESCRIPTOR gralloc1_create_descriptor = NULL;
-static GRALLOC1_PFN_DESTROY_DESCRIPTOR gralloc1_destroy_descriptor = NULL;
-static GRALLOC1_PFN_SET_CONSUMER_USAGE gralloc1_set_consumer_usage = NULL;
-static GRALLOC1_PFN_SET_DIMENSIONS gralloc1_set_dimensions = NULL;
-static GRALLOC1_PFN_SET_FORMAT gralloc1_set_format = NULL;
-static GRALLOC1_PFN_SET_PRODUCER_USAGE gralloc1_set_producer_usage = NULL;
-static GRALLOC1_PFN_GET_BACKING_STORE gralloc1_get_backing_store = NULL;
-static GRALLOC1_PFN_GET_CONSUMER_USAGE gralloc1_get_consumer_usage = NULL;
-static GRALLOC1_PFN_GET_DIMENSIONS gralloc1_get_dimensions = NULL;
-static GRALLOC1_PFN_GET_FORMAT gralloc1_get_format = NULL;
-static GRALLOC1_PFN_GET_PRODUCER_USAGE gralloc1_get_producer_usage = NULL;
-static GRALLOC1_PFN_GET_STRIDE gralloc1_get_stride = NULL;
-static GRALLOC1_PFN_ALLOCATE gralloc1_allocate = NULL;
-static GRALLOC1_PFN_RETAIN gralloc1_retain = NULL;
-static GRALLOC1_PFN_RELEASE gralloc1_release = NULL;
-static GRALLOC1_PFN_GET_NUM_FLEX_PLANES gralloc1_get_num_flex_planes = NULL;
-static GRALLOC1_PFN_LOCK gralloc1_lock = NULL;
-static GRALLOC1_PFN_LOCK_FLEX gralloc1_lock_flex = NULL;
-static GRALLOC1_PFN_UNLOCK gralloc1_unlock = NULL;
-static GRALLOC1_PFN_SET_LAYER_COUNT gralloc1_set_layer_count = NULL;
-static GRALLOC1_PFN_GET_LAYER_COUNT gralloc1_get_layer_count = NULL;
-
-static void gralloc1_init(void);
-#endif
-
-// simple macros to make sure the code is only compiled if we actually have the
-// header to be able to compile it.
-// we could also use Gralloc1On0Adapter, but that would mean we need to import
-// headers and cpp files from android 8, which may not compile against older
-// android trees.
-#if HAS_GRALLOC1_HEADER
-#define GRALLOC0(code) (version == 0) { code }
-#define GRALLOC1(code) (version == 1) { code }
-#else
-#define GRALLOC0(code) (version == 0) { code }
-#define GRALLOC1(code) (0) {}
-#endif
-
-#define NO_GRALLOC { fprintf(stderr, "%s:%d: called gralloc method without gralloc loaded\n", __func__, __LINE__); assert(NULL); }
-
-void hybris_gralloc_deinitialize(void);
-
-void hybris_gralloc_initialize(int framebuffer)
-{
- if (version == -1) {
- if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const struct hw_module_t **)&gralloc_hardware_module) == 0) {
-#if HAS_GRALLOC1_HEADER
- if ((gralloc1_open(gralloc_hardware_module, &gralloc1_device) == 0) && (gralloc1_device != NULL)) {
- // success
- gralloc1_init();
- version = 1;
- atexit(hybris_gralloc_deinitialize);
- } else
-#endif
- if (framebuffer) {
- if (framebuffer_open(gralloc_hardware_module, &framebuffer_device) == 0) {
- if ((gralloc_open(gralloc_hardware_module, &gralloc0_alloc) == 0) && gralloc0_alloc != NULL) {
- // success
- version = 0;
- atexit(hybris_gralloc_deinitialize);
- } else {
- fprintf(stderr, "failed to open the gralloc 0 module (framebuffer was requested therefore defaulted to version 0)\n");
- assert(NULL);
- }
- } else {
- fprintf(stderr, "failed to open the framebuffer module\n");
- assert(NULL);
- }
- } else
- if ((gralloc_open(gralloc_hardware_module, &gralloc0_alloc) == 0) && gralloc0_alloc != NULL) {
- // success
- version = 0;
- atexit(hybris_gralloc_deinitialize);
- } else {
- // fail
- framebuffer_device = NULL;
-#if HAS_GRALLOC1_HEADER
- gralloc1_device = NULL;
-#endif
- version = -2;
- fprintf(stderr, "failed to open gralloc module with both version 0 and 1 methods\n");
- hybris_gralloc_deinitialize();
- assert(NULL);
- }
- } else {
- fprintf(stderr, "failed to find/load gralloc module\n");
- assert(NULL);
- }
- } else {
- // shouldn't reach here.
- assert(NULL);
- }
-}
-
-void hybris_gralloc_deinitialize(void)
-{
- if (framebuffer_device) framebuffer_close(framebuffer_device);
- framebuffer_device = NULL;
-
- if (gralloc0_alloc) gralloc_close(gralloc0_alloc);
- gralloc0_alloc = NULL;
-
-#if HAS_GRALLOC1_HEADER
- if (gralloc1_device) gralloc1_close(gralloc1_device);
- gralloc1_device = NULL;
-#endif
-
- if (gralloc_hardware_module) dlclose(gralloc_hardware_module->dso);
- gralloc_hardware_module = NULL;
-}
-
-#if HAS_GRALLOC1_HEADER
-static void gralloc1_init(void)
-{
- uint32_t count = 0;
- gralloc1_device->getCapabilities(gralloc1_device, &count, NULL);
-
- if (count >= 1) {
- uint32_t i;
- int32_t *gralloc1_capabilities = (int32_t*)malloc(sizeof(int32_t) * count);
-
- gralloc1_device->getCapabilities(gralloc1_device, &count, gralloc1_capabilities);
-
- // currently the only one that affects us/interests us is release imply delete.
- for (i = 0; i < count; i++) {
- if (gralloc1_capabilities[i] == GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE) {
- gralloc1_release_implies_delete = 1;
- }
- }
-
- free(gralloc1_capabilities);
- }
-
- gralloc1_create_descriptor = (GRALLOC1_PFN_CREATE_DESCRIPTOR)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_CREATE_DESCRIPTOR);
- gralloc1_destroy_descriptor = (GRALLOC1_PFN_DESTROY_DESCRIPTOR)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_DESTROY_DESCRIPTOR);
- gralloc1_set_consumer_usage = (GRALLOC1_PFN_SET_CONSUMER_USAGE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_CONSUMER_USAGE);
- gralloc1_set_dimensions = (GRALLOC1_PFN_SET_DIMENSIONS)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_DIMENSIONS);
- gralloc1_set_format = (GRALLOC1_PFN_SET_FORMAT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_FORMAT);
- gralloc1_set_producer_usage = (GRALLOC1_PFN_SET_PRODUCER_USAGE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_PRODUCER_USAGE);
- gralloc1_get_backing_store = (GRALLOC1_PFN_GET_BACKING_STORE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_BACKING_STORE);
- gralloc1_get_consumer_usage = (GRALLOC1_PFN_GET_CONSUMER_USAGE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_CONSUMER_USAGE);
- gralloc1_get_dimensions = (GRALLOC1_PFN_GET_DIMENSIONS)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_DIMENSIONS);
- gralloc1_get_format = (GRALLOC1_PFN_GET_FORMAT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_FORMAT);
- gralloc1_get_producer_usage = (GRALLOC1_PFN_GET_PRODUCER_USAGE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_PRODUCER_USAGE);
- gralloc1_get_stride = (GRALLOC1_PFN_GET_STRIDE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_STRIDE);
- gralloc1_allocate = (GRALLOC1_PFN_ALLOCATE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_ALLOCATE);
- gralloc1_retain = (GRALLOC1_PFN_RETAIN)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_RETAIN);
- gralloc1_release = (GRALLOC1_PFN_RELEASE)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_RELEASE);
- gralloc1_get_num_flex_planes = (GRALLOC1_PFN_GET_NUM_FLEX_PLANES)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_NUM_FLEX_PLANES);
- gralloc1_lock = (GRALLOC1_PFN_LOCK)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_LOCK);
- gralloc1_lock_flex = (GRALLOC1_PFN_LOCK_FLEX)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_LOCK_FLEX);
- gralloc1_unlock = (GRALLOC1_PFN_UNLOCK)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_UNLOCK);
- gralloc1_set_layer_count = (GRALLOC1_PFN_SET_LAYER_COUNT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_LAYER_COUNT);
- gralloc1_get_layer_count = (GRALLOC1_PFN_GET_LAYER_COUNT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_LAYER_COUNT);
-}
-#endif
-
-int hybris_gralloc_release(buffer_handle_t handle, int was_allocated)
-{
- int ret = -ENOSYS;
-
- if GRALLOC1(
- ret = gralloc1_release(gralloc1_device, handle);
-
- // this needs to happen if the last reference is gone, this function is
- // only called in such cases.
- if (!gralloc1_release_implies_delete) {
- native_handle_close((native_handle_t*)handle);
- native_handle_delete((native_handle_t*)handle);
+(symlink to ../../../hybris/gralloc/gralloc.c)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/hybris-gralloc.h
^
|
@@ -1,36 +0,0 @@
-#ifndef hybris_gralloc_header_include_guard__
-#define hybris_gralloc_header_include_guard__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// for usage definitions and so on
-#if HAS_GRALLOC1_HEADER
-#include <hardware/gralloc1.h>
-#endif
-#include <hardware/gralloc.h>
-
-#include <cutils/native_handle.h>
-
-void hybris_gralloc_deinitialize(void);
-void hybris_gralloc_initialize(int framebuffer);
-void hybris_gralloc_deinitialize(void);
-int hybris_gralloc_release(buffer_handle_t handle, int was_allocated);
-int hybris_gralloc_retain(buffer_handle_t handle);
-int hybris_gralloc_allocate(int width, int height, int format, int usage, buffer_handle_t *handle, uint32_t *stride);
-int hybris_gralloc_lock(buffer_handle_t handle, int usage, int l, int t, int w, int h, void **vaddr);
-int hybris_gralloc_unlock(buffer_handle_t handle);
-int hybris_gralloc_fbdev_format(void);
-int hybris_gralloc_fbdev_framebuffer_count(void);
-int hybris_gralloc_fbdev_setSwapInterval(int interval);
-int hybris_gralloc_fbdev_post(buffer_handle_t handle);
-int hybris_gralloc_fbdev_width(void);
-int hybris_gralloc_fbdev_height(void);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
-
+(symlink to ../../../hybris/include/hybris/gralloc/gralloc.h)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/nativewindowbase.cpp
^
|
@@ -1,385 +0,0 @@
-#include <string.h>
-#include <system/window.h>
-#include <system/graphics.h>
-#include <hardware/gralloc.h>
-#include "support.h"
-#include <stdarg.h>
-
-extern "C" {
-#include <sync/sync.h>
-}
-
-#include "nativewindowbase.h"
-
-#include <android/log.h>
-//#define TRACE(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "HWCNativeWindow", fmt "\n--> %s\n----> %s:%d", ##__VA_ARGS__, __FILE__, __FUNCTION__, __LINE__)
-#define TRACE(fmt, ...)
-
-BaseNativeWindowBuffer::BaseNativeWindowBuffer()
-{
- TRACE("%p", this);
-
- // done in ANativeWindowBuffer::ANativeWindowBuffer
- // common.magic = ANDROID_NATIVE_WINDOW_MAGIC;
- // common.version = sizeof(ANativeWindow);
- // memset(common.reserved, 0, sizeof(window->native.common.reserved));
-
- ANativeWindowBuffer::common.decRef = _decRef;
- ANativeWindowBuffer::common.incRef = _incRef;
- ANativeWindowBuffer::width = 0;
- ANativeWindowBuffer::height = 0;
- ANativeWindowBuffer::stride = 0;
- ANativeWindowBuffer::format = 0;
- ANativeWindowBuffer::usage = 0;
- ANativeWindowBuffer::handle = 0;
-
- refcount = 0;
-}
-
-
-BaseNativeWindowBuffer::~BaseNativeWindowBuffer()
-{
- TRACE("%p", this);
-
- ANativeWindowBuffer::common.decRef = NULL;
- ANativeWindowBuffer::common.incRef = NULL;
- refcount = 0;
-}
-
-
-void BaseNativeWindowBuffer::_decRef(struct android_native_base_t* base)
-{
- ANativeWindowBuffer* self = container_of(base, ANativeWindowBuffer, common);
- BaseNativeWindowBuffer* bnwb = static_cast<BaseNativeWindowBuffer*>(self) ;
-
- TRACE("%p refcount = %i",bnwb, bnwb->refcount - 1);
-
- if (__sync_fetch_and_sub(&bnwb->refcount,1) == 1)
- {
- delete bnwb;
- }
-}
-
-
-
-void BaseNativeWindowBuffer::_incRef(struct android_native_base_t* base)
-{
- ANativeWindowBuffer* self = container_of(base, ANativeWindowBuffer, common);
- BaseNativeWindowBuffer* bnwb= static_cast<BaseNativeWindowBuffer*>(self) ;
-
- TRACE("%p refcount = %i", bnwb, bnwb->refcount + 1);
- __sync_fetch_and_add(&bnwb->refcount,1);
-}
-
-ANativeWindowBuffer* BaseNativeWindowBuffer::getNativeBuffer() const
-{
- return static_cast<ANativeWindowBuffer*>(const_cast<BaseNativeWindowBuffer*>(this));
-}
-
-BaseNativeWindow::BaseNativeWindow()
-{
- TRACE("this=%p or A %p", this, (ANativeWindow*)this);
- // done in ANativeWindow
- // common.magic = ANDROID_NATIVE_WINDOW_MAGIC;
- // common.version = sizeof(ANativeWindow);
- // memset(common.reserved, 0, sizeof(window->native.common.reserved));
- ANativeWindow::common.decRef = _decRef;
- ANativeWindow::common.incRef = _incRef;
-
- const_cast<uint32_t&>(ANativeWindow::flags) = 0;
- const_cast<float&>(ANativeWindow::xdpi) = 0;
- const_cast<float&>(ANativeWindow::ydpi) = 0;
- const_cast<int&>(ANativeWindow::minSwapInterval) = 0;
- const_cast<int&>(ANativeWindow::maxSwapInterval) = 0;
-
- ANativeWindow::setSwapInterval = _setSwapInterval;
-
- ANativeWindow::lockBuffer_DEPRECATED = &_lockBuffer_DEPRECATED;
- ANativeWindow::dequeueBuffer_DEPRECATED = &_dequeueBuffer_DEPRECATED;
- ANativeWindow::queueBuffer_DEPRECATED = &_queueBuffer_DEPRECATED;
- ANativeWindow::cancelBuffer_DEPRECATED = &_cancelBuffer_DEPRECATED;
- ANativeWindow::queueBuffer = &_queueBuffer;
- ANativeWindow::dequeueBuffer = &_dequeueBuffer;
- ANativeWindow::cancelBuffer = &_cancelBuffer;
-
- ANativeWindow::query = &_query;
- ANativeWindow::perform = &_perform;
-
- refcount = 0;
-}
-
-BaseNativeWindow::~BaseNativeWindow()
-{
- TRACE("");
- ANativeWindow::common.decRef = NULL;
- ANativeWindow::common.incRef = NULL;
- refcount = 0;
-}
-
-void BaseNativeWindow::_decRef(struct android_native_base_t* base)
-{
- ANativeWindow* self = container_of(base, ANativeWindow, common);
- BaseNativeWindow* bnw = static_cast<BaseNativeWindow*>(self);
-
- TRACE("%p refcount = %i", bnw, bnw->refcount - 1);
-
- if (__sync_fetch_and_sub(&bnw->refcount,1) == 1)
- {
- delete bnw;
- }
-}
-
-void BaseNativeWindow::_incRef(struct android_native_base_t* base)
-{
- ANativeWindow* self = container_of(base, ANativeWindow, common);
- BaseNativeWindow* bnw = static_cast<BaseNativeWindow*>(self);
-
- TRACE("%p refcount = %i", bnw, bnw->refcount + 1);
-
-
- __sync_fetch_and_add(&bnw->refcount,1);
-}
-
-int BaseNativeWindow::_setSwapInterval(struct ANativeWindow* window, int interval)
-{
- return static_cast<BaseNativeWindow*>(window)->setSwapInterval(interval);
-}
-
-int BaseNativeWindow::_dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer)
-{
- BaseNativeWindowBuffer* temp = static_cast<BaseNativeWindowBuffer*>(*buffer);
- int fenceFd = -1;
- int ret = static_cast<BaseNativeWindow*>(window)->dequeueBuffer(&temp, &fenceFd);
-
- *buffer = static_cast<ANativeWindowBuffer*>(temp);
-
- if (fenceFd >= 0)
- {
- sync_wait(fenceFd, -1);
- close(fenceFd);
- }
-
- return ret;
-}
-
-int BaseNativeWindow::_dequeueBuffer(struct ANativeWindow *window, ANativeWindowBuffer **buffer, int *fenceFd)
-{
- BaseNativeWindowBuffer *nativeBuffer = static_cast<BaseNativeWindowBuffer*>(*buffer);
- int ret = static_cast<BaseNativeWindow*>(window)->dequeueBuffer(&nativeBuffer, fenceFd);
- *buffer = static_cast<ANativeWindowBuffer*>(nativeBuffer);
- return ret;
-}
-
-int BaseNativeWindow::_queueBuffer_DEPRECATED(struct ANativeWindow* window, ANativeWindowBuffer* buffer)
-{
- BaseNativeWindow *nativeWindow = static_cast<BaseNativeWindow*>(window);
- BaseNativeWindowBuffer *nativeBuffer = static_cast<BaseNativeWindowBuffer*>(buffer);
-
- return nativeWindow->queueBuffer(nativeBuffer, -1);
-}
-
-int BaseNativeWindow::_queueBuffer(struct ANativeWindow *window, ANativeWindowBuffer *buffer, int fenceFd)
-{
- BaseNativeWindow *nativeWindow = static_cast<BaseNativeWindow*>(window);
- BaseNativeWindowBuffer *nativeBuffer = static_cast<BaseNativeWindowBuffer*>(buffer);
-
- return nativeWindow->queueBuffer(nativeBuffer, fenceFd);
-}
-
-int BaseNativeWindow::_cancelBuffer_DEPRECATED(struct ANativeWindow* window, ANativeWindowBuffer* buffer)
-{
- BaseNativeWindow *nativeWindow = static_cast<BaseNativeWindow*>(window);
- BaseNativeWindowBuffer *nativeBuffer = static_cast<BaseNativeWindowBuffer*>(buffer);
-
- return nativeWindow->cancelBuffer(nativeBuffer, -1);
-}
-
-int BaseNativeWindow::_cancelBuffer(struct ANativeWindow *window, ANativeWindowBuffer *buffer, int fenceFd)
-{
- BaseNativeWindow *nativeWindow = static_cast<BaseNativeWindow*>(window);
+(symlink to ../../../../libhybris/hybris/egl/platforms/common/nativewindowbase.cpp)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/compat/hwc2/tests/nativewindowbase.h
^
|
@@ -1,99 +0,0 @@
-#ifndef NATIVEWINDOWBASE_H
-#define NATIVEWINDOWBASE_H
-
-/* for ICS window.h */
-#include <string.h>
-#include <system/window.h>
-#include <EGL/egl.h>
-#include "support.h"
-#include <stdarg.h>
-#include <assert.h>
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-#define NO_ERROR 0L
-#define BAD_VALUE -1
-
-/**
- * @brief A Class to do common ANativeBuffer initialization and thunk c-style
- * callbacks into C++ method calls.
- **/
-class BaseNativeWindowBuffer : public ANativeWindowBuffer
-{
-protected:
- BaseNativeWindowBuffer();
- virtual ~BaseNativeWindowBuffer() ;
-
-public:
- /* When passing the buffer to EGL functions it's required to pass always the native
- * buffer. This method takes care about proper casting. */
- ANativeWindowBuffer* getNativeBuffer() const;
-
-private:
- unsigned int refcount;
- static void _decRef(struct android_native_base_t* base);
- static void _incRef(struct android_native_base_t* base);
-};
-
-/**
- * @brief A Class to do common ANativeWindow initialization and thunk c-style
- * callbacks into C++ method calls.
- **/
-class BaseNativeWindow : public ANativeWindow
-{
-public:
- operator EGLNativeWindowType()
- {
- EGLNativeWindowType ret = reinterpret_cast<EGLNativeWindowType>(static_cast<ANativeWindow *>(this));
- return ret;
- }
-
-protected:
- BaseNativeWindow();
- virtual ~BaseNativeWindow();
-
- // does this require more magic?
- unsigned int refcount;
- static void _decRef(struct android_native_base_t* base);
- static void _incRef(struct android_native_base_t* base);
-
- // these have to be implemented in the concrete implementation, eg. FBDEV or offscreen window
- virtual int setSwapInterval(int interval) = 0;
-
- virtual int dequeueBuffer(BaseNativeWindowBuffer **buffer, int *fenceFd) = 0;
- virtual int queueBuffer(BaseNativeWindowBuffer *buffer, int fenceFd) = 0;
- virtual int cancelBuffer(BaseNativeWindowBuffer *buffer, int fenceFd) = 0;
- virtual int lockBuffer(BaseNativeWindowBuffer *buffer) = 0; // DEPRECATED
-
- virtual unsigned int type() const = 0;
- virtual unsigned int width() const = 0;
- virtual unsigned int height() const = 0;
- virtual unsigned int format() const = 0;
- virtual unsigned int defaultWidth() const = 0;
- virtual unsigned int defaultHeight() const = 0;
- virtual unsigned int queueLength() const = 0;
- virtual unsigned int transformHint() const = 0;
- virtual unsigned int getUsage() const = 0;
- //perform interfaces
- virtual int setBuffersFormat(int format) = 0;
- virtual int setBuffersDimensions(int width, int height) = 0;
- virtual int setUsage(int usage) = 0;
- virtual int setBufferCount(int cnt) = 0;
-private:
- static int _setSwapInterval(struct ANativeWindow* window, int interval);
- static int _dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer);
- static const char *_native_window_operation(int what);
- static const char *_native_query_operation(int what);
- static int _lockBuffer_DEPRECATED(struct ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int _queueBuffer_DEPRECATED(struct ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int _query(const struct ANativeWindow* window, int what, int* value);
- static int _perform(struct ANativeWindow* window, int operation, ... );
- static int _cancelBuffer_DEPRECATED(struct ANativeWindow* window, ANativeWindowBuffer* buffer);
- static int _queueBuffer(struct ANativeWindow *window, ANativeWindowBuffer *buffer, int fenceFd);
- static int _dequeueBuffer(struct ANativeWindow *window, ANativeWindowBuffer **buffer, int *fenceFd);
- static int _cancelBuffer(struct ANativeWindow *window, ANativeWindowBuffer *buffer, int fenceFd);
-};
-
-#endif
+(symlink to ../../../../libhybris/hybris/egl/platforms/common/nativewindowbase.h)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/Makefile.am
^
|
@@ -6,21 +6,11 @@
if HAS_ANDROID_5_0_0
SUBDIRS += libsync
endif
-SUBDIRS += egl glesv1 glesv2 ui sf input camera vibrator media opencl
+SUBDIRS += egl glesv1 glesv2 ui sf input camera vibrator media opencl wifi hwc2
-if !HAS_ANDROID_8_0_0
-SUBDIRS += wifi
-endif
-
-if HAS_ANDROID_8_0_0
-SUBDIRS += hwc2
-endif
-
-if HAS_LIBNFC_NXP_HEADERS
SUBDIRS += libnfc_nxp libnfc_ndef_nxp
-endif
-SUBDIRS += utils tests
+SUBDIRS += utils tests
MAINTAINERCLEANFILES = \
aclocal.m4 compile config.guess config.sub \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -2102,6 +2102,14 @@
return my_property_get(key, value, default_value);
}
+int _hybris_hook_property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie)
+{
+ TRACE_HOOK("propfn '%p' cookie '%p'",
+ propfn, cookie);
+
+ return my_property_list(propfn, cookie);
+}
+
int _hybris_hook_property_set(const char *key, const char *value)
{
TRACE_HOOK("key '%s' value '%s'", key, value);
@@ -2584,6 +2592,15 @@
return _android_get_exported_namespace(name);
}
+/* this was added while debugging in the hopes to get a backtrace from a double
+ * free crash. Unfortunately it fixes the problem so we cannot get a proper
+ * backtrace to fix the underlying problem. */
+void _hybris_hook_free(void *ptr)
+{
+ if (ptr) ((char*)ptr)[0] = 0;
+ free(ptr);
+}
+
#if !defined(cfree)
#define cfree free
#endif
@@ -2592,6 +2609,7 @@
static struct _hook hooks_properties[] = {
HOOK_INDIRECT(property_get),
HOOK_INDIRECT(property_set),
+ HOOK_INDIRECT(property_list),
HOOK_INDIRECT(__system_property_get),
HOOK_INDIRECT(__system_property_read),
HOOK_TO(__system_property_set, _hybris_hook_property_set),
@@ -2610,7 +2628,7 @@
HOOK_DIRECT(getenv),
HOOK_DIRECT_NO_DEBUG(printf),
HOOK_INDIRECT(malloc),
- HOOK_DIRECT_NO_DEBUG(free),
+ HOOK_INDIRECT(free),
HOOK_DIRECT_NO_DEBUG(calloc),
HOOK_DIRECT_NO_DEBUG(cfree),
HOOK_DIRECT_NO_DEBUG(realloc),
@@ -2811,6 +2829,7 @@
HOOK_INDIRECT(setlinebuf),
HOOK_TO(__errno, __errno_location),
HOOK_INDIRECT(__set_errno),
+ HOOK_TO(__set_errno_internal, _hybris_hook___set_errno),
HOOK_TO(__progname, &program_invocation_name),
/* net specifics, to avoid __res_get_state */
HOOK_INDIRECT(getaddrinfo),
@@ -3049,7 +3068,7 @@
* upgraded to the newer linker. */
char device_name[PROP_VALUE_MAX];
memset(device_name, 0, sizeof(device_name));
- property_get("ro.build.product", device_name, "");
+ my_property_get("ro.build.product", device_name, "");
if (strlen(device_name) > 0) {
/* Force SDK version for both frieza/cooler and turbo for the time being */
if (strcmp(device_name, "frieza") == 0 ||
@@ -3108,10 +3127,9 @@
// make sure to skip the property hooks only when o.so is actually loaded
// since for testing and we sometimes set things like 99 as sdk version.
// The o linker is loaded when sdk_version >= 27 and exists.
-#if defined(WANT_LINKER_O)
- if (sdk_version < 27)
+ if (!found && sdk_version < 27)
found = bsearch(&key, hooks_properties, HOOKS_SIZE(hooks_properties), sizeof(hooks_properties[0]), hook_cmp);
-#endif
+
if (!found)
found = bsearch(&key, hooks_common, HOOKS_SIZE(hooks_common), sizeof(hooks_common[0]), hook_cmp);
@@ -3228,6 +3246,10 @@
_android_linker_init(sdk_version, __hybris_get_hooked_symbol);
#endif
+ if (_android_set_application_target_sdk_version) {
+ _android_set_application_target_sdk_version(sdk_version);
+ }
+
linker_initialized = 1;
}
@@ -3265,6 +3287,19 @@
{
ENSURE_LINKER_IS_LOADED();
+ // do not use hybris properties for older linkers
+ if (get_android_sdk_version() < 27) {
+ if (!strcmp(symbol, "property_list")) {
+ return my_property_list;
+ }
+ if (!strcmp(symbol, "property_get")) {
+ return my_property_get;
+ }
+ if (!strcmp(symbol, "property_set")) {
+ return my_property_set;
+ }
+ }
+
if (!_android_dlsym) {
return NULL;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/jb/linker.c
^
|
@@ -166,7 +166,7 @@
*/
extern void __attribute__((noinline)) rtld_db_dlactivity(void);
-static struct r_debug _r_debug = {1, NULL, &rtld_db_dlactivity,
+struct r_debug _r_debug = {1, NULL, &rtld_db_dlactivity,
RT_CONSISTENT, 0};
static struct link_map *r_debug_tail = 0;
@@ -188,16 +188,46 @@
* about leaf libraries, and ordering it this way
* reduces the back-and-forth over the wire.
*/
+
+ ///// PATCHED: we don't want libhybris modifying glibc's
+ ///// link_map objects, which should not be linked
+ ///// to bionic's stripped link_map objects.
+ ///// ==> make a copy of the whole chain
+ if(r_debug_tail == 0 && _r_debug.r_map != 0) {
+ struct link_map *glibc_link_map = malloc(sizeof(struct link_map));
+ glibc_link_map->l_addr = _r_debug.r_map->l_addr;
+ glibc_link_map->l_name = _r_debug.r_map->l_name;
+ glibc_link_map->l_ld = _r_debug.r_map->l_ld;
+ glibc_link_map->l_next = _r_debug.r_map->l_next;
+ glibc_link_map->l_prev = _r_debug.r_map->l_prev;
+
+ r_debug_tail = glibc_link_map;
+
+ while(glibc_link_map->l_next != 0) {
+ struct link_map *copy_next_link_map = malloc(sizeof(struct link_map));
+ copy_next_link_map->l_addr = glibc_link_map->l_next->l_addr;
+ copy_next_link_map->l_name = glibc_link_map->l_next->l_name;
+ copy_next_link_map->l_ld = glibc_link_map->l_next->l_ld;
+ copy_next_link_map->l_next = glibc_link_map->l_next->l_next;
+ copy_next_link_map->l_prev = glibc_link_map->l_next->l_prev;
+
+ glibc_link_map->l_next = copy_next_link_map;
+ copy_next_link_map->l_prev = glibc_link_map;
+
+ glibc_link_map = copy_next_link_map;
+ }
+ }
+
if (r_debug_tail) {
- r_debug_tail->l_next = map;
- map->l_prev = r_debug_tail;
- map->l_next = 0;
+ r_debug_tail->l_prev = map;
+ map->l_next = r_debug_tail;
+ map->l_prev = 0;
} else {
_r_debug.r_map = map;
map->l_prev = 0;
map->l_next = 0;
}
- r_debug_tail = map;
+ _r_debug.r_map = r_debug_tail = map;
}
static void remove_soinfo_from_debug_map(soinfo * info)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/mm/dlfcn.cpp
^
|
@@ -198,13 +198,13 @@
return do_dl_iterate_phdr(cb, data);
}
-void android_set_application_target_sdk_version(uint32_t target) {
+extern "C" void android_set_application_target_sdk_version(uint32_t target) {
// lock to avoid modification in the middle of dlopen.
ScopedPthreadMutexLocker locker(&g_dl_mutex);
set_application_target_sdk_version(target);
}
-uint32_t android_get_application_target_sdk_version() {
+extern "C" uint32_t android_get_application_target_sdk_version() {
return get_application_target_sdk_version();
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/mm/linker.cpp
^
|
@@ -141,10 +141,10 @@
void __attribute__((noinline)) __attribute__((visibility("default"))) rtld_db_dlactivity();
static pthread_mutex_t g__r_debug_mutex = PTHREAD_MUTEX_INITIALIZER;
-static r_debug _r_debug =
+r_debug _r_debug =
{1, nullptr, reinterpret_cast<uintptr_t>(&rtld_db_dlactivity), r_debug::RT_CONSISTENT, 0};
-static link_map* r_debug_tail = 0;
+static link_map* r_debug_head = 0;
static void* (*_get_hooked_symbol)(const char *sym, const char *requester);
@@ -164,23 +164,41 @@
// gdb tends to care more about libc than it does
// about leaf libraries, and ordering it this way
// reduces the back-and-forth over the wire.
- if (r_debug_tail) {
- r_debug_tail->l_next = map;
- map->l_prev = r_debug_tail;
- map->l_next = 0;
+
+ ///// PATCHED: we don't want libhybris modifying glibc's
+ ///// link_map objects, which should not be linked
+ ///// to bionic's stripped link_map objects.
+ ///// ==> make a copy of the whole chain
+ if(r_debug_head == 0 && _r_debug.r_map != 0) {
+ link_map *glibc_link_map = new link_map(*_r_debug.r_map);
+ r_debug_head = glibc_link_map;
+
+ while(glibc_link_map->l_next != 0) {
+ link_map *copy_next_link_map = new link_map(*glibc_link_map->l_next);
+ glibc_link_map->l_next = copy_next_link_map;
+ copy_next_link_map->l_prev = glibc_link_map;
+
+ glibc_link_map = copy_next_link_map;
+ }
+ }
+
+ if (r_debug_head != 0) {
+ r_debug_head->l_prev = map;
+ map->l_next = r_debug_head;
+ map->l_prev = 0;
} else {
_r_debug.r_map = map;
map->l_prev = 0;
map->l_next = 0;
}
- r_debug_tail = map;
+ _r_debug.r_map = r_debug_head = map;
}
static void remove_soinfo_from_debug_map(soinfo* info) {
link_map* map = &(info->link_map_head);
- if (r_debug_tail == map) {
- r_debug_tail = map->l_prev;
+ if (r_debug_head == map) {
+ r_debug_head = map->l_prev;
}
if (map->l_prev) {
@@ -3175,7 +3193,7 @@
map->l_next = nullptr;
_r_debug.r_map = map;
- r_debug_tail = map;
+ r_debug_head = map;
init_linker_info_for_gdb(linker_base);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/n/Makefile.am
^
|
@@ -54,3 +54,9 @@
n_la_CPPFLAGS += \
-DTRACE_DEBUG=1
endif
+
+if WANT_ARM_TRACING
+n_la_CPPFLAGS += \
+ -DWANT_ARM_TRACING
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/n/dlfcn.cpp
^
|
@@ -142,22 +142,22 @@
return do_dl_iterate_phdr(cb, data);
}
-void android_set_application_target_sdk_version(uint32_t target) {
+extern "C" void android_set_application_target_sdk_version(uint32_t target) {
// lock to avoid modification in the middle of dlopen.
ScopedPthreadMutexLocker locker(&g_dl_mutex);
set_application_target_sdk_version(target);
}
-uint32_t android_get_application_target_sdk_version() {
+extern "C" uint32_t android_get_application_target_sdk_version() {
return get_application_target_sdk_version();
}
-void android_dlwarning(void* obj, void (*f)(void*, const char*)) {
+extern "C" void android_dlwarning(void* obj, void (*f)(void*, const char*)) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
get_dlwarning(obj, f);
}
-bool android_init_namespaces(const char* public_ns_sonames,
+extern "C" bool android_init_namespaces(const char* public_ns_sonames,
const char* anon_ns_library_path) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
bool success = init_namespaces(public_ns_sonames, anon_ns_library_path);
@@ -168,7 +168,7 @@
return success;
}
-android_namespace_t* android_create_namespace(const char* name,
+extern "C" android_namespace_t* android_create_namespace(const char* name,
const char* ld_library_path,
const char* default_library_path,
uint64_t type,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/n/linker.cpp
^
|
@@ -68,6 +68,10 @@
#include "linker_non_pie.h"
#endif
+#ifdef WANT_ARM_TRACING
+#include "../wrappers.h"
+#endif
+
// Stay compatible with newer glibc
#ifndef R_AARCH64_TLS_TPREL64
#define R_AARCH64_TLS_TPREL64 R_AARCH64_TLS_TPREL
@@ -348,6 +352,10 @@
static void* (*_get_hooked_symbol)(const char *sym, const char *requester);
+#ifdef WANT_ARM_TRACING
+void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+#endif
+
static char __linker_dl_err_buf[768];
char* linker_get_error_buffer() {
@@ -2621,7 +2629,19 @@
uint32_t bind = ELF_ST_BIND(sym->st_info);
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));
+ }
+#else
*symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+#endif
return true;
}
@@ -2914,6 +2934,28 @@
return false;
}
}
+#ifdef WANT_ARM_TRACING
+ else
+ {
+ // this will be slower.
+ if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
+ return false;
+ }
+
+ if (!soinfo_do_lookup(this, sym_name, vi, &lsi, global_group, local_group, &s)) {
+ return false;
+ }
+
+ 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*)sym_addr, WRAPPER_HOOKED);
+ break;
+ }
+ }
+#endif
if (sym_addr == 0 && s == nullptr) {
// We only allow an undefined symbol if this is a weak reference...
@@ -2987,7 +3029,24 @@
}
}
#endif
- sym_addr = lsi->resolve_symbol_address(s);
+
+#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;
+ }
+#else
+ sym_addr = lsi->resolve_symbol_address(s);
+#endif
+
#if !defined(__LP64__)
if (protect_segments) {
if (phdr_table_unprotect_segments(phdr, phnum, load_bias) < 0) {
@@ -4624,7 +4683,11 @@
__libc_fatal("CANNOT LINK EXECUTABLE \"%s\": %s", args.argv[0], linker_get_error_buffer());
}
+#ifdef WANT_ARM_TRACING
+extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*), void *(create_wrapper)(const char*, void*, int)) {
+#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*)) {
+#endif
// Get a few environment variables.
const char* LD_DEBUG = getenv("HYBRIS_LD_DEBUG");
if (LD_DEBUG != nullptr) {
@@ -4648,6 +4711,9 @@
set_application_target_sdk_version(sdk_version);
_get_hooked_symbol = get_hooked_symbol;
+#ifdef WANT_ARM_TRACING
+ _create_wrapper = create_wrapper;
+#endif
}
#ifdef DISABLED_FOR_HYBRIS_SUPPORT
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/o/Makefile.am
^
|
@@ -61,3 +61,9 @@
o_la_CPPFLAGS += \
-DTRACE_DEBUG=1
endif
+
+if WANT_ARM_TRACING
+o_la_CPPFLAGS += \
+ -DWANT_ARM_TRACING
+endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/o/linker.cpp
^
|
@@ -72,6 +72,10 @@
//#include "android-base/stringprintf.h"
//#include "ziparchive/zip_archive.h"
+#ifdef WANT_ARM_TRACING
+#include "../wrappers.h"
+#endif
+
// Stay compatible with newer glibc
#ifndef R_AARCH64_TLS_TPREL64
#define R_AARCH64_TLS_TPREL64 R_AARCH64_TLS_TPREL
@@ -2161,7 +2165,19 @@
uint32_t bind = ELF_ST_BIND(sym->st_info);
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));
+ }
+#else
*symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+#endif
failure_guard.Disable();
LD_LOG(kLogDlsym,
"... dlsym successful: sym_name=\"%s\", sym_ver=\"%s\", found in=\"%s\", address=%p",
@@ -2566,6 +2582,28 @@
return false;
}
}
+#ifdef WANT_ARM_TRACING
+ else
+ {
+ // this will be slower.
+ if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
+ return false;
+ }
+
+ if (!soinfo_do_lookup(this, sym_name, vi, &lsi, global_group, local_group, &s)) {
+ return false;
+ }
+
+ 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*)sym_addr, WRAPPER_HOOKED);
+ break;
+ }
+ }
+#endif
if (sym_addr == 0 && s == nullptr) {
// We only allow an undefined symbol if this is a weak reference...
@@ -2639,7 +2677,24 @@
}
}
#endif
- sym_addr = lsi->resolve_symbol_address(s);
+
+#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;
+ }
+#else
+ sym_addr = lsi->resolve_symbol_address(s);
+#endif
+
#if !defined(__LP64__)
if (protect_segments) {
if (phdr_table_unprotect_segments(phdr, phnum, load_bias) < 0) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/o/linker_globals.h
^
|
@@ -82,4 +82,8 @@
extern void* (*_get_hooked_symbol)(const char *sym, const char *requester);
+#ifdef WANT_ARM_TRACING
+extern void *(*_create_wrapper)(const char *symbol, void *function, int wrapper_type);
+#endif
+
#endif /* __LINKER_GLOBALS_H */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/common/o/linker_main.cpp
^
|
@@ -496,8 +496,13 @@
}
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*), void *(create_wrapper)(const char*, void*, int)) {
+#else
extern "C" void android_linker_init(int sdk_version, void* (*get_hooked_symbol)(const char*, const char*)) {
+#endif
// Get a few environment variables.
const char* LD_DEBUG = getenv("HYBRIS_LD_DEBUG");
if (LD_DEBUG != nullptr) {
@@ -521,6 +526,9 @@
set_application_target_sdk_version(sdk_version);
_get_hooked_symbol = get_hooked_symbol;
+#ifdef WANT_ARM_TRACING
+ _create_wrapper = create_wrapper;
+#endif
sonext = solist = get_libdl_info(kLinkerPath, linker_link_map);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -60,11 +60,11 @@
[trace="no"])
AM_CONDITIONAL( [WANT_TRACE], [test x"$trace" = x"yes"])
-AC_ARG_ENABLE(mm_arm_tracing,
- [ --enable-mm-arm-tracing Enable ARM (32-bit only) tracing, useful for understanding what the blob is doing, currently only the mm linker is supported. (default=disabled)],
- [mm_arm_tracing=$enableval],
- [mm_arm_tracing="no"])
-AM_CONDITIONAL([WANT_ARM_TRACING], [test x"$mm_arm_tracing" = x"yes"])
+AC_ARG_ENABLE(arm_tracing,
+ [ --enable-arm-tracing Enable ARM (32-bit only) tracing, useful for understanding what the blob is doing, currently only the mm linker is supported. (default=disabled)],
+ [arm_tracing=$enableval],
+ [arm_tracing="no"])
+AM_CONDITIONAL([WANT_ARM_TRACING], [test x"$arm_tracing" = x"yes"])
AC_ARG_ENABLE(mesa,
[ --enable-mesa Enable mesa headers (default=disabled)],
@@ -151,14 +151,20 @@
[ --with-android-headers=DIR Use android headers available in DIR. See utils/extract-headers.sh ],
[
AM_CONDITIONAL([HAS_LIBNFC_NXP_HEADERS], [test -f $withval/libnfc-nxp/phLibNfc.h])
+ AM_CONDITIONAL([HAS_WIFI_LEGACY_HEADERS], [test -f $withval/hardware_legacy/wifi.h])
+ AM_CONDITIONAL([HAS_HWCOMPOSER2_HEADERS], [test -f $withval/hardware/hwcomposer2.h])
AM_CONDITIONAL([HAS_GRALLOC1_HEADER], [test -f $withval/hardware/gralloc1.h])
+ AM_CONDITIONAL([HAS_VIBRATOR_HEADER], [test -f $withval/hardware_legacy/vibrator.h])
AS_IF([test -f $withval/libnfc-nxp/phLibNfc.h], [ANDROID_HEADERS_CFLAGS="-I$withval -I$withval/libnfc-nxp"],[ANDROID_HEADERS_CFLAGS="-I$withval"])
AC_SUBST([ANDROID_HEADERS_CFLAGS])
],
[
PKG_CHECK_MODULES(ANDROID_HEADERS, android-headers,, exit)
AM_CONDITIONAL([HAS_LIBNFC_NXP_HEADERS], [false])
+ AM_CONDITIONAL([HAS_WIFI_LEGACY_HEADERS], [false])
+ AM_CONDITIONAL([HAS_HWCOMPOSER2_HEADERS], [false])
AM_CONDITIONAL([HAS_GRALLOC1_HEADER], [false])
+ AM_CONDITIONAL([HAS_VIBRATOR_HEADER], [false])
]
)
CPPFLAGS="$CPPFLAGS $ANDROID_HEADERS_CFLAGS"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/egl/platforms/common/nativewindowbase.cpp
^
|
@@ -1,4 +1,11 @@
+
+#ifndef ANDROID_BUILD
#include <android-config.h>
+#include "logging.h"
+#else
+#define TRACE(message, ...)
+#endif
+
#include <string.h>
#include <system/window.h>
#include <system/graphics.h>
@@ -12,15 +19,14 @@
}
#endif
+#ifdef ANDROID_BUILD
+#define TRACE(...)
+#define HYBRIS_TRACE_BEGIN(...)
+#define HYBRIS_TRACE_END(...)
+#endif
#include "nativewindowbase.h"
-#include "logging.h"
-
-#define TRACE(message, ...) HYBRIS_DEBUG_LOG(EGL, message, ##__VA_ARGS__)
-
-
-
BaseNativeWindowBuffer::BaseNativeWindowBuffer()
{
TRACE("%p", this);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.cpp
^
|
@@ -14,10 +14,13 @@
* limitations under the License.
*/
+#ifndef ANDROID_BUILD
#include <android-config.h>
+#include "logging.h"
+#endif
+
#include "hwcomposer_window.h"
#include "hwcomposer.h"
-#include "logging.h"
#include <errno.h>
#include <assert.h>
@@ -31,7 +34,14 @@
#include <sync/sync.h>
};
+#ifdef ANDROID_BUILD
+#define TRACE(...)
+#define HYBRIS_TRACE_BEGIN(...)
+#define HYBRIS_TRACE_END(...)
+#include "hybris-gralloc.h"
+#else
#include <hybris/gralloc/gralloc.h>
+#endif
extern "C" struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format, HWCPresentCallback present, void *cb_data)
{
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/egl/platforms/wayland/Makefile.am
^
|
@@ -6,6 +6,7 @@
-I$(top_srcdir)/include \
-I$(top_srcdir)/egl \
-I$(top_srcdir)/egl/platforms/common \
+ -I$(top_builddir)/egl/platforms/common \
$(ANDROID_HEADERS_CFLAGS) \
$(WAYLAND_CLIENT_CFLAGS)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/egl/platforms/wayland/wayland_window.cpp
^
|
@@ -102,7 +102,11 @@
void WaylandNativeWindow::free_callback(struct wl_egl_window *egl_window, void *)
{
- ((WaylandNativeWindow*)(egl_window->nativewindow))->m_window = 0;
+ WaylandNativeWindow *native = (WaylandNativeWindow*)egl_window->nativewindow;
+
+ native->lock();
+ native->m_window = 0;
+ native->unlock();
}
void WaylandNativeWindow::lock()
@@ -215,7 +219,7 @@
if (frame_callback)
wl_callback_destroy(frame_callback);
wl_event_queue_destroy(wl_queue);
- if (m_window) {
+ if (m_window) {
m_window->nativewindow = NULL;
m_window->resize_callback = NULL;
m_window->free_callback = NULL;
@@ -368,12 +372,12 @@
HYBRIS_TRACE_END("wayland-platform", "dequeueBuffer_wait_for_buffer", "");
/* If the buffer doesn't match the window anymore, re-allocate */
- if (wnb->width != m_window->width || wnb->height != m_window->height
+ if (wnb->width != m_width || wnb->height != m_height
|| wnb->format != m_format || wnb->usage != m_usage)
{
TRACE("wnb:%p,win:%p %i,%i %i,%i x%x,x%x x%x,x%x",
wnb,m_window,
- wnb->width,m_window->width, wnb->height,m_window->height,
+ wnb->width,m_width, wnb->height,m_height,
wnb->format,m_format, wnb->usage,m_usage);
destroyBuffer(wnb);
m_bufList.erase(it);
@@ -504,6 +508,10 @@
{
int ret = 0;
lock();
+ if (!m_window) {
+ unlock();
+ return;
+ }
WaylandNativeWindowBuffer *wnb = queue.front();
if (!wnb) {
@@ -523,6 +531,7 @@
}
if (ret < 0) {
HYBRIS_TRACE_END("wayland-platform", "queueBuffer_wait_for_frame_callback", "-%p", wnb);
+ unlock();
return;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/gralloc/GrallocUsageConversion.cpp
^
|
@@ -14,11 +14,15 @@
* limitations under the License.
*/
-#include <grallocusage/GrallocUsageConversion.h>
+#include <hybris/grallocusage/GrallocUsageConversion.h>
#include <hardware/gralloc.h>
#include <hardware/gralloc1.h>
+#ifndef ANDROID_BUILD
+#include <android-config.h>
+#endif
+
void android_convertGralloc0To1Usage(int32_t usage, uint64_t* producerUsage,
uint64_t* consumerUsage) {
constexpr uint64_t PRODUCER_MASK =
@@ -27,15 +31,22 @@
GRALLOC1_PRODUCER_USAGE_CPU_WRITE |
/* GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN | */
GRALLOC1_PRODUCER_USAGE_GPU_RENDER_TARGET | GRALLOC1_PRODUCER_USAGE_PROTECTED |
- GRALLOC1_PRODUCER_USAGE_CAMERA | GRALLOC1_PRODUCER_USAGE_VIDEO_DECODER |
- GRALLOC1_PRODUCER_USAGE_SENSOR_DIRECT_DATA;
+ GRALLOC1_PRODUCER_USAGE_CAMERA | GRALLOC1_PRODUCER_USAGE_VIDEO_DECODER
+#if ANDROID_VERSION_MAJOR >= 8
+ | GRALLOC1_PRODUCER_USAGE_SENSOR_DIRECT_DATA
+#endif
+ ;
constexpr uint64_t CONSUMER_MASK =
GRALLOC1_CONSUMER_USAGE_CPU_READ |
/* GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN | */
GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE | GRALLOC1_CONSUMER_USAGE_HWCOMPOSER |
GRALLOC1_CONSUMER_USAGE_CLIENT_TARGET | GRALLOC1_CONSUMER_USAGE_CURSOR |
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER | GRALLOC1_CONSUMER_USAGE_CAMERA |
- GRALLOC1_CONSUMER_USAGE_RENDERSCRIPT | GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER;
+ GRALLOC1_CONSUMER_USAGE_RENDERSCRIPT
+#if ANDROID_VERSION_MAJOR >= 8
+ | GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER
+#endif
+ ;
*producerUsage = static_cast<uint64_t>(usage) & PRODUCER_MASK;
*consumerUsage = static_cast<uint64_t>(usage) & CONSUMER_MASK;
if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_READ_OFTEN) == GRALLOC_USAGE_SW_READ_OFTEN) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/gralloc/Makefile.am
^
|
@@ -16,8 +16,7 @@
libgralloc_la_CFLAGS = -DHAS_GRALLOC1_HEADER=0
endif
libgralloc_la_CFLAGS += -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-# let's avoid changing GrallocUsageConversion.cpp for now:
-libgralloc_la_CXXFLAGS = -std=gnu++11 -I$(top_srcdir)/include/hybris
+libgralloc_la_CXXFLAGS = -std=gnu++11 -I$(top_srcdir)/include
if WANT_TRACE
libgralloc_la_CFLAGS += -DDEBUG
endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/gralloc/gralloc.c
^
|
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
#include <hardware/hardware.h>
#include <hardware/gralloc.h>
@@ -7,8 +9,13 @@
#endif
#include <hardware/fb.h>
+#ifdef ANDROID_BUILD
+#include "hybris-gralloc.h"
+#else
+#include <android-config.h>
#include <hybris/gralloc/gralloc.h>
#include <hybris/common/binding.h>
+#endif
#include <errno.h>
#include <stdio.h>
@@ -16,6 +23,8 @@
#include <stdlib.h>
#include <assert.h>
+#include <dlfcn.h>
+
static int version = -1;
static hw_module_t *gralloc_hardware_module = NULL;
@@ -45,8 +54,10 @@
static GRALLOC1_PFN_LOCK gralloc1_lock = NULL;
static GRALLOC1_PFN_LOCK_FLEX gralloc1_lock_flex = NULL;
static GRALLOC1_PFN_UNLOCK gralloc1_unlock = NULL;
+#ifdef GRALLOC1_PFN_SET_LAYER_COUNT
static GRALLOC1_PFN_SET_LAYER_COUNT gralloc1_set_layer_count = NULL;
static GRALLOC1_PFN_GET_LAYER_COUNT gralloc1_get_layer_count = NULL;
+#endif
static void gralloc1_init(void);
#endif
@@ -84,6 +95,7 @@
if (framebuffer_open(gralloc_hardware_module, &framebuffer_device) == 0) {
if ((gralloc_open(gralloc_hardware_module, &gralloc0_alloc) == 0) && gralloc0_alloc != NULL) {
// success
+ gralloc0_module = (struct gralloc_module_t*)gralloc_hardware_module;
version = 0;
atexit(hybris_gralloc_deinitialize);
} else {
@@ -97,6 +109,7 @@
} else
if ((gralloc_open(gralloc_hardware_module, &gralloc0_alloc) == 0) && gralloc0_alloc != NULL) {
// success
+ gralloc0_module = (struct gralloc_module_t*)gralloc_hardware_module;
version = 0;
atexit(hybris_gralloc_deinitialize);
} else {
@@ -133,7 +146,11 @@
gralloc1_device = NULL;
#endif
+#ifdef ANDROID_BUILD
+ if (gralloc_hardware_module) dlclose(gralloc_hardware_module->dso);
+#else
if (gralloc_hardware_module) android_dlclose(gralloc_hardware_module->dso);
+#endif
gralloc_hardware_module = NULL;
}
@@ -151,9 +168,11 @@
// currently the only one that affects us/interests us is release imply delete.
for (i = 0; i < count; i++) {
+#if ANDROID_VERSION_MAJOR >= 8
if (gralloc1_capabilities[i] == GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE) {
gralloc1_release_implies_delete = 1;
}
+#endif
}
free(gralloc1_capabilities);
@@ -178,8 +197,10 @@
gralloc1_lock = (GRALLOC1_PFN_LOCK)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_LOCK);
gralloc1_lock_flex = (GRALLOC1_PFN_LOCK_FLEX)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_LOCK_FLEX);
gralloc1_unlock = (GRALLOC1_PFN_UNLOCK)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_UNLOCK);
+#ifdef GRALLOC1_PFN_SET_LAYER_COUNT
gralloc1_set_layer_count = (GRALLOC1_PFN_SET_LAYER_COUNT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_SET_LAYER_COUNT);
gralloc1_get_layer_count = (GRALLOC1_PFN_GET_LAYER_COUNT)gralloc1_device->getFunction(gralloc1_device, GRALLOC1_FUNCTION_GET_LAYER_COUNT);
+#endif
}
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/hwc2/Makefile.am
^
|
@@ -9,6 +9,13 @@
if WANT_DEBUG
libhwc2_la_CFLAGS += -ggdb -O0
endif
+if HAS_HWCOMPOSER2_HEADERS
+libhwc2_la_CFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+else
+libhwc2_la_CFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
libhwc2_la_LDFLAGS = \
$(top_builddir)/common/libhybris-common.la \
-version-info "1":"0":"0"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/hwc2/hwc2.c
^
|
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#if HAS_HWCOMPOSER2_HEADERS
+
#include <dlfcn.h>
#include <stddef.h>
@@ -107,3 +109,6 @@
hwc2_compat_out_fences_t*, hwc2_compat_layer_t*);
HYBRIS_IMPLEMENT_VOID_FUNCTION1(hwc2, hwc2_compat_out_fences_destroy,
hwc2_compat_out_fences_t*);
+
+#endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/include/hybris/hwc2/hwc2_compatibility_layer.h
^
|
@@ -100,7 +100,7 @@
hwc2_error_t hwc2_compat_display_set_client_target(hwc2_compat_display_t* display,
uint32_t slot,
- ANativeWindowBuffer* buffer,
+ struct ANativeWindowBuffer* buffer,
const int32_t acquireFenceFd,
android_dataspace_t dataspace);
@@ -121,7 +121,7 @@
hwc2_error_t hwc2_compat_layer_set_buffer(hwc2_compat_layer_t* layer,
uint32_t slot,
- ANativeWindowBuffer* buffer,
+ struct ANativeWindowBuffer* buffer,
const int32_t acquireFenceFd);
hwc2_error_t hwc2_compat_layer_set_blend_mode(hwc2_compat_layer_t* layer, int mode);
hwc2_error_t hwc2_compat_layer_set_color(hwc2_compat_layer_t* layer,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/libnfc_ndef_nxp/Makefile.am
^
|
@@ -7,6 +7,14 @@
$(ANDROID_HEADERS_CFLAGS) \
-Wno-error=unused-function
+if HAS_LIBNFC_NXP_HEADERS
+libnfc_ndef_nxp_la_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=1
+else
+libnfc_ndef_nxp_la_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=0
+endif
+
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libnfc_ndef_nxp.pc
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.c
^
|
@@ -17,10 +17,11 @@
*/
/**
- * Bindings generated using:
- * https://github.com/thp/libhybris-nfc-wrapper-generator
+ * Bindings generated using scripts in: utils/generate_nfc
**/
+#if HAS_LIBNFC_NXP_HEADERS
+
#include <libnfc-nxp/phNfcStatus.h>
#include <libnfc-nxp/phNfcTypes.h>
#include <libnfc-nxp/phNfcIoctlCode.h>
@@ -41,3 +42,5 @@
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_ndef_so, NFCSTATUS, phFriNfc_NdefRecord_Parse, phFriNfc_NdefRecord_t *, uint8_t *);
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_ndef_so, NFCSTATUS, phFriNfc_NdefRecord_Generate, phFriNfc_NdefRecord_t *, uint8_t *, uint32_t, uint32_t *);
/* XXX No prototype for exported symbol: __on_dlclose */
+#endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/libnfc_nxp/Makefile.am
^
|
@@ -7,6 +7,14 @@
$(ANDROID_HEADERS_CFLAGS) \
-Wno-error=unused-function
+if HAS_LIBNFC_NXP_HEADERS
+libnfc_nxp_la_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=1
+else
+libnfc_nxp_la_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=0
+endif
+
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libnfc_nxp.pc
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/libnfc_nxp/libnfc_nxp.c
^
|
@@ -17,10 +17,11 @@
*/
/**
- * Bindings generated using:
- * https://github.com/thp/libhybris-nfc-wrapper-generator
+ * Bindings generated using scripts in: utils/generate_nfc
**/
+#if HAS_LIBNFC_NXP_HEADERS
+
#include <android-config.h>
#include <libnfc-nxp/phNfcTypes.h>
@@ -594,3 +595,5 @@
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, int, phDal4Nfc_msgctl, int, int, void *);
HYBRIS_IMPLEMENT_FUNCTION5(libnfc_so, int, phDal4Nfc_msgrcv, int, void *, size_t, long, int);
/* XXX No prototype for exported symbol: __on_dlclose */
+#endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -12,42 +12,12 @@
test_media \
test_recorder \
test_gps \
- test_opencl
+ test_opencl \
+ test_wifi \
+ test_hwc2 \
+ test_hwcomposer \
+ test_nfc
-if !HAS_ANDROID_8_0_0
-bin_PROGRAMS += \
- test_wifi
-endif
-
-if HAS_ANDROID_4_2_0
-bin_PROGRAMS += test_hwcomposer
-endif
-
-if HAS_ANDROID_5_0_0
-bin_PROGRAMS += test_hwcomposer
-endif
-
-if HAS_ANDROID_8_0_0
-bin_PROGRAMS += test_hwc2
-endif
-
-if HAS_LIBNFC_NXP_HEADERS
-# test_nfc depends on NFC hardware HAL interface, which is only
-# available until Android API level 15 (v4.0.3, v4.0.4).
-if HAS_ANDROID_4_0_3
-bin_PROGRAMS += test_nfc
-else
-if HAS_ANDROID_4_1_0
-bin_PROGRAMS += test_nfc
-else
-if HAS_ANDROID_5_0_0
-bin_PROGRAMS += test_nfc
-endif
-endif
-endif
-endif
-
-bin_PROGRAMS += test_audio
test_audio_SOURCES = test_audio.c
test_audio_CFLAGS = \
-I$(top_srcdir)/include \
@@ -105,13 +75,24 @@
test_hwcomposer_LDADD = \
-lm \
$(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 \
- $(top_builddir)/libsync/libsync.la \
$(top_builddir)/hardware/libhardware.la
+
+if HAS_ANDROID_4_2_0
+test_hwcomposer_LDADD += \
+ $(top_builddir)/libsync/libsync.la \
+ $(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la
+else
+if HAS_ANDROID_5_0_0
+test_hwcomposer_LDADD += \
+ $(top_builddir)/libsync/libsync.la \
+ $(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la
+endif
+endif
+
test_sensors_SOURCES = test_sensors.c
test_sensors_CFLAGS = \
-I$(top_srcdir)/include \
@@ -203,6 +184,15 @@
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS) \
-Wno-error=unused-function
+
+if HAS_LIBNFC_NXP_HEADERS
+test_nfc_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=1
+else
+test_nfc_CFLAGS += \
+ -DHAS_LIBNFC_NXP_HEADERS=0
+endif
+
test_nfc_LDFLAGS = -pthread
test_nfc_LDADD = \
$(top_builddir)/common/libhybris-common.la \
@@ -213,6 +203,11 @@
test_vibrator_CFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
+if HAS_VIBRATOR_HEADER
+test_vibrator_CFLAGS += -DHAS_VIBRATOR_HEADER=1
+else
+test_vibrator_CFLAGS += -DHAS_VIBRATOR_HEADER=0
+endif
test_vibrator_LDADD = \
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/hardware/libhardware.la \
@@ -222,6 +217,15 @@
test_wifi_CFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
+
+if HAS_WIFI_LEGACY_HEADERS
+test_wifi_CFLAGS += \
+ -DHAS_WIFI_LEGACY_HEADERS=1
+else
+test_wifi_CFLAGS += \
+ -DHAS_WIFI_LEGACY_HEADERS=0
+endif
+
test_wifi_LDADD = \
$(top_builddir)/wifi/libwifi.la
@@ -243,13 +247,23 @@
-I$(top_srcdir)/libsync \
-std=gnu++11
+if HAS_HWCOMPOSER2_HEADERS
+test_hwc2_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+else
+test_hwc2_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
+
+if HAS_ANDROID_7_0_0
test_hwc2_LDADD = \
- -lm \
- $(top_builddir)/common/libhybris-common.la \
+ -lm \
+ $(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 \
$(top_builddir)/libsync/libsync.la \
$(top_builddir)/hwc2/libhwc2.la
+endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_gps.c
^
|
@@ -277,11 +277,19 @@
{
case GPS_REQUEST_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_open\n");
- AGps->data_conn_open(apn);
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 2
+ AGps->data_conn_open(AGPS_TYPE_SUPL, apn, AGPS_APN_BEARER_IPV4);
+#else
+ AGps->data_conn_open(apn);
+#endif
break;
case GPS_RELEASE_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_closed\n");
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 2
+ AGps->data_conn_closed(AGPS_TYPE_SUPL);
+#else
AGps->data_conn_closed();
+#endif
break;
case GPS_AGPS_DATA_CONNECTED:
fprintf(stdout, "*** data_conn_established\n");
@@ -395,7 +403,7 @@
fprintf(stdout, "*** cleanup\n");
if(AGps)
{
-#if ! defined(HAS_ANDROID_4_2_0) && ! defined(HAS_ANDROID_5_0_0)
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 2
AGps->data_conn_closed(AGPS_TYPE_SUPL);
#else
AGps->data_conn_closed();
@@ -603,7 +611,11 @@
}
if (AGps)
- AGps->data_conn_closed(AGPS_TYPE_SUPL);
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 2
+ AGps->data_conn_closed(AGPS_TYPE_SUPL);
+#else
+ AGps->data_conn_closed();
+#endif
fprintf(stdout, "*** stop tracking\n");
Gps->stop();
fprintf(stdout, "*** cleaning up\n");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_hwc2.cpp
^
|
@@ -16,6 +16,8 @@
*
*/
+#if HAS_HWCOMPOSER2_HEADERS
+
#include <assert.h>
#include <stdio.h>
#include <math.h>
@@ -343,3 +345,14 @@
return 0;
}
+
+#else
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ printf("test_hwc2 is not supported in this build\n");
+ return 0;
+}
+#endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_hwcomposer.cpp
^
|
@@ -16,6 +16,9 @@
*/
#include <android-config.h>
+
+#if ((ANDROID_VERSION_MAJOR >= 4 && ANDROID_VERSION_MINOR >= 2) || ANDROID_VERSION_MAJOR >= 5)
+
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <assert.h>
@@ -371,4 +374,14 @@
#endif
}
+#else
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ printf("test_hwcomposer is not supported in this build\n");
+ return 0;
+}
+#endif
+
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_nfc.c
^
|
@@ -17,6 +17,9 @@
*/
#include <android-config.h>
+
+#if HAS_LIBNFC_NXP_HEADERS
+
#include <assert.h>
#include <stdio.h>
#include <pthread.h>
@@ -371,3 +374,15 @@
return 0;
}
+
+#else
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ printf("test_nfc is not supported in this build\n");
+ return 0;
+}
+
+#endif
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_vibrator.c
^
|
@@ -16,6 +16,8 @@
*
*/
+#if HAS_VIBRATOR_HEADER
+
#include <android-config.h>
#include <assert.h>
#include <stdio.h>
@@ -54,4 +56,14 @@
return 0;
}
+#else
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ printf("test_vibrator is not supported in this build");
+ return 0;
+}
+#endif
+
// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/tests/test_wifi.c
^
|
@@ -19,7 +19,9 @@
#include <string.h>
#include <android-config.h>
-#include <hardware_legacy/wifi.h>
+
+int wifi_load_driver();
+int wifi_unload_driver();
#define COMMAND_LOAD_WIFI "1"
#define COMMAND_UNLOAD_WIFI "0"
@@ -49,7 +51,6 @@
}
fprintf(stdout, "WiFi driver load state: %d\n", is_wifi_driver_loaded());
-
return 0;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/hybris/wifi/wifi.c
^
|
@@ -20,7 +20,6 @@
#include <stddef.h>
#include <hybris/common/binding.h>
-#include <hardware_legacy/wifi.h>
#define COMPAT_LIBRARY_PATH "libhardware_legacy.so"
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/README
^
|
@@ -0,0 +1,18 @@
+libnfc wrapper generator scripts for libhybris
+==============================================
+
+These scripts generate libhybris wrapper libraries for Android libnfc.
+There are actually two different libnfc implementations in Android:
+
+ - libnfc-nxp
+ - libnfc-nci
+
+These scripts currently generate wrappers for libnfc-nxp, but could be
+adapted to generate wrappers for libnfc-nci as well.
+
+Usage:
+
+ git submodule init
+ git submodule update
+ sh -x generate.sh
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/README.android-src
^
|
@@ -0,0 +1,19 @@
+Clone to folder:
+ android_platform_frameworks_native
+URL:
+ https://android.googlesource.com/platform/frameworks/native
+
+Clone to folder:
+ android_platform_hardware_libhardware
+URL:
+ https://android.googlesource.com/platform/hardware/libhardware/
+
+Clone to folder:
+ android_platform_system_core
+URL:
+ https://android.googlesource.com/platform/system/core
+
+Clone to folder:
+ android_platform_external_libnfc-nxp
+URL:
+ https://android.googlesource.com/platform/external/libnfc-nxp
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/generate.sh
^
|
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+# Generate C prototype definitions for Android libnfc
+# Copyright (C) 2013 Jolla Ltd.
+# Contact: Thomas Perl <thomas.perl@jollamobile.com>
+
+mkdir -p output
+
+cproto -x \
+ android_platform_external_libnfc-nxp/*/*.c \
+ -I android_platform_external_libnfc-nxp/inc \
+ -I android_platform_external_libnfc-nxp/src \
+ -I android_platform_external_libnfc-nxp/Linux_x86 \
+ -I android_platform_hardware_libhardware/include \
+ -I android_platform_system_core/include \
+ -I android_platform_frameworks_native/include \
+ -I . -DNXP_MESSAGING \
+ > output/libnfc_prototypes.h
+
+python generate_wrappers.py \
+ output/libnfc_prototypes.h \
+ symbols/libnfc.so.txt \
+ /system/lib/libnfc.so \
+ > output/libnfc-nxp.c
+
+python generate_wrappers.py \
+ output/libnfc_prototypes.h \
+ symbols/libnfc_ndef.so.txt \
+ /system/lib/libnfc_ndef.so \
+ > output/libnfc_ndef-nxp.c
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/generate_wrappers.py
^
|
@@ -0,0 +1,145 @@
+#!/usr/bin/python
+# gnerate_wrappers.py: Parse header and output libhybris binding code
+# Adapted for libhybris from apkenv-wrapper-generator
+#
+# apkenv-wrapper-generator version:
+# Copyright (C) 2012 Thomas Perl <m@thp.io>; 2012-10-19
+#
+# libhybris version:
+# Copyright (C) 2013 Jolla Ltd.
+# Contact: Thomas Perl <thomas.perl@jollamobile.com>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+import re
+import os
+import sys
+
+# Some special cases to to avoid having to parse the full C grammar
+FIXED_MAPPINGS = {
+}
+
+# Never generate wrappers for these functions
+BLACKLISTED_FUNCS = [
+]
+
+def clean_arg(arg):
+ arg = arg.strip()
+ arg = arg.replace('__const', 'const')
+
+ while '[' in arg:
+ # int x[] -> int *x
+ arg = re.sub(r'(.*?)([A-Za-z_]+)(\[[^\]]*\])(.*)$', r'\1*\2\4', arg)
+
+ return arg.strip()
+
+class Argument:
+ def __init__(self, type_, name):
+ self.type_ = type_
+ self.name = name
+
+class Function:
+ def __init__(self, retval, name, args):
+ self.retval = retval
+ self.name = name
+ self.raw_args = args
+ self.parsing_error = None
+ self.args = list(self._parse_args(args))
+
+ def _parse_args(self, args):
+ for arg in map(clean_arg, args.split(',')):
+ arg = clean_arg(arg)
+ xarg = re.match(r'^(.*?)([A-Za-z0-9_]+)$', arg)
+ if not xarg:
+ # Unknown argument
+ if arg in FIXED_MAPPINGS:
+ yield Argument(FIXED_MAPPINGS[arg], '__undefined__')
+ continue
+ self.parsing_error = 'Could not parse: ' + repr(arg)
+ print self.parsing_error
+ continue
+ type_, name = xarg.groups()
+ if type_ == '':
+ type_ = name
+ name = '__undefined__'
+ yield Argument(type_, name)
+
+def parse_header(filename):
+ """Parse header file written by cproto"""
+ for line in open(filename):
+ if line.startswith('/*'):
+ continue
+ retval, funcname, args = re.match(r'^(.+ [*]?)([A-Za-z0-9_]+)\((.*)\);\s*$', line).groups()
+ retval, funcname, args = [x.strip() for x in (retval, funcname, args)]
+ if funcname not in BLACKLISTED_FUNCS:
+ yield (funcname, Function(retval, funcname, args))
+
+def parse_symbols(filename):
+ """Parse 'objdump -T'-style symbol list"""
+ for line in open(filename):
+ line = line.strip()
+ if not line:
+ continue
+
+ items = line.split()
+ if len(items) != 6:
+ continue
+
+ if 'DF' in items and '.text' in items:
+ # Print exported symbol name from text segment in library
+ yield items[-1]
+
+
+
+if len(sys.argv) != 4:
+ print >>sys.stderr, """
+ Usage: %s headerfile.h objdump-Tfile.so.txt /system/lib/something.so
+ """ % (sys.argv[0],)
+ sys.exit(1)
+
+
+headerfile = sys.argv[1]
+symbolsfile = sys.argv[2]
+libraryfile = sys.argv[3]
+
+libname = os.path.basename(libraryfile).replace('.', '_')
+
+available_functions = dict(parse_header(headerfile))
+
+print """
+#include <hybris/internal/binding.h>
+
+HYBRIS_LIBRARY_INITIALIZE(%s, "%s");
+""" % (libname, libraryfile)
+
+for symbol in parse_symbols(symbolsfile):
+ if symbol not in available_functions:
+ print '/* XXX No prototype for exported symbol: %s */' % symbol
+ continue
+
+ function = available_functions[symbol]
+ args = [a.type_.strip() for a in function.args if a.type_.strip() not in ('', 'void')]
+ if function.retval == 'void':
+ print 'HYBRIS_IMPLEMENT_VOID_FUNCTION%d(%s, %s);' % (len(args), libname, ', '.join([function.name] + args))
+ else:
+ print 'HYBRIS_IMPLEMENT_FUNCTION%d(%s, %s, %s);' % (len(args), libname, function.retval, ', '.join([function.name] + args))
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/linux/README
^
|
@@ -0,0 +1,5 @@
+This is just a dummy include directory, so the file
+
+android_platform_external_libnfc-nxp/Linux_x86/phDal4Nfc_i2c.c
+
+can be properly parsed by cproto.
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/linux/pn544.h
^
|
@@ -0,0 +1 @@
+/* Dummy header */
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/symbols/README
^
|
@@ -0,0 +1,3 @@
+These symbols have been obtained via:
+
+ objdump -T <filename>
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/symbols/libnfc.so.txt
^
|
@@ -0,0 +1,603 @@
+
+libnfc.so: file format elf32-little
+
+DYNAMIC SYMBOL TABLE:
+0000790c g DF .text 00000020 phLibNfc_Mgt_ConfigureDriver
+0003d120 g DF .text 00000394 phDal4Nfc_Config
+00000000 DF *UND* 00000000 __aeabi_unwind_cpp_pr0
+0000792c g DF .text 00000020 phLibNfc_Mgt_UnConfigureDriver
+0003d018 g DF .text 00000108 phDal4Nfc_ConfigRelease
+0000794c g DF .text 00000020 phLibNfc_HW_Reset
+0003d630 g DF .text 00000020 phDal4Nfc_Reset
+00000000 DF *UND* 00000000 __aeabi_unwind_cpp_pr1
+0000796c g DF .text 00000004 phLibNfc_Download_Mode
+0003d650 g DF .text 0000002c phDal4Nfc_Download
+00007970 g DF .text 00000004 phLibNfc_Load_Firmware_Image
+0000f3ec g DF .text 000000fc dlopen_firmware
+00007974 g DF .text 00000024 phLibNfc_Mgt_Recovery
+00000000 DF *UND* 00000000 usleep
+00007998 g DF .text 00000018 phLibNfc_SetIsoXchgTimeout
+0004102e g DO .data 00000001 nxp_nfc_isoxchg_timeout
+000079b0 g DF .text 00000014 phLibNfc_GetIsoXchgTimeout
+000079c4 g DF .text 00000018 phLibNfc_SetHciTimeout
+00041028 g DO .data 00000004 nxp_nfc_hci_response_timeout
+000079dc g DF .text 00000014 phLibNfc_GetHciTimeout
+000079f0 g DF .text 00000018 phLibNfc_SetFelicaTimeout
+00041021 g DO .data 00000001 nxp_nfc_felica_timeout
+00007a08 g DF .text 00000014 phLibNfc_GetFelicaTimeout
+00007a1c g DF .text 00000018 phLibNfc_SetMifareRawTimeout
+0004102d g DO .data 00000001 nxp_nfc_mifareraw_timeout
+00007a34 g DF .text 00000014 phLibNfc_GetMifareRawTimeout
+00007a48 g DF .text 000000f4 phLibNfc_Mgt_DeInitialize
+0000fa30 g DF .text 000000ac phHal4Nfc_Close
+0000fadc g DF .text 00000130 phHal4Nfc_Hal4Reset
+0003c0ec g DF .text 0000000c phOsalNfc_FreeMemory
+0000c370 g DF .text 000000cc phLibNfc_Ndef_DeInit
+00007b3c g DF .text 00000030 phLibNfc_Pending_Shutdown
+00007b6c g DF .text 000003c8 phLibNfc_Mgt_Reset
+00000000 DF *UND* 00000000 memset
+00041058 g DO .bss 00000004 pNdefRecord
+00041498 g DO .bss 00000014 NdefInfo
+00007f34 g DF .text 000000ec phLibNfc_UpdateNextState
+00008020 g DF .text 000000fc phLibNfc_Mgt_Initialize
+0003c0e8 g DF .text 00000004 phOsalNfc_GetMemory
+0000f4e8 g DF .text 00000278 phHal4Nfc_Open
+0000c1f8 g DF .text 00000178 phLibNfc_Ndef_Init
+0000811c g DF .text 00000064 phLibNfc_UpdateCurState
+0000e4b8 g DF .text 000000c4 phHal4Nfc_RegisterNotification
+00041480 g DO .bss 00000018 sSecuredElementInfo
+0003c0fc g DF .text 00000014 phOsalNfc_RaiseException
+00008424 g DF .text 00000180 phLibNfc_Mgt_GetstackCapabilities
+0000fc0c g DF .text 000000b8 phHal4Nfc_GetDeviceCapabilities
+00000000 DF *UND* 00000000 memcpy
+00000000 DF *UND* 00000000 memcmp
+00000000 DF *UND* 00000000 __android_log_print
+000410a0 g DO .bss 00000004 nxp_nfc_full_version
+000085a4 g DF .text 000001c4 phLibNfc_Mgt_ConfigureTestMode
+00041040 g DO .bss 00000004 gpphLibContext
+00008814 g DF .text 000000b8 phLibNfc_config_discovery_cb
+000088cc g DF .text 000000e8 phLibNfc_Mgt_ConfigureDiscovery
+0000db9c g DF .text 000001a0 phHal4Nfc_ConfigureDiscovery
+000089b4 g DF .text 00000130 phLibNfc_RemoteDev_CheckPresence
+0001130c g DF .text 000000cc phHal4Nfc_PresenceCheck
+00010bb8 g DF .text 0000059c phHal4Nfc_Transceive
+000109a8 g DF .text 00000210 phHal4Nfc_Connect
+0000ac0c g DF .text 00000140 phLibNfc_Reconnect_Mifare_Cb
+0000929c g DF .text 000000c0 phLibNfc_RemoteDev_NtfRegister
+0000935c g DF .text 00000078 phLibNfc_RemoteDev_NtfUnregister
+0000e57c g DF .text 000000c8 phHal4Nfc_UnregisterNotification
+000093d4 g DF .text 0000015c phLibNfc_RemoteDev_ReConnect
+00009530 g DF .text 00000164 phLibNfc_RemoteDev_Connect
+00009694 g DF .text 0000012c phLibNfc_RemoteDev_Disconnect
+0001120c g DF .text 00000100 phHal4Nfc_Disconnect
+000097c0 g DF .text 00000264 phLibNfc_RemoteDev_Transceive
+00009a24 g DF .text 00000128 phLibNfc_Mgt_SetP2P_ConfigParams
+0000da58 g DF .text 00000144 phHal4Nfc_ConfigParameters
+00000000 DF *UND* 00000000 __stack_chk_fail
+00000000 DO *UND* 00000000 __stack_chk_guard
+0002541c g DF .text 000000bc phFriNfc_LlcpTransport_CloseAll
+00009d44 g DF .text 0000018c phLibNfc_Mgt_SetLlcp_ConfigParams
+00023708 g DF .text 00000154 phFriNfc_Llcp_EncodeLinkParams
+00023be8 g DF .text 000000f0 phFriNfc_Llcp_Reset
+00024a6c g DF .text 00000188 phFriNfc_LlcpTransport_Reset
+00009ed0 g DF .text 0000010c phLibNfc_Llcp_CheckLlcp
+00023cd8 g DF .text 00000060 phFriNfc_Llcp_ChkLlcp
+00009fdc g DF .text 00000058 phLibNfc_Llcp_Activate
+00023d38 g DF .text 0000002c phFriNfc_Llcp_Activate
+0000a034 g DF .text 00000058 phLibNfc_Llcp_Deactivate
+00023d64 g DF .text 00000084 phFriNfc_Llcp_Deactivate
+0000a08c g DF .text 0000004c phLibNfc_Llcp_GetLocalInfo
+00023de8 g DF .text 0000003c phFriNfc_Llcp_GetLocalInfo
+0000a0d8 g DF .text 00000064 phLibNfc_Llcp_GetRemoteInfo
+00023e24 g DF .text 0000003c phFriNfc_Llcp_GetRemoteInfo
+0000a13c g DF .text 000000d8 phLibNfc_Llcp_DiscoverServices
+000250a4 g DF .text 0000004c phFriNfc_LlcpTransport_DiscoverServices
+0000a214 g DF .text 0000008c phLibNfc_Llcp_Socket
+000250f0 g DF .text 00000300 phFriNfc_LlcpTransport_Socket
+0000a2a0 g DF .text 00000034 phLibNfc_Llcp_Close
+000253f0 g DF .text 0000002c phFriNfc_LlcpTransport_Close
+0000a2d4 g DF .text 00000040 phLibNfc_Llcp_SocketGetLocalOptions
+00025034 g DF .text 00000038 phFriNfc_LlcpTransport_SocketGetLocalOptions
+0000a314 g DF .text 00000060 phLibNfc_Llcp_SocketGetRemoteOptions
+0002506c g DF .text 00000038 phFriNfc_LlcpTransport_SocketGetRemoteOptions
+0000a374 g DF .text 00000044 phLibNfc_Llcp_Bind
+000254d8 g DF .text 00000218 phFriNfc_LlcpTransport_Bind
+0000a3b8 g DF .text 00000048 phLibNfc_Llcp_Listen
+000256f0 g DF .text 00000054 phFriNfc_LlcpTransport_Listen
+0000a400 g DF .text 0000007c phLibNfc_Llcp_Accept
+00025744 g DF .text 000000d0 phFriNfc_LlcpTransport_Accept
+0000a47c g DF .text 00000068 phLibNfc_Llcp_Reject
+00025814 g DF .text 00000034 phFriNfc_LlcpTransport_Reject
+0000a4e4 g DF .text 0000006c phLibNfc_Llcp_Connect
+00025848 g DF .text 000000cc phFriNfc_LlcpTransport_Connect
+0000a550 g DF .text 00000070 phLibNfc_Llcp_ConnectByUri
+00025914 g DF .text 000000c0 phFriNfc_LlcpTransport_ConnectByUri
+0000a5c0 g DF .text 00000068 phLibNfc_Llcp_Disconnect
+000259d4 g DF .text 00000038 phFriNfc_LlcpTransport_Disconnect
+0000a628 g DF .text 00000070 phLibNfc_Llcp_Recv
+00025a84 g DF .text 00000060 phFriNfc_LlcpTransport_Recv
+0000a698 g DF .text 00000070 phLibNfc_Llcp_RecvFrom
+00025bbc g DF .text 00000064 phFriNfc_LlcpTransport_RecvFrom
+0000a708 g DF .text 00000070 phLibNfc_Llcp_Send
+00025a0c g DF .text 00000078 phFriNfc_LlcpTransport_Send
+0000a778 g DF .text 00000084 phLibNfc_Llcp_SendTo
+00025ae4 g DF .text 000000d8 phFriNfc_LlcpTransport_SendTo
+0000a930 g DF .text 000002dc phLibNfc_Mgt_IoCtl
+0000f760 g DF .text 000002d0 phHal4Nfc_Ioctl
+0000fe6c g DF .text 000000e8 phHal4Nfc_Switch_Swp_Mode
+00000000 DF *UND* 00000000 phFriNfc_NdefRecord_GetRecords
+00037da8 g DF .text 00000044 phFriNfc_NdefReg_DispatchPacket
+00037e14 g DF .text 00000564 phFriNfc_NdefReg_Process
+00037d04 g DF .text 000000a4 phFriNfc_NdefReg_RmCb
+00000000 DF *UND* 00000000 phFriNfc_NdefRecord_Parse
+000378b4 g DF .text 00000238 phFriNfc_NdefMap_GetContainerSize
+0003bf2c g DF .text 00000070 phOsalNfc_Timer_Stop
+0003c0a0 g DF .text 00000048 phOsalNfc_Timer_Delete
+0000bc40 g DF .text 0000030c phLibNfc_Ndef_Read
+00037338 g DF .text 00000040 phFriNfc_NdefMap_SetCompletionRoutine
+00037378 g DF .text 00000150 phFriNfc_NdefMap_RdNdef
+0000bf4c g DF .text 000002ac phLibNfc_Ndef_Write
+00037850 g DF .text 00000064 phFriNfc_NdefMap_EraseNdef
+000374c8 g DF .text 00000180 phFriNfc_NdefMap_WrNdef
+0000c43c g DF .text 000001c0 phLibNfc_Ndef_CheckNdef
+0003715c g DF .text 000001dc phFriNfc_NdefMap_Reset
+000376a0 g DF .text 000000f4 phFriNfc_NdefMap_ChkNdef
+0003be58 g DF .text 000000d4 phOsalNfc_Timer_Start
+0003bdac g DF .text 000000ac phOsalNfc_Timer_Create
+0000c5fc g DF .text 000001f4 phLibNfc_RemoteDev_FormatNdef
+0003b188 g DF .text 000000cc phFriNfc_NdefSmtCrd_Reset
+0003b254 g DF .text 00000044 phFriNfc_NdefSmtCrd_SetCR
+0003b2f8 g DF .text 000000f0 phFriNfc_NdefSmtCrd_Format
+0000c7f0 g DF .text 000002f0 phLibNfc_ConvertToReadOnlyNdef
+00037648 g DF .text 00000058 phFriNfc_NdefMap_ConvertToReadOnly
+0003b298 g DF .text 00000060 phFriNfc_NdefSmtCrd_ConvertToReadOnly
+0002ebec g DF .text 00000130 phFriNfc_MifareStdMap_ConvertToReadOnly
+0000cae0 g DF .text 00000268 phLibNfc_Ndef_SearchNdefContent
+00037c14 g DF .text 0000007c phFriNfc_NdefReg_Reset
+00037c90 g DF .text 00000074 phFriNfc_NdefReg_AddCb
+0000d0d0 g DF .text 0000008c phLibNfc_SE_NtfRegister
+0000d15c g DF .text 00000070 phLibNfc_SE_NtfUnregister
+0000d1cc g DF .text 00000100 phLibNfc_SE_GetSecureElementList
+0000d2cc g DF .text 00000320 phLibNfc_SE_SetMode
+0000fd0c g DF .text 00000160 phHal4Nfc_Switch_SMX_Mode
+0000d780 g DF .text 00000124 phLibNfc_RemoteDev_Receive
+000101b4 g DF .text 00000158 phHal4Nfc_Receive
+0000d8a4 g DF .text 000001b4 phLibNfc_RemoteDev_Send
+0000ffe8 g DF .text 000001cc phHal4Nfc_Send
+00014484 g DF .text 00000180 phHciNfc_Configure
+00014604 g DF .text 00000088 phHciNfc_Config_Discovery
+0001468c g DF .text 00000120 phHciNfc_Restart_Discovery
+0000dd3c g DF .text 000000b4 phHal4Nfc_ConfigureComplete
+000116f8 g DF .text 00000180 phHal4Nfc_DisconnectComplete
+0000ddf0 g DF .text 000006c8 phHal4Nfc_TargetDiscoveryComplete
+000148ec g DF .text 00000068 phHciNfc_Select_Next_Target
+000414b8 g DO .bss 00000004 gpphHal4Nfc_Hwref
+0000fcc4 g DF .text 00000048 phHal4Nfc_HandleEmulationEvent
+00011878 g DF .text 00000128 phHal4Nfc_TransceiveComplete
+0001030c g DF .text 0000024c phHal4Nfc_SendCompleteHandler
+000114e8 g DF .text 00000060 phHal4Nfc_ReactivationComplete
+000113d8 g DF .text 00000110 phHal4Nfc_PresenceChkComplete
+00011548 g DF .text 000001b0 phHal4Nfc_ConnectComplete
+00010558 g DF .text 000001ac phHal4Nfc_RecvCompleteHandler
+000143b0 g DF .text 000000d4 phHciNfc_Release
+00010830 g DF .text 0000013c phHal4Nfc_HandleP2PDeActivate
+00010704 g DF .text 0000012c phHal4Nfc_P2PActivateComplete
+00000000 DF *UND* 00000000 dlopen
+00000000 DF *UND* 00000000 dlsym
+000141e0 g DF .text 000001d0 phHciNfc_Initialise
+0003cf04 g DF .text 00000114 phDal4Nfc_Register
+00020850 g DF .text 0000011c phLlcNfc_Register
+00015008 g DF .text 00000080 phHciNfc_System_Get_Info
+00014edc g DF .text 000000b4 phHciNfc_System_Test
+00014f90 g DF .text 00000078 phHciNfc_System_Configure
+00014e60 g DF .text 0000007c phHciNfc_PRBS_Test
+000133bc g DF .text 00000378 phDnldNfc_Upgrade
+00013338 g DF .text 00000084 phDnldNfc_Run_Check
+00041080 g DO .bss 00000004 nxp_nfc_fw
+0001482c g DF .text 000000c0 phHciNfc_Switch_SmxMode
+000147ac g DF .text 00000080 phHciNfc_Switch_SwpMode
+00014cd4 g DF .text 000000d8 phHciNfc_Send_Data
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.30.tar.bz2/libhybris/utils/generate_nfc/symbols/libnfc_ndef.so.txt
^
|
@@ -0,0 +1,19 @@
+
+libnfc_ndef.so: file format elf32-little
+
+DYNAMIC SYMBOL TABLE:
+00000000 DF *UND* 00000000 __aeabi_unwind_cpp_pr0
+000004a7 g DF .text 000001ee phFriNfc_NdefRecord_GetRecords
+00000695 g DF .text 00000050 phFriNfc_NdefRecord_GetLength
+000006e5 g DF .text 000000e8 phFriNfc_NdefRecord_Parse
+000007cd g DF .text 00000146 phFriNfc_NdefRecord_Generate
+00000914 g DF .text 0000000c __on_dlclose
+00000000 DF *UND* 00000000 __cxa_finalize
+00002000 g D .bss 00000000 __dso_handle
+00001ed4 g D .init_array 00000000 __INIT_ARRAY__
+00001edc g D .fini_array 00000000 __FINI_ARRAY__
+00002000 g D *ABS* 00000000 _edata
+00002000 g D *ABS* 00000000 __bss_start
+00002010 g D *ABS* 00000000 _end
+
+
|