summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-20 07:28:17 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-20 07:28:17 +0000
commit26b0d995f39c645117d902e73a08139bd400e631 (patch)
treea39a6c4d0f1c19cea52ff32a4daa64d79c2ce716
parentaf4c0f419f5f242872927a87898c17605553b82a (diff)
parent209b465e277c15a0344d99790300583515c5d965 (diff)
downloadmarlin-26b0d995f39c645117d902e73a08139bd400e631.tar.gz
release-request-8a29fe1b-a466-48e3-824a-9b3737e5c08a-for-git_oc-release-4115999 snap-temp-L30600000075741665
Change-Id: I0aaf061af6a1c09cec529b9eaeaac5271a62e242
-rw-r--r--camera/QCamera2/HAL3/QCamera3Channel.cpp21
-rwxr-xr-xdumpstate/DumpstateDevice.cpp5
-rw-r--r--sepolicy/file.te3
-rw-r--r--sepolicy/genfs_contexts5
-rw-r--r--sepolicy/hal_dumpstate_impl.te7
-rw-r--r--sepolicy/hal_gnss_default.te14
-rw-r--r--sepolicy/hal_wifi.te7
7 files changed, 61 insertions, 1 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3Channel.cpp b/camera/QCamera2/HAL3/QCamera3Channel.cpp
index eced9389..df38002e 100644
--- a/camera/QCamera2/HAL3/QCamera3Channel.cpp
+++ b/camera/QCamera2/HAL3/QCamera3Channel.cpp
@@ -841,7 +841,26 @@ void QCamera3ProcessingChannel::streamCbRoutine(mm_camera_super_buf_t *super_fra
if (mOutOfSequenceBuffers.empty()) {
stream->cancelBuffer(oldestBufIndex);
}
- mOutOfSequenceBuffers.push_back(super_frame);
+
+ //push in order!
+ auto itr = mOutOfSequenceBuffers.begin();
+ for (; itr != mOutOfSequenceBuffers.end(); itr++) {
+ mm_camera_super_buf_t *super_buf = *itr;
+ uint32_t buf_idx = super_buf->bufs[0]->buf_idx;
+ int32_t frame_num = mMemory.getFrameNumber(buf_idx);
+ if (resultFrameNumber < frame_num) {
+ LOGE("Out of order frame!! set buffer status error flag!");
+ mOutOfSequenceBuffers.insert(itr, super_frame);
+ super_buf->bufs[0]->flags |= V4L2_BUF_FLAG_ERROR;
+ break;
+ }
+ }
+
+ if (itr == mOutOfSequenceBuffers.end()) {
+ LOGE("Add the frame to the end of mOutOfSequenceBuffers");
+ // add the buffer
+ mOutOfSequenceBuffers.push_back(super_frame);
+ }
return;
}
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index daf27d27..445e777e 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -109,8 +109,13 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
DumpFileToFd(fd, "CPU present", "/sys/devices/system/cpu/present");
DumpFileToFd(fd, "CPU online", "/sys/devices/system/cpu/online");
DumpFileToFd(fd, "INTERRUPTS", "/proc/interrupts");
+
DumpFileToFd(fd, "RPM Stats", "/d/rpm_stats");
DumpFileToFd(fd, "Power Management Stats", "/d/rpm_master_stats");
+ DumpFileToFd(fd, "WLAN Power Stats", "/d/wlan_wcnss/power_stats");
+ DumpFileToFd(fd, "Runtime-PM Stats", "/d/cnss_runtime_pm");
+ DumpFileToFd(fd, "CNSS Pre-Alloc", "/d/cnss-prealloc/status");
+
DumpFileToFd(fd, "SMD Log", "/d/ipc_logging/smd/log");
RunCommandToFd(fd, "ION HEAPS", {"/vendor/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"});
DumpFileToFd(fd, "dmabuf info", "/d/dma_buf/bufinfo");
diff --git a/sepolicy/file.te b/sepolicy/file.te
index 7a0f5621..54886403 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -49,6 +49,9 @@ type debugfs_mdp, debugfs_type, fs_type;
type debugfs_ion, debugfs_type, fs_type;
type debugfs_qsee_log, debugfs_type, fs_type;
type debugfs_usb, debugfs_type, fs_type;
+type debugfs_wlan, debugfs_type, fs_type;
+type debugfs_runtime_pm, debugfs_type, fs_type;
+type debugfs_cnss, debugfs_type, fs_type;
# /proc
type proc_kernel_sched, fs_type;
diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts
index 6b896dff..b31401a7 100644
--- a/sepolicy/genfs_contexts
+++ b/sepolicy/genfs_contexts
@@ -13,3 +13,8 @@ genfscon proc /debug/fwdump u:object_r:proc_wifi_dbg:s
genfscon proc /debugdriver/driverdump u:object_r:proc_wifi_dbg:s0
genfscon debugfs /kgsl/proc u:object_r:debugfs_kgsl:s0
+
+# debugfs
+genfscon debugfs /cnss_runtime_pm u:object_r:debugfs_runtime_pm:s0
+genfscon debugfs /cnss-prealloc/status u:object_r:debugfs_cnss:s0
+genfscon debugfs /wlan_wcnss u:object_r:debugfs_wlan:s0 \ No newline at end of file
diff --git a/sepolicy/hal_dumpstate_impl.te b/sepolicy/hal_dumpstate_impl.te
index b8dbc9b0..08f6d2aa 100644
--- a/sepolicy/hal_dumpstate_impl.te
+++ b/sepolicy/hal_dumpstate_impl.te
@@ -31,6 +31,13 @@ allow hal_dumpstate_impl sysfs:dir r_dir_perms;
# rpm stat
allow hal_dumpstate_impl debugfs_rpm:file r_file_perms;
allow hal_dumpstate_impl debugfs_bufinfo:file r_file_perms;
+# wlan power stats
+allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms;
+allow hal_dumpstate_impl debugfs_wlan:file r_file_perms;
+# runtime-pm
+allow hal_dumpstate_impl debugfs_runtime_pm:file r_file_perms;
+# cnss
+allow hal_dumpstate_impl debugfs_cnss:file r_file_perms;
# qsee_logger
allow hal_dumpstate_impl qsee_logger_exec:file rx_file_perms;
allow hal_dumpstate_impl debugfs_qsee_log:file r_file_perms;
diff --git a/sepolicy/hal_gnss_default.te b/sepolicy/hal_gnss_default.te
index 80f38e7c..9167ab9b 100644
--- a/sepolicy/hal_gnss_default.te
+++ b/sepolicy/hal_gnss_default.te
@@ -5,6 +5,7 @@ allow hal_gnss_default per_mgr_service:service_manager find;
allow hal_gnss_default location_data_file:dir { search write };
allow hal_gnss_default location_data_file:fifo_file { open read setattr write };
allow hal_gnss_default location:unix_stream_socket connectto;
+allow hal_gnss_default location_data_file:dir rw_dir_perms;
allow hal_gnss_default location_data_file:sock_file write;
# for SUPL/911 related compliance cases
@@ -12,3 +13,16 @@ allow hal_gnss_default netmgrd:unix_stream_socket connectto;
allow hal_gnss_default netmgrd_socket:dir search;
allow hal_gnss_default netmgrd_socket:sock_file write;
allow hal_gnss_default self:netlink_route_socket { bind create nlmsg_read read write };
+
+# Most HALs are not allowed to use network sockets. Qcom library
+# libqdi is used across multiple processes which are clients of
+# netmgrd including the GNSS HAL. libqdi first attempts to get the network
+# interface using an IOCTL on a UDP INET socket, which isn't allowed here.
+# If that fails, it falls back to using libc's if_nameindex() which requires
+# a netlink route socket, which HALs may use. Due to the initial
+# attempt to use a UDP socket, we still see a selinux denial,
+# but it is safe to ignore.
+# TODO (b/37730994) Remove udp_socket requirement from
+# libqdi and have all its clients use netlink route
+# sockets.
+dontaudit hal_gnss_default self:udp_socket create;
diff --git a/sepolicy/hal_wifi.te b/sepolicy/hal_wifi.te
index bd7ebc1a..1983a95f 100644
--- a/sepolicy/hal_wifi.te
+++ b/sepolicy/hal_wifi.te
@@ -8,3 +8,10 @@ allow hal_wifi location_data_file:{ file fifo_file } create_file_perms;
# Allow wifi hal to read debug info from the driver.
r_dir_file(hal_wifi, proc_wifi_dbg)
+
+userdebug_or_eng(`
+# debugfs entries are only needed in user-debug or eng builds
+
+# Allow wifi hal to access wlan debugfs files and directories
+allow hal_wifi debugfs_wlan:dir r_dir_perms;
+')