diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index d292ea4..f96bc91 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -16,6 +16,7 @@ * limitations under the License. */ +#include #include "hwc_mdpcomp.h" #include "hwc_qbuf.h" #include "hwc_external.h" @@ -726,7 +727,9 @@ int MDPComp::draw(hwc_context_t *ctx, hwc_layer_list_t* list) { //lock buffer before queue //XXX: Handle lock failure - ctx->qbuf->lockAndAdd(hnd); + if (ctx->swapInterval != 0) { + ctx->qbuf->lockAndAdd(hnd); + } ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \ using pipe: %d", __FUNCTION__, layer, @@ -811,6 +814,10 @@ bool MDPComp::configure(hwc_composer_device_t *dev, hwc_layer_list_t* list) { bool doable = is_doable(dev, list); if(doable) { + char value[PROPERTY_VALUE_MAX]; + property_get("debug.egl.swapinterval", value, "1"); + ctx->swapInterval = atoi(value); + if(setup(ctx, list)) { setMDPCompLayerFlags(list); sMDPCompState = MDPCOMP_ON; diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp index 88512fe..db9eb28 100644 --- a/libhwcomposer/hwc_utils.cpp +++ b/libhwcomposer/hwc_utils.cpp @@ -16,6 +16,7 @@ */ #include +#include #include "hwc_utils.h" #include "mdp_version.h" #include "hwc_video.h" @@ -53,6 +54,10 @@ void initContext(hwc_context_t *ctx) init_uevent_thread(ctx); + char value[PROPERTY_VALUE_MAX]; + property_get("debug.egl.swapinterval", value, "1"); + ctx->swapInterval = atoi(value); + ALOGI("Initializing Qualcomm Hardware Composer"); ALOGI("MDP version: %d", ctx->mMDP.version); } diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index 37c52c8..5127e99 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -129,6 +129,7 @@ struct hwc_context_t { int numHwLayers; int overlayInUse; int deviceOrientation; + int swapInterval; //Framebuffer device framebuffer_device_t *mFbDev;