This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building from Source
#51
Hi, all!
I solved my problem by installing on My PC Ubuntu 18.04 64 bit.
And further as wrote lostangel556 in first post.
Reply
#52
(10-14-2017, 03:11 PM)lostangel556 Wrote:
(10-04-2017, 07:15 PM)lobo Wrote: 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:
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:
/* HDMI default vide mode */
#define HDMI_VIDEO_DEFAULT_MODE 523 //1280x800

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):
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.

Big Grin Thank you Lobo, Not only have i managed to compile from the source and fix the hdmi display not turning on from power on, but in following your instructions have fixed my screen resolution issues.
Your display timings, I actually placed them in "arch/arm/boot/dts/lcd-asus.dtsi" instead, as per below. It compiles without error and boots with the correct resolution when a EDID table is not received. Ill have a look at uBoot as well as it could be useful to do similar.
Code:
/*
* Asus tinker board LCD BOX
*/

/ {
............
disp_timings: display-timings {
num_timings = <4>;
native-mode = <&timing1>;
compatible = "rockchip,display-timings";
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>;
};
   };
};
       

I don't seem to be able to get the kernel to build after adding this rk_screen section. I am editing:

kernel/arch/arm/boot/dts/rk3288-miniarm.dts

I tried to add to the below to the end of that file:

Code:
&rk_screen {
       display-timings = <&disp_timings>;
       disp_timings: display-timings {
               native-mode = <&timing0>;
               timing0: timing0 {
                       screen-type = <SCREEN_RGB>;
                       out-face    = <OUT_P888>;
                       color-mode = <COLOR_YCBCR>;
                       clock-frequency = <32000000>;
                       hactive = <800>;
                       vactive = <480>;
                       hback-porch = <45>;
                       hfront-porch = <13>;
                       vback-porch = <128>;
                       vfront-porch = <40>;
                       hsync-len = <3>;
                       vsync-len = <48>;
                       hsync-active = <0>;
                       vsync-active = <0>;
                       de-active = <0>;
                       pixelclk-active = <0>;
                       swap-rb = <0>;
                       swap-rg = <0>;
                       swap-gb = <0>;
               };
       };
};

But when I run:

Code:
make ARCH=arm rk3288-miniarm.img -j8

to build the kernel, I get an error:

Code:
Error: arch/arm/boot/dts/rk3288-miniarm.dts:707.19-20 syntax error

FATAL ERROR: Unable to parse input tree

Which points me to <SCREEN_RGB>. I guess that means the variable is undefined? If I introduce:

Code:
#include <dt-bindings/display/rk_fb.h>

Which seems to define those variables, I get another error of:

Code:
Error: arch/arm/boot/dts/rk3288-miniarm.dts:703.1-11 Label or path rk_screen not found

FATAL ERROR: Syntax error parsing input tree

I don't know how to include the definition of rk_screen, and am generally thinking I am doing the wrong thing.

Which file should I add the rk_screen section too? Is it a specific section of that file? Is there any includes I need to add?

Thanks for your help,
Jon.
Reply
#53
Hello Jon, you are working on the marshmallow kernel or on the Nougat kernel? Note that this thread was for Marshmallow kernel.
Reply
#54
(01-16-2019, 10:51 AM)lobo Wrote: Hello Jon, you are working on the marshmallow kernel or on the Nougat kernel? Note that this thread was for Marshmallow kernel.

Ah, yes I was trying 7.1.2. Is there an alternative guide for that?
Reply
#55
Sorry I don't know as my screens are working out of the box with Android 7.1.2 kernel.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)