设置主副屏幕显示
修改主副屏幕配置属性
device/rockchip/rk3288/system.prop
-sys.hwc.device.primary=LVDS
-sys.hwc.device.extend=HDMI-A,eDP
+persist.hwc.device.primary=LVDS
+persist.hwc.device.extend=HDMI-A,eDP
frameworks/base/services/core/jni/com_android_server_rkdisplay_RkDisplayModes.cpp
@@ -118,7 +118,7 @@ static void updateConnectors(){
}
ALOGD("crtc: %d %d foundHdmi %d", crtcId1, crtcId2, foundHdmi);
char property[PROPERTY_VALUE_MAX];
- property_get("sys.hwc.device.primary", property, "null");
+ property_get("persist.hwc.device.primary", property, "null");
if (crtcId1 == crtcId2 && foundHdmi && strstr(property, "HDMI-A") == NULL) {
for (auto &conn : drm_->connectors()) {
if (builtInHdmi(conn->get_type()) && conn->state() == DRM_MODE_CONNECTED) {
@@ -365,7 +365,7 @@ static void saveHwcInitalInfo(struct file_base_paramer *base_paramer, int dpy){
base_paramer->main.hwc_info.framebuffer_height = 1080;
base_paramer->main.hwc_info.fps = 60.00;
memset(property,0,sizeof(property));
- len = property_get("sys.hwc.device.primary", property, NULL);
+ len = property_get("persist.hwc.device.primary", property, NULL);
if (len) {
memcpy(base_paramer->main.hwc_info.device, property, strlen(property));
} else {
@@ -378,7 +378,7 @@ static void saveHwcInitalInfo(struct file_base_paramer *base_paramer, int dpy){
base_paramer->aux.hwc_info.framebuffer_height = 1080;
base_paramer->aux.hwc_info.fps = 60.00;
memset(property,0,sizeof(property));
- len = property_get("sys.hwc.device.extend", property, NULL);
+ len = property_get("persist.hwc.device.extend", property, NULL);
if (len)
memcpy(base_paramer->aux.hwc_info.device, property, strlen(property));
else
frameworks/base/services/core/jni/rkdisplay/drmresources.cpp
- primary_length = property_get("sys.hwc.device.primary", primary_name, NULL);
- extend_length = property_get("sys.hwc.device.extend", extend_name, NULL);
+ primary_length = property_get("persist.hwc.device.primary", primary_name, NULL);
+ extend_length = property_get("persist.hwc.device.extend", extend_name, NULL);
hardware/rockchip/hwcomposer/drmresources.cpp
- primary_length = property_get("sys.hwc.device.primary", primary_name, NULL);
- extend_length = property_get("sys.hwc.device.extend", extend_name, NULL);
+ primary_length = property_get("persist.hwc.device.primary", primary_name, NULL);
+ extend_length = property_get("persist.hwc.device.extend", extend_name, NULL);
关于主副屏幕切换问题已在第一篇的服务中介绍,在U盘rk_lcd_screen文件中添加
primary=LVDS(主屏幕显示)
extend=HDMI-A(副屏幕显示)
服务会将设置的屏幕添加到系统属性中。