Allwinner A13 (Olimex A13SOM) DRM support

208 views
Skip to first unread message
Message has been deleted

Sergio Sota

unread,
Dec 4, 2020, 7:31:35 AM12/4/20
to linux-sunxi
Dear all,

I'm building a linux system for the Olimex A13SOM module. This little module comes
with the Allwinner A13 SOC. In the past we have been using other modules with the
Allwinner A20 SOC and the old sunxi-linux kernel in order to have support for all
the SOC peripherals (as the Video Engine decoder, Mali GPU, etc)

This time we would like to use a mainline kernel, taking into account that by now
almost all peripherals are supported in mainline. We have had luck tunning device
tree (as we were used to use .fex files) and by now we can have Ethernet over SPI,
Can interface over SPI, ALSA audio output, LCD RGB video output, Cryto engine to
generate fast entropy, OpenGL ES support (thanks to LIMA driver and Mesa3d libs)
and so on... but we would like also to have video decoding support.

We have turned on the frontend, backend, video engine in the device tree, build
the kernel with Cedrus V4L M2M driver, libva_vl42_request and v4l2_request_test.
(and also set the CMA memory allocation, environment variables, etc)

Using vainfo everything is ok, the linux driver-libva request part works, but then
we check with v4l2_request_test utility and it fails as there is no DRM support on
our system. We have on the system /dev/video0 and /dev/media0 but no /dev/dri/card0
device (in fact we selected the linux sun4i-drm driver but no message appers on the
boot sequence regarding this, even when build as module it happens nothing...)

We have checked the Cedrus driver information and appears to be no support for the
DRM plane in A13 SOC (broken/missing) and as I understand that means that part of
the picture composing work should be done by software (and that's not reliable)

My question is: is there DRM plane support for A13 SOC? (as time goes on I checked
there has been work done in the mainline kernel and fixes made) Then, in case of no
support, are there plans to add this support in the future? and finally, could we
play video files without this DRM support? by what means?

Thanks in advance for your help and your time, your team have made a wonderful
work. I also apologize for my poor English, and for writing this email as maybe this is
not the proper way to issue this questions, but didn't know other way 🙂

Best Regards,
Sergio Sota

Clément Péron

unread,
Dec 6, 2020, 1:02:09 PM12/6/20
to pika...@gmail.com, linux-sunxi
Hi Sergio,
Sorry I can't help you a lot on this.
I don't know if the wiki is up to date for this.
But note that A13 is similar to R8 => C.H.I.P Computer.
All stuff you found on R8 will be the same for A13.

Have a look at the R8 CHIP device-tree.
https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/sun5i-r8-chip.dts

And check that you have a correct TCON description in your dt.
If you can, post your device-tree.
And don't forget to reply if you make it works :)

Regards,
Clement


>
> Thanks in advance for your help and your time, your team have made a wonderful
> work. I also apologize for my poor English, and for writing this email as maybe this is
> not the proper way to issue this questions, but didn't know other way
>
> Best Regards,
> Sergio Sota
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/a6390bb5-69f1-47a7-864c-399109838857n%40googlegroups.com.

Sergio Sota

unread,
Dec 11, 2020, 11:13:37 AM12/11/20
to linux-sunxi
Hi Clement,

this week we have had no luck with Allwinner A13 video decoding, here you
can find my device tree. We have added panel description (before we used
an uboot configuration) front-end, back-end and tcon. Also on linux mainline
kernel (5.9.11) we have selected DRM_SUN4I and DRM_SUN4I_BACKEND,
but seems to be no DRM plane support on our system (no sun4i-drm kernel
messages and no /dev/dri/card0 device)

Also with VLC player we have selected in the menu the configuration options:
VA-API video decoder and X11 video output (XCB) but no video decoding.
With MPV player instead we can see some video frames, but it seems to be
trying to decode via software, so it is almost like static pictures.

Best Regards,
Sergio Sota

This device tree is based on mainline kernel sun5i-a13-olinuxino-micro.dts

#######################################################
################## DEVICE TREE START #####################
#######################################################


/*
 * Copyright 2012 Maxime Ripard <maxime...@free-electrons.com>
 * Copyright 2013 Hans de Goede <hdeg...@redhat.com>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

/dts-v1/;
#include "sun5i-a13.dtsi"
#include "sunxi-common-regulators.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
    model = "Olimex A13-Olinuxino Micro";
    compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13";

    aliases {
        serial0 = &uart1;
    };

    chosen {
        stdout-path = "serial0:115200n8";
    };

    leds {
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&led_pins_olinuxinom>;

        power {
            label = "a13-olinuxino-micro:green:power";
            gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 */
            default-state = "on";
        };
    };

/*****************************************************************************
 * clock spi0 mcp2515 (spi can controller)
 *****************************************************************************/
    clocks {
        #address-cells = <1>;
        #size-cells = <1>;
        can0_osc_fixed: can0_osc_fixed {
            compatible = "fixed-clock";
            #clock-cells = <0>;
            clock-frequency  = <10000000>;
        };
    };

/*****************************************************************************
 * panel backlight
 *****************************************************************************/
    backlight: backlight {
        compatible = "pwm-backlight";
        pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
        brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
        default-brightness-level = <8>;
    };

/*****************************************************************************
 * panel tft lcd 10.1" (rgb interface)
 *****************************************************************************/
    panel {
        compatible = "olimex,lcd-olinuxino", "simple-panel";
        power-supply = <&reg_vcc3v3>;
        enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
        backlight = <&backlight>;
        status = "okay";

        display-timings {
            timing0 {
                clock-frequency = <45000000>;
                hactive = <1024>;
                vactive = <600>;
                hfront-porch = <16>;
                hback-porch = <150>;
                hsync-len = <10>;
                vback-porch = <2>;
                vfront-porch = <21>;
                vsync-len = <2>;
                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <1>;
            };
        };

        port {
            #address-cells = <1>;
            #size-cells = <0>;

            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };
    };
};

&ehci0 {
    status = "okay";
};

&i2c0 {
    status = "okay";
};

&i2c1 {
    status = "okay";
};

&i2c2 {
    status = "okay";
};

&mmc0 {
    vmmc-supply = <&reg_vcc3v3>;
    bus-width = <4>;
    cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
    status = "okay";
};

&ohci0 {
    status = "okay";
};

&otg_sram {
    status = "okay";
};

&reg_usb0_vbus {
    gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
    status = "okay";
};

&reg_usb1_vbus {
    gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
    status = "okay";
};

&uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_pg_pins>;
    status = "okay";
};

&usb_otg {
    dr_mode = "otg";
    status = "okay";
};

&usbphy {
    usb0_id_det-gpios = <&pio 6 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PG2 */
    usb0_vbus_det-gpios = <&pio 6 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PG1 */
    usb0_vbus-supply = <&reg_usb0_vbus>;
    usb1_vbus-supply = <&reg_usb1_vbus>;
    status = "okay";
};

&pio {
    led_pins_olinuxinom: led-pin {
        pins = "PG9";
        function = "gpio_out";
        drive-strength = <20>;
    };

/*****************************************************************************
 * spi0 pins
 *****************************************************************************/
    spi0_pins: spi0_pins {
        pins = "PC0", "PC1", "PC2";
        function = "spi0";
    };

    spi0_cs0_pin: spi0_cs_pin {
        pins = "PC3";
        function = "spi0";
    };

/*****************************************************************************
 * spi2 ethernet controller (enc28j60) pins
 *****************************************************************************/
    eth0_irq_pin: eth0_irq_pin {
        pins = "PB3";
        function = "irq";
        bias-pull-up;
    };

/*****************************************************************************
 * spi2 pins
 *****************************************************************************/
    spi2_pins: spi2_pins {
        pins = "PE1", "PE2", "PE3";
        function = "spi2";
    };

    spi2_cs0_pin: spi2_cs0_pin {
        pins = "PE0";
        function = "spi2";
    };

/*****************************************************************************
 * spi0 can controller (mcp2515) pins
 *****************************************************************************/
    can0_irq_pin: can0_irq_pin {
        pins = "PB4";
        function = "irq";
        bias-pull-up;
    };
};

/*****************************************************************************
 * spi0 (mcp2515 spi can controller)
 *****************************************************************************/
&spi0 {
    #address-cells = <1>;
    #size-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
    status = "okay";

    mcp2515@0 {
        compatible = "microchip,mcp2515";
        reg = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&can0_irq_pin>;
        interrupt-parent = <&pio>;
        interrupts = <1 4 2>; /* PB4 IRQ_TYPE_EDGE_FALLING */
        clocks = <&can0_osc_fixed>;
        spi-max-frequency = <10000000>;
        status = "okay";
    };
};

/*****************************************************************************
 * spi2 (enc28j60 spi ethernet controller)
 *****************************************************************************/
&spi2 {
    #address-cells = <1>;
    #size-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>, <&spi2_cs0_pin>;
    status = "okay";

    enc28j60@0 {
        compatible = "microchip,enc28j60";
        /* compatible = "microchip,encx24j600"; */
        reg = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&eth0_irq_pin>;
        interrupt-parent = <&pio>;
        interrupts = <1 3 2>; /* PB3 IRQ_TYPE_EDGE_FALLING */
        spi-max-frequency = <12000000>;
        status = "okay";
    };
};

/*****************************************************************************
 * codec audio controller (headphones)
 *****************************************************************************/
&codec {
    status = "okay";
};

/*****************************************************************************
 * crypto engine (sha, md5, rng)
 *****************************************************************************/
&crypto {
    status = "okay";
};

/*****************************************************************************
 * front end (display engine)
 *****************************************************************************/
&fe0 {
    status = "okay";
};

/*****************************************************************************
 * back end (display engine)
 *****************************************************************************/
&be0 {
    status = "okay";
};

/*****************************************************************************
 * pipeline (display engine)
 *****************************************************************************/
&tcon0 {
    pinctrl-names = "default";
    pinctrl-0 = <&lcd_rgb666_pins>;
    status = "okay";
};

/*****************************************************************************
 * timing controller (panel tft lcd 10.1")
 *****************************************************************************/
&tcon0_out {
    tcon0_out_lcd: endpoint@0 {
        reg = <0>;
        remote-endpoint = <&panel_input>;
    };
};

/*****************************************************************************
 * pwm controller
 *****************************************************************************/
&pwm {
    pinctrl-names = "default";
    pinctrl-0 = <&pwm0_pin>;
    status = "okay";
};


#######################################################
################### DEVICE TREE END ######################
#######################################################

Clément Péron

unread,
Dec 11, 2020, 11:37:52 AM12/11/20
to pika...@gmail.com, linux-sunxi
Hi Sergio,

Maybe you missed enabling tve0 ?

https://elixir.bootlin.com/linux/v5.9.13/source/arch/arm/boot/dts/sun5i.dtsi#L244

Also could you send the bootlog is this doesn't fix your issue.

Clement
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/565d70c3-b708-4216-83fd-ae37d42858e0n%40googlegroups.com.

Clément Péron

unread,
Dec 11, 2020, 1:56:16 PM12/11/20
to pika...@gmail.com, linux-sunxi
Hi Sergio,

Sorry looks like the tve0 is only required for composite / VGA output.

Which LCD Panel do you use ?

Looks like the bindings you are using should be declared on a I2C bus.
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/olimex,lcd-olinuxino.yaml

So the drivers will read the configuration from the I2C eeprom
Also check that CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is enabled.

Regards,
Clement

Sergio Sota

unread,
Dec 11, 2020, 2:33:50 PM12/11/20
to linux-sunxi
Hi Clement,

yes, tve0 is only for VGA/CVBS video output (which we don't use right now)
But just in case we have enabled this controller and the result is the same.

You're probably right about the I2C port (as the binding suggest) The thing is
we are using the olimex olinuxino tft lcd 10.1" panel, and as the binding file
states there should be an I2C bus connection (besides the RGB, hsync, vsync,
de, clk, backlight, etc) This I2C bus should connect to an internal eeprom that
contains the timing requirements (then the driver knows what kind of panel is
attached and selects between 4.3/7/10.1 inches olimex panels) But then on
the physical boards there is no I2C bus connecting the panel... (check the
schematics) besides in the future we intend to use other tft lcd 10.1" panels.

Olimex A13SOM board schematic:

Olimex Olinuxino-micro board schematic (with an A13 similar as A13SOM)

Olimex Olinuxino 10.1" tft lcd board schematic

that's why we set the timing in the device tree. So, may be what we should do
is remove the panel from the compatible line and use it only as a generic one:

+compatible = "simple-panel";
-compatible = "olimex,lcd-olinuxino", "simple-panel";

Anyway, we will check both posibilities (defining the panel on a I2C bus and
in the root but only as a generic panel) Thanks again for your invaluable help :-D

Best Regards,
Sergio Sota

Chen-Yu Tsai

unread,
Dec 11, 2020, 10:00:51 PM12/11/20
to pika...@gmail.com, linux-sunxi
On Sat, Dec 12, 2020 at 3:33 AM Sergio Sota <pika...@gmail.com> wrote:
>
> Hi Clement,
>
> yes, tve0 is only for VGA/CVBS video output (which we don't use right now)
> But just in case we have enabled this controller and the result is the same.
>
> You're probably right about the I2C port (as the binding suggest) The thing is
> we are using the olimex olinuxino tft lcd 10.1" panel, and as the binding file
> states there should be an I2C bus connection (besides the RGB, hsync, vsync,
> de, clk, backlight, etc) This I2C bus should connect to an internal eeprom that
> contains the timing requirements (then the driver knows what kind of panel is
> attached and selects between 4.3/7/10.1 inches olimex panels) But then on
> the physical boards there is no I2C bus connecting the panel... (check the
> schematics) besides in the future we intend to use other tft lcd 10.1" panels.
>
> Olimex A13SOM board schematic:
> https://github.com/OLIMEX/SOM/blob/master/A13/A13-SOM/A13-SOM512_Rev_G.pdf
>
> Olimex Olinuxino-micro board schematic (with an A13 similar as A13SOM)
> https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A13-OLinuXino-MICRO/1.%20Latest%20hardware%20revision/A13-OLinuXino-MICRO%20hardware%20revision%20B1/A13-OLinuXino-MICRO_Rev_B1.pdf
>
> Olimex Olinuxino 10.1" tft lcd board schematic
> https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/LCDs/LCD-OLinuXino-10TS/Hardware%20revision%20C1/LCD-OLINUXINO-10''TS_Rev_C.pdf
>
> that's why we set the timing in the device tree. So, may be what we should do
> is remove the panel from the compatible line and use it only as a generic one:
>
> +compatible = "simple-panel";
> -compatible = "olimex,lcd-olinuxino", "simple-panel";
>
> Anyway, we will check both posibilities (defining the panel on a I2C bus and
> in the root but only as a generic panel) Thanks again for your invaluable help :-D

If you want to specify display timings in the device tree, you should be
using the "panel-dpi" compatible, as specified in the panel-dpi binding:

Documentation/devicetree/bindings/display/panel/panel-dpi.yaml

Also, when asking for help, please always include full kernel logs. Others
do not know what is happening on your system and can only guess if you
do not provide logs.

ChenYu
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/2aa1145d-0fc4-4183-84ec-4d89fa566488n%40googlegroups.com.

Sergio Sota

unread,
Dec 15, 2020, 12:51:15 PM12/15/20
to linux-sunxi
Hi Clement and Chen-Yu Tsai,

this time we send the kernel logs as requested, but before that here are our
findings. We have inspected the LCD TFT panel and although it is from Olimex it
is not compatible with the "olimex,lcd-olinuxino" simple panel driver. It has the
very same board but the eeprom ic is not present, this time we checked the I2C
tracks and the olimex documentation. It seems that only some models have this
eeprom installed, and the driver needs this to autodetect the panel model. Also
we would like to use diferent panels in the future, so declaring the panel in the
I2C bus is not an option.

We make some changes to the device tree, as Chen-Yu Tsai suggested the panel
should be declared as a panel-dpi (with timings, backlight, power, etc) Below these
lines you could check our complete device tree. This time nothing happens, in the
kernel logs no sun4i-drm driver messages... but, as we have been trying many many
combinations without luck, when we disable this panel (status "okay" -> "disabled")
then in the kernel logs some sun4i-drm driver messages appear (at last!) some of
them complaining about the frontend and the non existence of panel. By the way,
until now we could see on the panel only thanks to the uboot configuration:

CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:45000,le:150,ri:16,up:21,lo:2,hs:10,vs:2,sync:3,vmode:0"
CONFIG_VIDEO_LCD_POWER="PB10"
CONFIG_VIDEO_LCD_BL_PWM="PB2"

but when we disable the panel on device tree then the panel turns off as linux boot.

Here comes the device tree [1], the kernel logs [2] (no changes) and the messages
that appear when we disable the panel [3] (from the sun4i-drm driver) Note: Don't
take into account other messages regarding the lost of entropy... as we also have
problems with cryptodevice and rng-tools (sunxi crypto) and that is another story.

Thanks again for your help and excuse our ignorance :-)

Best Regards,
Sergio Sota

##################################################################################
[1]###############################################################################
##################################################################################
        status = "okay";
    };

/*****************************************************************************
 * panel tft lcd 10.1" (rgb interface) (default)
 *****************************************************************************/
    panel {

        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "panel-dpi";

        power-supply = <&reg_vcc3v3>;
        enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>;
        backlight = <&backlight>;
        data-mapping = "rgb666";
        width-mm = <224>;
        height-mm = <126>;
        status = "okay";


        port {
            #address-cells = <1>;
            #size-cells = <0>;
            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };

        panel-timing {

            clock-frequency = <45000000>;
            hactive = <1024>;
            vactive = <600>;
            hfront-porch = <16>;
            hback-porch = <150>;
            hsync-len = <10>;
            vback-porch = <2>;
            vfront-porch = <21>;
            vsync-len = <2>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <1>;
            pixelclk-active = <1>;
        };
    };

/*****************************************************************************
 * panel tft lcd 7.0" (rgb interface) (test)
 *****************************************************************************/
/*
    panel {

        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "panel-dpi";

        power-supply = <&reg_vcc3v3>;
        enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>;
        backlight = <&backlight>;
        data-mapping = "rgb666";
        width-mm = <154>;
        height-mm = <86>;
        status = "disabled";


        port {
            #address-cells = <1>;
            #size-cells = <0>;
            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };

        panel-timing {   
            clock-frequency = <33000000>;
            hactive = <800>;
            vactive = <480>;
            hfront-porch = <209>;
            hback-porch = <16>;
            hsync-len = <30>;
            vback-porch = <22>;
            vfront-porch = <22>;
            vsync-len = <1>;

            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <1>;
            pixelclk-active = <1>;
        };
    };
*/
};
 * [fe0] -> [be0] -> [tcon0] |-> [panel] (tft lcd 10.1") <- [pwm]
 *                           |-> [tve0]  (vga/cvbs port)
 *****************************************************************************/


/*****************************************************************************
 * front end (display engine)
 *****************************************************************************/
&fe0 {
    status = "okay";
};

/*****************************************************************************
 * back end (display engine)
 *****************************************************************************/
&be0 {
    status = "okay";
};

/*****************************************************************************
 * pipeline (display engine)
 *****************************************************************************/
&tcon0 {
    pinctrl-names = "default";
    pinctrl-0 = <&lcd_rgb666_pins>;
    status = "okay";
};

/*****************************************************************************
 * timing controller (panel tft lcd 10.1")
 *****************************************************************************/
&tcon0_out {
    tcon0_out_lcd: endpoint@0 {
        reg = <0>;
        remote-endpoint = <&panel_input>;
        allwinner,tcon-channel = <0>;
    };
};

/*****************************************************************************
 * tv encoder controller (vga/cvbs video output)
 *****************************************************************************/
&tve0 {
    status = "okay";
};

/*****************************************************************************

 * pwm controller
 *****************************************************************************/
&pwm {
    pinctrl-names = "default";
    pinctrl-0 = <&pwm0_pin>;
    status = "okay";
};

##################################################################################
[2]###############################################################################
##################################################################################
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.82 (sergio@fanamoel) (gcc version 9.3.0 (Buildroot -gbc8b7d5)) #5 SMP Tue Dec 15 15:39:33 CET 2020
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Olimex A13-Olinuxino Micro
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Reserved memory: created CMA memory pool at 0x43c00000, size 96 MiB
[    0.000000] OF: reserved mem: initialized node default-pool, compatible id shared-dma-pool
[    0.000000] On node 0 totalpages: 64936
[    0.000000]   Normal zone: 508 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 64936 pages, LIFO batch:15
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] percpu: Embedded 15 pages/cpu s30604 r8192 d22644 u61440
[    0.000000] pcpu-alloc: s30604 r8192 d22644 u61440 alloc=15*4096
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64428
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 146872K/259744K available (7168K kernel code, 444K rwdata, 1888K rodata, 1024K init, 248K bss, 14568K reserved, 98304K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2b0/0x458 with crng_init=0
[    0.000020] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000049] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000226] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000479] Console: colour dummy device 80x30
[    0.000539] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
[    0.090102] pid_max: default: 32768 minimum: 301
[    0.090253] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090268] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090998] CPU: Testing write buffer coherency: ok
[    0.091062] CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.091419] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.092041] Setting up static identity map for 0x40100000 - 0x40100060
[    0.092208] rcu: Hierarchical SRCU implementation.
[    0.092657] smp: Bringing up secondary CPUs ...
[    0.092672] smp: Brought up 1 node, 1 CPU
[    0.092681] SMP: Total of 1 processors activated (1001.88 BogoMIPS).
[    0.092688] CPU: All CPU(s) started in SVC mode.
[    0.093136] devtmpfs: initialized
[    0.097192] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.097456] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.097481] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.103293] pinctrl core: initialized pinctrl subsystem
[    0.104439] NET: Registered protocol family 16
[    0.106049] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.106938] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.122081] SCSI subsystem initialized
[    0.122397] libata version 3.00 loaded.
[    0.122640] usbcore: registered new interface driver usbfs
[    0.122693] usbcore: registered new interface driver hub
[    0.122757] usbcore: registered new device driver usb
[    0.122965] mc: Linux media interface: v0.10
[    0.123001] videodev: Linux video capture interface: v2.00
[    0.123058] pps_core: LinuxPPS API ver. 1 registered
[    0.123066] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giom...@linux.it>
[    0.123095] PTP clock support registered
[    0.123321] Advanced Linux Sound Architecture Driver Initialized.
[    0.124291] clocksource: Switched to clocksource timer
[    0.125108] simple-framebuffer 4fda8000.framebuffer: framebuffer at 0x4fda8000, 0x258000 bytes, mapped to 0x(ptrval)
[    0.125127] simple-framebuffer 4fda8000.framebuffer: format=x8r8g8b8, mode=1024x600x32, linelength=4096
[    0.134238] Console: switching to colour frame buffer device 128x37
[    0.142607] simple-framebuffer 4fda8000.framebuffer: fb0: simplefb registered!
[    0.150213] thermal_sys: Registered thermal governor 'step_wise'
[    0.150746] NET: Registered protocol family 2
[    0.151291] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.151321] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.151351] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.151384] TCP: Hash tables configured (established 2048 bind 2048)
[    0.151492] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.151516] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.151661] NET: Registered protocol family 1
[    0.152329] RPC: Registered named UNIX socket transport module.
[    0.152345] RPC: Registered udp transport module.
[    0.152352] RPC: Registered tcp transport module.
[    0.152357] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.153967] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    0.161263] NFS: Registering the id_resolver key type
[    0.161311] Key type id_resolver registered
[    0.161318] Key type id_legacy registered
[    0.161415] NET: Registered protocol family 38
[    0.161475] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.161486] io scheduler mq-deadline registered
[    0.161493] io scheduler kyber registered
[    0.162314] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[    0.165013] sun5i-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.166333] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.166874] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[    0.221806] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.223723] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    0.224815] printk: console [ttyS0] disabled
[    0.244934] 1c28400.serial: ttyS0 at MMIO 0x1c28400 (irq = 36, base_baud = 1500000) is a U6_16550A
[    0.837326] printk: console [ttyS0] enabled
[    0.843446] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.857689] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.868442] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.879549] libphy: Fixed MDIO Bus: probed
[    0.883655] CAN device driver interface
[    1.725254] random: fast init done
[    1.910042] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[    1.916873] mcp251x spi0.0: Probe failed, err=16
[    1.921526] mcp251x: probe of spi0.0 failed with error -16
[    1.927469] enc28j60 spi1.0: Ethernet driver 1.02 loaded
[    1.939158] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.945787] ehci-platform: EHCI generic platform driver
[    1.951703] enc28j60 spi1.0 eth0: link down
[    1.956124] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.962325] ohci-platform: OHCI generic platform driver
[    1.974351] i2c /dev entries driver
[    1.986037] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.995762] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    2.011183] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    2.041601] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    2.049620] sun4i-ss 1c15000.crypto-engine: Die ID 1
[    2.082072] usbcore: registered new interface driver usbhid
[    2.087721] usbhid: USB HID core driver
[    2.097756] cedrus 1c0e000.video-codec: Device registered as /dev/video0
[    2.112019] debugfs: Directory '1c22c00.codec' with parent 'sun4i-codec' already present!
[    2.127627] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[    2.140917] NET: Registered protocol family 17
[    2.145456] can: controller area network core (rev 20170425 abi 9)
[    2.151744] NET: Registered protocol family 29
[    2.156213] can: raw protocol (rev 20170425)
[    2.160482] can: broadcast manager protocol (rev 20170425 t)
[    2.166154] can: netlink gateway (rev 20190810) max_hops=1
[    2.171881] Key type dns_resolver registered
[    2.176290] Registering SWP/SWPB emulation handler
[    2.197283] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    2.213341] ehci-platform 1c14000.usb: EHCI Host Controller
[    2.219052] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[    2.232575] ehci-platform 1c14000.usb: irq 24, io mem 0x01c14000
[    2.238678] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.257069] mmc0: new high speed SDHC card at address aaaa
[    2.267926] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[    2.274677] mmcblk0: mmc0:aaaa SS16G 14.8 GiB
[    2.285113] hub 1-0:1.0: USB hub found
[    2.290522] hub 1-0:1.0: 1 port detected
[    2.299716]  mmcblk0: p1 p2
[    2.304084] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[    2.310840] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 2
[    2.324868] ohci-platform 1c14400.usb: irq 25, io mem 0x01c14400
[    2.407000] hub 2-0:1.0: USB hub found
[    2.410946] hub 2-0:1.0: 1 port detected
[    2.420810] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    2.432117] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    2.437964] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    2.451585] hub 3-0:1.0: USB hub found
[    2.460348] hub 3-0:1.0: 1 port detected
[    2.470321] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    2.486175] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    2.501366] hctosys: unable to open rtc device (rtc0)
[    2.506763] ALSA device list:
[    2.509737]   #0: sun4i-codec
[    2.548014] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.556233] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.573458] devtmpfs: mounted
[    2.578317] Freeing unused kernel memory: 1024K
[    2.588068] Run /sbin/init as init process
[    2.907811] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    3.459578] cryptodev: loading out-of-tree module taints kernel.
[    3.489157] cryptodev: driver 1.11 loaded.
[    3.645748] udevd[91]: starting version 3.2.9
[    3.670450] random: udevd: uninitialized urandom read (16 bytes read)
[    3.698902] random: udevd: uninitialized urandom read (16 bytes read)
[    3.719746] random: udevd: uninitialized urandom read (16 bytes read)
[    3.802315] udevd[92]: starting eudev-3.2.9
[    6.282520] urandom_read: 1 callbacks suppressed
[    6.282531] random: dd: uninitialized urandom read (512 bytes read)
[    6.582832] random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
[    6.614975] random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
[    7.322509] enc28j60 spi1.0 eth0: normal mode
[    7.327010] enc28j60 spi1.0 eth0: multicast mode
[    7.523150] random: crng init done
[    7.526575] random: 2 urandom warning(s) missed due to ratelimiting
[    8.144967] enc28j60 spi1.0 eth0: link up - Half duplex
[   10.983560] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des) -2
[   11.060702] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des3_ede) -2
[   11.172575] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   11.243105] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   11.303542] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   11.541122] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   11.604164] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   11.661342] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   33.124321] vcc3v0: disabling
[   33.127316] vcc5v0: disabling
[   33.130282] usb0-vbus: disabling
[   50.222729] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des) -2
[   50.283230] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des3_ede) -2
[   50.414581] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   50.462177] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   50.531644] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   50.792128] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   50.853913] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   50.912563] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2

