Skip to content

Instantly share code, notes, and snippets.

@xenon92
Last active July 7, 2017 10:48
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save xenon92/4d1867360b4ef212e042 to your computer and use it in GitHub Desktop.
Patches to Paranoid Android for Samsung Galaxy Grand Duos GT-i9082

Paranoid Android

Patches (android Kitkat)

####Samsung Galaxy Grand Duos GT-i9082

  • The path of the patch is mentioned in the file name of the patch
  • Patch to "vendor/pa" is redundant now as this commit as been merged in the Paranoid Android Legacy repository upstream
  • Patches can be merged using "git am filename.patch"
From 422d2b3dc8b3dc24e1e2ba9d9852e8e50d7048ad Mon Sep 17 00:00:00 2001
From: Shubhang <shubhang92@gmail.com>
Date: Sun, 13 Apr 2014 15:32:36 +0530
Subject: [PATCH] Enable ROM build with Linaro 4.7
Change-Id: I5bad284239533dad03d62a2ac770b2ad958af893
---
core/combo/TARGET_linux-arm.mk | 2 +-
envsetup.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index ae6623c..d6496c6 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -49,7 +49,7 @@ include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
-TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)
+TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/linaro47
TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/arm-linux-androideabi-
endif
diff --git a/envsetup.sh b/envsetup.sh
index faf060b..9df485a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -152,7 +152,7 @@ function setpaths()
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
- arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
+ arm) toolchaindir=arm/linaro47/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
@@ -168,7 +168,7 @@ function setpaths()
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
- toolchaindir=arm/arm-eabi-$targetgccversion/bin
+ toolchaindir=arm/linaro47/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
--
1.9.2
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)
From 0adf8dfc02fc982ae89e794ee9216f2149e9634e Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 17 Dec 2013 13:15:52 +0700
Subject: [PATCH 2/3] OMXCodec: set default input buffer size
Broadcom OMX only set the buffer size to 65536 by default which
is not enough for higher bitrate video
Change-Id: I74372f3d821e41feb38b9bc0cca4ef56aa019493
---
media/libstagefright/OMXCodec.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index fa4643f..02c45b5 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -801,6 +801,18 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
setMinBufferSize(kPortIndexInput, (OMX_U32)maxInputSize);
}
+// Capri's OMX fail to set a reasonable default size from width and height
+#ifdef CAPRI_HWC
+ else {
+ int32_t width;
+ int32_t height;
+ if (meta->findInt32(kKeyWidth, &width) && meta->findInt32(kKeyHeight, &height)) {
+ setMinBufferSize(kPortIndexInput, (width * height * 3) / 2);
+ } else {
+ ALOGE("Failed to set min buffer size");
+ }
+ }
+#endif
initOutputFormat(meta);
--
1.8.3.4 (Apple Git-47)
From 3a374db88238ae39b0a38498f49f8327870edc90 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Mon, 23 Dec 2013 18:41:44 +0700
Subject: [PATCH 3/3] OMXCodec: set default input buffer size only for BCM
decoder
Change-Id: Ic554343069b47a4b66ea9e8daee684d4923ecd98
---
media/libstagefright/OMXCodec.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 02c45b5..5d48f39 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -803,7 +803,7 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
}
// Capri's OMX fail to set a reasonable default size from width and height
#ifdef CAPRI_HWC
- else {
+ else if (!strncmp(mComponentName, "OMX.BRCM.vc4.decoder.", 21)) {
int32_t width;
int32_t height;
if (meta->findInt32(kKeyWidth, &width) && meta->findInt32(kKeyHeight, &height)) {
--
1.8.3.4 (Apple Git-47)
From 31518ae60f839087b56d93063494f541c2ac0ef4 Mon Sep 17 00:00:00 2001
From: Shubhang <shubhang92@gmail.com>
Date: Tue, 21 Jan 2014 23:27:53 +0530
Subject: [PATCH] I9082: fix hwc issues
This is just a rebase on Carbon Kitkat
Original patch for CM11- https://gist.github.com/pawitp/7891444
Credits to pawitp for the patch
Change-Id: Ib6520123f1e7bcdcb2ec8c73fe1d98e85c26fd1d
---
libs/binder/Parcel.cpp | 12 ++++++++++++
services/surfaceflinger/DisplayHardware/HWComposer.cpp | 5 +++++
services/surfaceflinger/Layer.cpp | 3 +++
services/surfaceflinger/SurfaceFlinger.cpp | 9 +++++++++
4 files changed, 29 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
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 02c8f9b..dc14bdc 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -1178,13 +1178,18 @@ public:
//getLayer()->compositionType = HWC_FRAMEBUFFER;
}
virtual void setPlaneAlpha(uint8_t alpha) {
+// CAPRI_HWC does not respect planeAlpha despite being v1.2
+#ifndef CAPRI_HWC
if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_2)) {
getLayer()->planeAlpha = alpha;
} else {
+#endif
if (alpha < 0xFF) {
getLayer()->flags |= HWC_SKIP_LAYER;
}
+#ifndef CAPRI_HWC
}
+#endif
}
virtual void setDefaultState() {
hwc_layer_1_t* const l = getLayer();
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 75fca20..05aa131 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1186,6 +1186,8 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const
void Layer::updateTransformHint(const sp<const DisplayDevice>& hw) const {
uint32_t orientation = 0;
+// CAPRI_HWC has display problem in landscape mode when transform is used
+#ifndef CAPRI_HWC
if (!mFlinger->mDebugDisableTransformHint) {
// The transform hint is used to improve performance, but we can
// only have a single transform hint, it cannot
@@ -1196,6 +1198,7 @@ void Layer::updateTransformHint(const sp<const DisplayDevice>& hw) const {
orientation = 0;
}
}
+#endif
mSurfaceFlingerConsumer->setTransformHint(orientation);
}
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 339e798..ffe94a9 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1108,6 +1108,7 @@ void SurfaceFlinger::setUpHWComposer() {
sp<const DisplayDevice> hw(mDisplays[dpy]);
const int32_t id = hw->getHwcDisplayId();
if (id >= 0) {
+#ifdef QCOM_HARDWARE
// Get the layers in the current drawying state
const LayerVector& layers(mDrawingState.layersSortedByZ);
bool freezeSurfacePresent = false;
@@ -1127,6 +1128,7 @@ void SurfaceFlinger::setUpHWComposer() {
}
}
}
+#endif
const Vector< sp<Layer> >& currentLayers(
hw->getVisibleLayersSortedByZ());
@@ -1140,6 +1142,7 @@ void SurfaceFlinger::setUpHWComposer() {
*/
const sp<Layer>& layer(currentLayers[i]);
layer->setPerFrameData(hw, *cur);
+#ifdef QCOM_HARDWARE
if(freezeSurfacePresent) {
// if freezeSurfacePresent, set ANIMATING flag
cur->setAnimating(true);
@@ -1160,6 +1163,7 @@ void SurfaceFlinger::setUpHWComposer() {
}
}
}
+#endif
}
}
}
@@ -3157,6 +3161,11 @@ status_t SurfaceFlinger::captureScreenImplLocked(
{
ATRACE_CALL();
+// Rotation artifact problems when useReadPixels is false
+#ifdef CAPRI_HWC
+ useReadPixels = true;
+#endif
+
// get screen geometry
const uint32_t hw_w = hw->getWidth();
const uint32_t hw_h = hw->getHeight();
--
1.8.5.2
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)
From 0de87b38af49d6b9a1bcd067d40ebce25dc77d35 Mon Sep 17 00:00:00 2001
From: Shubhang <shubhang92@gmail.com>
Date: Sat, 3 May 2014 21:33:50 +0530
Subject: [PATCH] pa: add Samsung Galaxy Grand GT-i9082
Change-Id: I39c78dc5738a1ab0f1293be2b713c223a3fac819
---
configs/bootanimation.mk | 2 +-
products/AndroidProducts.mk | 3 +++
products/pa_i9082.mk | 41 +++++++++++++++++++++++++++++++++++++++++
vendorsetup.sh | 1 +
4 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 products/pa_i9082.mk
diff --git a/configs/bootanimation.mk b/configs/bootanimation.mk
index 99a11ff..3f4c981 100644
--- a/configs/bootanimation.mk
+++ b/configs/bootanimation.mk
@@ -29,7 +29,7 @@ ifneq ($(filter pa_edison pa_maserasti pa_spyder pa_targa pa_umts_spyder pa_hika
endif
# PA HDPI Devices
-ifneq ($(filter pa_galaxysmtd pa_i9100 pa_i9100g pa_serrano3gxx pa_serranoltexx,$(TARGET_PRODUCT)),)
+ifneq ($(filter pa_galaxysmtd pa_i9082 pa_i9100 pa_i9100g pa_serrano3gxx pa_serranoltexx,$(TARGET_PRODUCT)),)
PRODUCT_COPY_FILES += \
vendor/pa/prebuilt/bootanimation/800x480.zip:system/media/bootanimation.zip
endif
diff --git a/products/AndroidProducts.mk b/products/AndroidProducts.mk
index 0b35409..e11ec2d 100644
--- a/products/AndroidProducts.mk
+++ b/products/AndroidProducts.mk
@@ -78,6 +78,9 @@ endif
ifeq (pa_i605,$(TARGET_PRODUCT))
PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_i605.mk
endif
+ifeq (pa_i9082,$(TARGET_PRODUCT))
+ PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_i9082.mk
+endif
ifeq (pa_i9100,$(TARGET_PRODUCT))
PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_i9100.mk
endif
diff --git a/products/pa_i9082.mk b/products/pa_i9082.mk
new file mode 100644
index 0000000..650f71a
--- /dev/null
+++ b/products/pa_i9082.mk
@@ -0,0 +1,41 @@
+# Copyright (C) 2013 ParanoidAndroid Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Check for target product
+ifeq (pa_i9082,$(TARGET_PRODUCT))
+
+# OVERLAY_TARGET adds overlay asset source
+OVERLAY_TARGET := pa_hdpi
+
+# Build paprefs from sources
+PREFS_FROM_SOURCE ?= false
+
+# Inherit telephony common stuff
+$(call inherit-product, vendor/pa/configs/telephony.mk)
+
+# Include ParanoidAndroid common configuration
+include vendor/pa/main.mk
+
+# Inherit AOSP device configuration
+$(call inherit-product, device/samsung/i9082/full_i9082.mk)
+
+# Override AOSP build properties
+PRODUCT_NAME := pa_i9082
+PRODUCT_BRAND := samsung
+PRODUCT_MANUFACTURER := samsung
+PRODUCT_MODEL := GT-I9082
+
+#Set build fingerprint / ID / Prduct Name ect.
+PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=baffinvj TARGET_DEVICE=baffin BUILD_FINGERPRINT=samsung/baffinvj/baffin:4.1.2/JZO54K/I9082LDCAMC2:user/release-keys PRIVATE_BUILD_DESC="baffinvj-user 4.1.2 JZO54K I9082LDCAMC2 release-keys"
+endif
diff --git a/vendorsetup.sh b/vendorsetup.sh
index f150fbe..0e69ab2 100644
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -20,6 +20,7 @@ add_lunch_combo pa_hikari-userdebug
add_lunch_combo pa_hlte-userdebug
add_lunch_combo pa_honami-userdebug
add_lunch_combo pa_i605-userdebug
+add_lunch_combo pa_i9082-userdebug
add_lunch_combo pa_i9100-userdebug
add_lunch_combo pa_i9100g-userdebug
add_lunch_combo pa_i9300-userdebug
--
1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment