libhwcomposer: Support swap interval zero

Change-Id: I4732263c86bb28b4c7135bad9768b8690f7f60e0
This commit is contained in:
Jeykumar Sankaran 2012-08-06 14:14:01 -07:00 committed by Andrew Sutherland
parent 060e7797ed
commit 7c5f26105a
3 changed files with 14 additions and 1 deletions

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
#include <cutils/properties.h>
#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;

View File

@ -16,6 +16,7 @@
*/
#include <overlay.h>
#include <cutils/properties.h>
#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);
}

View File

@ -129,6 +129,7 @@ struct hwc_context_t {
int numHwLayers;
int overlayInUse;
int deviceOrientation;
int swapInterval;
//Framebuffer device
framebuffer_device_t *mFbDev;