display: Add option to disable hardware VSYNC

* Set TARGET_NO_HW_VSYNC to disable use of VSYNC

Change-Id: I9c48f89ba6d4a39baf7c149717b13c83c0b7f3eb

Conflicts:
	common.mk
	libhwcomposer/hwc.cpp
This commit is contained in:
Steve Kondik 2012-08-07 19:56:31 -07:00 committed by Andrew Sutherland
parent c8b3f3bce8
commit 85ff2df3a5
3 changed files with 13 additions and 14 deletions

View File

@ -26,12 +26,6 @@ ifeq ($(ARCH_ARM_HAVE_NEON),true)
common_flags += -D__ARM_HAVE_NEON
endif
common_deps :=
kernel_includes :=
#Kernel includes
ifeq ($(call is-vendor-board-platform,QCOM),true)
common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
ifeq ($(TARGET_NO_HW_VSYNC),true)
common_flags += -DNO_HW_VSYNC
endif

View File

@ -120,6 +120,7 @@ static int hwc_eventControl(struct hwc_composer_device* dev,
private_module_t* m = reinterpret_cast<private_module_t*>(
ctx->mFbDev->common.module);
switch(event) {
#ifndef NO_HW_VSYNC
case HWC_EVENT_VSYNC:
if(ioctl(m->framebuffer->fd, MSMFB_OVERLAY_VSYNC_CTRL, &value) < 0)
ret = -errno;
@ -128,6 +129,7 @@ static int hwc_eventControl(struct hwc_composer_device* dev,
ret = ctx->mExtDisplay->enableHDMIVsync(value);
}
break;
#endif
case HWC_EVENT_ORIENTATION:
ctx->deviceOrientation = value;
break;
@ -219,12 +221,13 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name,
methods->eventControl = hwc_eventControl;
dev->device.common.tag = HARDWARE_DEVICE_TAG;
//XXX: This disables hardware vsync on 8x55
// Fix when HW vsync is available on 8x55
if(dev->mMDP.version == 400)
dev->device.common.version = 0;
else
dev->device.common.version = HWC_DEVICE_API_VERSION_0_3;
#ifdef NO_HW_VSYNC
dev->device.common.version = 0;
ALOGI("%s: Hardware VSYNC not supported", __FUNCTION__);
#else
dev->device.common.version = HWC_DEVICE_API_VERSION_0_3;
ALOGI("%s: Hardware VSYNC supported", __FUNCTION__);
#endif
dev->device.common.module = const_cast<hw_module_t*>(module);
dev->device.common.close = hwc_device_close;
dev->device.prepare = hwc_prepare;

View File

@ -496,6 +496,7 @@ bool ExternalDisplay::commit()
int ExternalDisplay::enableHDMIVsync(int enable)
{
#ifndef NO_HW_VSYNC
if(mFd > 0) {
int ret = ioctl(mFd, MSMFB_OVERLAY_VSYNC_CTRL, &enable);
if (ret<0) {
@ -503,6 +504,7 @@ int ExternalDisplay::enableHDMIVsync(int enable)
strerror(errno));
}
}
#endif
return -errno;
}