diff options
-rw-r--r-- | Android.mk | 8 | ||||
-rw-r--r-- | applypatch/Android.mk | 8 | ||||
-rw-r--r-- | minui/Android.mk | 1 | ||||
-rw-r--r-- | minui/graphics_adf.cpp | 24 | ||||
-rw-r--r-- | tests/Android.mk | 4 | ||||
-rw-r--r-- | updater/Android.mk | 4 |
6 files changed, 36 insertions, 13 deletions
diff --git a/Android.mk b/Android.mk index 384eefe3f..b1d84cd99 100644 --- a/Android.mk +++ b/Android.mk @@ -22,7 +22,7 @@ LOCAL_CLANG := true LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter -Werror LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE LOCAL_MODULE := libfusesideload -LOCAL_STATIC_LIBRARIES := libcutils libc libcrypto_static +LOCAL_STATIC_LIBRARIES := libcutils libc libcrypto include $(BUILD_STATIC_LIBRARY) # libmounts (static library) @@ -85,8 +85,8 @@ LOCAL_STATIC_LIBRARIES := \ libminui \ libpng \ libfs_mgr \ - libcrypto_utils_static \ - libcrypto_static \ + libcrypto_utils \ + libcrypto \ libbase \ libcutils \ libutils \ @@ -144,7 +144,7 @@ LOCAL_SRC_FILES := \ asn1_decoder.cpp \ verifier.cpp \ ui.cpp -LOCAL_STATIC_LIBRARIES := libcrypto_utils_static libcrypto_static +LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto include $(BUILD_STATIC_LIBRARY) include $(LOCAL_PATH)/minui/Android.mk \ diff --git a/applypatch/Android.mk b/applypatch/Android.mk index 48efe340e..604787e78 100644 --- a/applypatch/Android.mk +++ b/applypatch/Android.mk @@ -33,7 +33,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include LOCAL_STATIC_LIBRARIES += \ libotafault \ libbase \ - libcrypto_static \ + libcrypto \ libbz \ libz include $(BUILD_STATIC_LIBRARY) @@ -48,7 +48,7 @@ LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/include \ bootable/recovery LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include -LOCAL_STATIC_LIBRARIES += libcrypto_static libbz libz +LOCAL_STATIC_LIBRARIES += libcrypto libbz libz include $(BUILD_STATIC_LIBRARY) # libimgpatch (host static library) @@ -62,7 +62,7 @@ LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/include \ bootable/recovery LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include -LOCAL_STATIC_LIBRARIES += libcrypto_static libbz libz +LOCAL_STATIC_LIBRARIES += libcrypto libbz libz include $(BUILD_HOST_STATIC_LIBRARY) # applypatch (executable) @@ -78,7 +78,7 @@ LOCAL_STATIC_LIBRARIES += \ libedify \ libotafault \ libminzip \ - libcrypto_static \ + libcrypto \ libbz LOCAL_SHARED_LIBRARIES += libz libcutils libc include $(BUILD_EXECUTABLE) diff --git a/minui/Android.mk b/minui/Android.mk index 3057f452c..380ec2bfd 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -11,6 +11,7 @@ LOCAL_SRC_FILES := \ LOCAL_WHOLE_STATIC_LIBRARIES += libadf LOCAL_WHOLE_STATIC_LIBRARIES += libdrm +LOCAL_WHOLE_STATIC_LIBRARIES += libsync_recovery LOCAL_STATIC_LIBRARIES += libpng LOCAL_MODULE := libminui diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index a72e40b58..3c3541094 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp @@ -26,11 +26,13 @@ #include <sys/mman.h> #include <adf/adf.h> +#include <sync/sync.h> #include "graphics.h" struct adf_surface_pdata { GRSurface base; + int fence_fd; int fd; __u32 offset; __u32 pitch; @@ -55,6 +57,7 @@ static void adf_blank(minui_backend *backend, bool blank); static int adf_surface_init(adf_pdata *pdata, drm_mode_modeinfo *mode, adf_surface_pdata *surf) { memset(surf, 0, sizeof(*surf)); + surf->fence_fd = -1; surf->fd = adf_interface_simple_buffer_alloc(pdata->intf_fd, mode->hdisplay, mode->vdisplay, pdata->format, &surf->offset, &surf->pitch); if (surf->fd < 0) @@ -194,6 +197,23 @@ static GRSurface* adf_init(minui_backend *backend) return ret; } +static void adf_sync(adf_surface_pdata *surf) +{ + unsigned int warningTimeout = 3000; + + if (surf == NULL) + return; + + if (surf->fence_fd >= 0){ + int err = sync_wait(surf->fence_fd, warningTimeout); + if (err < 0) + perror("adf sync fence wait error\n"); + + close(surf->fence_fd); + surf->fence_fd = -1; + } +} + static GRSurface* adf_flip(minui_backend *backend) { adf_pdata *pdata = (adf_pdata *)backend; @@ -203,9 +223,10 @@ static GRSurface* adf_flip(minui_backend *backend) surf->base.width, surf->base.height, pdata->format, surf->fd, surf->offset, surf->pitch, -1); if (fence_fd >= 0) - close(fence_fd); + surf->fence_fd = fence_fd; pdata->current_surface = (pdata->current_surface + 1) % pdata->n_surfaces; + adf_sync(&pdata->surfaces[pdata->current_surface]); return &pdata->surfaces[pdata->current_surface].base; } @@ -219,6 +240,7 @@ static void adf_blank(minui_backend *backend, bool blank) static void adf_surface_destroy(adf_surface_pdata *surf) { munmap(surf->base.data, surf->pitch * surf->base.height); + close(surf->fence_fd); close(surf->fd); } diff --git a/tests/Android.mk b/tests/Android.mk index 7b004b2a0..a683395fc 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -39,8 +39,8 @@ LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_STATIC_LIBRARIES := \ libbase \ libverifier \ - libcrypto_utils_static \ - libcrypto_static \ + libcrypto_utils \ + libcrypto \ libminui \ libminzip \ libcutils \ diff --git a/updater/Android.mk b/updater/Android.mk index 75af4bdd0..b4d427c5d 100644 --- a/updater/Android.mk +++ b/updater/Android.mk @@ -34,8 +34,8 @@ LOCAL_STATIC_LIBRARIES += \ libfec_rs \ libext4_utils_static \ libsquashfs_utils \ - libcrypto_utils_static \ - libcrypto_static \ + libcrypto_utils \ + libcrypto \ libapplypatch \ libbase \ libotafault \ |