Merge changes from topic "b376426334-dump-display" into main
* changes: display-dump: sepolicy for new secondary display dump display-dump: sepolicy for legacy secondary display dump display-dump: sepolicy for new primary display dump display-dump: sepolicy for legacy primary display dump display-dump: update project-specific crtc sysfs node
This commit is contained in:
commit
06d1a53ceb
36 changed files with 200 additions and 54 deletions
|
@ -4,14 +4,14 @@ package {
|
||||||
|
|
||||||
sh_binary {
|
sh_binary {
|
||||||
name: "dump_display_userdebug.sh",
|
name: "dump_display_userdebug.sh",
|
||||||
src: "dump_display_userdebug.sh",
|
src: "common/dump_display_userdebug.sh",
|
||||||
vendor: true,
|
vendor: true,
|
||||||
sub_dir: "dump",
|
sub_dir: "dump",
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_binary {
|
cc_binary {
|
||||||
name: "dump_display",
|
name: "dump_exynos_display",
|
||||||
srcs: ["dump_display.cpp"],
|
srcs: ["exynos/dump_display.cpp"],
|
||||||
cflags: [
|
cflags: [
|
||||||
"-Wall",
|
"-Wall",
|
||||||
"-Wextra",
|
"-Wextra",
|
||||||
|
@ -26,8 +26,8 @@ cc_binary {
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_binary {
|
cc_binary {
|
||||||
name: "dump_second_display",
|
name: "dump_exynos_second_display",
|
||||||
srcs: ["dump_second_display.cpp"],
|
srcs: ["exynos/dump_second_display.cpp"],
|
||||||
cflags: [
|
cflags: [
|
||||||
"-Wall",
|
"-Wall",
|
||||||
"-Wextra",
|
"-Wextra",
|
||||||
|
@ -40,3 +40,33 @@ cc_binary {
|
||||||
relative_install_path: "dump",
|
relative_install_path: "dump",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cc_binary {
|
||||||
|
name: "dump_pixel_display",
|
||||||
|
srcs: ["pixel/dump_display.cpp"],
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libbase",
|
||||||
|
"libdump",
|
||||||
|
],
|
||||||
|
vendor: true,
|
||||||
|
relative_install_path: "dump",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_binary {
|
||||||
|
name: "dump_pixel_second_display",
|
||||||
|
srcs: ["pixel/dump_second_display.cpp"],
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libdump",
|
||||||
|
],
|
||||||
|
vendor: true,
|
||||||
|
relative_install_path: "dump",
|
||||||
|
}
|
||||||
|
|
4
display/dump_exynos_display.mk
Normal file
4
display/dump_exynos_display.mk
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/exynos
|
||||||
|
|
||||||
|
PRODUCT_PACKAGES_DEBUG += dump_display_userdebug.sh
|
||||||
|
PRODUCT_PACKAGES += dump_exynos_display
|
3
display/dump_exynos_second_display.mk
Normal file
3
display/dump_exynos_second_display.mk
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
PRODUCT_PACKAGES += dump_exynos_second_display
|
||||||
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/exynos
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy/pixel
|
||||||
|
|
||||||
PRODUCT_PACKAGES_DEBUG += dump_display_userdebug.sh
|
PRODUCT_PACKAGES_DEBUG += dump_display_userdebug.sh
|
||||||
PRODUCT_PACKAGES += dump_display
|
PRODUCT_PACKAGES += dump_pixel_display
|
3
display/dump_pixel_second_display.mk
Normal file
3
display/dump_pixel_second_display.mk
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
PRODUCT_PACKAGES += dump_pixel_second_display
|
||||||
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/pixel
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
PRODUCT_PACKAGES += dump_second_display
|
|
||||||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
setbuf(stdout, NULL);
|
setbuf(stdout, NULL);
|
||||||
dumpFileContent("DECON-0 counters /sys/class/drm/card0/device/decon0/counters", "/sys/class/drm/card0/device/decon0/counters");
|
dumpFileContent("DECON-0 counters", "/sys/class/drm/card0/device/decon0/counters");
|
||||||
dumpFileContent("CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event");
|
dumpFileContent("CRTC-0 event log", "/sys/kernel/debug/dri/0/crtc-0/event");
|
||||||
runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v");
|
runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v");
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <dump/pixel_dump.h>
|
#include <dump/pixel_dump.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
dumpFileContent("DECON-1 counters /sys/class/drm/card0/device/decon1/counters", "/sys/class/drm/card0/device/decon1/counters");
|
dumpFileContent("DECON-1 counters", "/sys/class/drm/card0/device/decon1/counters");
|
||||||
dumpFileContent("CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event");
|
dumpFileContent("CRTC-1 event log", "/sys/kernel/debug/dri/0/crtc-1/event");
|
||||||
|
|
||||||
dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name");
|
dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name");
|
29
display/pixel/dump_display.cpp
Normal file
29
display/pixel/dump_display.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source 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.
|
||||||
|
*/
|
||||||
|
#include <dump/pixel_dump.h>
|
||||||
|
#include <android-base/file.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setbuf(stdout, NULL);
|
||||||
|
dumpFileContent("CRTC-0 status", "/sys/kernel/debug/dri/0/crtc-0/status");
|
||||||
|
runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v");
|
||||||
|
|
||||||
|
dumpFileContent("Primary panel name", "/sys/class/drm/card0/device/primary-panel/panel_name");
|
||||||
|
dumpFileContent("Primary panel extra info", "/sys/class/drm/card0/device/primary-panel/panel_extinfo");
|
||||||
|
dumpFileContent("Primary panel power Vreg", "/sys/class/drm/card0/device/primary-panel/panel_pwr_vreg");
|
||||||
|
dumpFileContent("Primary panel power mode register", "/sys/class/drm/card0/device/primary-panel/power_mode");
|
||||||
|
return 0;
|
||||||
|
}
|
25
display/pixel/dump_second_display.cpp
Normal file
25
display/pixel/dump_second_display.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2022 The Android Open Source 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.
|
||||||
|
*/
|
||||||
|
#include <dump/pixel_dump.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
dumpFileContent("CRTC-1 status", "/sys/kernel/debug/dri/0/crtc-1/status");
|
||||||
|
|
||||||
|
dumpFileContent("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name");
|
||||||
|
dumpFileContent("Secondary panel extra info", "/sys/class/drm/card0/device/secondary-panel/panel_extinfo");
|
||||||
|
dumpFileContent("Secondary panel power mode register", "/sys/class/drm/card0/device/secondary-panel/power_mode");
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -1,15 +0,0 @@
|
||||||
# Display (dump for bugreport)
|
|
||||||
pixel_bugreport(dump_display)
|
|
||||||
|
|
||||||
allow dump_display sysfs_display:file r_file_perms;
|
|
||||||
allow dump_display vendor_displaycolor_service:service_manager find;
|
|
||||||
binder_call(dump_display, hal_graphics_composer_default)
|
|
||||||
allow dump_display vendor_dumpsys:file execute_no_trans;
|
|
||||||
allow dump_display vendor_shell_exec:file execute_no_trans;
|
|
||||||
|
|
||||||
userdebug_or_eng(`
|
|
||||||
allow dump_display vendor_dri_debugfs:dir r_dir_perms;
|
|
||||||
allow dump_display vendor_dri_debugfs:file r_file_perms;
|
|
||||||
')
|
|
||||||
vndbinder_use(dump_display)
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Display eng/userdebug (dump for bugreport)
|
|
||||||
pixel_bugreport(dump_display_userdebug)
|
|
||||||
|
|
||||||
userdebug_or_eng(`
|
|
||||||
allow dump_display_userdebug vendor_toolbox_exec:file execute_no_trans;
|
|
||||||
allow dump_display_userdebug vendor_log_file:dir search;
|
|
||||||
allow dump_display_userdebug vendor_hwc_log_file:dir r_dir_perms;
|
|
||||||
allow dump_display_userdebug vendor_hwc_log_file:file r_file_perms;
|
|
||||||
allow dump_display_userdebug debugfs_tracing_instances:dir search;
|
|
||||||
allow dump_display_userdebug debugfs_tracing_instances:file r_file_perms;
|
|
||||||
')
|
|
15
display/sepolicy/exynos/dump_display.te
Normal file
15
display/sepolicy/exynos/dump_display.te
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Display (dump for bugreport)
|
||||||
|
pixel_bugreport(dump_exynos_display)
|
||||||
|
|
||||||
|
allow dump_exynos_display sysfs_display:file r_file_perms;
|
||||||
|
allow dump_exynos_display vendor_displaycolor_service:service_manager find;
|
||||||
|
binder_call(dump_exynos_display, hal_graphics_composer_default)
|
||||||
|
allow dump_exynos_display vendor_dumpsys:file execute_no_trans;
|
||||||
|
allow dump_exynos_display vendor_shell_exec:file execute_no_trans;
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_exynos_display vendor_dri_debugfs:dir r_dir_perms;
|
||||||
|
allow dump_exynos_display vendor_dri_debugfs:file r_file_perms;
|
||||||
|
')
|
||||||
|
vndbinder_use(dump_exynos_display)
|
||||||
|
|
11
display/sepolicy/exynos/dump_display_userdebug.te
Normal file
11
display/sepolicy/exynos/dump_display_userdebug.te
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Display eng/userdebug (dump for bugreport)
|
||||||
|
pixel_bugreport(dump_exynos_display_userdebug)
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_exynos_display_userdebug vendor_toolbox_exec:file execute_no_trans;
|
||||||
|
allow dump_exynos_display_userdebug vendor_log_file:dir search;
|
||||||
|
allow dump_exynos_display_userdebug vendor_hwc_log_file:dir r_dir_perms;
|
||||||
|
allow dump_exynos_display_userdebug vendor_hwc_log_file:file r_file_perms;
|
||||||
|
allow dump_exynos_display_userdebug debugfs_tracing_instances:dir search;
|
||||||
|
allow dump_exynos_display_userdebug debugfs_tracing_instances:file r_file_perms;
|
||||||
|
')
|
5
display/sepolicy/exynos/file_contexts
Normal file
5
display/sepolicy/exynos/file_contexts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_exynos_display_userdebug_exec:s0
|
||||||
|
/vendor/bin/dump/dump_exynos_display u:object_r:dump_exynos_display_exec:s0
|
||||||
|
|
||||||
|
/data/vendor/log/hwc(/.*)? u:object_r:vendor_hwc_log_file:s0
|
||||||
|
|
3
display/sepolicy/exynos/hal_graphics_composer_default.te
Normal file
3
display/sepolicy/exynos/hal_graphics_composer_default.te
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
allow hal_graphics_composer_default dump_exynos_display:fifo_file { append write };
|
||||||
|
allow hal_graphics_composer_default dump_exynos_display:fd use;
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
allow hal_graphics_composer_default dump_display:fifo_file { append write };
|
|
||||||
allow hal_graphics_composer_default dump_display:fd use;
|
|
||||||
|
|
15
display/sepolicy/pixel/dump_display.te
Normal file
15
display/sepolicy/pixel/dump_display.te
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Display (dump for bugreport)
|
||||||
|
pixel_bugreport(dump_pixel_display)
|
||||||
|
|
||||||
|
allow dump_pixel_display sysfs_display:file r_file_perms;
|
||||||
|
allow dump_pixel_display vendor_displaycolor_service:service_manager find;
|
||||||
|
binder_call(dump_pixel_display, hal_graphics_composer_default)
|
||||||
|
allow dump_pixel_display vendor_dumpsys:file execute_no_trans;
|
||||||
|
allow dump_pixel_display vendor_shell_exec:file execute_no_trans;
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_pixel_display vendor_dri_debugfs:dir r_dir_perms;
|
||||||
|
allow dump_pixel_display vendor_dri_debugfs:file r_file_perms;
|
||||||
|
')
|
||||||
|
vndbinder_use(dump_pixel_display)
|
||||||
|
|
11
display/sepolicy/pixel/dump_display_userdebug.te
Normal file
11
display/sepolicy/pixel/dump_display_userdebug.te
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Display eng/userdebug (dump for bugreport)
|
||||||
|
pixel_bugreport(dump_pixel_display_userdebug)
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_pixel_display_userdebug vendor_toolbox_exec:file execute_no_trans;
|
||||||
|
allow dump_pixel_display_userdebug vendor_log_file:dir search;
|
||||||
|
allow dump_pixel_display_userdebug vendor_hwc_log_file:dir r_dir_perms;
|
||||||
|
allow dump_pixel_display_userdebug vendor_hwc_log_file:file r_file_perms;
|
||||||
|
allow dump_pixel_display_userdebug debugfs_tracing_instances:dir search;
|
||||||
|
allow dump_pixel_display_userdebug debugfs_tracing_instances:file r_file_perms;
|
||||||
|
')
|
3
display/sepolicy/pixel/file.te
Normal file
3
display/sepolicy/pixel/file.te
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
type vendor_hwc_log_file, file_type, data_file_type;
|
||||||
|
type vendor_dri_debugfs, fs_type, debugfs_type;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_display_userdebug_exec:s0
|
/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_pixel_display_userdebug_exec:s0
|
||||||
/vendor/bin/dump/dump_display u:object_r:dump_display_exec:s0
|
/vendor/bin/dump/dump_pixel_display u:object_r:dump_pixel_display_exec:s0
|
||||||
|
|
||||||
/data/vendor/log/hwc(/.*)? u:object_r:vendor_hwc_log_file:s0
|
/data/vendor/log/hwc(/.*)? u:object_r:vendor_hwc_log_file:s0
|
||||||
|
|
3
display/sepolicy/pixel/genfs_contexts
Normal file
3
display/sepolicy/pixel/genfs_contexts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
genfscon debugfs /dri/0/crtc- u:object_r:vendor_dri_debugfs:s0
|
||||||
|
genfscon sysfs /module/drm/parameters/debug u:object_r:sysfs_display:s0
|
3
display/sepolicy/pixel/hal_graphics_composer_default.te
Normal file
3
display/sepolicy/pixel/hal_graphics_composer_default.te
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
allow hal_graphics_composer_default dump_pixel_display:fifo_file { append write };
|
||||||
|
allow hal_graphics_composer_default dump_pixel_display:fd use;
|
||||||
|
|
2
display/sepolicy/pixel/vndservice.te
Normal file
2
display/sepolicy/pixel/vndservice.te
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
type vendor_displaycolor_service, vndservice_manager_type;
|
||||||
|
|
2
display/sepolicy/pixel/vndservice_contexts
Normal file
2
display/sepolicy/pixel/vndservice_contexts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
displaycolor u:object_r:vendor_displaycolor_service:s0
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
pixel_bugreport(dump_second_display)
|
|
||||||
|
|
||||||
allow dump_second_display sysfs_display:file r_file_perms;
|
|
||||||
|
|
||||||
userdebug_or_eng(`
|
|
||||||
allow dump_second_display vendor_dri_debugfs:dir r_dir_perms;
|
|
||||||
allow dump_second_display vendor_dri_debugfs:file r_file_perms;
|
|
||||||
')
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
pixel_bugreport(dump_exynos_second_display)
|
||||||
|
|
||||||
|
allow dump_exynos_second_display sysfs_display:file r_file_perms;
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_exynos_second_display vendor_dri_debugfs:dir r_dir_perms;
|
||||||
|
allow dump_exynos_second_display vendor_dri_debugfs:file r_file_perms;
|
||||||
|
')
|
||||||
|
|
2
display/sepolicy_second_display/exynos/file_contexts
Normal file
2
display/sepolicy_second_display/exynos/file_contexts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/vendor/bin/dump/dump_exynos_second_display u:object_r:dump_exynos_second_display_exec:s0
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
/vendor/bin/dump/dump_second_display u:object_r:dump_second_display_exec:s0
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
pixel_bugreport(dump_pixel_second_display)
|
||||||
|
|
||||||
|
allow dump_pixel_second_display sysfs_display:file r_file_perms;
|
||||||
|
|
||||||
|
userdebug_or_eng(`
|
||||||
|
allow dump_pixel_second_display vendor_dri_debugfs:dir r_dir_perms;
|
||||||
|
allow dump_pixel_second_display vendor_dri_debugfs:file r_file_perms;
|
||||||
|
')
|
||||||
|
|
2
display/sepolicy_second_display/pixel/file_contexts
Normal file
2
display/sepolicy_second_display/pixel/file_contexts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/vendor/bin/dump/dump_pixel_second_display u:object_r:dump_pixel_second_display_exec:s0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue