[Samsung Galaxy S II Plus] haky 86:
Hello mate

I know there is another guide how to compile CyanogenMod for Samsung Galaxy S2 Plus, but I will add something from my experience to be more clear and easy to understand.

Requirements:

I recommend Ubuntu 12.04 x64 because is faster than 14.10 for me.

OpenJDK 6 for jellybean and kitkat.

Some of your attention.

Steps:

Steps to install Java which is the most important component for building.

Steps to install Repo tool from Google.

Make sure to run terminal as root.

Steps to install recommend packages for Ubuntu 12.04 x64.

Steps to download CyanogenMod 11

Steps to save time and size by deleting some project such as all official devices and tools designed for Mac OS X, if you are use only Linux.

Steps to create the perfect manifest for S2 Plus device.

Now once repos are downloaded follow these steps to apply patch to got it worked without problems.

from the root of cm's source type gedit 1.patch and insert the following code for RIL, once you save file type git apply --stat 1.patch

RIL patch

From e289a7f5e1acf9557e7bc25c6f2642619c310849 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 12 Apr 2013 11:40:15 +0700
Subject: [PATCH] libnetutils: add ifc_set_mtu

Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e
---
libnetutils/ifc_utils.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index 240b5f3..4741651 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -985,3 +985,19 @@ int ifc_get_mtu(const char *name, int *mtuSz)

return -1;
}
+
+// Required for Broadcom RILD
+int ifc_set_mtu(const char *name, int mtuSz)
+{
+ struct ifreq ifr;
+ int ret;
+ ifc_init_ifr(name, &ifr);
+ ifr.ifr_mtu = mtuSz;
+
+ ret = ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr);
+ if (ret < 0) {
+ printerr("ifc_set_mtu: SIOCSIFMTU failed: %d\n", ret);
+ }
+
+ return ret;
+}
--
1.7.3.4

Bluetooth patch

From 9ea34a45b82771a564ba9549752d152fbd529acf Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 20:09:12 +0700
Subject: [PATCH] libbt: switch to N_BRCM_HCI line disclipline for userial
ioctl

Change-Id: I12c297c6b26fc0cb6f0a36ed8f5d04d4d36a4092
---
src/userial_vendor.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index 5233d19..86d98e8 100755
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -183,6 +183,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
uint16_t parity;
uint8_t stop_bits;

+#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ int ldisc;
+#endif
+
vnd_userial.fd = -1;

if (!userial_to_tcio_baud(p_cfg->baud, &baud))
@@ -252,6 +256,13 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios);

#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ // TODO: check for breakage on tuna (Galaxy Nexus). It defines this,
+ // but does not contain the kernel code to support it.
+
+ // Switch to N_BRCM_HCI line disclipline for ioctl to work
+ ldisc = 25; // N_BRCM_HCI
+ ioctl(vnd_userial.fd, TIOCSETD, &ldisc);
+
userial_ioctl_init_bt_wake(vnd_userial.fd);
#endif

--
1.8.3.4 (Apple Git-47)

Legacy patch

From 814e9318a2eb62cfe0cd2ec6a71226017b259ea5 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 19:38:17 +0700
Subject: [PATCH] binder: add compat symbols

Required for libtvservice_binder.so on I9082

Change-Id: I059e92f19e4c5a911d38faa9c4df549c75c90761
---
libs/binder/Parcel.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 38e019c..26e54f1 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -808,6 +808,12 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
return status;
}

+extern "C" status_t _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(void *parcel, void *val);
+
+extern "C" status_t _ZN7android6Parcel5writeERKNS_11FlattenableE(void *parcel, void *val) {
+ return _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(parcel, val);
+}
+
status_t Parcel::write(const FlattenableHelperInterface& val)
{
status_t err;
@@ -1184,6 +1190,12 @@ status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const
return NO_ERROR;
}

