Allow GPU composition to occur at a lower resolution
Add a vendor-specified system property to allow GPU fallback composition to occur at a lower resolution than the display mode resolution.
Bug: 144574809
Test: Tested with sysprop disabled, and tested backport in Android Q with sysprop enabled. Unable to test on Android R due to device issues.
Change-Id: I02948ce72f49d20416d0e4dd45a4cffe99e28820
diff --git a/services/surfaceflinger/SurfaceFlingerProperties.cpp b/services/surfaceflinger/SurfaceFlingerProperties.cpp
index f3352a5..9d78702 100644
--- a/services/surfaceflinger/SurfaceFlingerProperties.cpp
+++ b/services/surfaceflinger/SurfaceFlingerProperties.cpp
@@ -70,6 +70,22 @@
defaultValue);
}
+int32_t max_graphics_width(int32_t defaultValue) {
+ auto temp = SurfaceFlingerProperties::max_graphics_width();
+ if (temp.has_value()) {
+ return *temp;
+ }
+ return defaultValue;
+}
+
+int32_t max_graphics_height(int32_t defaultValue) {
+ auto temp = SurfaceFlingerProperties::max_graphics_height();
+ if (temp.has_value()) {
+ return *temp;
+ }
+ return defaultValue;
+}
+
bool has_wide_color_display(bool defaultValue) {
auto temp = SurfaceFlingerProperties::has_wide_color_display();
if (temp.has_value()) {