15.6FHD lcd screen on A20 with Android

Started by simo, July 23, 2019, 12:26:16 AM

Previous topic - Next topic

simo


Hi there,
I'm trying to use the 15.6FHD lcd screen (LCD-OLinuXino-15.6FHD - rev. H) with A20-OLinuXino-MICRO running Android.

I already know that the prebuild Android images are not usable for this screen and I've to properly compile the fex file and build Android from the source code (I've already build my custom images for 7'' and 10'' rgb lcd display).

Since I've found not too much informations on the fex parameters suitable for the 15.6FHD I've try to:

- look at the NCS8801 datasheet, the RGB/LVDS to eDP converter used on the display companion board, to figure out how to talk to it. But I've also done a lot of assumptions in this activity since this is a programmable device and so can be configured in different ways (and all the config seems to be done by a PIC on the same board connected by i2c)... After few days of tests I've abandoned this way

- start the Linux OS image with the same lcd, change the screen resolution (and the FEX configuration) with ./change_display.sh following
https://www.olimex.com/wiki/A20-OLinuXino-MICRO#How_to_change_HDMI.2C_VGA_and_LCD_resolutions_in_the_official_Debian_image.3F
Then generating a new FEX with a bin2fex from the script.bin the the boot partition and finding there what should be the lcd config parameters.
I've found these:

[disp_init]
disp_init_enable = 1
disp_mode = 0
screen0_output_type = 1
screen0_output_mode = 4
screen1_output_type = 0
screen1_output_mode = 4
fb0_width = 1920
fb0_height = 1080
fb0_framebuffer_num = 2
fb0_format = 10
fb0_pixel_sequence = 0
fb0_scaler_mode_enable = 1
fb1_width = 1024
fb1_height = 600
fb1_framebuffer_num = 2
fb1_format = 10
fb1_pixel_sequence = 0
fb1_scaler_mode_enable = 0
lcd0_backlight = 0
lcd1_backlight = 197
lcd0_bright = 50
lcd0_contrast = 50
lcd0_saturation = 57
lcd0_hue = 50
lcd1_bright = 239
lcd1_contrast = 50
lcd1_saturation = 57
lcd1_hue = 50

[lcd0_para]
lcd_used = 1
lcd_x = 1920
lcd_y = 1080
lcd_dclk_freq = 152
lcd_pwm_not_used = 0
lcd_pwm_ch = 0
lcd_pwm_freq = 1000
lcd_pwm_pol = 1
lcd_max_bright = 240
lcd_min_bright = 64
lcd_if = 3
lcd_hbp = 306
lcd_ht = 2376
lcd_vbp = 62
lcd_vt = 2314
lcd_vspw = 9
lcd_hspw = 60
lcd_hv_if = 0
lcd_hv_smode = 0
lcd_hv_s888_if = 0
lcd_hv_syuv_if = 0
lcd_lvds_ch = 1
lcd_lvds_mode = 0
lcd_lvds_bitwidth = 1
lcd_lvds_io_cross = 0
lcd_cpu_if = 0
lcd_frm = 1
lcd_io_cfg0 = 268435456
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0 = 0x0
lcd_gamma_tbl_1 = 0x10101
lcd_gamma_tbl_255 = 0xffffff
lcd_power_used = 1
lcd_power = port:PH08<1><0><default><1>
lcd_pwm_used = 1
lcd_pwm = port:PB02<2><0><default><default>
lcdd0 = port:PD00<3><0><default><default>
lcdd1 = port:PD01<3><0><default><default>
lcdd2 = port:PD02<3><0><default><default>
lcdd3 = port:PD03<3><0><default><default>
lcdd4 = port:PD04<3><0><default><default>
lcdd5 = port:PD05<3><0><default><default>
lcdd6 = port:PD06<3><0><default><default>
lcdd7 = port:PD07<3><0><default><default>
lcdd8 = port:PD08<3><0><default><default>
lcdd9 = port:PD09<3><0><default><default>
lcdd10 = port:PD10<3><0><default><default>
lcdd11 = port:PD11<3><0><default><default>
lcdd12 = port:PD12<3><0><default><default>
lcdd13 = port:PD13<3><0><default><default>
lcdd14 = port:PD14<3><0><default><default>
lcdd15 = port:PD15<3><0><default><default>
lcdd16 = port:PD16<3><0><default><default>
lcdd17 = port:PD17<3><0><default><default>
lcdd18 = port:PD18<3><0><default><default>
lcdd19 = port:PD19<3><0><default><default>
lcdd20 = port:PD20<3><0><default><default>
lcdd21 = port:PD21<3><0><default><default>


I've then rebuild my Android image with these. Now the OS complete the boot without (apparently) any error, the LCD backligth is turn on and off when the display is supposed to be on and off but...the display remain fully black, no image on it.

- From the Android shell I've also looking for "something" that confirm me the actual display configuration. I didn't find it. The only information I've find is from the command

root@android:/ # am display-size reset

that should reset the screen resolution to the original configuration.
From logcat, it shows

I/WindowManager( 1999): Using new display size: 1920x1080

So seems that Android is using at least the correct resolution 



I'm stuck... :'(

Has someone been able to use the 15.6FHD rev.H lcd display on Android?
Or have some idea on what may be wrong or what be worth to try?


Bye
Simo

simo

Hi Again,
I've done a lot of more tests here...

At first I've just play with the fex file but this is already in my previous post.
The only result I've got here is ...none. The display remain always black, regardless any parameter. And this even if SurfaceFlinger and the android-side didn't log any error on logcat and seems to be initialized with the correct resolution.

So, I've start wondering if the problem may be at a lower level. The SurfaceFlinger process interface the display via the mali.ko kernel module, that is build from the Mali driver (basically the driver of the gpu internal in the arm cpus). I've not found the source code from which the Olimex linux imags are built but looking roughly at the size of the mali kernel modules in both the android and linux images these appear to be very different (size obtained with a lsmod, I'm sorry but I do not have any more an "original" image to report here the sizes I've found).
So, summarizing, it seems that we have different mali gpu driver in the android and linux images. So maybe the problem is in the gpu driver...

In the code we can use to compile our android image from scratch (ref. the great https://www.olimex.com/forum/index.php?topic=2475.0) we can find the source used for the mali kernel modules under
...lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2
Looking at the arm website we can find newer mali driver for Utgard gpu (A20 has an internal Mali-400, the driver source codes are in  https://developer.arm.com/tools-and-software/graphics-and-gaming/mali-drivers/utgard-kernel). I was able to compile the latest 2 version r8p1 and r9 porting the hardware configuration from the old sources (it is just a .h file with few parameters). These new mali.ko modules are loaded without any problem.

Now, one good and one bad news:
- The good one is that whit these modules the 15.6 FHD display, at least, turn on at boot and "try" to show the A20 startup logo (try...there are still problems since I've not a clear image but a screen full of moving lines...but at least the colours are very similar to the a20 startup logo:-)
- The bad one is that SurfaceFlinger now goes in Segmentation Fault.

I strongly suspect that this is bound to the fact that just before it loads the libMali.so (the mali userspace driver) and this should have the same version of the kernel module loaded before. This is definitely a real problem since reading around seems that these are provided only as closed source blobs from the cpu manufacturer.
I've found (here https://bootlin.com/blog/mali-opengl-support-on-allwinner-platforms-with-mainline-linux/) that allwinner has provided that userspace blobs for r8p1 driver (https://github.com/bootlin/mali-blobs). I've also try these in my android image but...these blobs are compiled for linux and not for android, so are useless (they try to exploit libpthread.so that do not exists in android).

Trying to summarize:
something seems to get better using newer mali driver but without the compiled (for Android) userspace driver libMali.so it is quite useless.
I'm wondering if someone (someone at Olimex?) can and know a way to ask for them directly to AllWinner. I do not think there is another way to have them.

Regards
Simone

simo

Still wondering if someone at Olimex can ask for the compiled userspace Mali driver missing above to AllWinner.
Is it possible?

Bye
Simone