+#       modified:   include/binder/MemoryBase.h
 #       modified:   include/gui/GLConsumer.h
 #       modified:   include/media/openmax/OMX_IVCommon.h
+#       modified:   include/ui/GraphicBuffer.h
 #       modified:   include/ui/PixelFormat.h
 #       modified:   include/ui/Region.h
+#       modified:   libs/binder/MemoryBase.cpp
+#       modified:   libs/gui/Android.mk
 #       modified:   libs/gui/GLConsumer.cpp
 #       modified:   libs/ui/PixelFormat.cpp
 #       modified:   opengl/include/EGL/eglext.h
 #       modified:   opengl/libs/EGL/eglApi.cpp
 #       modified:   opengl/libs/EGL/egl_entries.in
+#       modified:   services/surfaceflinger/SurfaceFlinger.cpp
+diff --git a/frameworks/native/include/binder/MemoryBase.h b/frameworks/native/include/binder/MemoryBase.h
+index 463e26d..286e0d3 100644
+--- a/frameworks/native/include/binder/MemoryBase.h
++++ b/frameworks/native/include/binder/MemoryBase.h
+@@ -34,6 +34,10 @@ public:
+     virtual ~MemoryBase();
+     virtual sp<IMemoryHeap> getMemory(ssize_t* offset, size_t* size) const;
+ 
++#ifdef STE_HARDWARE
++    virtual sp<IMemoryHeap> getMemory(long* offset, unsigned int* size) const;
++#endif
++
+ protected:
+     size_t getSize() const { return mSize; }
+     ssize_t getOffset() const { return mOffset; }
 diff --git a/frameworks/native/include/gui/GLConsumer.h b/frameworks/native/include/gui/GLConsumer.h
-index f0a75dc..35aa19f 100644
+index f0a75dc..6cf4922 100644
 --- a/frameworks/native/include/gui/GLConsumer.h
 +++ b/frameworks/native/include/gui/GLConsumer.h
-@@ -419,6 +419,7 @@ private:
-     // It is set to false by detachFromContext, and then set to true again by
-     // attachToContext.
-     bool mAttached;
-+
- };
- 
- // ----------------------------------------------------------------------------
+@@ -32,6 +32,11 @@
+ #include <utils/Vector.h>
+ #include <utils/threads.h>
+ 
++#ifdef STE_HARDWARE  
++#include <hardware/copybit.h>
++#include <gui/IGraphicBufferAlloc.h>
++#endif
++
+ #define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture"
+ #define ANDROID_GRAPHICS_FRAMEAVAILABLELISTENER_JNI_ID \
+                                          "mFrameAvailableListener"
+@@ -59,6 +64,9 @@ class String8;
+  */
+ class GLConsumer : public ConsumerBase {
+ public:
++#ifdef STE_HARDWARE
++    enum { NUM_BLIT_BUFFER_SLOTS = 2 };
++#endif
+     typedef ConsumerBase::FrameAvailableListener FrameAvailableListener;
+ 
+     // GLConsumer constructs a new GLConsumer object. tex indicates the
+@@ -272,6 +280,14 @@ private:
+     EGLImageKHR createImage(EGLDisplay dpy,
+             const sp<GraphicBuffer>& graphicBuffer);
+ 
++#ifdef STE_HARDWARE
++    // returns TRUE if buffer needs color format conversion
++    bool conversionIsNeeded(const sp<GraphicBuffer>& graphicBuffer);
++
++    // converts buffer to a suitable color format
++    status_t convert(sp<GraphicBuffer> &srcBuf, sp<GraphicBuffer> &dstBuf);
++#endif
++
+     // freeBufferLocked frees up the given buffer slot.  If the slot has been
+     // initialized this will release the reference to the GraphicBuffer in that
+     // slot and destroy the EGLImage in that slot.  Otherwise it has no effect.
+@@ -389,6 +405,18 @@ private:
+     // attachToContext is called.
+     EGLDisplay mEglDisplay;
+ 
++#ifdef STE_HARDWARE
++    // mBlitEngine is the handle to the copybit device which will be used in
++    // case color transform is needed before the EGL image is created.
++    copybit_device_t* mBlitEngine;
++
++    // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to
++    // allocate new GraphicBuffer objects.
++    sp<IGraphicBufferAlloc> mGraphicBufferAlloc;
++    sp<GraphicBuffer> mBlitSlots[NUM_BLIT_BUFFER_SLOTS];
++    int mNextBlitSlot;
++#endif
++
+     // mEglContext is the OpenGL ES context with which this GLConsumer is
+     // currently associated.  It is initialized to EGL_NO_CONTEXT and gets set
+     // to the current GL context when updateTexImage is called for the first
 diff --git a/frameworks/native/include/media/openmax/OMX_IVCommon.h b/frameworks/native/include/media/openmax/OMX_IVCommon.h
 index 85bf00d..db4a5e5 100644
 --- a/frameworks/native/include/media/openmax/OMX_IVCommon.h

     OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
     OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
     OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002,
diff --git a/frameworks/native/include/ui/PixelFormat.h b/frameworks/native/include/ui/PixelFormat.h
index 9f3e267..d89790d 100644
--- a/frameworks/native/include/ui/PixelFormat.h

+    case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP_TILED:
+    case HAL_PIXEL_FORMAT_YCbCr_420_P:
+    case HAL_PIXEL_FORMAT_YCrCb_420_P:
+    case HAL_PIXEL_FORMAT_YCbCr_420_I:
+    case HAL_PIXEL_FORMAT_CbYCrY_420_I:
+    case HAL_PIXEL_FORMAT_YCBCR42XMBN:
