diff options
author | Mykola Ostrovskyy <mykola@ti.com> | 2012-12-11 12:47:01 +0200 |
---|---|---|
committer | Mykola Ostrovskyy <mykola@ti.com> | 2012-12-18 17:31:33 +0200 |
commit | c3117a24cb2c97b467032adb6e204f575414c915 (patch) | |
tree | ffeb1037370fbdcc43bd8c249e8cbd694a5fdcbe /hwc | |
parent | 1ea098c8ccc6d06a13c0e472e82b7b70b41cf3a2 (diff) | |
download | hardware_ti_omap4-c3117a24cb2c97b467032adb6e204f575414c915.zip hardware_ti_omap4-c3117a24cb2c97b467032adb6e204f575414c915.tar.gz hardware_ti_omap4-c3117a24cb2c97b467032adb6e204f575414c915.tar.bz2 |
hwc: Disable eglSwapBuffers() in HWC 1.1+
SurfaceFlinger will invoke eglSwapBuffers() for each display between
prepare() and set() calls. See DisplayDevice::swapBuffers().
Change-Id: I004648d7e3f334bb5d5edb5ab9a0a7f676296ad6
Signed-off-by: Mykola Ostrovskyy <mykola@ti.com>
Diffstat (limited to 'hwc')
-rw-r--r-- | hwc/hwc.c | 31 |
1 files changed, 19 insertions, 12 deletions
@@ -1973,18 +1973,25 @@ static int hwc_set(struct hwc_composer_device_1 *dev, // screen off. no shall not call eglSwapBuffers() in that case. if (hwc_dev->use_sgx) { - if (!eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur)) { - ALOGE("eglSwapBuffers error"); - err = HWC_EGL_ERROR; - goto err_out; - } - if (list) { - if (hwc_dev->counts.framebuffer) { - /* Layer with HWC_FRAMEBUFFER_TARGET should be last in the list. The buffer handle - * is updated by SurfaceFlinger after prepare() call, so FB slot has to be updated - * in set(). - */ - hwc_dev->buffers[0] = list->hwLayers[list->numHwLayers - 1].handle; + if (hwc_dev->base.common.version <= HWC_DEVICE_API_VERSION_1_0) { + if (!eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur)) { + ALOGE("eglSwapBuffers error"); + err = HWC_EGL_ERROR; + goto err_out; + } + } else { + if (list) { + if (hwc_dev->counts.framebuffer) { + /* Layer with HWC_FRAMEBUFFER_TARGET should be last in the list. The buffer handle + * is updated by SurfaceFlinger after prepare() call, so FB slot has to be updated + * in set(). + */ + hwc_dev->buffers[0] = list->hwLayers[list->numHwLayers - 1].handle; + } else { + ALOGE("No buffer is provided for GL composition"); + err = -EFAULT; + goto err_out; + } } } } |