调整android输出分辨率,适配更大分辨率的屏

有时我们希望实现在大分辨率的屏上显示小分辨率的android界面。

实际代码修改如下:


--- a/kernel/msm-3.18/drivers/video/msm/mdss/mdss_fb.c
+++ b/kernel/msm-3.18/drivers/video/msm/mdss/mdss_fb.c
@@ -2501,8 +2501,8 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
        else
                fix->line_length = var->xres * bpp;
 
-       var->xres_virtual = var->xres;
-       var->yres_virtual = panel_info->yres * mfd->fb_page;
+       var->xres_virtual = 640;//var->xres;
+       var->yres_virtual = 480 * mfd->fb_page;
        var->bits_per_pixel = bpp * 8;  /* FrameBuffer color depth */
 
        /*
@@ -3410,8 +3410,8 @@ void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
 {
        u32 frame_rate;
 
-       var->xres = mdss_fb_get_panel_xres(pinfo);
-       var->yres = pinfo->yres;
+       var->xres = 640;//mdss_fb_get_panel_xres(pinfo);
+       var->yres = 480;//pinfo->yres;
        var->lower_margin = pinfo->lcdc.v_front_porch -
                pinfo->prg_fet;
        var->upper_margin = pinfo->lcdc.v_back_porch +

显示屏的实际分辨率为1366x768


显示效果图;

调整android输出分辨率,适配更大分辨率的屏_第1张图片



你可能感兴趣的:(Android深入研究,高通)