+extern "C" status_t _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(void *parcel, void *val);
+
+extern "C" status_t _ZNK7android6Parcel4readERNS_11FlattenableE(void *parcel, void *val) {
+ return _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(parcel, val);
+}
+
status_t Parcel::read(FlattenableHelperInterface& val) const
{
// size
--
1.8.3.4 (Apple Git-47)

Frameworks/native for hwc

diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
index 319aeaa..4264248 100644
--- a/include/gui/ISurfaceComposer.h
+++ b/include/gui/ISurfaceComposer.h
@@ -122,6 +122,16 @@ class ISurfaceComposer: public IInterface {
uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool isCpuConsumer) = 0;
+
+#ifdef USE_MHEAP_SCREENSHOT
+ /* Capture the specified screen. requires READ_FRAME_BUFFER permission
+ * This function will fail if there is a secure window on screen.
+ */
+ virtual status_t captureScreen(const sp<IBinder>& display, sp<IMemoryHeap>* heap,
+ uint32_t* width, uint32_t* height,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ) = 0;
+#endif
};

// ----------------------------------------------------------------------------
@@ -140,6 +150,9 @@ class BnSurfaceComposer: public BnInterface<ISurfaceComposer> {
GET_BUILT_IN_DISPLAY,
SET_TRANSACTION_STATE,
AUTHENTICATE_SURFACE,
+#ifdef USE_MHEAP_SCREENSHOT
+ CAPTURE_SCREEN_DEPRECATED,
+#endif
BLANK,
UNBLANK,
GET_DISPLAY_INFO,
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 90d3dcd..425c111 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -39,6 +39,9 @@ namespace android {

class DisplayInfo;
class Composer;
+#ifdef USE_MHEAP_SCREENSHOT
+class IMemoryHeap;
+#endif
class ISurfaceComposerClient;
class IGraphicBufferProducer;
class Region;
@@ -179,6 +182,9 @@ class ScreenshotClient
uint32_t minLayerZ, uint32_t maxLayerZ);

private:
+#ifdef USE_MHEAP_SCREENSHOT
+ sp<IMemoryHeap> mHeap;
+#endif
mutable sp<CpuConsumer> mCpuConsumer;
mutable sp<BufferQueue> mBufferQueue;
CpuConsumer::LockedBuffer mBuffer;
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 7957981..356ffd2 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -53,6 +53,10 @@ ifeq ($(BOARD_EGL_SKIP_FIRST_DEQUEUE),true)
LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE
endif

+ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true)
+ LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT
+endif
+
LOCAL_MODULE:= libgui

ifeq ($(TARGET_BOARD_PLATFORM), tegra)
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 6d22066..ccde018 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -102,6 +102,28 @@ class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
remote()->transact(BnSurfaceComposer::BOOT_FINISHED, data, &reply);
}

