Sync up to v216

This commit is contained in:
Andy CrossGate Yan 2020-05-11 03:29:26 +00:00
parent d1718561d3
commit 23b58fa57f
11 changed files with 565 additions and 31 deletions

View File

@ -0,0 +1,36 @@
From 1c4a894af6bb803164eb43f7dd7ae32fcdd24dbf Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 12 Apr 2020 16:11:09 +0200
Subject: [PATCH 14/21] Ignore unknown audio codecs in media profiles'
AudioEncoder Cap
---
media/libmedia/MediaProfiles.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 98c54971ad..08d0199a07 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -300,6 +300,7 @@ MediaProfiles::createAudioEncoderCap(const char **atts)
const size_t nMappings = sizeof(sAudioEncoderNameMap)/sizeof(sAudioEncoderNameMap[0]);
const int codec = findTagForName(sAudioEncoderNameMap, nMappings, atts[1]);
+ if(codec == -1) return nullptr;
CHECK(codec != -1);
MediaProfiles::AudioEncoderCap *cap =
@@ -419,7 +420,9 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
profiles->mVideoEncoders.add(createVideoEncoderCap(atts));
} else if (strcmp("AudioEncoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- profiles->mAudioEncoders.add(createAudioEncoderCap(atts));
+ MediaProfiles::AudioEncoderCap* cap = createAudioEncoderCap(atts);
+ if(cap != nullptr)
+ profiles->mAudioEncoders.add(cap);
} else if (strcmp("VideoDecoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
profiles->mVideoDecoders.add(createVideoDecoderCap(atts));
--
2.17.1

View File

@ -0,0 +1,45 @@
From b37ac3beb32e99e1517f3baf7efd98b0b8c80b8a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 13 Apr 2020 21:01:16 +0200
Subject: [PATCH 15/21] There are three SCO devices. Fallback from one to the
others if needed
---
.../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
index 1f9b725a24..ecba6023dd 100644
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -294,6 +294,27 @@ sp <HwModule> HwModuleCollection::getModuleForDeviceTypes(audio_devices_t type,
}
}
}
+ //We didn't find one? Ok but all SCOs are equivalent surely?
+ if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ ALOGE("Fallback SCO");
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
+ ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
+ ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ auto ret = getModuleForDeviceTypes(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ }
return nullptr;
}
--
2.17.1

View File

@ -0,0 +1,42 @@
From 7f6429fa4982c534ba6c0fd3cfd2eba1e8ffe80d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 17 Apr 2020 23:15:08 +0200
Subject: [PATCH 16/21] Ignore broken camcorder profiles
---
media/libmedia/MediaProfiles.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 08d0199a07..0944c973db 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -341,10 +341,12 @@ MediaProfiles::createCamcorderProfile(int cameraId, const char **atts, Vector<in
const size_t nProfileMappings = sizeof(sCamcorderQualityNameMap)/
sizeof(sCamcorderQualityNameMap[0]);
const int quality = findTagForName(sCamcorderQualityNameMap, nProfileMappings, atts[1]);
+ if(quality == -1) return nullptr;
CHECK(quality != -1);
const size_t nFormatMappings = sizeof(sFileFormatMap)/sizeof(sFileFormatMap[0]);
const int fileFormat = findTagForName(sFileFormatMap, nFormatMappings, atts[3]);
+ if(fileFormat == -1) return nullptr;
CHECK(fileFormat != -1);
MediaProfiles::CamcorderProfile *profile = new MediaProfiles::CamcorderProfile;
@@ -435,8 +437,10 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
profiles->mCurrentCameraId = getCameraId(atts);
profiles->addStartTimeOffset(profiles->mCurrentCameraId, atts);
} else if (strcmp("EncoderProfile", name) == 0) {
- profiles->mCamcorderProfiles.add(
- createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds));
+ MediaProfiles::CamcorderProfile* profile = createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds);
+ if(profile != nullptr) {
+ profiles->mCamcorderProfiles.add(profile);
+ }
} else if (strcmp("ImageEncoding", name) == 0) {
profiles->addImageEncodingQualityLevel(profiles->mCurrentCameraId, atts);
}
--
2.17.1

View File

