From 357ee6d8dc19a916a4a9aea2e779a982204a6eaf Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Mon, 27 Aug 2012 13:49:18 -0400 Subject: [PATCH] hwc: Call swap buffers even on NULL lists Swap buffers and UI mirroring must be done even on NULL lists which are composed by SurfaceFlinger. Change-Id: I6c840e3dd02dfa447c10bf3f4798114fc74536ee --- libhwcomposer/hwc.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 91101d3..378f33d 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -173,19 +173,21 @@ static int hwc_set(hwc_composer_device_t *dev, { int ret = 0; hwc_context_t* ctx = (hwc_context_t*)(dev); - if (LIKELY(list)) { - VideoOverlay::draw(ctx, list); - VideoPIP::draw(ctx,list); - ExtOnly::draw(ctx, list); - CopyBit::draw(ctx, list, (EGLDisplay)dpy, (EGLSurface)sur); - MDPComp::draw(ctx, list); - EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur); + if (dpy && sur) { + if (LIKELY(list)) { + VideoOverlay::draw(ctx, list); + VideoPIP::draw(ctx,list); + ExtOnly::draw(ctx, list); + CopyBit::draw(ctx, list, (EGLDisplay)dpy, (EGLSurface)sur); + MDPComp::draw(ctx, list); + } + eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur); wait4fbPost(ctx); //Can draw to HDMI only when fb_post is reached UIMirrorOverlay::draw(ctx); //HDMI commit and primary commit (PAN) happening in parallel if(ctx->mExtDisplay->getExternalDisplay()) - ctx->mExtDisplay->commit(); + ctx->mExtDisplay->commit(); //Virtual barrier for threads to finish wait4Pan(ctx); } else {