+#ifdef USE_MHEAP_SCREENSHOT
+ virtual status_t captureScreen(
+ const sp<IBinder>& display, sp<IMemoryHeap>* heap,
+ uint32_t* width, uint32_t* height,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
+ data.writeStrongBinder(display);
+ data.writeInt32(reqWidth);
+ data.writeInt32(reqHeight);
+ data.writeInt32(minLayerZ);
+ data.writeInt32(maxLayerZ);
+ remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN_DEPRECATED, data, &reply);
+ *heap = interface_cast<IMemoryHeap>(reply.readStrongBinder());
+ *width = reply.readInt32();
+ *height = reply.readInt32();
+ return reply.readInt32();
+ }
+#endif
+
virtual status_t captureScreen(const sp<IBinder>& display,
const sp<IGraphicBufferProducer>& producer,
uint32_t reqWidth, uint32_t reqHeight,
@@ -278,6 +300,25 @@ status_t BnSurfaceComposer::onTransact(
bootFinished();
return NO_ERROR;
}
+#ifdef USE_MHEAP_SCREENSHOT
+ case CAPTURE_SCREEN_DEPRECATED: {
+ CHECK_INTERFACE(ISurfaceComposer, data, reply);
+ sp<IBinder> display = data.readStrongBinder();
+ uint32_t reqWidth = data.readInt32();
+ uint32_t reqHeight = data.readInt32();
+ uint32_t minLayerZ = data.readInt32();
+ uint32_t maxLayerZ = data.readInt32();
+ sp<IMemoryHeap> heap;
+ uint32_t w, h;
+ status_t res = captureScreen(display, &heap, &w, &h,
+ reqWidth, reqHeight, minLayerZ, maxLayerZ);
+ reply->writeStrongBinder(heap->asBinder());
+ reply->writeInt32(w);
+ reply->writeInt32(h);
+ reply->writeInt32(res);
+ return NO_ERROR;
+ }
+#endif
case CAPTURE_SCREEN: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> display = data.readStrongBinder();
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index a6187f5..ba0f64d 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -699,6 +699,14 @@ status_t ScreenshotClient::capture(
uint32_t minLayerZ, uint32_t maxLayerZ) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
+#ifdef USE_MHEAP_SCREENSHOT
+ int format = 0;
+ producer->query(NATIVE_WINDOW_FORMAT,&format);
+ if (format == PIXEL_FORMAT_RGBA_8888) {
+ /* For some reason, this format fails badly */
+ return BAD_VALUE;
+ }
+#endif
return s->captureScreen(display, producer,
reqWidth, reqHeight, minLayerZ, maxLayerZ,
SS_CPU_CONSUMER);
@@ -734,6 +742,19 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
uint32_t minLayerZ, uint32_t maxLayerZ) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
+#ifdef USE_MHEAP_SCREENSHOT
+ int ret = -1;
+ mHeap = 0;
+ ret = s->captureScreen(display, &mHeap,
+ &mBuffer.width, &mBuffer.height, reqWidth, reqHeight,
+ minLayerZ, maxLayerZ);
+ if (ret == NO_ERROR) {
+ mBuffer.format = PIXEL_FORMAT_RGBA_8888;
+ mBuffer.stride = mBuffer.width;
+ mBuffer.data = (uint8_t *)mHeap->getBase();
+ }
+ return ret;
+#else
sp<CpuConsumer> cpuConsumer = getCpuConsumer();

if (mHaveBuffer) {
@@ -752,6 +773,7 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
}
}
return err;
+#endif
}

status_t ScreenshotClient::update(const sp<IBinder>& display) {
@@ -764,12 +786,16 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
}

void ScreenshotClient::release() {
+#ifdef USE_MHEAP_SCREENSHOT
+ mHeap = 0;
+#else
if (mHaveBuffer) {
mCpuConsumer->unlockBuffer(mBuffer);
memset(&mBuffer, 0, sizeof(mBuffer));
mHaveBuffer = false;
}
mCpuConsumer.clear();
+#endif
}

void const* ScreenshotClient::getPixels() const {
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index e33daa2..807c149 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -60,6 +60,10 @@ ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
endif

+ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true)
+ LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT
+endif
+
# See build/target/board/generic/BoardConfig.mk for a description of this setting.
ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 67b715c..e1f5ce5 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -23,6 +23,9 @@
#include <dlfcn.h>

#include <EGL/egl.h>
+#ifdef USE_MHEAP_SCREENSHOT
+#include <GLES/gl.h>
+#endif