@ -0,0 +1,45 @@
From 30a73a881ec671fd02fc25a3e38838bbe1454813 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 29 Apr 2020 00:15:49 +0200
Subject: [PATCH 17/21] Revert "Ignore broken camcorder profiles"
This reverts commit 5caabfcd03ca00211a0419ec3c04cff1a4efcf9e.
Will use upstream's better alternative
---
media/libmedia/MediaProfiles.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 0944c973db..08d0199a07 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -341,12 +341,10 @@ MediaProfiles::createCamcorderProfile(int cameraId, const char **atts, Vector<in
const size_t nProfileMappings = sizeof(sCamcorderQualityNameMap)/
sizeof(sCamcorderQualityNameMap[0]);
const int quality = findTagForName(sCamcorderQualityNameMap, nProfileMappings, atts[1]);
- if(quality == -1) return nullptr;
CHECK(quality != -1);
const size_t nFormatMappings = sizeof(sFileFormatMap)/sizeof(sFileFormatMap[0]);
const int fileFormat = findTagForName(sFileFormatMap, nFormatMappings, atts[3]);
- if(fileFormat == -1) return nullptr;
CHECK(fileFormat != -1);
MediaProfiles::CamcorderProfile *profile = new MediaProfiles::CamcorderProfile;
@@ -437,10 +435,8 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
profiles->mCurrentCameraId = getCameraId(atts);
profiles->addStartTimeOffset(profiles->mCurrentCameraId, atts);
} else if (strcmp("EncoderProfile", name) == 0) {
- MediaProfiles::CamcorderProfile* profile = createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds);
- if(profile != nullptr) {
- profiles->mCamcorderProfiles.add(profile);
- }
+ profiles->mCamcorderProfiles.add(
+ createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds));
} else if (strcmp("ImageEncoding", name) == 0) {
profiles->addImageEncodingQualityLevel(profiles->mCurrentCameraId, atts);
}
--
2.17.1

View File

