RK3399 Android7.1 异形屏修改
属性说明:
persist.sys.framebuffer.xoffset //用来调整水平方向偏移
persist.sys.framebuffer.yoffset //用来调整垂直方向偏移
persist.sys.framebuffer.main //用来设置上层应用的渲染布局,这个属性值与裁剪屏尺寸相关,例如可显示区域为 1920x400,那么就设置为 1920x400@60 即可。
sys.hwc.compose_policy=0 //裁剪屏建议关闭HWC,否则在一些场景显示会出现偏差出现抖屏的情况,修改方法可将build.prop文件中的该字段修改为 0,默认值为 6
HWC_DISPLAY_PRIMARY = 0,
HWC_DISPLAY_EXTERNAL = 1, // HDMI, EDP
hardware\rockchip\hwcomposer\hwcomposer.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | static int hwc_get_display_configs( struct hwc_composer_device_1 *dev, int display, uint32_t *configs, size_t *num_configs) { if (!num_configs) return 0; struct hwc_context_t *ctx = ( struct hwc_context_t *)&dev->common; DrmConnector *connector = ctx->drm.GetConnectorFromType(display); if (!connector) { ALOGE( "%s:Failed to get connector for display %d line=%d" , __FUNCTION__,display,__LINE__); return -ENODEV; } hwc_drm_display_t *hd = &ctx->displays[connector->display()]; if (!hd->active) return -ENODEV; int ret = connector->UpdateModes(); if (ret) { ALOGE( "Failed to update display modes %d" , ret); return ret; } if (connector->state() != DRM_MODE_CONNECTED && display == HWC_DISPLAY_EXTERNAL) { ALOGE( "connector is not connected with display %d" , display); return -ENODEV; } update_display_bestmode(hd, display, connector); DrmMode mode = connector->best_mode(); connector->set_current_mode(mode); char framebuffer_size[PROPERTY_VALUE_MAX]; uint32_t width = 0, height = 0 , vrefresh = 0 ; if (display == HWC_DISPLAY_PRIMARY) property_get( "persist." PROPERTY_TYPE ".framebuffer.main" , framebuffer_size, "use_baseparameter" ); else if (display == HWC_DISPLAY_EXTERNAL) property_get( "persist." PROPERTY_TYPE ".framebuffer.aux" , framebuffer_size, "use_baseparameter" ); |
android7.1_异形屏修改
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 0.dts中配置1920x1080的分辨率 1.build.prop添加下面属性: persist.sys.framebuffer.main=1920x600@60 2.hardware/rockchip/hwcomposer合入下面修改: diff --git a/hwcomposer.cpp b/hwcomposer.cpp index 0fd2177..3ad13a9 100755 --- a/hwcomposer.cpp +++ b/hwcomposer.cpp @@ -3498,8 +3498,10 @@ static int hwc_get_display_configs( struct hwc_composer_device_1 *dev, char framebuffer_size[PROPERTY_VALUE_MAX]; uint32_t width = 0, height = 0 , vrefresh = 0 ; + if (display == HWC_DISPLAY_PRIMARY) property_get( "persist.sys.framebuffer.main" , framebuffer_size, "use_baseparameter" ); - + else if (display == HWC_DISPLAY_EXTERNAL) + property_get( "persist.sys.framebuffer.aux" , framebuffer_size, "use_baseparameter" ); /* * if unset framebuffer_size, get it from baseparameter , by libin */ @@ -2298,7 +2301,8 @@ static int hwc_prepare(hwc_composer_device_1_t *dev, size_t num_displays, hd->rel_yres = mode.v_display(); hd->v_total = mode.v_total(); hd->w_scale = ( float )mode.h_display() / hd->framebuffer_width; - hd->h_scale = ( float )mode.v_display() / hd->framebuffer_height; + //hd->h_scale = (float)mode.v_display() / hd->framebuffer_height; + hd->h_scale = 1.0; int fbSize = hd->framebuffer_width * hd->framebuffer_height; //get plane size for display std::vector<PlaneGroup *>& plane_groups = ctx->drm.GetPlaneGroups(); @@ -3638,7 +3647,8 @@ static int hwc_set_active_config( struct hwc_composer_device_1 *dev, int display, return -ENOENT; } hd->w_scale = ( float )mode.h_display() / hd->framebuffer_width; - hd->h_scale = ( float )mode.v_display() / hd->framebuffer_height; + //hd->h_scale = (float)mode.v_display() / hd->framebuffer_height; + hd->h_scale = 1.0; c->set_current_mode(mode); ctx->drm.UpdateDisplayRoute(); |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
2020-09-01 RK:Launcher3 禁用快捷方式、禁用壁纸小控件、隐藏指定应用图标