##################################################################################
[3]###############################################################################
##################################################################################
....
....
[    0.821822] printk: console [ttyS0] enabled
[    0.827885] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.838967] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[    0.849374] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc084ba58)
[    0.857516] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[    0.865383] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084a5f8)
[    0.873157] sun4i-drm display-engine: bound 1c0a000.tv-encoder (ops 0xc084b318)
[    0.880485] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.887103] [drm] No driver support for vblank timestamp query.
[    0.893018] checking generic (4fe89000 177000) vs hw (0 ffffffff)
[    0.893023] fb0: switching to sun4i-drm-fb from simple
[    0.898563] Console: switching to colour dummy device 80x30
[    0.904878] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    0.960782] Console: switching to colour frame buffer device 90x36
[    0.986888] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[    0.995855] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    1.006602] sun5i-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    1.017640] libphy: Fixed MDIO Bus: probed
[    1.021747] CAN device driver interface
[    1.636375] random: fast init done
....
....

Chen-Yu Tsai

unread,
Dec 15, 2020, 10:29:31 PM12/15/20
to pika...@gmail.com, linux-sunxi
Hi,

On Wed, Dec 16, 2020 at 1:51 AM Sergio Sota <pika...@gmail.com> wrote:
>
> Hi Clement and Chen-Yu Tsai,
>
> this time we send the kernel logs as requested, but before that here are our
> findings. We have inspected the LCD TFT panel and although it is from Olimex it
> is not compatible with the "olimex,lcd-olinuxino" simple panel driver. It has the
> very same board but the eeprom ic is not present, this time we checked the I2C
> tracks and the olimex documentation. It seems that only some models have this
> eeprom installed, and the driver needs this to autodetect the panel model. Also
> we would like to use diferent panels in the future, so declaring the panel in the
> I2C bus is not an option.
>
> We make some changes to the device tree, as Chen-Yu Tsai suggested the panel
> should be declared as a panel-dpi (with timings, backlight, power, etc) Below these
> lines you could check our complete device tree. This time nothing happens, in the
> kernel logs no sun4i-drm driver messages... but, as we have been trying many many
> combinations without luck, when we disable this panel (status "okay" -> "disabled")
> then in the kernel logs some sun4i-drm driver messages appear (at last!) some of
> them complaining about the frontend and the non existence of panel. By the way,
> until now we could see on the panel only thanks to the uboot configuration:

panel-dpi was introduced in v5.7-rc1. You should check whether something is
available in your kernel version before actually using it. We are assuming
you are using the latest mainline kernel.

Since the new LTS is out, I suggest you give it a try.

ChenYu
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/b883b560-95fd-4cee-9c4f-2146fb88db7fn%40googlegroups.com.

Sergio Sota

unread,
Dec 16, 2020, 11:26:29 AM12/16/20
to linux-sunxi
Hi Chen-Yu Tsai,

Thank you so much for your help. You are right, we should have checked first the
panel-dpi kernel support. Our apologies. This time we have build a complete new
system with the last kernel (from our Buildroot version this is kernel 5.9.11)
and with it we have the following kernel logs (the complete log at the end):

================================================================================
...
[    2.160358] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[    2.170868] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc084bb28)
[    2.179113] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084a688)
[    2.186967] sun4i-drm display-engine: bound 1c0a000.tv-encoder (ops 0xc084b3e8)
[    2.194748] checking generic (4fda8000 258000) vs hw (0 ffffffff)
[    2.194757] fb0: switching to sun4i-drm-fb from simple
[    2.200423] Console: switching to colour dummy device 80x30
[    2.206899] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    2.215041] [drm] kms: can't enable cloning when we probably wanted to.
...
================================================================================

so, the sun4i-drm driver emits messages as before, and this time it is not
complaining about the panel (but it still can not find the frontend) Also this
time there is a /dri/card0 device on the system :-) but the panel is dark, not
showing anything on screen... maybe there is some option we are missing, so we
decided to make the following changes:

1) edit "drivers/gpu/drm/panel/panel-simple.c" & add support to our custom panel

================================================================================
...
static const struct drm_display_mode fanamoel_tftlcd10_mode = {
    .clock = 45000,
    .hdisplay = 1024,
    .hsync_start = 1024 + 16,
    .hsync_end = 1024 + 16 + 10,
    .htotal = 1024 + 16 + 10 + 150,
    .vdisplay = 600,
    .vsync_start = 600 + 2,
    .vsync_end = 600 + 2 + 2,
    .vtotal = 600 + 2 + 2 + 21,
};

static const struct panel_desc fanamoel_tftlcd10 = {
    .modes = &fanamoel_tftlcd10_mode,
    .num_modes = 1,
    .size = {
        .width = 224,
        .height = 126,
    },
    .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
    .bus_flags = DRM_BUS_FLAG_DE_HIGH,
};
...
     }, {
        .compatible = "fanamoel,tftlcd10",
        .data = &fanamoel_tftlcd10,
    }, {
...
================================================================================

2) define panel compatible with "fanamoel,tftlcd10" (our custom "simple-panel")
Notice that we removed panel-timings (they are defined now on the driver side)

================================================================================
...

/*****************************************************************************
 * panel backlight
 *****************************************************************************/
    backlight: backlight {
        compatible = "pwm-backlight";
        pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
        brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
        default-brightness-level = <8>;
        enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>;
        status = "okay";
    };

/*****************************************************************************
 * panel tft lcd 10.1" (rgb interface) (default)
 *****************************************************************************/
    panel {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fanamoel,tftlcd10";
        power-supply = <&reg_vcc3v3>;

        backlight = <&backlight>;
        status = "okay";

        port {
            #address-cells = <1>;
            #size-cells = <0>;
            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };
    };
...
================================================================================

Now with these changes the kernel logs are the same, there is no complains about
the panel but no frontend. The /dri/card0 is still present and this time the
panel is working
, we can see our apps on screen. With /sys/class/backlight we
can turn on/off the screen and change the brightness... so far so good. Here you
can see the vainfo output:

================================================================================
vainfo: VA-API version: 1.9 (libva 2.9.0)
vainfo: Driver version: v4l2-request
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264MultiviewHigh      :    VAEntrypointVLD
      VAProfileH264StereoHigh         :    VAEntrypointVLD
================================================================================

But again, we still can not play video, we have /dev/dri/card0, /dev/video0 and
/dev/media0... libva and libva_v4l2_request, but when we use the video test app
v4l2_request_test this is the output:

================================================================================
Config:
 Video path: /dev/video0
 Media path: /dev/media0
 DRM path: /dev/dri/card0
 DRM driver: sun4i-drm
 Slices path: data/bbb-mpeg2
 Slices filename format: slice-%d.dump
 FPS: 0

Preset:
 Name: bbb-mpeg2
 Description: big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG
 License: Creative Commons Attribution 3.0
 Attribution: Blender Foundation | www.blender.org
 Width: 854
 Height: 480
 Frames count: 25
 Format: MPEG2

Media device driver: cedrus
Destination format: NV12 YUV
Unable to find any plane for CRTC 43
Unable to select DRM plane for CRTC 43
Unable to start display engine

================================================================================

We think we are getting close to solve this problem. Maybe it is something
related with the frontend not being bound
? We checked why there is no frontend
enabled, and in drivers/gpu/drm/sun4i/sun4i_backend.c when the backend is being
set there is a part that loads a list of frontends for that backend... but this
list is empty
... so no frontend is found. This list is filled from the function
sun4i_frontend_bind in drivers/gpu/drm/sun4i/sun4i_frontend.c but we believe
that binding process is never called.

We will keep on searching for a solution. Any help or clue would be greatly
appreciated
. As always thank you so much for your help :-)

Best Regards,
Sergio Sota

Here are again the complete device tree and kernel logs (as you never know)

================================================================================
        enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>;
        status = "okay";
    };

/*****************************************************************************
 * panel tft lcd 10.1" (rgb interface) (default)
 *****************************************************************************/
    panel {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fanamoel,tftlcd10";
        power-supply = <&reg_vcc3v3>;

        backlight = <&backlight>;
        status = "okay";

        port {
            #address-cells = <1>;
            #size-cells = <0>;
            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };
    };


/*****************************************************************************
 * panel tft lcd 7.0" (rgb interface) (test)
 *****************************************************************************/
