Android 修改屏幕尺寸

一些时候我们做的软件对屏幕尺寸有要求的,如下修改,就可以得到对应的屏幕尺寸

--- a/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/lcm/panel-simple.c
+++ b/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/lcm/panel-simple.c
@@ -581,6 +581,11 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
        if (!of_property_read_u32(dev->of_node, "delay,unprepare", &val))
                of_desc->delay.unprepare = val;
 
+       if (!of_property_read_u32(dev->of_node, "width-mm", &val))
+               of_desc->size.width = val;
+       if (!of_property_read_u32(dev->of_node, "height-mm", &val))
+               of_desc->size.height = val;
+
        panel->enabled = false;
        panel->prepared = false;
        panel->desc = of_desc;
diff --git a/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/rk3368-p9.dts b/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/r
index b1bf655..d5654c6 100755
--- a/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/rk3368-p9.dts
+++ b/rk3368h/device/rockchip/rk3368/hra_project/SN22_2G/rk3368-p9.dts
@@ -867,6 +867,8 @@
                dsi,format = ;
                dsi,lanes = <4>;
 
+        width-mm = <108>; 
+               height-mm = <172>;
                delay,prepare = <120>;
                delay,enable = <200>;
                reset-delay-ms = <20>;

修改参数宽 width-mm 和 高 height-mm 就可以得到对应要求尺寸的屏幕大小

你可能感兴趣的:(Android,java,android)