From 3f805e093bfd88c6516a3d61e50311587c58712f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Dec 2013 09:17:26 -0500 Subject: Add initial juice Patches and script to apply them Signed-off-by: root --- frameworks/native/native.git-1.patch | 49 +++++++++++++++++ frameworks/native/native.git-2.patch | 52 ++++++++++++++++++ frameworks/native/native.git-3.patch | 45 ++++++++++++++++ frameworks/native/native.git-4.patch | 102 +++++++++++++++++++++++++++++++++++ frameworks/native/native.git-5.patch | 33 ++++++++++++ 5 files changed, 281 insertions(+) create mode 100644 frameworks/native/native.git-1.patch create mode 100644 frameworks/native/native.git-2.patch create mode 100644 frameworks/native/native.git-3.patch create mode 100644 frameworks/native/native.git-4.patch create mode 100644 frameworks/native/native.git-5.patch (limited to 'frameworks/native') diff --git a/frameworks/native/native.git-1.patch b/frameworks/native/native.git-1.patch new file mode 100644 index 0000000..a446b36 --- /dev/null +++ b/frameworks/native/native.git-1.patch @@ -0,0 +1,49 @@ +From 1ff66dc28169874ef32f968da6e8ddd14ef28eba Mon Sep 17 00:00:00 2001 +From: Bernhard Rosenkraenzer +Date: Thu, 25 Jul 2013 13:27:18 +0530 +Subject: [PATCH] surfaceflinger: Don't crash on missing functions in + hwcomposers + +Some hwcomposers -- most notably hwcomposer.default.so -- don't +implement blank() or eventControl(). +Don't crash when trying to use them. + +Signed-off-by: Amit Pundir +--- + .../surfaceflinger/DisplayHardware/HWComposer.cpp | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp +index c7d1a90..7f9fb2f 100644 +--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp ++++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp +@@ -493,7 +493,7 @@ void HWComposer::eventControl(int disp, int event, int enabled) { + const int32_t oldValue = mDisplayData[disp].events & eventBit; + if (newValue != oldValue) { + ATRACE_CALL(); +- err = mHwc->eventControl(mHwc, disp, event, enabled); ++ err = mHwc->eventControl ? mHwc->eventControl(mHwc, disp, event, enabled) : NO_ERROR; + if (!err) { + int32_t& events(mDisplayData[disp].events); + events = (events & ~eventBit) | newValue; +@@ -731,14 +731,15 @@ status_t HWComposer::release(int disp) { + LOG_FATAL_IF(disp >= VIRTUAL_DISPLAY_ID_BASE); + if (mHwc) { + eventControl(disp, HWC_EVENT_VSYNC, 0); +- return (status_t)mHwc->blank(mHwc, disp, 1); ++ if (mHwc->blank) ++ return (status_t)mHwc->blank(mHwc, disp, 1); + } + return NO_ERROR; + } + + status_t HWComposer::acquire(int disp) { + LOG_FATAL_IF(disp >= VIRTUAL_DISPLAY_ID_BASE); +- if (mHwc) { ++ if (mHwc && mHwc->blank) { + return (status_t)mHwc->blank(mHwc, disp, 0); + } + return NO_ERROR; +-- +1.7.9.5 + diff --git a/frameworks/native/native.git-2.patch b/frameworks/native/native.git-2.patch new file mode 100644 index 0000000..8efff07 --- /dev/null +++ b/frameworks/native/native.git-2.patch @@ -0,0 +1,52 @@ +From 95c7fb8f9c5a0843e7ec411920910484c0bd37bc Mon Sep 17 00:00:00 2001 +From: Vishal Bhoj +Date: Thu, 25 Jul 2013 13:33:13 +0530 +Subject: [PATCH] surfaceflinger: Handle screen timeout on hw without vsync + +timeout currently at 1 second waiting for vsync. With +this change timeout happens at 16ms. + +Signed-off-by: Amit Pundir +--- + services/surfaceflinger/EventThread.cpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp +index 3528b62..b79c973 100644 +--- a/services/surfaceflinger/EventThread.cpp ++++ b/services/surfaceflinger/EventThread.cpp +@@ -20,6 +20,7 @@ + #include + + #include ++#include + + #include + #include +@@ -42,6 +43,11 @@ EventThread::EventThread(const sp& src) + mVsyncEnabled(false), + mDebugVsyncEnabled(false) { + ++ char value[PROPERTY_VALUE_MAX]; ++ property_get("debug.sf.no_hw_vsync", value, "0"); ++ if (1 == atoi(value)) ++ mUseSoftwareVSync = true; ++ + for (int32_t i=0 ; i +Date: Fri, 20 Dec 2013 06:09:30 -0500 +Subject: [PATCH] installd: insert one backdoor to support boot via nfs + +when boot via nfs, we need the install usr on nfs server to have the +chown permission as it does on android. but that's no easy to do with +setting of nfs. so we will make the install to run as root via the +property hack.installd.for.nfs set to 1 when want to boot via nfs + +Change-Id: I101849f9b7f55b9e8dd657ae321cf9341ddc7d02 +Signed-off-by: Vishal +--- + cmds/installd/installd.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c +index 0c80dac..e9eb61a 100644 +--- a/cmds/installd/installd.c ++++ b/cmds/installd/installd.c +@@ -533,6 +533,7 @@ int main(const int argc, const char *argv[]) { + socklen_t alen; + int lsocket, s, count; + int selinux_enabled = (is_selinux_enabled() > 0); ++ char nfs_hack_flag[PROPERTY_VALUE_MAX]; + + ALOGI("installd firing up\n"); + +@@ -551,7 +552,12 @@ int main(const int argc, const char *argv[]) { + exit(1); + } + +- drop_privileges(); ++ property_get("hack.installd.for.nfs", nfs_hack_flag, "0"); ++ if(!strcmp(nfs_hack_flag, "1")) { ++ ALOGI("Will not drop the privileges of installd service since hack.installd.for.nfs=%s.\n", nfs_hack_flag); ++ }else{ ++ drop_privileges(); ++ } + + lsocket = android_get_control_socket(SOCKET_PATH); + if (lsocket < 0) { +-- +1.8.5 + diff --git a/frameworks/native/native.git-4.patch b/frameworks/native/native.git-4.patch new file mode 100644 index 0000000..468d498 --- /dev/null +++ b/frameworks/native/native.git-4.patch @@ -0,0 +1,102 @@ +From efa820d42f8e375537b3e318ea26eb01aeac9990 Mon Sep 17 00:00:00 2001 +From: Amit Pundir +Date: Thu, 1 Aug 2013 18:15:27 +0530 +Subject: [PATCH] servicemanager: enable bctest with debug logs + +Enable bctest binder test and put ioctl pass/failure logs for lava. + +Change-Id: I33eb6b87d3f9efcef7334dbb0a649ce23b8b0a21 +Signed-off-by: Amit Pundir +--- + cmds/servicemanager/Android.mk | 10 ++++++---- + cmds/servicemanager/binder.c | 30 +++++++++++++++++++++++++++--- + 2 files changed, 33 insertions(+), 7 deletions(-) + +diff --git a/cmds/servicemanager/Android.mk b/cmds/servicemanager/Android.mk +index 8840867..46a053d 100644 +--- a/cmds/servicemanager/Android.mk ++++ b/cmds/servicemanager/Android.mk +@@ -1,9 +1,11 @@ + LOCAL_PATH:= $(call my-dir) + +-#include $(CLEAR_VARS) +-#LOCAL_SRC_FILES := bctest.c binder.c +-#LOCAL_MODULE := bctest +-#include $(BUILD_EXECUTABLE) ++include $(CLEAR_VARS) ++LOCAL_SHARED_LIBRARIES := liblog ++LOCAL_CFLAGS := -DBCTEST_DEBUG=1 ++LOCAL_SRC_FILES := bctest.c binder.c ++LOCAL_MODULE := bctest ++include $(BUILD_EXECUTABLE) + + include $(CLEAR_VARS) + LOCAL_SHARED_LIBRARIES := liblog +diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c +index 1985756..c45ef6d 100644 +--- a/cmds/servicemanager/binder.c ++++ b/cmds/servicemanager/binder.c +@@ -136,7 +136,16 @@ void binder_close(struct binder_state *bs) + + int binder_become_context_manager(struct binder_state *bs) + { +- return ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); ++ int ret; ++ ret = ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); ++ if (ret < 0) { ++ fprintf(stderr,"binder_set_context_manager: ioctl FAIL (%s)\n", strerror(errno)); ++#if BCTEST_DEBUG ++ } else { ++ fprintf(stderr,"binder_set_context_manager: ioctl PASS\n"); ++#endif ++ } ++ return ret; + } + + int binder_write(struct binder_state *bs, void *data, unsigned len) +@@ -151,8 +160,12 @@ int binder_write(struct binder_state *bs, void *data, unsigned len) + bwr.read_buffer = 0; + res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr); + if (res < 0) { +- fprintf(stderr,"binder_write: ioctl failed (%s)\n", ++ fprintf(stderr,"binder_write: ioctl FAIL (%s)\n", + strerror(errno)); ++#if BCTEST_DEBUG ++ } else { ++ fprintf(stderr,"binder_write: ioctl PASS\n"); ++#endif + } + return res; + } +@@ -339,8 +352,12 @@ int binder_call(struct binder_state *bs, + res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr); + + if (res < 0) { +- fprintf(stderr,"binder: ioctl failed (%s)\n", strerror(errno)); ++ fprintf(stderr,"binder: ioctl FAIL (%s)\n", strerror(errno)); + goto fail; ++#if BCTEST_DEBUG ++ } else { ++ fprintf(stderr,"binder: ioctl PASS\n"); ++#endif + } + + res = binder_parse(bs, reply, readbuf, bwr.read_consumed, 0); +@@ -376,7 +393,14 @@ void binder_loop(struct binder_state *bs, binder_handler func) + + if (res < 0) { + ALOGE("binder_loop: ioctl failed (%s)\n", strerror(errno)); ++#if BCTEST_DEBUG ++ fprintf(stderr,"binder_loop: ioctl FAIL (%s)\n", strerror(errno)); ++#endif + break; ++#if BCTEST_DEBUG ++ } else { ++ fprintf(stderr,"binder_loop: ioctl PASS\n"); ++#endif + } + + res = binder_parse(bs, 0, readbuf, bwr.read_consumed, func); +-- +1.7.9.5 + diff --git a/frameworks/native/native.git-5.patch b/frameworks/native/native.git-5.patch new file mode 100644 index 0000000..289ceec --- /dev/null +++ b/frameworks/native/native.git-5.patch @@ -0,0 +1,33 @@ +From 5b26de0b29013f2da4b2bf20268df2a3a1d8d184 Mon Sep 17 00:00:00 2001 +From: Amit Pundir +Date: Wed, 6 Nov 2013 10:30:48 +0530 +Subject: [PATCH] libEGL: use s/w rendering on h/w with no GPU + +Fallback to Software Renderer used for emulators if we are running +on a hardware with no GPU support. + +Change-Id: Id0772f466b5a08f90e7f9eceeb9b8f5f69179539 +Signed-off-by: Amit Pundir +--- + opengl/libs/EGL/Loader.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp +index 02914a0..7c4822c 100644 +--- a/opengl/libs/EGL/Loader.cpp ++++ b/opengl/libs/EGL/Loader.cpp +@@ -86,6 +86,11 @@ checkGlesEmulationStatus(void) + char prop[PROPERTY_VALUE_MAX]; + int result = -1; + ++ /* Running on a hardware with no GPU? */ ++ property_get("ro.nohardwaregfx",prop,"false"); ++ if (!strcmp(prop,"true")) ++ return 0; ++ + /* First, check for qemu=1 */ + property_get("ro.kernel.qemu",prop,"0"); + if (atoi(prop) != 1) +-- +1.7.9.5 + -- cgit v1.2.3