#include <cutils/log.h>
#include <cutils/properties.h>
@@ -2778,6 +2781,9 @@ status_t SurfaceFlinger::onTransact(
const int pid = ipc->getCallingPid();
const int uid = ipc->getCallingUid();
if ((uid != AID_GRAPHICS) &&
+#ifdef USE_MHEAP_SCREENSHOT
+ (uid != AID_SYSTEM) &&
+#endif
!PermissionCache::checkPermission(sAccessSurfaceFlinger, pid, uid)) {
ALOGE("Permission Denial: "
"can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
@@ -2786,6 +2792,9 @@ status_t SurfaceFlinger::onTransact(
break;
}
case CAPTURE_SCREEN:
+#ifdef USE_MHEAP_SCREENSHOT
+ case CAPTURE_SCREEN_DEPRECATED:
+#endif
{
// codes that require permission check
IPCThreadState* ipc = IPCThreadState::self();
@@ -3029,9 +3038,18 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display,
Mutex::Autolock _l(flinger->mStateLock);
sp<const DisplayDevice> hw(flinger->getDisplayDevice(display));
bool useReadPixels = this->useReadPixels && !flinger->mGpuToCpuSupported;
- result = flinger->captureScreenImplLocked(hw,
- producer, reqWidth, reqHeight, minLayerZ, maxLayerZ,
- useReadPixels);
+#ifdef USE_MHEAP_SCREENSHOT
+ if (!useReadPixels) {
+#endif
+ result = flinger->captureScreenImplLocked(hw,
+ producer, reqWidth, reqHeight, minLayerZ, maxLayerZ,
+ useReadPixels);
+#ifdef USE_MHEAP_SCREENSHOT
+ } else {
+ // Should never get here
+ return BAD_VALUE;
+ }
+#endif
static_cast<GraphicProducerWrapper*>(producer->asBinder().get())->exit(result);
return true;
}
@@ -3257,6 +3275,108 @@ void SurfaceFlinger::checkScreenshot(size_t w, size_t s, size_t h, void const* v
}
}

+#ifdef USE_MHEAP_SCREENSHOT
+status_t SurfaceFlinger::captureScreenImplCpuConsumerLocked(
+ const sp<const DisplayDevice>& hw,
+ sp<IMemoryHeap>* heap, uint32_t* w, uint32_t* h,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ)
+{
+ ATRACE_CALL();
+
+ // get screen geometry
+ const uint32_t hw_w = hw->getWidth();
+ const uint32_t hw_h = hw->getHeight();
+
+ if ((reqWidth > hw_w) || (reqHeight > hw_h)) {
+ ALOGE("size mismatch (%d, %d) > (%d, %d)",
+ reqWidth, reqHeight, hw_w, hw_h);
+ return BAD_VALUE;
+ }
+
+ reqWidth = (!reqWidth) ? hw_w : reqWidth;
+ reqHeight = (!reqHeight) ? hw_h : reqHeight;
+
+ status_t result = NO_ERROR;
+
+ renderScreenImplLocked(hw, reqWidth, reqHeight, minLayerZ, maxLayerZ, true);
+
+ size_t size = reqWidth * reqHeight * 4;
+ // allocate shared memory large enough to hold the
+ // screen capture
+ sp<MemoryHeapBase> base(
+ new MemoryHeapBase(size, 0, "screen-capture") );
+ void *vaddr = base->getBase();
+ glReadPixels(0, 0, reqWidth, reqHeight,
+ GL_RGBA, GL_UNSIGNED_BYTE, vaddr);
+ if (glGetError() == GL_NO_ERROR) {
+ *heap = base;
+ *w = reqWidth;
+ *h = reqHeight;
+ result = NO_ERROR;
+ } else {
+ result = INVALID_OPERATION;
+ }
+
+ return result;
+}
+
+status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display,
+ sp<IMemoryHeap>* heap,
+ uint32_t* outWidth, uint32_t* outHeight,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ)
+{
+ if (CC_UNLIKELY(display == 0))
+ return BAD_VALUE;
+
+ class MessageCaptureScreen : public MessageBase {
+ SurfaceFlinger* flinger;
+ sp<IBinder> display;
+ sp<IMemoryHeap>* heap;
+ uint32_t* outWidth;
+ uint32_t* outHeight;
+ uint32_t reqWidth;
+ uint32_t reqHeight;
+ uint32_t minLayerZ;
+ uint32_t maxLayerZ;
+ status_t result;
+ public:
+ MessageCaptureScreen(SurfaceFlinger* flinger,
+ const sp<IBinder>& display, sp<IMemoryHeap>* heap,
+ uint32_t* outWidth, uint32_t* outHeight,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ)
+ : flinger(flinger), display(display), heap(heap),
+ outWidth(outWidth), outHeight(outHeight),
+ reqWidth(reqWidth), reqHeight(reqHeight),
+ minLayerZ(minLayerZ), maxLayerZ(maxLayerZ),
+ result(PERMISSION_DENIED)
+ {
+ }
+ status_t getResult() const {
+ return result;
+ }
+ virtual bool handler() {
+ Mutex::Autolock _l(flinger->mStateLock);
+ sp<const DisplayDevice> hw(flinger->getDisplayDevice(display));
+ result = flinger->captureScreenImplCpuConsumerLocked(hw, heap,
+ outWidth, outHeight,
+ reqWidth, reqHeight, minLayerZ, maxLayerZ);
+ return true;
+ }
+ };
+
+ sp<MessageBase> msg = new MessageCaptureScreen(this, display, heap,
+ outWidth, outHeight, reqWidth, reqHeight, minLayerZ, maxLayerZ);
+ status_t res = postMessageSync(msg);
+ if (res == NO_ERROR) {
+ res = static_cast<MessageCaptureScreen*>( msg.get() )->getResult();
+ }
+ return res;
+}
+#endif
+
// ---------------------------------------------------------------------------

SurfaceFlinger::LayerVector::LayerVector() {
@@ -3303,6 +3423,7 @@ SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(DisplayDevice::DisplayTyp
}; // namespace android

+#ifndef USE_MHEAP_SCREENSHOT
#if defined(__gl_h_)
#error "don't include gl/gl.h in this file"
#endif
@@ -3310,3 +3431,4 @@ SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(DisplayDevice::DisplayTyp
#if defined(__gl2_h_)
#error "don't include gl2/gl2.h in this file"
#endif
+#endif
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 8c28962..ada2914 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -208,6 +208,11 @@ class SurfaceFlinger : public BnSurfaceComposer,
const sp<IGraphicBufferProducer>& producer,
uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ, bool isCpuConsumer);
+#ifdef USE_MHEAP_SCREENSHOT
+ virtual status_t captureScreen(const sp<IBinder>& display, sp<IMemoryHeap>* heap,
+ uint32_t* width, uint32_t* height, uint32_t reqWidth,
+ uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ);
+#endif
// called when screen needs to turn off
virtual void blank(const sp<IBinder>& display);
// called when screen is turning back on
@@ -324,6 +329,14 @@ class SurfaceFlinger : public BnSurfaceComposer,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useReadPixels);

+#ifdef USE_MHEAP_SCREENSHOT
+ status_t captureScreenImplCpuConsumerLocked(
+ const sp<const DisplayDevice>& hw,
+ sp<IMemoryHeap>* heap, uint32_t* width, uint32_t* height,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ);
+#endif
+
/* ------------------------------------------------------------------------
* EGL
*/

Chromium_org patch

From 1ad8b5f5d66937b50e38782170b00ef61404633e Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 11 Dec 2013 20:47:31 +0700
Subject: [PATCH] chromium: disable HW rendering for capri

Change-Id: I16b2c14eb15a3efe4d84d603c132434a5f97530a
---
android_webview/browser/in_process_view_renderer.cc | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc
index e384584..5e15022 100644
--- a/android_webview/browser/in_process_view_renderer.cc
+++ b/android_webview/browser/in_process_view_renderer.cc
@@ -133,8 +133,13 @@ class ScopedPixelAccess {
};

bool HardwareEnabled() {
+// HACK: CAPRI_HWC has problems with GL image upload which can lead to system crash
+#ifdef CAPRI_HWC
+ static bool g_hw_enabled = false;
+#else
static bool g_hw_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableWebViewGLMode);
+#endif
return g_hw_enabled;
}

--
1.8.3.4 (Apple Git-47)

Once you are finish with patching source, type this.

gedit device/samsung/s2vep/vendorsetup.sh

inser in the file add_lunch_combo cm_s2vep-userdebug then save file.

Now let's start building by

cd vendor/cm

./get-prebuilts

.cd .. to_root_of_cm_source

. build/envsetup.sh

lunch and insert the number of your device

brunch s2vep

If you find this thread mention me in your new rom's thread ;)

HAPPY BUILDING