diff options
author | 2025-03-19 16:40:39 -0700 | |
---|---|---|
committer | 2025-03-19 16:40:39 -0700 | |
commit | 1d39cd545b47c54f52ed4fbb7f447edd4225552e (patch) | |
tree | b46e7dddb33d4aebeab3c3ff23e159b49c015d32 | |
parent | 1e4ff8584c21dcab1197027899e909a179735e9d (diff) | |
parent | 7d0d256b62dee09e04528c4244a4f7026fa0fb8c (diff) |
Snap for 13241370 from 7d0d256b62dee09e04528c4244a4f7026fa0fb8c to 25Q2-release
Change-Id: I4eb6edbfe6f3c12120608a9978564d4d42d12720
-rw-r--r-- | cmds/atrace/atrace.rc | 91 | ||||
-rw-r--r-- | include/android/configuration.h | 1 | ||||
-rw-r--r-- | include/android/thermal.h | 20 | ||||
-rw-r--r-- | libs/ui/include/ui/DisplayIdentification.h | 17 | ||||
-rw-r--r-- | vulkan/scripts/vkjson_generator.py | 30 | ||||
-rw-r--r-- | vulkan/vkjson/vkjson.cc | 3 | ||||
-rw-r--r-- | vulkan/vkjson/vkjson.h | 25 | ||||
-rw-r--r-- | vulkan/vkjson/vkjson_instance.cc | 20 |
8 files changed, 107 insertions, 100 deletions
diff --git a/cmds/atrace/atrace.rc b/cmds/atrace/atrace.rc index fdac5db1d1..316f04cb27 100644 --- a/cmds/atrace/atrace.rc +++ b/cmds/atrace/atrace.rc @@ -316,97 +316,6 @@ on late-init && property:ro.boot.fastboot.boottrace= write /sys/kernel/debug/tracing/tracing_on 0 write /sys/kernel/tracing/tracing_on 0 -# Only create the tracing instance if persist.mm_events.enabled -# Attempting to remove the tracing instance after it has been created -# will likely fail with EBUSY as it would be in use by traced_probes. -on mm_events_property_available && property:persist.mm_events.enabled=true -# Create MM Events Tracing Instance for Kmem Activity Trigger - mkdir /sys/kernel/debug/tracing/instances/mm_events 0755 system system - mkdir /sys/kernel/tracing/instances/mm_events 0755 system system - -# Read and set per CPU buffer size - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb - chmod 0666 /sys/kernel/tracing/instances/mm_events/buffer_size_kb - -# Set the default buffer size to the minimum - write /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb 1 - write /sys/kernel/tracing/instances/mm_events/buffer_size_kb 1 - -# Read and enable tracing - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/tracing_on - chmod 0666 /sys/kernel/tracing/instances/mm_events/tracing_on - -# Tracing disabled by default - write /sys/kernel/debug/tracing/instances/mm_events/tracing_on 0 - write /sys/kernel/tracing/instances/mm_events/tracing_on 0 - -# Read and truncate kernel trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/trace - -# Enable trace events - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/events/vmscan/mm_vmscan_direct_reclaim_begin/enable - chmod 0666 /sys/kernel/tracing/instances/mm_events/events/vmscan/mm_vmscan_direct_reclaim_begin/enable - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/events/vmscan/mm_vmscan_kswapd_wake/enable - chmod 0666 /sys/kernel/tracing/instances/mm_events/events/vmscan/mm_vmscan_kswapd_wake/enable - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/events/compaction/mm_compaction_begin/enable - chmod 0666 /sys/kernel/tracing/instances/mm_events/events/compaction/mm_compaction_begin/enable - -# Read and clear per-CPU raw kernel trace -# Cannot use wildcards in .rc files. Update this if there is a phone with -# more CPUs. - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu0/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu0/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu1/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu1/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu2/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu2/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu3/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu3/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu4/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu4/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu5/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu5/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu6/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu6/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu7/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu7/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu8/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu8/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu9/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu9/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu10/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu10/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu11/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu11/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu12/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu12/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu13/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu13/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu14/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu14/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu15/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu15/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu16/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu16/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu17/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu17/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu18/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu18/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu19/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu19/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu20/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu20/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu21/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu21/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu22/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu22/trace - chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/per_cpu/cpu23/trace - chmod 0666 /sys/kernel/tracing/instances/mm_events/per_cpu/cpu23/trace - -on property:ro.persistent_properties.ready=true - trigger mm_events_property_available - # Handle hyp tracing instance on late-init && property:ro.boot.hypervisor.vm.supported=1 diff --git a/include/android/configuration.h b/include/android/configuration.h index 46c7dfeceb..a291db0ecd 100644 --- a/include/android/configuration.h +++ b/include/android/configuration.h @@ -26,6 +26,7 @@ #ifndef ANDROID_CONFIGURATION_H #define ANDROID_CONFIGURATION_H +#include <stdint.h> #include <sys/cdefs.h> #include <android/asset_manager.h> diff --git a/include/android/thermal.h b/include/android/thermal.h index e5d46b5b8a..93ae961423 100644 --- a/include/android/thermal.h +++ b/include/android/thermal.h @@ -304,6 +304,26 @@ int AThermal_getThermalHeadroomThresholds(AThermalManager* _Nonnull manager, * Prototype of the function that is called when thermal headroom or thresholds changes. * It's passed the updated thermal headroom and thresholds as parameters, as well as the * pointer provided by the client that registered a callback. + * <p> + * This may not be used to fully replace the {@link AThermal_getThermalHeadroom} API as it will + * only notify on one of the conditions below that will significantly change one or both + * values of current headroom and headroom thresholds since previous callback: + * 1. thermal throttling events: when the skin temperature has cross any of the thresholds + * and there isn't a previous callback in a short time ago with similar values. + * 2. skin temperature threshold change events: note that if the absolute °C threshold + * values change in a way that does not significantly change the current headroom nor + * headroom thresholds, it will not trigger any callback. The client should not + * need to take action in such case since the difference from temperature vs threshold + * hasn't changed. + * <p> + * By API version 36, it provides a forecast in the same call for developer's convenience + * based on a {@code forecastSeconds} defined by the device, which can be static or dynamic + * varied by OEM. Be aware that it will not notify on forecast temperature change but the + * events mentioned above. So periodically polling against {@link AThermal_getThermalHeadroom} + * API should still be used to actively monitor temperature forecast in advance. + * <p> + * This serves as a more advanced option compared to thermal status listener, where the + * latter will only notify on thermal throttling events with status update. * * @param data The data pointer to be passed when callback is called. * @param headroom The current non-negative normalized headroom value, also see diff --git a/libs/ui/include/ui/DisplayIdentification.h b/libs/ui/include/ui/DisplayIdentification.h index 1e3449c004..201d5e9ff5 100644 --- a/libs/ui/include/ui/DisplayIdentification.h +++ b/libs/ui/include/ui/DisplayIdentification.h @@ -39,12 +39,29 @@ struct DetailedTimingDescriptor { ui::Size physicalSizeInMm; }; +// These values must match the ones in ScreenPartStatus.aidl file in the composer HAL +enum class ScreenPartStatus : uint8_t { + /** + * Device cannot differentiate an original screen from a replaced screen. + */ + UNSUPPORTED = 0, + /** + * Device has the original screen it was manufactured with. + */ + ORIGINAL = 1, + /** + * Device has a replaced screen. + */ + REPLACED = 2, +}; + struct DisplayIdentificationInfo { PhysicalDisplayId id; std::string name; uint8_t port; std::optional<DeviceProductInfo> deviceProductInfo; std::optional<DetailedTimingDescriptor> preferredDetailedTimingDescriptor; + ScreenPartStatus screenPartStatus; }; struct ExtensionBlock { diff --git a/vulkan/scripts/vkjson_generator.py b/vulkan/scripts/vkjson_generator.py index 7dc55d9703..6f621a1542 100644 --- a/vulkan/scripts/vkjson_generator.py +++ b/vulkan/scripts/vkjson_generator.py @@ -184,12 +184,22 @@ def generate_vk_core_struct_definition(f): vkJson_core_entries.append(f"{struct_name} {version.lower()}") f.write(f"struct {struct_name} {{\n") + f.write(f" {struct_name}() {{\n") # Start of constructor + for item in items: + for struct_type, _ in item.items(): + field_name = "properties" if "Properties" in struct_type else "features" + f.write(f" memset(&{field_name}, 0, sizeof({struct_type}));\n") + f.write(" }\n") # End of constructor for item in items: for struct_type, _ in item.items(): field_name = "properties" if "Properties" in struct_type else "features" f.write(f" {struct_type} {field_name};\n") + if version == "Core14": + f.write(f"std::vector<VkImageLayout> copy_src_layouts;\n") + f.write(f"std::vector<VkImageLayout> copy_dst_layouts;\n") + f.write("};\n\n") return vkJson_core_entries @@ -212,11 +222,6 @@ def generate_memset_statements(f): f.write(f"memset(&{variable_name}, 0, sizeof({class_name}));\n") entries.append(f"{class_name} {variable_name}") - # Process vulkan core structs - for version in VK.VULKAN_CORES_AND_STRUCTS_MAPPING["versions"]: - struct_name = f"VkJson{version}" - f.write(f"memset(&{version.lower()}, 0, sizeof({struct_name}));\n") - return entries @@ -1757,6 +1762,21 @@ VkJsonDevice VkJsonGetDevice(VkPhysicalDevice physical_device) { if (device.properties.apiVersion >= VK_API_VERSION_1_4) {\n""") f.write(cc_code_properties_14) f.write(f"vkGetPhysicalDeviceProperties2(physical_device, &properties);\n\n") + + f.write("""\ +if (device.core14.properties.copySrcLayoutCount > 0 || device.core14.properties.copyDstLayoutCount > 0 ) { + if (device.core14.properties.copySrcLayoutCount > 0) { + device.core14.copy_src_layouts.resize(device.core14.properties.copySrcLayoutCount); + device.core14.properties.pCopySrcLayouts = device.core14.copy_src_layouts.data(); + } + if (device.core14.properties.copyDstLayoutCount > 0) { + device.core14.copy_dst_layouts.resize(device.core14.properties.copyDstLayoutCount); + device.core14.properties.pCopyDstLayouts = device.core14.copy_dst_layouts.data(); + } + vkGetPhysicalDeviceProperties2(physical_device, &properties); +} + \n""") + f.write(cc_code_features_14) f.write(f"vkGetPhysicalDeviceFeatures2(physical_device, &features);\n\n") f.write("""\ diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc index 531a623e90..517e62d1db 100644 --- a/vulkan/vkjson/vkjson.cc +++ b/vulkan/vkjson/vkjson.cc @@ -36,6 +36,9 @@ #include <type_traits> #include <utility> +/* + * This file is autogenerated by vkjson_generator.py. Do not edit directly. + */ namespace { /* diff --git a/vulkan/vkjson/vkjson.h b/vulkan/vkjson/vkjson.h index d74644ca8e..cfba8c58d9 100644 --- a/vulkan/vkjson/vkjson.h +++ b/vulkan/vkjson/vkjson.h @@ -33,6 +33,9 @@ #undef max #endif +/* + * This file is autogenerated by vkjson_generator.py. Do not edit directly. + */ struct VkJsonLayer { VkLayerProperties properties; std::vector<VkExtensionProperties> extensions; @@ -263,23 +266,41 @@ struct VkJsonKHRDriverProperties { }; struct VkJsonCore11 { + VkJsonCore11() { + memset(&properties, 0, sizeof(VkPhysicalDeviceVulkan11Properties)); + memset(&features, 0, sizeof(VkPhysicalDeviceVulkan11Features)); + } VkPhysicalDeviceVulkan11Properties properties; VkPhysicalDeviceVulkan11Features features; }; struct VkJsonCore12 { + VkJsonCore12() { + memset(&properties, 0, sizeof(VkPhysicalDeviceVulkan12Properties)); + memset(&features, 0, sizeof(VkPhysicalDeviceVulkan12Features)); + } VkPhysicalDeviceVulkan12Properties properties; VkPhysicalDeviceVulkan12Features features; }; struct VkJsonCore13 { + VkJsonCore13() { + memset(&properties, 0, sizeof(VkPhysicalDeviceVulkan13Properties)); + memset(&features, 0, sizeof(VkPhysicalDeviceVulkan13Features)); + } VkPhysicalDeviceVulkan13Properties properties; VkPhysicalDeviceVulkan13Features features; }; struct VkJsonCore14 { + VkJsonCore14() { + memset(&properties, 0, sizeof(VkPhysicalDeviceVulkan14Properties)); + memset(&features, 0, sizeof(VkPhysicalDeviceVulkan14Features)); + } VkPhysicalDeviceVulkan14Properties properties; VkPhysicalDeviceVulkan14Features features; + std::vector<VkImageLayout> copy_src_layouts; + std::vector<VkImageLayout> copy_dst_layouts; }; struct VkJsonDevice { @@ -306,10 +327,6 @@ struct VkJsonDevice { sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures)); memset(&shader_draw_parameter_features, 0, sizeof(VkPhysicalDeviceShaderDrawParameterFeatures)); - memset(&core11, 0, sizeof(VkJsonCore11)); - memset(&core12, 0, sizeof(VkJsonCore12)); - memset(&core13, 0, sizeof(VkJsonCore13)); - memset(&core14, 0, sizeof(VkJsonCore14)); } VkJsonKHRVariablePointers khr_variable_pointers; VkJsonKHRShaderFloat16Int8 khr_shader_float16_int8; diff --git a/vulkan/vkjson/vkjson_instance.cc b/vulkan/vkjson/vkjson_instance.cc index 22b3204e61..636c11933a 100644 --- a/vulkan/vkjson/vkjson_instance.cc +++ b/vulkan/vkjson/vkjson_instance.cc @@ -27,6 +27,9 @@ #include <algorithm> #include <utility> +/* + * This file is autogenerated by vkjson_generator.py. Do not edit directly. + */ namespace { bool EnumerateExtensions(const char* layer_name, @@ -512,6 +515,23 @@ VkJsonDevice VkJsonGetDevice(VkPhysicalDevice physical_device) { vkGetPhysicalDeviceProperties2(physical_device, &properties); + if (device.core14.properties.copySrcLayoutCount > 0 || + device.core14.properties.copyDstLayoutCount > 0) { + if (device.core14.properties.copySrcLayoutCount > 0) { + device.core14.copy_src_layouts.resize( + device.core14.properties.copySrcLayoutCount); + device.core14.properties.pCopySrcLayouts = + device.core14.copy_src_layouts.data(); + } + if (device.core14.properties.copyDstLayoutCount > 0) { + device.core14.copy_dst_layouts.resize( + device.core14.properties.copyDstLayoutCount); + device.core14.properties.pCopyDstLayouts = + device.core14.copy_dst_layouts.data(); + } + vkGetPhysicalDeviceProperties2(physical_device, &properties); + } + device.core14.features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES; device.core14.features.pNext = features.pNext; |