@ -0,0 +1,37 @@
From 3e491a01db93c380807138228337102ffcf6893a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 29 Apr 2020 00:17:01 +0200
Subject: [PATCH 18/21] Revert "Ignore unknown audio codecs in media profiles'
AudioEncoder Cap"
This reverts commit ee00227dc5ddfc88b13fa37ba96f846950c03b4e.
---
media/libmedia/MediaProfiles.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 08d0199a07..98c54971ad 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -300,7 +300,6 @@ MediaProfiles::createAudioEncoderCap(const char **atts)
const size_t nMappings = sizeof(sAudioEncoderNameMap)/sizeof(sAudioEncoderNameMap[0]);
const int codec = findTagForName(sAudioEncoderNameMap, nMappings, atts[1]);
- if(codec == -1) return nullptr;
CHECK(codec != -1);
MediaProfiles::AudioEncoderCap *cap =
@@ -420,9 +419,7 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
profiles->mVideoEncoders.add(createVideoEncoderCap(atts));
} else if (strcmp("AudioEncoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- MediaProfiles::AudioEncoderCap* cap = createAudioEncoderCap(atts);
- if(cap != nullptr)
- profiles->mAudioEncoders.add(cap);
+ profiles->mAudioEncoders.add(createAudioEncoderCap(atts));
} else if (strcmp("VideoDecoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
profiles->mVideoDecoders.add(createVideoDecoderCap(atts));
--
2.17.1

View File

@ -0,0 +1,140 @@
From 3a0b6a588a9cf02fdc5b47644ed446687469a025 Mon Sep 17 00:00:00 2001
From: Alex Zhang <difan@google.com>
Date: Fri, 17 Apr 2020 16:08:24 -0700
Subject: [PATCH 19/21] Allow graceful degradation of MediaProfile with broken
configuration.
Currently, when media profile declares something unsupported / broken,
MediaProfile will crash. This patch will change the behavior to
gracefully degradation instead. b/147701370 is an example IRL. If
vendor declares profile unsupported in AOSP, Treble firmware will crash
instead of having a non-working or suboptimally working camera.
Test: Compiles
Signed-off-by: Alex Zhang <difan@google.com>
Change-Id: Icc0f85fe0aac748be4d4f7dd94814f615d528a03
---
media/libmedia/MediaProfiles.cpp | 42 +++++++++++++++++++++-----------
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 98c54971ad..366d90de9e 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -194,7 +194,7 @@ MediaProfiles::createVideoCodec(const char **atts, MediaProfiles *profiles)
const size_t nMappings = sizeof(sVideoEncoderNameMap)/sizeof(sVideoEncoderNameMap[0]);
const int codec = findTagForName(sVideoEncoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::VideoCodec *videoCodec =
new MediaProfiles::VideoCodec(static_cast<video_encoder>(codec),
@@ -216,7 +216,7 @@ MediaProfiles::createAudioCodec(const char **atts, MediaProfiles *profiles)
!strcmp("channels", atts[6]));
const size_t nMappings = sizeof(sAudioEncoderNameMap)/sizeof(sAudioEncoderNameMap[0]);
const int codec = findTagForName(sAudioEncoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::AudioCodec *audioCodec =
new MediaProfiles::AudioCodec(static_cast<audio_encoder>(codec),
@@ -236,7 +236,7 @@ MediaProfiles::createAudioDecoderCap(const char **atts)
const size_t nMappings = sizeof(sAudioDecoderNameMap)/sizeof(sAudioDecoderNameMap[0]);
const int codec = findTagForName(sAudioDecoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::AudioDecoderCap *cap =
new MediaProfiles::AudioDecoderCap(static_cast<audio_decoder>(codec));
@@ -252,7 +252,7 @@ MediaProfiles::createVideoDecoderCap(const char **atts)
const size_t nMappings = sizeof(sVideoDecoderNameMap)/sizeof(sVideoDecoderNameMap[0]);
const int codec = findTagForName(sVideoDecoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::VideoDecoderCap *cap =
new MediaProfiles::VideoDecoderCap(static_cast<video_decoder>(codec));
@@ -276,7 +276,7 @@ MediaProfiles::createVideoEncoderCap(const char **atts)
const size_t nMappings = sizeof(sVideoEncoderNameMap)/sizeof(sVideoEncoderNameMap[0]);
const int codec = findTagForName(sVideoEncoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::VideoEncoderCap *cap =
new MediaProfiles::VideoEncoderCap(static_cast<video_encoder>(codec),
@@ -300,7 +300,7 @@ MediaProfiles::createAudioEncoderCap(const char **atts)
const size_t nMappings = sizeof(sAudioEncoderNameMap)/sizeof(sAudioEncoderNameMap[0]);
const int codec = findTagForName(sAudioEncoderNameMap, nMappings, atts[1]);
- CHECK(codec != -1);
+ if (codec == -1) return nullptr;
MediaProfiles::AudioEncoderCap *cap =
new MediaProfiles::AudioEncoderCap(static_cast<audio_encoder>(codec), atoi(atts[5]),
@@ -340,11 +340,11 @@ MediaProfiles::createCamcorderProfile(int cameraId, const char **atts, Vector<in
const size_t nProfileMappings = sizeof(sCamcorderQualityNameMap)/
sizeof(sCamcorderQualityNameMap[0]);
const int quality = findTagForName(sCamcorderQualityNameMap, nProfileMappings, atts[1]);
- CHECK(quality != -1);
+ if (quality == -1) return nullptr;
const size_t nFormatMappings = sizeof(sFileFormatMap)/sizeof(sFileFormatMap[0]);
const int fileFormat = findTagForName(sFileFormatMap, nFormatMappings, atts[3]);
- CHECK(fileFormat != -1);
+ if (fileFormat == -1) return nullptr;
MediaProfiles::CamcorderProfile *profile = new MediaProfiles::CamcorderProfile;
profile->mCameraId = cameraId;
@@ -416,24 +416,38 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
createAudioCodec(atts, profiles);
} else if (strcmp("VideoEncoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- profiles->mVideoEncoders.add(createVideoEncoderCap(atts));
+ MediaProfiles::VideoEncoderCap* cap = createVideoEncoderCap(atts);
+ if (cap != nullptr) {
+ profiles->mVideoEncoders.add(cap);
+ }
} else if (strcmp("AudioEncoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- profiles->mAudioEncoders.add(createAudioEncoderCap(atts));
+ MediaProfiles::AudioEncoderCap* cap = createAudioEncoderCap(atts);
+ if (cap != nullptr) {
+ profiles->mAudioEncoders.add(cap);
+ }
} else if (strcmp("VideoDecoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- profiles->mVideoDecoders.add(createVideoDecoderCap(atts));
+ MediaProfiles::VideoDecoderCap* cap = createVideoDecoderCap(atts);
+ if (cap != nullptr) {
+ profiles->mVideoDecoders.add(cap);
+ }
} else if (strcmp("AudioDecoderCap", name) == 0 &&
strcmp("true", atts[3]) == 0) {
- profiles->mAudioDecoders.add(createAudioDecoderCap(atts));
+ MediaProfiles::AudioDecoderCap* cap = createAudioDecoderCap(atts);
+ if (cap != nullptr) {
+ profiles->mAudioDecoders.add(cap);
+ }
} else if (strcmp("EncoderOutputFileFormat", name) == 0) {
profiles->mEncoderOutputFileFormats.add(createEncoderOutputFileFormat(atts));
} else if (strcmp("CamcorderProfiles", name) == 0) {
profiles->mCurrentCameraId = getCameraId(atts);
profiles->addStartTimeOffset(profiles->mCurrentCameraId, atts);
} else if (strcmp("EncoderProfile", name) == 0) {
- profiles->mCamcorderProfiles.add(
- createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds));
+ MediaProfiles::CamcorderProfile* profile = createCamcorderProfile(profiles->mCurrentCameraId, atts, profiles->mCameraIds);
+ if (profile != nullptr) {
+ profiles->mCamcorderProfiles.add(profile);
+ }
} else if (strcmp("ImageEncoding", name) == 0) {
profiles->addImageEncodingQualityLevel(profiles->mCurrentCameraId, atts);
}
--
2.17.1

View File

@ -0,0 +1,87 @@
From cc25640b4712cd8eb8e98829bf523f2786fbb5ca Mon Sep 17 00:00:00 2001
From: Marcus Huang <marcus.huang@mediatek.com>
Date: Fri, 18 Oct 2019 15:51:35 +0800
Subject: [PATCH 20/21] Fix android.media.cts.ImageReaderDecoderTest fail on
MT6580 project
Root Cause:
Google C2 H264/H265 decoder request 64-aligned stride from graphic block; but ARM GPU would return
with 128-aligned stride when input height ONLY satisfies 2-aligned (e.g. 130).
Solution:
Revise stride alignment from 64 to 128 of C2 H264/H265 decoder
Bug: 142924202
Test: Build C2 Codec
Test:
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH264Image
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH264ImageReader
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH265Image
run cts -m CtsMediaTestCases -t android.media.cts.ImageReaderDecoderTest#testGoogH265ImageReader
Change-Id: I6eaff1b858e031b64744bc67d8aee5cc51cfd92d
(cherry picked from commit 28af1154b5f52c1f1a3687ff099ca609218bd78a)
---
media/codec2/components/avc/C2SoftAvcDec.cpp | 4 ++--
media/codec2/components/avc/C2SoftAvcDec.h | 1 +
media/codec2/components/hevc/C2SoftHevcDec.cpp | 4 ++--
media/codec2/components/hevc/C2SoftHevcDec.h | 1 +
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/media/codec2/components/avc/C2SoftAvcDec.cpp b/media/codec2/components/avc/C2SoftAvcDec.cpp
index fa98178187..75a612276d 100644
--- a/media/codec2/components/avc/C2SoftAvcDec.cpp
+++ b/media/codec2/components/avc/C2SoftAvcDec.cpp
@@ -755,8 +755,8 @@ c2_status_t C2SoftAvcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool>
ALOGE("not supposed to be here, invalid decoder context");
return C2_CORRUPTED;
}
- if (mStride != ALIGN64(mWidth)) {
- mStride = ALIGN64(mWidth);
+ if (mStride != ALIGN128(mWidth)) {
+ mStride = ALIGN128(mWidth);
if (OK != setParams(mStride, IVD_DECODE_FRAME)) return C2_CORRUPTED;
}
if (mOutBlock &&
diff --git a/media/codec2/components/avc/C2SoftAvcDec.h b/media/codec2/components/avc/C2SoftAvcDec.h
index 4414a26c96..ed27493f32 100644
--- a/media/codec2/components/avc/C2SoftAvcDec.h
+++ b/media/codec2/components/avc/C2SoftAvcDec.h
@@ -40,6 +40,7 @@ namespace android {
#define ivdext_ctl_get_vui_params_ip_t ih264d_ctl_get_vui_params_ip_t
#define ivdext_ctl_get_vui_params_op_t ih264d_ctl_get_vui_params_op_t
#define ALIGN64(x) ((((x) + 63) >> 6) << 6)
+#define ALIGN128(x) ((((x) + 127) >> 7) << 7)
#define MAX_NUM_CORES 4
#define IVDEXT_CMD_CTL_SET_NUM_CORES \
(IVD_CONTROL_API_COMMAND_TYPE_T)IH264D_CMD_CTL_SET_NUM_CORES
diff --git a/media/codec2/components/hevc/C2SoftHevcDec.cpp b/media/codec2/components/hevc/C2SoftHevcDec.cpp
index df677c284e..389ea610dc 100644
--- a/media/codec2/components/hevc/C2SoftHevcDec.cpp
+++ b/media/codec2/components/hevc/C2SoftHevcDec.cpp
@@ -752,8 +752,8 @@ c2_status_t C2SoftHevcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool>
ALOGE("not supposed to be here, invalid decoder context");
return C2_CORRUPTED;
}
- if (mStride != ALIGN64(mWidth)) {
- mStride = ALIGN64(mWidth);
+ if (mStride != ALIGN128(mWidth)) {
+ mStride = ALIGN128(mWidth);
if (OK != setParams(mStride, IVD_DECODE_FRAME)) return C2_CORRUPTED;
}
if (mOutBlock &&
diff --git a/media/codec2/components/hevc/C2SoftHevcDec.h b/media/codec2/components/hevc/C2SoftHevcDec.h
index ce63a6c4c3..aecd1011de 100644
--- a/media/codec2/components/hevc/C2SoftHevcDec.h
+++ b/media/codec2/components/hevc/C2SoftHevcDec.h
@@ -38,6 +38,7 @@ namespace android {
#define ivdext_ctl_get_vui_params_ip_t ihevcd_cxa_ctl_get_vui_params_ip_t
#define ivdext_ctl_get_vui_params_op_t ihevcd_cxa_ctl_get_vui_params_op_t
#define ALIGN64(x) ((((x) + 63) >> 6) << 6)
+#define ALIGN128(x) ((((x) + 127) >> 7) << 7)
#define MAX_NUM_CORES 4
#define IVDEXT_CMD_CTL_SET_NUM_CORES \
(IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_NUM_CORES
--
2.17.1

View File

@ -0,0 +1,61 @@
From 12e2bc3a80b81c0b399ec5d0c3b1ddead5085fef Mon Sep 17 00:00:00 2001
From: Wonsik Kim <wonsik@google.com>
Date: Fri, 10 Jan 2020 09:59:42 -0800
Subject: [PATCH 21/21] avc/hevc: Align 128 everywhere
Bug: 142924202
Test: media module tests
Change-Id: Icef9b6b19d11bbf1ce0a2078113bfcc0a9cdc3ad
(cherry picked from commit 48dfc8c137b161cfcf652947621439deed7d9252)
---
media/codec2/components/avc/C2SoftAvcDec.cpp | 4 ++--
media/codec2/components/hevc/C2SoftHevcDec.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/media/codec2/components/avc/C2SoftAvcDec.cpp b/media/codec2/components/avc/C2SoftAvcDec.cpp
index 75a612276d..2be51dd49e 100644
--- a/media/codec2/components/avc/C2SoftAvcDec.cpp
+++ b/media/codec2/components/avc/C2SoftAvcDec.cpp
@@ -500,7 +500,7 @@ void C2SoftAvcDec::getVersion() {
status_t C2SoftAvcDec::initDecoder() {
if (OK != createDecoder()) return UNKNOWN_ERROR;
mNumCores = MIN(getCpuCoreCount(), MAX_NUM_CORES);
- mStride = ALIGN64(mWidth);
+ mStride = ALIGN128(mWidth);
mSignalledError = false;
resetPlugin();
(void) setNumCores();
@@ -908,7 +908,7 @@ void C2SoftAvcDec::process(
if (0 < s_decode_op.u4_pic_wd && 0 < s_decode_op.u4_pic_ht) {
if (mHeaderDecoded == false) {
mHeaderDecoded = true;
- setParams(ALIGN64(s_decode_op.u4_pic_wd), IVD_DECODE_FRAME);
+ setParams(ALIGN128(s_decode_op.u4_pic_wd), IVD_DECODE_FRAME);
}
if (s_decode_op.u4_pic_wd != mWidth || s_decode_op.u4_pic_ht != mHeight) {
mWidth = s_decode_op.u4_pic_wd;
diff --git a/media/codec2/components/hevc/C2SoftHevcDec.cpp b/media/codec2/components/hevc/C2SoftHevcDec.cpp
index 389ea610dc..6db4387272 100644
--- a/media/codec2/components/hevc/C2SoftHevcDec.cpp
+++ b/media/codec2/components/hevc/C2SoftHevcDec.cpp
@@ -497,7 +497,7 @@ status_t C2SoftHevcDec::getVersion() {
status_t C2SoftHevcDec::initDecoder() {
if (OK != createDecoder()) return UNKNOWN_ERROR;
mNumCores = MIN(getCpuCoreCount(), MAX_NUM_CORES);
- mStride = ALIGN64(mWidth);
+ mStride = ALIGN128(mWidth);
mSignalledError = false;
resetPlugin();
(void) setNumCores();
@@ -904,7 +904,7 @@ void C2SoftHevcDec::process(
if (0 < s_decode_op.u4_pic_wd && 0 < s_decode_op.u4_pic_ht) {
if (mHeaderDecoded == false) {
mHeaderDecoded = true;
- setParams(ALIGN64(s_decode_op.u4_pic_wd), IVD_DECODE_FRAME);
+ setParams(ALIGN128(s_decode_op.u4_pic_wd), IVD_DECODE_FRAME);
}
if (s_decode_op.u4_pic_wd != mWidth || s_decode_op.u4_pic_ht != mHeight) {
mWidth = s_decode_op.u4_pic_wd;
--
2.17.1

View File

@ -1,31 +0,0 @@
From 807d3807f81b4893cd5186c60cfcf94920281a41 Mon Sep 17 00:00:00 2001
From: Steve Kondik <steve@cyngn.com>
Date: Sat, 3 Jan 2015 05:13:26 -0800
Subject: [PATCH 16/36] power: Disable keyboard/button lights while
dozing/dreaming
* With hardkeys and doze mode enabled, entering suspend results in
an epic battle over the lights. It's a bad situation. Disable
them when we're sleepy.
Change-Id: I7f1fc35a1573717d1ea101a07c4171d6f66d1553
---
.../core/java/com/android/server/power/PowerManagerService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 5cccc77ac53..e7d5315a2b9 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -2040,7 +2040,7 @@ public final class PowerManagerService extends SystemService
final long nextProfileTimeout = getNextProfileTimeoutLocked(now);
mUserActivitySummary = 0;
- if (mLastUserActivityTime >= mLastWakeTime) {
+ if (mWakefulness == WAKEFULNESS_AWAKE && mLastUserActivityTime >= mLastWakeTime) {
nextTimeout = mLastUserActivityTime
+ screenOffTimeout - screenDimDuration;
if (now < nextTimeout) {
--
2.17.1

View File

@ -0,0 +1,25 @@
From bd6e789f55e396d1672f97f5f95761b23044e2b4 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 9 Apr 2020 22:57:47 +0200
Subject: [PATCH 58/58] Additional fod command for non-optical samsung devices
running Q vendor
---
.../com/android/server/biometrics/fingerprint/FacolaView.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
index 42f21d63430..a87f7e78af4 100644
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
@@ -307,6 +307,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
writeFile("/sys/kernel/oppo_display/dimlayer_hbm", "1");
if(samsungFod) {
samsungCmd("fod_enable,1,1");
+ samsungCmd("fod_enable,1,1,0");
}
if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
--
2.17.1

View File

@ -0,0 +1,47 @@
From 107c7e3fbff713065def6e10f11e7210929726fe Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 29 Jul 2019 18:09:12 +0200
Subject: [PATCH 2/2] Don't fail on FTP conntracking failing
The issue has been seen on some Samsung devices.
See https://github.com/phhusson/treble_experimentations/issues/425
Thanks @zamrih for pin-pointing the issue and validating fix
Change-Id: I3d9c865eb5a4b421f9983210c2ceae62b4906234
---
server/TetherController.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index 64ff80b0..2fa4a0c9 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -700,15 +700,19 @@ int TetherController::setForwardRules(bool add, const char *intIface, const char
return -EREMOTEIO;
}
- std::vector<std::string> v4 = {
-#ifndef IGNORES_FTP_PPTP_CONNTRACK_FAILURE
+ std::vector<std::string> v4Ftp = {
"*raw",
- StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp", op,
- LOCAL_RAW_PREROUTING, intIface),
+ StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp",
+ op, LOCAL_RAW_PREROUTING, intIface),
StringPrintf("%s %s -p tcp --dport 1723 -i %s -j CT --helper pptp", op,
LOCAL_RAW_PREROUTING, intIface),
"COMMIT",
-#endif
+ };
+ if(iptablesRestoreFunction(V4, Join(v4Ftp, '\n'), nullptr) == -1) {
+ ALOGE("Failed adding iptables CT target on FTP.");
+ }
+
+ std::vector<std::string> v4 = {
"*filter",
StringPrintf("%s %s -i %s -o %s -m state --state ESTABLISHED,RELATED -g %s", op,
LOCAL_FORWARD, extIface, intIface, LOCAL_TETHER_COUNTERS_CHAIN),
--
2.17.1