summaryrefslogtreecommitdiffstats
path: root/hwc/hwc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hwc/hwc.c')
-rw-r--r--hwc/hwc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 6b69e4b..c4da67d 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -811,7 +811,10 @@ static int omap4_hwc_set(struct hwc_composer_device *dev, hwc_display_t dpy,
// LOGD("set %d layers (sgx=%d)\n", dsscomp->num_ovls, hwc_dev->use_sgx);
- if (hwc_dev->use_sgx) {
+ if (hwc_dev->use_sgx && dpy && sur) {
+ // list can be NULL which means hwc is temporarily disabled.
+ // however, if dpy and sur are null it means we're turning the
+ // screen off. no shall not call eglSwapBuffers() in that case.
if (!eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur)) {
LOGE("eglSwapBuffers error");
err = HWC_EGL_ERROR;