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:
Hung-Yeh Lee 2024-12-29 18:31:49 -08:00 committed by Android (Google) Code Review
commit 06d1a53ceb
36 changed files with 200 additions and 54 deletions

View file

@ -4,14 +4,14 @@ package {
sh_binary {
name: "dump_display_userdebug.sh",
src: "dump_display_userdebug.sh",
src: "common/dump_display_userdebug.sh",
vendor: true,
sub_dir: "dump",
}
cc_binary {
name: "dump_display",
srcs: ["dump_display.cpp"],
name: "dump_exynos_display",
srcs: ["exynos/dump_display.cpp"],
cflags: [
"-Wall",
"-Wextra",
@ -26,8 +26,8 @@ cc_binary {
}
cc_binary {
name: "dump_second_display",
srcs: ["dump_second_display.cpp"],
name: "dump_exynos_second_display",
srcs: ["exynos/dump_second_display.cpp"],
cflags: [
"-Wall",
"-Wextra",
@ -40,3 +40,33 @@ cc_binary {
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",
}

View 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

View file

@ -0,0 +1,3 @@
PRODUCT_PACKAGES += dump_exynos_second_display
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/exynos

View file

@ -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 += dump_display
PRODUCT_PACKAGES += dump_pixel_display

View file

@ -0,0 +1,3 @@
PRODUCT_PACKAGES += dump_pixel_second_display
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display/pixel

View file

@ -1,3 +0,0 @@
PRODUCT_PACKAGES += dump_second_display
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/display/sepolicy_second_display

View file

@ -18,7 +18,7 @@
int main() {
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");
runCommand("libdisplaycolor", "/vendor/bin/dumpsys displaycolor -v");

View file

@ -16,7 +16,7 @@
#include <dump/pixel_dump.h>
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("Secondary panel name", "/sys/class/drm/card0/device/secondary-panel/panel_name");

View 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;
}

View 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;
}

View file

@ -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)

View file

@ -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;
')

View 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)

View 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;
')

View 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

View 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;

View file

@ -1,3 +0,0 @@
allow hal_graphics_composer_default dump_display:fifo_file { append write };
allow hal_graphics_composer_default dump_display:fd use;

View 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)

View 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;
')

View file

@ -0,0 +1,3 @@
type vendor_hwc_log_file, file_type, data_file_type;
type vendor_dri_debugfs, fs_type, debugfs_type;

View file

@ -1,5 +1,5 @@
/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_display_userdebug_exec:s0
/vendor/bin/dump/dump_display u:object_r:dump_display_exec:s0
/vendor/bin/dump/dump_display_userdebug\.sh u:object_r:dump_pixel_display_userdebug_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

View 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

View 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;

View file

@ -0,0 +1,2 @@
type vendor_displaycolor_service, vndservice_manager_type;

View file

@ -0,0 +1,2 @@
displaycolor u:object_r:vendor_displaycolor_service:s0

View file

@ -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;
')

View file

@ -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;
')

View file

@ -0,0 +1,2 @@
/vendor/bin/dump/dump_exynos_second_display u:object_r:dump_exynos_second_display_exec:s0

View file

@ -1,2 +0,0 @@
/vendor/bin/dump/dump_second_display u:object_r:dump_second_display_exec:s0

View file

@ -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;
')

View file

@ -0,0 +1,2 @@
/vendor/bin/dump/dump_pixel_second_display u:object_r:dump_pixel_second_display_exec:s0