Yes, I also would like to have the whole source code. Hopefully Asus will publish soon.
But to change hdmi resolution it is not needed the android source code. I spent a lot of the last days to go through the rockchip hdmi kernel driver source code. The default resolution the driver uses, can be modified in drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c. Yesterday I found the right timings for my 1280x800 7" display, that is connected via a M.NT68676 hdmi adapter board:
And in rockchip-hdmi.h can be set the default mode.
But this is not everything. The android window manager always uses the resolution 1920x1080. This works, but is not nice! Letters and symbols are very small. Don't work 'wm size 1280x800'. This produces misalignment of the touch panel area, for example in the center the touch is o.k. but the wider to the edge the bigger the misalignment. Or the 'wm density' causes cut symbols. The trick is, how to make the window manager use the physical resolution of your lcd display. First I thought it is inside the android code, but it is not. To find this, cost me several days.
In the device tree, in section rk_screen also is needed to definethe correct timings (rk3288-miniarm.dts):
With this setting, the native-mode points to the 1280x800 timing, the framebuffer is initialized to this resolution. And this makes the window manager also use this resolution as physical resolution. Finally I changed the density from 240 to 180.
But to change hdmi resolution it is not needed the android source code. I spent a lot of the last days to go through the rockchip hdmi kernel driver source code. The default resolution the driver uses, can be modified in drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c. Yesterday I found the right timings for my 1280x800 7" display, that is connected via a M.NT68676 hdmi adapter board:
Code:
{
.mode = {
.name = "1280x800p@60hz",
.refresh = 60,
.xres = 1280,
.yres = 800,
.pixclock = 85000000,
.left_margin = 200,
.right_margin = 72,
.upper_margin = 22,
.lower_margin = 3,
.hsync_len = 128,
.vsync_len = 6,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = 0,
.flag = 0,
},
.vic = HDMI_VIDEO_DMT | 11, //512 | 11 = 523
.vic_2nd = 0,
.pixelrepeat = 1,
.interface = OUT_P888,
},And in rockchip-hdmi.h can be set the default mode.
Code:
Edit:
#define HDMI_AUTO_CONFIG false
/* HDMI default vide mode */
#define HDMI_VIDEO_DEFAULT_MODE 523 //1280x800But this is not everything. The android window manager always uses the resolution 1920x1080. This works, but is not nice! Letters and symbols are very small. Don't work 'wm size 1280x800'. This produces misalignment of the touch panel area, for example in the center the touch is o.k. but the wider to the edge the bigger the misalignment. Or the 'wm density' causes cut symbols. The trick is, how to make the window manager use the physical resolution of your lcd display. First I thought it is inside the android code, but it is not. To find this, cost me several days.
In the device tree, in section rk_screen also is needed to definethe correct timings (rk3288-miniarm.dts):
Code:
/*Use own rk_screen config
#include "lcd-asus.dtsi"*/
.
.
.
&rk_screen {
display-timings = <&disp_timings>;
disp_timings: display-timings {
native-mode = <&timing2>;
timing0: timing0 {
screen-type = <SCREEN_MIPI>;
out-face = <OUT_P888>;
clock-frequency = <28488600>;
hactive = <800>;
vactive = <480>;
hback-porch = <26>;
hfront-porch = <85>;
vback-porch = <21>;
vfront-porch = <7>;
hsync-len = <20>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
timing1: timing1 {
screen-type = <SCREEN_RGB>;
out-face = <OUT_P888>;
color-mode = <COLOR_YCBCR>;
clock-frequency = <74250000>;
hactive = <1024>;
vactive = <600>;
hback-porch = <160>;
hfront-porch = <24>;
vback-porch = <29>;
vfront-porch = <3>;
hsync-len = <136>;
vsync-len = <6>;
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
timing2: timing2 {
screen-type = <SCREEN_RGB>;
out-face = <OUT_P888>;
color-mode = <COLOR_YCBCR>;
clock-frequency = <83500000>;
hactive = <1280>;
vactive = <800>;
hback-porch = <200>;
hfront-porch = <72>;
vback-porch = <22>;
vfront-porch = <3>;
hsync-len = <128>;
vsync-len = <6>;
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
timing3: timing3 {
screen-type = <SCREEN_RGB>;
out-face = <OUT_P888>;
color-mode = <COLOR_YCBCR>;
clock-frequency = <148500000>;
hactive = <1920>;
vactive = <1080>;
hback-porch = <148>;
hfront-porch = <88>;
vback-porch = <36>;
vfront-porch = <4>;
hsync-len = <44>;
vsync-len = <5>;
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
};
};With this setting, the native-mode points to the 1280x800 timing, the framebuffer is initialized to this resolution. And this makes the window manager also use this resolution as physical resolution. Finally I changed the density from 240 to 180.



![[-]](https://tinkerboarding.co.uk/forum/images/collapse.png)