/*
    panel {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fanamoel,tftlcd7";
        power-supply = <&reg_vcc3v3>;

        backlight = <&backlight>;
        status = "okay";

        port {
            #address-cells = <1>;
            #size-cells = <0>;
            panel_input: endpoint {
                remote-endpoint = <&tcon0_out_lcd>;
            };
        };
    };
================================================================================

The CAN controller is unplugged and the Ethernet controller is plugged but with
no conection (just ignore those parts as well as the system crypto low entropy)

================================================================================
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.9.11 (sergio@fanamoel) (arm-buildroot-linux-gnueabihf-gcc.br_real (Buildroot -gbadaf6c) 9.3.0, GNU ld (GNU Binutils) 2.34) #3 SMP Wed Dec 16 14:29:27 CET 2020

[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Olimex A13-Olinuxino Micro
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Reserved memory: created CMA memory pool at 0x43c00000, size 96 MiB
[    0.000000] OF: reserved mem: initialized node default-pool, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x000000004fda7fff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000004fda7fff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fda7fff]
[    0.000000] On node 0 totalpages: 64936

[    0.000000]   Normal zone: 508 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 64936 pages, LIFO batch:15
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] percpu: Embedded 15 pages/cpu s30924 r8192 d22324 u61440
[    0.000000] pcpu-alloc: s30924 r8192 d22324 u61440 alloc=15*4096

[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64428
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 146824K/259744K available (7168K kernel code, 493K rwdata, 1984K rodata, 1024K init, 249K bss, 14616K reserved, 98304K cma-reserved, 0K highmem)

[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x324/0x4cc with crng_init=0

[    0.000020] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000049] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000212] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000477] Console: colour dummy device 80x30
[    0.000531] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
[    0.090101] pid_max: default: 32768 minimum: 301
[    0.090258] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090273] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090989] CPU: Testing write buffer coherency: ok
[    0.091045] CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.091323] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.091934] Setting up static identity map for 0x40100000 - 0x40100060
[    0.092102] rcu: Hierarchical SRCU implementation.
[    0.092527] smp: Bringing up secondary CPUs ...
[    0.092541] smp: Brought up 1 node, 1 CPU
[    0.092550] SMP: Total of 1 processors activated (1001.88 BogoMIPS).
[    0.092557] CPU: All CPU(s) started in SVC mode.
[    0.092994] devtmpfs: initialized
[    0.096978] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.097233] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.097257] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.103257] pinctrl core: initialized pinctrl subsystem
[    0.104596] NET: Registered protocol family 16
[    0.106254] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.107079] thermal_sys: Registered thermal governor 'step_wise'
[    0.107468] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.127598] SCSI subsystem initialized
[    0.127896] libata version 3.00 loaded.
[    0.128149] usbcore: registered new interface driver usbfs
[    0.128205] usbcore: registered new interface driver hub
[    0.128265] usbcore: registered new device driver usb
[    0.128464] mc: Linux media interface: v0.10
[    0.128500] videodev: Linux video capture interface: v2.00
[    0.128552] pps_core: LinuxPPS API ver. 1 registered
[    0.128559] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giom...@linux.it>
[    0.128586] PTP clock support registered
[    0.129076] Advanced Linux Sound Architecture Driver Initialized.
[    0.130049] clocksource: Switched to clocksource timer
[    0.131075] simple-framebuffer 4fda8000.framebuffer: framebuffer at 0x4fda8000, 0x258000 bytes, mapped to 0x(ptrval)
[    0.131096] simple-framebuffer 4fda8000.framebuffer: format=x8r8g8b8, mode=1024x600x32, linelength=4096
[    0.140401] Console: switching to colour frame buffer device 128x37
[    0.148997] simple-framebuffer 4fda8000.framebuffer: fb0: simplefb registered!
[    0.156373] NET: Registered protocol family 2
[    0.156929] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.156959] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.156988] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.157021] TCP: Hash tables configured (established 2048 bind 2048)
[    0.157141] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.157165] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.157317] NET: Registered protocol family 1
[    0.157985] RPC: Registered named UNIX socket transport module.
[    0.158000] RPC: Registered udp transport module.
[    0.158006] RPC: Registered tcp transport module.
[    0.158012] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.159580] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    0.165885] NFS: Registering the id_resolver key type
[    0.165937] Key type id_resolver registered
[    0.165945] Key type id_legacy registered
[    0.166044] NET: Registered protocol family 38
[    0.166103] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.166114] io scheduler mq-deadline registered
[    0.166122] io scheduler kyber registered
[    0.166828] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[    0.169423] sun5i-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.170946] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[    0.171854] pwm-backlight backlight: supply power not found, using dummy regulator
[    0.225448] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.227473] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[    0.228494] printk: console [ttyS0] disabled
[    0.248662] 1c28400.serial: ttyS0 at MMIO 0x1c28400 (irq = 36, base_baud = 1500000) is a U6_16550A
[    0.875214] printk: console [ttyS0] enabled
[    0.881534] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pd not found, using dummy regulator
[    0.895286] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pc not found, using dummy regulator
[    0.904892] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pe not found, using dummy regulator
[    0.915183] libphy: Fixed MDIO Bus: probed
[    0.919291] CAN device driver interface
[    1.740659] random: fast init done
[    1.940948] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[    1.947761] mcp251x spi0.0: Probe failed, err=16
[    1.952433] mcp251x: probe of spi0.0 failed with error -16
[    1.958369] enc28j60 spi1.0: Ethernet driver 1.02 loaded
[    1.970127] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.976658] ehci-platform: EHCI generic platform driver
[    1.982563] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.988772] ohci-platform: OHCI generic platform driver
[    1.995862] i2c /dev entries driver
[    2.002576] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    2.012408] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[    2.021889] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    2.051130] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    2.059481] sun4i-ss 1c15000.crypto-engine: Die ID 1
[    2.067498] usbcore: registered new interface driver usbhid
[    2.073154] usbhid: USB HID core driver
[    2.078347] cedrus 1c0e000.video-codec: Device registered as /dev/video0
[    2.087894] debugfs: Directory '1c22c00.codec' with parent 'sun4i-codec' already present!
[    2.100096] NET: Registered protocol family 17
[    2.104574] can: controller area network core (rev 20170425 abi 9)
[    2.110886] NET: Registered protocol family 29
[    2.115332] can: raw protocol (rev 20170425)
[    2.119597] can: broadcast manager protocol (rev 20170425 t)
[    2.125280] can: netlink gateway (rev 20190810) max_hops=1
[    2.130991] Key type dns_resolver registered
[    2.135370] Registering SWP/SWPB emulation handler
[    2.151553] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pd not found, using dummy regulator
[    2.160358] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[    2.170868] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc084bb28)
[    2.179113] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084a688)
[    2.186967] sun4i-drm display-engine: bound 1c0a000.tv-encoder (ops 0xc084b3e8)
[    2.194748] checking generic (4fda8000 258000) vs hw (0 ffffffff)
[    2.194757] fb0: switching to sun4i-drm-fb from simple
[    2.200423] Console: switching to colour dummy device 80x30
[    2.206899] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    2.215041] [drm] kms: can't enable cloning when we probably wanted to.
[    2.253210] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.255820] mmc0: new high speed SDHC card at address aaaa
[    2.256896] mmcblk0: mmc0:aaaa SS16G 14.8 GiB
[    2.268565] Console: switching to colour frame buffer device 128x37
[    2.268963]  mmcblk0: p1 p2
[    2.310585] sun4i-drm display-engine: [drm] fb0: sun4i-drmdrmfb frame buffer device
[    2.319325] ehci-platform 1c14000.usb: EHCI Host Controller
[    2.325001] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[    2.333338] ehci-platform 1c14000.usb: irq 24, io mem 0x01c14000
[    2.360058] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[    2.367049] hub 1-0:1.0: USB hub found
[    2.370931] hub 1-0:1.0: 1 port detected
[    2.376142] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[    2.382899] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 2
[    2.391110] ohci-platform 1c14400.usb: irq 25, io mem 0x01c14400
[    2.465629] hub 2-0:1.0: USB hub found
[    2.469499] hub 2-0:1.0: 1 port detected
[    2.476836] usb_phy_generic usb_phy_generic.0.auto: supply vcc not found, using dummy regulator
[    2.486635] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    2.492497] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    2.502140] hub 3-0:1.0: USB hub found
[    2.505944] hub 3-0:1.0: 1 port detected
[    2.511097] ALSA device list:
[    2.514077]   #0: sun4i-codec
[    2.531856] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.540153] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.550891] devtmpfs: mounted
[    2.555420] Freeing unused kernel memory: 1024K
[    2.561234] Run /sbin/init as init process
[    2.565328]   with arguments:
[    2.565332]     /sbin/init
[    2.565335]     earlyprintk
[    2.565339]   with environment:
[    2.565342]     HOME=/
[    2.565345]     TERM=linux
[    2.787451] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    3.244581] cryptodev: loading out-of-tree module taints kernel.
[    3.262087] cryptodev: driver 1.11 loaded.
[    3.401014] udevd[93]: starting version 3.2.9
[    3.420607] random: udevd: uninitialized urandom read (16 bytes read)
[    3.438036] random: udevd: uninitialized urandom read (16 bytes read)
[    3.450468] random: udevd: uninitialized urandom read (16 bytes read)
[    3.513141] udevd[94]: starting eudev-3.2.9
[    5.478117] urandom_read: 1 callbacks suppressed
[    5.478129] random: dd: uninitialized urandom read (512 bytes read)
[    5.681727] random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
[    5.688872] random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
[    6.382095] enc28j60 spi1.0 eth0: link down
[    6.386333] enc28j60 spi1.0 eth0: normal mode
[    6.390842] enc28j60 spi1.0 eth0: multicast mode
[    6.804280] enc28j60 spi1.0 eth0: multicast mode
[    7.062588] enc28j60 spi1.0 eth0: multicast mode
[    7.105573] enc28j60 spi1.0 eth0: multicast mode
[    7.571521] urandom_read: 2 callbacks suppressed
[    7.571531] random: Xorg: uninitialized urandom read (4 bytes read)
[   10.011691] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des) -2
[   10.083236] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des3_ede) -2
[   10.219528] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   10.286269] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   10.339046] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   10.589844] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   10.648573] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   10.728593] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   11.339471] random: crng init done
[   33.130114] vcc3v0: disabling
[   33.133111] vcc5v0: disabling
[   33.136076] usb0-vbus: disabling
[   52.648035] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des) -2
[   52.698076] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(des3_ede) -2
[   52.797900] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   52.847854] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   52.897976] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for cbc(aes) -2
[   53.097935] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   53.147903] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
[   53.198167] sun4i-ss 1c15000.crypto-engine: ERROR: Cannot allocate fallback for ecb(aes) -2
================================================================================

Chen-Yu Tsai

unread,
Dec 16, 2020, 12:36:42 PM12/16/20
to pika...@gmail.com, linux-sunxi
Hi,
I'm not sure what went wrong. Maybe something was parsed incorrectly?
Anyway, if the current solution works for you, then stick to it I guess.
The simple reason is: sun5i-a13-display-frontend was not added to the driver.
Simply put, no one did the work to add support for the A10s/A13 display
frontend. You could try changing the compatible to sun4i-a10-display-frontend,
or add an entry for sun5i-a13-display-frontend to the driver, using the same
settings as the A10 or the A20 for testing.

And yes, on the A13, to display the image decoded from cedrus directly
requires the frontend to be present to convert the tiled image format.

Also, IIRC libva-v4l2-request is deprecated.

ChenYu
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/6487b49e-2498-4e4d-bf28-460d23e57b4fn%40googlegroups.com.

Jernej Å krabec

unread,
Dec 16, 2020, 12:39:56 PM12/16/20
to pika...@gmail.com, linux...@googlegroups.com, linux-sunxi, we...@kernel.org
Dne sreda, 16. december 2020 ob 18:36:25 CET je Chen-Yu Tsai napisal(a):
At least headers in that repo are out of date, so it won't work for H264.
MPEG2 might still work.

Best regards,
Jernej
> > backlight: backlight {
> >
> > compatible = "pwm-backlight";
> > pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
> > brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
> > default-brightness-level = <8>;
> > enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>;
> > status = "okay";
> >
> > };
> >
> > /*************************************************************************
> > ****>
> > * panel tft lcd 10.1" (rgb interface) (default)
> > *************************************************************************
> > ****/>
> > panel {
> >
> > #address-cells = <1>;
> > #size-cells = <0>;
> > compatible = "fanamoel,tftlcd10";
> > power-supply = <&reg_vcc3v3>;
> > backlight = <&backlight>;
> > status = "okay";
> >
> > port {
> >
> > #address-cells = <1>;
> > #size-cells = <0>;
> > panel_input: endpoint {
> >
> > remote-endpoint = <&tcon0_out_lcd>;
> >
> > };
> >
> > };
> >
> > };
> >
> > /*************************************************************************
> > ****>
> >> > ############ /*
> >> > ******/ backlight: backlight {
> >> > compatible = "pwm-backlight";
> >> > pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
> >> > brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
> >> > default-brightness-level = <8>;
> >> > status = "okay";
> >> > };
> >> >
> >> > /**********************************************************************
> >> > ******* * panel tft lcd 10.1" (rgb interface) (default)
> >> > ***********************************************************************
> >> > ******* * panel tft lcd 7.0" (rgb interface) (test)
> >> > ***********************************************************************
> >> > #######################################################################
> >> > ###########
> >> > [2]###################################################################
> >> > ############
> >> > ######################################################################
> >> >> >> > > *************** * clock spi0 mcp2515 (spi can controller)
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ clocks {
> >> >> >> > > #address-cells = <1>;
> >> >> >> > > #size-cells = <1>;
> >> >> >> > > can0_osc_fixed: can0_osc_fixed {
> >> >> >> > > compatible = "fixed-clock";
> >> >> >> > > #clock-cells = <0>;
> >> >> >> > > clock-frequency = <10000000>;
> >> >> >> > > };
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * panel backlight
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ backlight: backlight {
> >> >> >> > > compatible = "pwm-backlight";
> >> >> >> > > pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
> >> >> >> > > brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
> >> >> >> > > default-brightness-level = <8>;
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * panel tft lcd 10.1" (rgb interface)
> >> >> >> > > ***************************************************************
> >> >> >> > > *************** * front end (display engine)
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ &fe0 {
> >> >> >> > > status = "okay";
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * back end (display engine)
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ &be0 {
> >> >> >> > > status = "okay";
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * pipeline (display engine)
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ &tcon0 {
> >> >> >> > > pinctrl-names = "default";
> >> >> >> > > pinctrl-0 = <&lcd_rgb666_pins>;
> >> >> >> > > status = "okay";
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * timing controller (panel tft lcd 10.1")
> >> >> >> > > ***************************************************************
> >> >> >> > > **************/ &tcon0_out {
> >> >> >> > > tcon0_out_lcd: endpoint@0 {
> >> >> >> > > reg = <0>;
> >> >> >> > > remote-endpoint = <&panel_input>;
> >> >> >> > > };
> >> >> >> > > };
> >> >> >> > >
> >> >> >> > > /**************************************************************
> >> >> >> > > *************** * pwm controller
> >> >> >> > > ***************************************************************
> >> >> >> > > https://groups.google.com/d/msgid/linux-sunxi/565d70c3-b708-42
> >> >> >> > > 16-83fd-ae37d42858e0n%40googlegroups.com.>> >> >
> >> >> > --
> >> >> > You received this message because you are subscribed to the Google
> >> >> > Groups "linux-sunxi" group. To unsubscribe from this group and stop
> >> >> > receiving emails from it, send an email to
> >> >> > linux-sunxi...@googlegroups.com. To view this discussion on the
> >> >> > web, visit
> >> >> > https://groups.google.com/d/msgid/linux-sunxi/2aa1145d-0fc4-4183-84
> >> >> > ec-4d89fa566488n%40googlegroups.com.>> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups "linux-sunxi" group. To unsubscribe from this group and stop
> >> > receiving emails from it, send an email to
> >> > linux-sunxi...@googlegroups.com. To view this discussion on the web,
> >> > visit
> >> > https://groups.google.com/d/msgid/linux-sunxi/b883b560-95fd-4cee-9c4f-> >> > 2146fb88db7fn%40googlegroups.com.>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "linux-sunxi" group. To unsubscribe from this group and stop receiving
> > emails from it, send an email to
> > linux-sunxi...@googlegroups.com. To view this discussion on the
> > web, visit
> > https://groups.google.com/d/msgid/linux-sunxi/6487b49e-2498-4e4d-bf28-460
> > d23e57b4fn%40googlegroups.com.




Sergio Sota

unread,
Dec 18, 2020, 10:31:09 AM12/18/20
to linux-sunxi
Hi Clement, Chen-Yu Tsai and Jernej Å krabec,

we have updated the device tree frontend as suggested (taking into account that
sun5i-a13-display-frontend was not added to the driver and that the a10 frontend
should be compatible) to sun4i-a10-display-frontend. Now the kernel logs are:

<<<===========================================================
...
[    2.171465] Key type dns_resolver registered
[    2.175845] Registering SWP/SWPB emulation handler
[    2.191990] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pd not found, using dummy regulator
[    2.200843] sun4i-drm display-engine: bound 1e00000.display-frontend (ops 0xc084c328)
[    2.209107] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc084bb68)
[    2.217464] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc084a6c8)
[    2.225311] sun4i-drm display-engine: bound 1c0a000.tv-encoder (ops 0xc084b428)

[    2.233146] checking generic (4fda8000 258000) vs hw (0 ffffffff)
[    2.233154] fb0: switching to sun4i-drm-fb from simple
[    2.238746] Console: switching to colour dummy device 80x30
[    2.245271] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 1
[    2.253402] [drm] kms: can't enable cloning when we probably wanted to.

[    2.291290] mmc0: host does not support reading read-only switch, assuming write-enable
...
===========================================================>>>

everything is ok now, we also check that there is also no mali gpu declaration
on a13 device tree so we added the very same from a10 (in documentation it is
said that they have the same gpu mali-400) and also enabled the display-engine

<<<===========================================================
...
/soc {
    mali: gpu@1c40000 {
        compatible = "allwinner,sun4i-a10-mali", "arm,mali-400";
        reg = <0x01c40000 0x10000>;
        interrupts = <69>, <70>, <71>, <72>,  <73>;
        interrupt-names = "gp", "gpmmu", "pp0", "ppmmu0", "pmu";
        clocks = <&ccu CLK_AHB_GPU>, <&ccu CLK_GPU>;
        clock-names = "bus", "core";
        resets = <&ccu RST_GPU>;
        assigned-clocks = <&ccu CLK_GPU>;
        assigned-clock-rates = <384000000>;
    };

}
...
/{
    de: display-engine {
        compatible = "allwinner,sun5i-a13-display-engine";
        allwinner,pipelines = <&fe0>;
    };
};
...
&de {
    status = "okay";
};

&mali {
    status = "okay";
};

...
===========================================================>>>

Now the mali gpu and lima kernel driver are correctly loaded:

<<<===========================================================
...
[    0.881876] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pd not found, using dummy regulator
[    0.895920] lima 1c40000.gpu: gp - mali400 version major 1 minor 1
[    0.902267] lima 1c40000.gpu: pp0 - mali400 version major 1 minor 1
[    0.908568] lima 1c40000.gpu: l2 cache 32K, 4-way, 64byte cache line, 64bit external bus
[    0.917322] lima 1c40000.gpu: bus rate = 300000000
[    0.922177] lima 1c40000.gpu: mod rate = 384000000
[    0.927515] [drm] Initialized lima 1.1.0 20191231 for 1c40000.gpu on minor 0

[    0.935599] sun5i-pinctrl 1c20800.pinctrl: supply vcc-pc not found, using dummy regulator
...
===========================================================>>>

we have completed a drm driver test with the "modetest" tool and this command:
"modetest -M sun4i-drm -s 49@47:1024x600-60" (only mode supported on our panel)
and the result is correct, we can see the color bars on screen, the drm works!
we also have completed a kms driver test with "kmscube" tool and we can see a
3dcube on screen with 60fps at only 10% cpu, the kms works! With a video the
test report 20fps at 42% cpu ("kmscube -V test.mpg")

I would like to thank you all for your help regarding this issue, it seems that
now we finally have drm support on allwinner a13 soc :-)


But v4l2_request_test didn't work (as reported, it has out of date headers and
is now deprecated) So we still can not play video files on the system. We have
also tried with mpv, vlc (as sunxi reported) and gstreamer... with no luck :-(

May be is another topic, or maybe it is related, but that's what we know:
We have installed mesa3d library following the linux sunxi instructions, and
now we have libEGL.so.1.0.0 / libGLESv1_CM.so.1.1.0 / libGLESv2.so.2.0.0 on our
system, but when we launch a test such as "glxgears" app we only reach 15fps.
What's more, when a QT app such as vlc is launched we get the following message:
"libEGL warning: DRI2: failed to authenticate"
(the libs in /usr/lib/libEGL-libGLESv1_CM-libGLESv2 are the only ones on system)
Seems as if there is no hardware gpu use / access, but we created correctly the
mesa3d libs (check the following build configure info) and QT openGLES support.

<<<===========================================================
...
Message: Configuration summary:
        
        prefix:          /usr
        libdir:          lib
        includedir:      include
        
        OpenGL:          yes (ES1: yes ES2: yes)
        OSMesa:          no
        
        DRI platform:    drm
        DRI drivers:     no
        DRI driver dir:  /usr/lib/dri
        
        GLX:             DRI-based
        
        EGL:             yes
        EGL drivers:     builtin:egl_dri2
        GBM:             yes
        EGL/Vulkan/VL platforms:   x11 surfaceless drm
        
        Vulkan drivers:  no
        
        llvm:            no
        
        Gallium drivers: kmsro lima panfrost swrast
        Gallium st:      mesa
        HUD lmsensors:   no
        
        Shared-glapi:    yes

Build targets in project: 121

Option buildtype is: release [default: debugoptimized]
...
===========================================================>>>


We will keep on searching for a solution.
Any help or clue would be greatly
appreciated
. Even at the risk of being tiring, thank you very much for your help

Best Regards,
Sergio Sota

Sergio Sota

unread,
Dec 22, 2020, 11:50:31 AM12/22/20
to linux-sunxi
Hi Clement, Chen-Yu Tsai and Jernej Å krabec,

the last question was of topic (as the A13SOM drm driver support was solved)
but just to complete here are our findings and solution to this issue.

we finally found the problem: x11-server was compiled without glamor driver.
Before we enabled glamor we have only software rendering on x11, but checking
mesa3d documentation: to use OpenGL with Lima driver and x11 there is needed
modesetting & glamor drivers (the last one where missed by a libepoxy library
dependency) Then the message "libEGL warning: DRI2: failed to authenticate" no
longer appears... but now all OpenGL apps crash (with a "Segmentation fault")
We checked the /tmp/Xorg.0.log file and found only one error message:

...
(EE) AIGLX error: sun4i-drm does not export required DRI extension
(II) IGLX: Loaded and initialized swrast

...

The solution was found thanks to the following post, short story: the xserver
doesn't recognize drivers with hyphen in the name (sun4i-drm), we use xorg
version 1.20.9 and have found there is needed a patch (located in the post)

"https://forum.clockworkpi.com/t/apt-full-upgrade-getting-the-new-software-updates-from-debian/5664"

Once we aplied the patch there are no more error messages on Xorg.0.log

...
(II) AIGLX: Loaded and initialized sun4i-drm
(II) GLX: Initialized DRI2 GL provider for screen 0

...

All seems to be fine, but OpenGL apps still crash. If we use kmscube test
(after killing xorg server to permit the access) the app works fine (60fps)

We have reported this issue to the mesa3d-users mail list and will keep on

searching for a solution. Any help or clue would be greatly appreciated.
Thanks for your help and time!

Best Regards,
Sergio Sota

Here are our xorg.conf and /tmp/Xorg.0.log

==============================================================================
# Monitors represent physical monitors.
Section "Monitor"
        Identifier      "LCD-0"
EndSection

# Devices represent video cards or similars.
#Section "Device"
        Identifier      "FBDEV-0"
#EndSection

# Screen sections connect Devices to Monitors.
Section "Screen"
        Identifier      "SCREEN-0"
        Device          "FBDEV-0"
        Monitor         "LCD-0"
EndSection

# InputClass to add some options to the detected TouchScreen
Section "InputClass"
        Identifier      "LCDTS-0"
        Driver          "evdev"
        MatchProduct    "Goodix"
#       Option          "TransformationMatrix" "0.587156 0 0 0 1 0 0 0 1"
EndSection

# OutputClass to add some options to the detected GPU
Section "OutputClass"
        Identifier      "LIMA-0"
        MatchDriver     "sun4i-drm"
        Driver          "modesetting"
#       Option          "PrimaryGPU" "true"
EndSection

# ServerFlags add some configurations to ServerLayout.
Section "ServerFlags"
        Option          "BlankTime" "0"
        Option          "StandbyTime" "0"
        Option          "SuspendTime" "0"
        Option          "OffTime" "0"
        Option          "AutoAddGPU" "off"
        Option          "Debug" "dmabuf_capable"
EndSection

# ServerLayout define input/output devices used for X server.
Section "ServerLayout"
        Identifier      "LAYOUT-0"
        Screen          0 "SCREEN-0"
EndSection
==============================================================================

==============================================================================
[     6.913]
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[     6.913] Build Operating System: Linux 4.15.0-115-generic x86_64
[     6.913] Current Operating System: Linux fanamoel-tk10 5.9.11 #1 SMP Mon Dec 21 15:09:42 CET 2020 armv7l
[     6.913] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[     6.913] Build Date: 21 December 2020  05:18:05PM
[     6.913]  
[     6.913] Current version of pixman: 0.40.0
[     6.913]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[     6.913] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     6.913] (==) Log file: "/var/log/Xorg.0.0.log", Time: Thu Jan  1 00:00:06 1970
[     6.935] (==) Using config file: "/etc/X11/xorg.conf"
[     6.935] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     6.939] (==) ServerLayout "LAYOUT-0"
[     6.939] (**) |-->Screen "SCREEN-0" (0)
[     6.939] (**) |   |-->Monitor "LCD-0"
[     6.946] (**) |   |-->Device "FBDEV-0"
[     6.946] (**) Option "BlankTime" "0"
[     6.946] (**) Option "StandbyTime" "0"
[     6.946] (**) Option "SuspendTime" "0"
[     6.946] (**) Option "OffTime" "0"
[     6.946] (**) Option "AutoAddGPU" "off"
[     6.946] (**) Option "Debug" "dmabuf_capable"
[     6.946] (==) Automatically adding devices
[     6.946] (==) Automatically enabling devices
[     6.946] (**) Not automatically adding GPU devices
[     6.946] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     6.960] (WW) The directory "/usr/share/fonts/X11//TTF/" does not exist.
[     6.960]     Entry deleted from font path.
[     6.960] (WW) The directory "/usr/share/fonts/X11//OTF/" does not exist.
[     6.960]     Entry deleted from font path.
[     6.960] (WW) The directory "/usr/share/fonts/X11//Type1/" does not exist.
[     6.960]     Entry deleted from font path.
[     6.961] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/X11//100dpi/".
[     6.962]     Entry deleted from font path.
[     6.962]     (Run 'mkfontdir' on "/usr/share/fonts/X11//100dpi/").
[     6.963] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/X11//75dpi/".
[     6.963]     Entry deleted from font path.
[     6.963]     (Run 'mkfontdir' on "/usr/share/fonts/X11//75dpi/").
[     6.963] (==) FontPath set to:
    /usr/share/fonts/X11//misc/
[     6.963] (==) ModulePath set to "/usr/lib/xorg/modules"
[     6.963] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[     6.963] (II) Loader magic: 0x1dde08
[     6.963] (II) Module ABI versions:
[     6.963]     X.Org ANSI C Emulation: 0.4
[     6.963]     X.Org Video Driver: 24.1
[     6.963]     X.Org XInput driver : 24.1
[     6.963]     X.Org Server Extension : 10.0
[     6.965] (II) xfree86: Adding drm device (/dev/dri/card1)
[     6.965] (II) Platform probe for /sys/devices/platform/display-engine/drm/card1
[     6.982] (II) xfree86: Adding drm device (/dev/dri/card0)
[     6.982] (II) Platform probe for /sys/devices/platform/soc/1c40000.gpu/drm/card0
[     6.983] (**) OutputClass "LIMA-0" setting /dev/dri/card1 as PrimaryGPU
[     6.983] (II) LoadModule: "glx"
[     6.998] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     7.095] (II) Module glx: vendor="X.Org Foundation"
[     7.095]     compiled for 1.20.9, module version = 1.0.0
[     7.095]     ABI class: X.Org Server Extension, version 10.0
[     7.095] (II) Applying OutputClass "LIMA-0" to /dev/dri/card1
[     7.095]     loading driver: modesetting
[     7.095] (==) Matched modesetting as autoconfigured driver 0
[     7.095] (==) Matched fbdev as autoconfigured driver 1
[     7.095] (==) Assigned the driver to the xf86ConfigLayout
[     7.095] (II) LoadModule: "modesetting"
[     7.096] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[     7.102] (II) Module modesetting: vendor="X.Org Foundation"
[     7.102]     compiled for 1.20.9, module version = 1.20.9
[     7.102]     Module class: X.Org Video Driver
[     7.102]     ABI class: X.Org Video Driver, version 24.1
[     7.102] (II) LoadModule: "fbdev"
[     7.103] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[     7.105] (II) Module fbdev: vendor="X.Org Foundation"
[     7.105]     compiled for 1.20.9, module version = 0.5.0
[     7.106]     Module class: X.Org Video Driver
[     7.106]     ABI class: X.Org Video Driver, version 24.1
[     7.106] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     7.106] (II) FBDEV: driver for framebuffer: fbdev
[     7.106] (++) using VT number 1

[     7.106] (WW) xf86OpenConsole: setpgid failed: Operation not permitted
[     7.115] (II) modeset(0): using drv /dev/dri/card1
[     7.115] (WW) Falling back to old probe method for fbdev
[     7.115] (II) Loading sub module "fbdevhw"
[     7.115] (II) LoadModule: "fbdevhw"
[     7.116] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[     7.122] (II) Module fbdevhw: vendor="X.Org Foundation"
[     7.122]     compiled for 1.20.9, module version = 0.0.2
[     7.122]     ABI class: X.Org Video Driver, version 24.1
[     7.122] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[     7.123] (II) modeset(0): Creating default Display subsection in Screen section
    "SCREEN-0" for depth/fbbpp 24/32
[     7.123] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[     7.123] (II) Applying OutputClass "LIMA-0" options to /dev/dri/card1
[     7.123] (==) modeset(0): RGB weight 888
[     7.123] (==) modeset(0): Default visual is TrueColor
[     7.123] (II) Loading sub module "glamoregl"
[     7.123] (II) LoadModule: "glamoregl"
[     7.124] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[     7.291] (II) Module glamoregl: vendor="X.Org Foundation"
[     7.291]     compiled for 1.20.9, module version = 1.0.1
[     7.291]     ABI class: X.Org ANSI C Emulation, version 0.4
[     8.083] (II) modeset(0): glamor X acceleration enabled on Mali400
[     8.083] (II) modeset(0): glamor initialized
[     8.084] (II) modeset(0): Output None-1 using monitor section LCD-0
[     8.084] (II) modeset(0): Output Composite-1 has no monitor section
[     8.085] (II) modeset(0): EDID for output None-1
[     8.085] (II) modeset(0): Printing probed modes for output None-1
[     8.085] (II) modeset(0): Modeline "1024x600"x60.0   45.00  1024 1040 1050 1200  600 602 604 625 (37.5 kHz eP)
[     8.085] (II) modeset(0): EDID for output Composite-1
[     8.085] (II) modeset(0): Printing probed modes for output Composite-1
[     8.085] (II) modeset(0): Modeline "PAL"x25.0   13.50  720 723 725 864  576 604 606 625 interlace (15.6 kHz e)
[     8.085] (II) modeset(0): Modeline "NTSC"x30.0   13.50  720 738 740 858  480 506 508 525 interlace (15.7 kHz e)
[     8.085] (II) modeset(0): Output None-1 connected
[     8.086] (II) modeset(0): Output Composite-1 connected
[     8.086] (II) modeset(0): Using sloppy heuristic for initial modes
[     8.086] (II) modeset(0): Output None-1 using initial mode 1024x600 +0+0
[     8.086] (II) modeset(0): Output Composite-1 using initial mode PAL +0+0
[     8.086] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[     8.086] (==) modeset(0): DPI set to (96, 96)
[     8.086] (II) Loading sub module "fb"
[     8.086] (II) LoadModule: "fb"
[     8.086] (II) Loading /usr/lib/xorg/modules/libfb.so
[     8.108] (II) Module fb: vendor="X.Org Foundation"
[     8.109]     compiled for 1.20.9, module version = 1.0.0
[     8.109]     ABI class: X.Org ANSI C Emulation, version 0.4
[     8.109] (II) UnloadModule: "fbdev"
[     8.109] (II) Unloading fbdev
[     8.109] (II) UnloadSubModule: "fbdevhw"
[     8.109] (II) Unloading fbdevhw
[     8.606] (==) modeset(0): Backing store disabled
[     8.606] (==) modeset(0): Silken mouse enabled
[     8.632] (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[     8.633] (==) modeset(0): DPMS enabled
[     8.633] (WW) modeset(0): Option "PrimaryGPU" is not used
[     8.633] (II) modeset(0): [DRI2] Setup complete
[     8.633] (II) modeset(0): [DRI2]   DRI driver: sun4i-drm
[     8.633] (II) modeset(0): [DRI2]   VDPAU driver: sun4i-drm
[     8.633] (II) Initializing extension Generic Event Extension
[     8.633] (II) Initializing extension SHAPE
[     8.634] (II) Initializing extension MIT-SHM
[     8.634] (II) Initializing extension XInputExtension
[     8.640] (II) Initializing extension XTEST
[     8.640] (II) Initializing extension BIG-REQUESTS
[     8.640] (II) Initializing extension SYNC
[     8.640] (II) Initializing extension XKEYBOARD
[     8.641] (II) Initializing extension XC-MISC
[     8.641] (II) Initializing extension XFIXES
[     8.641] (II) Initializing extension RENDER
[     8.641] (II) Initializing extension RANDR
[     8.641] (II) Initializing extension DAMAGE
[     8.641] (II) Initializing extension MIT-SCREEN-SAVER
[     8.641] (II) Initializing extension DOUBLE-BUFFER
[     8.641] (II) Initializing extension RECORD
[     8.641] (II) Initializing extension DPMS
[     8.641] (II) Initializing extension Present
[     8.641] (II) Initializing extension DRI3
[     8.641] (II) Initializing extension X-Resource
[     8.641] (II) Initializing extension XVideo
[     8.641] (II) Initializing extension XVideo-MotionCompensation
[     8.641] (II) Initializing extension GLX
[     8.784] (II) AIGLX: Loaded and initialized sun4i-drm
[     8.784] (II) GLX: Initialized DRI2 GL provider for screen 0
[     8.784] (II) Initializing extension XFree86-VidModeExtension
[     8.784] (II) Initializing extension XFree86-DGA
[     8.784] (II) Initializing extension XFree86-DRI
[     8.789] (II) Initializing extension DRI2
[     8.804] (II) modeset(0): Damage tracking initialized
[     8.804] (II) modeset(0): Setting screen physical size to 270 x 158
==============================================================================

Clément Péron

unread,
Dec 22, 2020, 5:03:02 PM12/22/20
to pika...@gmail.com, linux-sunxi
Hi Sergio,


Le mar. 22 déc. 2020 à 17:50, Sergio Sota <pika...@gmail.com> a écrit :
Hi Clement, Chen-Yu Tsai and Jernej Å krabec,

the last question was of topic (as the A13SOM drm driver support was solved)

As the DRM issue is solved by using some patches could you send those patches to linux ML ?

Thanks Clément

Sergio Sota

unread,
Dec 23, 2020, 11:24:34 AM12/23/20
to linux-sunxi
Hi Clement,

you mean the sun5i.dtsi device tree patch? we added the mali gpu support and
also change the frontend compatible to "allwinner,sun4i-a10-display-frontend"
We are not experts but if you are confident enough sure we can send a patch to
linux ML :-)
but the rest of things (custom lcd panel, custom board, etc.) is
specific to our custom system. Besides there is something wrong, we still have
problems with OpenGL apps
, that crush without reason with a Segmentation Fault
(we think is something mesa3d/x11 related, as modetest and kmscube works but
you never know...)

Best Regards,
Sergio Sota

Here is the suggested linux ML patch file "sun5i-gpu-frontend-support.patch"
=================================================================
diff -Naur linux-old/arch/arm/boot/dts/sun5i.dtsi linux-new/arch/arm/boot/dts/sun5i.dtsi
--- linux-old/arch/arm/boot/dts/sun5i.dtsi    2020-11-24 13:39:15.000000000 +0100
+++ linux-new/arch/arm/boot/dts/sun5i.dtsi    2020-12-23 10:12:57.950313393 +0100
@@ -726,6 +726,18 @@
             #size-cells = <0>;
         };
 
+        mali: gpu@1c40000 {
+            compatible = "allwinner,sun4i-a10-mali", "arm,mali-400";
+            reg = <0x01c40000 0x10000>;
+            interrupts = <69>, <70>, <71>, <72>,  <73>;
+            interrupt-names = "gp", "gpmmu", "pp0", "ppmmu0", "pmu";
+            clocks = <&ccu CLK_AHB_GPU>, <&ccu CLK_GPU>;
+            clock-names = "bus", "core";
+            resets = <&ccu RST_GPU>;
+            assigned-clocks = <&ccu CLK_GPU>;
+            assigned-clock-rates = <384000000>;
+        };
+
         timer@1c60000 {
             compatible = "allwinner,sun5i-a13-hstimer";
             reg = <0x01c60000 0x1000>;
@@ -734,7 +746,7 @@
         };
 
         fe0: display-frontend@1e00000 {
-            compatible = "allwinner,sun5i-a13-display-frontend";
+            compatible = "allwinner,sun4i-a10-display-frontend";
             reg = <0x01e00000 0x20000>;
             interrupts = <47>;
             clocks = <&ccu CLK_DE_FE>, <&ccu CLK_DE_FE>,
=================================================================

Clément Péron

unread,
Dec 23, 2020, 11:34:35 AM12/23/20
to pika...@gmail.com, linux-sunxi
Hi Sergio,

On Wed, 23 Dec 2020 at 17:24, Sergio Sota <pika...@gmail.com> wrote:
>
> Hi Clement,
>
> you mean the sun5i.dtsi device tree patch? we added the mali gpu support and
> also change the frontend compatible to "allwinner,sun4i-a10-display-frontend"
> We are not experts but if you are confident enough sure we can send a patch to
> linux ML :-) but the rest of things (custom lcd panel, custom board, etc.) is
> specific to our custom system. Besides there is something wrong, we still have
> problems with OpenGL apps, that crush without reason with a Segmentation Fault
> (we think is something mesa3d/x11 related, as modetest and kmscube works but
> you never know...)

Yes one patch for the Mali node and one patch to have
"allwinner,sun4i-a10-display-frontend" as fallback.

fe0: display-frontend@1e00000 {
compatible = "allwinner,sun5i-a13-display-frontend",
"allwinner,sun4i-a10-display-frontend";

The assigned clock-rate is a bit high, you could try with 320000000
which is the vendor clock.

Regards,
Clement
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/4123dc78-089b-40ad-a8dc-7e64fe09192en%40googlegroups.com.

Sergio Sota

unread,
Dec 23, 2020, 11:46:10 AM12/23/20
to linux-sunxi
Hi Clement,

ok, we will send 2 patches to the linux ML as you suggested, thanks :-)

Best Regards,
Sergio Sota
Reply all
Reply to author
Forward
0 new messages