diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index c643e3b..e1735fc 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -152,7 +152,6 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) static int fb_compositionComplete(struct framebuffer_device_t* dev) { // TODO: Properly implement composition complete callback - glFinish(); return 0; } diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk index 2ef979a..dbcab81 100644 --- a/libhwcomposer/Android.mk +++ b/libhwcomposer/Android.mk @@ -7,7 +7,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay libgenlock \ libhwcexternal libqdutils libhardware_legacy \ - libdl libmemalloc libhwcservice + libdl libmemalloc libhwcservice libGLESv1_CM LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"hwcomposer\" LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp index 069913f..bab7184 100644 --- a/libhwcomposer/hwc_copybit.cpp +++ b/libhwcomposer/hwc_copybit.cpp @@ -21,6 +21,7 @@ #define DEBUG_COPYBIT 0 #include #include +#include #include "hwc_copybit.h" #include "comptype.h" #include "egl_handles.h" @@ -185,6 +186,12 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_layer_list_t *list, EGLDisplay dpy, return -1; } + // Invoke a glFinish if we are rendering any layers using copybit. + // We call glFinish instead of locking the renderBuffer because the + // GPU could take longer than the genlock timeout value to complete + // rendering + glFinish(); + for (size_t i=0; inumHwLayers; i++) { if (list->hwLayers[i].compositionType == HWC_USE_COPYBIT) { retVal = drawLayerUsingCopybit(ctx, &(list->hwLayers[i]),