Android-Framework default horizontal screen and dpi settings

1. Environment

Qualcomm 865 Android 10

2. Source code modification location

1. Modify dpi 

device/qcom/kona/kona.mk

@@ -116,7 +116,7 @@ TARGET_USES_RRO := true
 # system prop for Bluetooth SOC type
 PRODUCT_PROPERTY_OVERRIDES += \
     vendor.qcom.bluetooth.soc=hastings \
-	ro.sf.lcd_density=480
+	ro.sf.lcd_density=360

2. Change to the default horizontal screen, that is, change the resolution

hardware/qcom/display/composer/hwc_display.cpp
@@ -1089,11 +1089,11 @@ HWC2::Error HWCDisplay::GetDisplayAttribute(hwc2_config_t config, HWC2::Attribut
       break;
     case HWC2::Attribute::Width:
       // *out_value = INT32(variable_config.x_pixels);
-      *out_value = property_get_int32("ro.boot.virtdroid_width", 1080);
+      *out_value = property_get_int32("ro.boot.virtdroid_width", 1920);
       break;
     case HWC2::Attribute::Height:
       // *out_value = INT32(variable_config.y_pixels);
-      *out_value = property_get_int32("ro.boot.virtdroid_height", 1920);
+      *out_value = property_get_int32("ro.boot.virtdroid_height", 1080);
       break;
     case HWC2::Attribute::DpiX:
       *out_value = INT32(variable_config.x_dpi * 1000.0f);

vendor/qcom/proprietary/devicetree-4.19/qcom/project_visional.dtsi
@@ -224,8 +224,8 @@
 &display_timing {
         qcom,mdss-dsi-panel-framerate = <144>;
         /delete-property/ qcom,mdss-dsi-panel-width;
-        qcom,mdss-dsi-panel-width = <1080>;
-        qcom,mdss-dsi-panel-height = <1920>;
+        qcom,mdss-dsi-panel-width = <1920>;
+        qcom,mdss-dsi-panel-height = <1080>;
 };

Guess you like

Origin blog.csdn.net/banzhuantuqiang/article/details/134947817