qtlinux-kernelmesa

How to enable etnaviv drivers without using Yocto build?


I have custom board with kernel 4.14 and vivante drivers 6.2.4p4.0 (Official Freescale's ones). I want to test my Qt application using the mesa drivers instead of the Freescale's. I've already downloaded and manually compiled and installed the mesa drivers with kmsro and etnaviv drivers options enabled, but these steps doesn't seem to be enough.

What are the steps to do after installing the mesa drivers to enable them?

I don't have access to a Yocto layer for my board, so rebuilding the image is not an option.

thanks!


Solution

  • To get the etnaviv kernel module enabled, I did the following:

    Download and compile kernel source v4.14, enabling the following options:

    Then install or compile MESA. If you choose to compile MESA remember to enable the options kmsro and etnaviv on the meson_options.txt file.

    Lastly, to check if etnaviv was successfully loaded, do:

    # dmesg | grep etnaviv
    

    Should output something like this:

    [    6.249793] etnaviv gpu-subsystem: bound 134000.gpu (ops gpu_ops [etnaviv])
    [    6.249866] etnaviv gpu-subsystem: bound 130000.gpu (ops gpu_ops [etnaviv])
    [    6.249919] etnaviv gpu-subsystem: bound 2204000.gpu (ops gpu_ops [etnaviv])
    [    6.249934] etnaviv-gpu 134000.gpu: model: GC320, revision: 5007
    [    6.332274] etnaviv-gpu 130000.gpu: model: GC2000, revision: 5108
    [    6.402442] etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215
    [    6.402474] etnaviv-gpu 2204000.gpu: Ignoring GPU with VG and FE2.0
    [    6.416880] [drm] Initialized etnaviv 1.1.0 20151214 for gpu-subsystem on minor 1
    

    Check also your dtb file for proper initialization, mine has the following entries regarding the gpu:

            gpu@00130000 {
                compatible = "vivante,gc";
                reg = <0x130000 0x4000>;
                interrupts = <0x0 0x9 0x4>;
                clocks = <0x2 0x1b 0x2 0x7a 0x2 0x4a>;
                clock-names = "bus", "core", "shader";
                power-domains = <0x9>;
                linux,phandle = <0x82>;
                phandle = <0x82>;
        };
    
        gpu@00134000 {
                compatible = "vivante,gc";
                reg = <0x134000 0x4000>;
                interrupts = <0x0 0xa 0x4>;
                clocks = <0x2 0x1a 0x2 0x79>;
                clock-names = "bus", "core";
                power-domains = <0x9>;
                linux,phandle = <0x81>;
                phandle = <0x81>;
        };
    
        gpu@02204000 {
            compatible = "vivante,gc";
            reg = <0x2204000 0x4000>;
            interrupts = <0x0 0xb 0x4>;
            clocks = <0x2 0x8f 0x2 0x79>;
            clock-names = "bus", "core";
            power-domains = <0x9>;
            linux,phandle = <0x83>;
            phandle = <0x83>;
        };
    
       gpu-subsystem {
            compatible = "fsl,imx-gpu-subsystem";
            cores = <0x81 0x82 0x83>;
        };
    

    Note: If you get a dmesg error output like "command buffer outside valid memory window", it might be the case that you need to increase the cma being reserved. You must do it via kernel parameter, In my case I had to set via uboot the following: cma=256M@2G