Merge "audio: different frame size calculation for input and output"
diff --git a/include/hardware/hdmi_cec.h b/include/hardware/hdmi_cec.h
index 46294ae..d7951f3 100644
--- a/include/hardware/hdmi_cec.h
+++ b/include/hardware/hdmi_cec.h
@@ -156,7 +156,6 @@
 enum {
     HDMI_EVENT_CEC_MESSAGE = 1,
     HDMI_EVENT_HOT_PLUG = 2,
-    HDMI_EVENT_TX_STATUS = 3,
 };
 
 /*
@@ -169,21 +168,13 @@
 };
 
 /*
- * TX result type. Used when the event type is HDMI_EVENT_TX_STATUS.
- */
-enum {
-    HDMI_TX_STATUS_SUCCESS = 0,
-    HDMI_TX_STATUS_TIMEDOUT = 1, /* failed on wait */
-    HDMI_TX_STATUS_NOCONN = 2    /* connection problem */
-};
-
-/*
  * error code used for send_message.
  */
 enum {
     HDMI_RESULT_SUCCESS = 0,
     HDMI_RESULT_NACK = 1,        /* not acknowledged */
-    HDMI_RESULT_BUSY = 2         /* bus is busy */
+    HDMI_RESULT_BUSY = 2,        /* bus is busy */
+    HDMI_RESULT_FAIL = 3,
 };
 
 /*
@@ -263,7 +254,6 @@
     union {
         cec_message_t cec;
         hotplug_event_t hotplug;
-        tx_status_event_t tx_status;
     };
 } hdmi_event_t;
 
@@ -348,8 +338,7 @@
      * some reason. HAL implementation should take the situation into account
      * so as not to wait forever for the message to get sent out.
      *
-     * It should try retransmission at least once as specified in the standard,
-     * and later should report the transmission result via tx_status_event_t.
+     * It should try retransmission at least once as specified in the standard.
      *
      * Returns error code. See HDMI_RESULT_SUCCESS, HDMI_RESULT_NACK, and
      * HDMI_RESULT_BUSY.
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk
index a4ffd20..092e851 100644
--- a/modules/gralloc/Android.mk
+++ b/modules/gralloc/Android.mk
@@ -29,5 +29,8 @@
 
 LOCAL_MODULE := gralloc.default
 LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -Wno-missing-field-initializers
+ifeq ($(TARGET_USE_PAN_DISPLAY),true)
+LOCAL_CFLAGS += -DUSE_PAN_DISPLAY=1
+endif
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index 9d8513a..486e27a 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -42,6 +42,13 @@
 
 /*****************************************************************************/
 
+// Set TARGET_USE_PAN_DISPLAY to true at compile time if the
+// board uses FBIOPAN_DISPLAY to setup page flipping, otherwise
+// default ioctl to do page-flipping is FBIOPUT_VSCREENINFO.
+#ifndef USE_PAN_DISPLAY
+#define USE_PAN_DISPLAY 0
+#endif
+
 // numbers of buffers for page flipping
 #define NUM_BUFFERS 2
 
@@ -178,10 +185,15 @@
 
 
     uint32_t flags = PAGE_FLIP;
+#if USE_PAN_DISPLAY
+    if (ioctl(fd, FBIOPAN_DISPLAY, &info) == -1) {
+        ALOGW("FBIOPAN_DISPLAY failed, page flipping not supported");
+#else
     if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1) {
+        ALOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported");
+#endif
         info.yres_virtual = info.yres;
         flags &= ~PAGE_FLIP;
-        ALOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported");
     }
 
     if (info.yres_virtual < info.yres * 2) {