Recent updates on Mesa Lima driver

Added by Özcan Oğuz about 6 years ago

Hello everyone,

I just checked the yuq's mesa-lima driver on the link below and I saw a commit that pushed 12 hours ago. Also there is a new wiki entry which shows the instructions to build the driver.


I dump the content to here:


Be able to run the following OGL application:

    off-screen rendering
        simple triangle:
        vertex shader uniform:
        multi varying:
        multi draw:
            ./kmscube -d -D /dev/dri/renderD128
            ./kmscube -d -D /dev/dri/renderD128 -M rgba
    on-screen rendering
        PRIME export/import:
        renderonly lib:
            ./kmscube -M rgba
            ./kmscube -A
            glmark2-drm -b build
            glmark2-es2-drm -b build

Tested on

        Allwinner A20/H3
        Rockchip RK3188
        Exynos 4412
        Allwinner H5
        Rockchip RK3328
        Amlogic S905X

Build and install
common process

    build Linux kernel with lima driver from:
    build mesa with lima driver by:

./configure --with-gallium-drivers=exynos,sun4i,meson,rockchip,lima --with-dri-drivers= \
  --with-platforms=drm,x11 --disable-xvmc --disable-vdpau --enable-debug


For those who want to use buildroot:

meson metadata with lima driver and test apps:

    dump the runtime close source mali driver memory for reverse engineering


    Newly refined GP compiler needs optimization, code size can be ~40% smaller compared to close source driver output, main problem should be creating too many moves but too few reg load/store
    PP compiler optimization, add post scheduler instruction combination which combine multi instructions into one instruction
    both GP and PP compiler need control flow and other un-implemented instruction support
    texture mipmap support
    Build a piglit test result list so that we can start clear them one by one.
    New mesa NIR changes will always lower io/alu to scalar which is not expected by PP, need merge scalar back to vector or create a PIPE_CAP to disable it, see
    Tiled texture format support
        thread rendering that has dedicated render thread to submit command


    Power management
    TTM buffer eviction/swap support, need to investigate if GP/PP support MMU fault recovery
    Dump buffer support


    GP compiler needs re-fine so that we can guarantee the vertex shader compilation succeed, Connor Abbott think out a new algorithm which should work
    Mesa renderonly lib support
    multi varying support, current implementation assumes we only have a single varying (gl_Position), command stream setup need be implemented for multi varying support
    command stream setup for multi draw, flush at once
    Mali450 initial support
    PP uniform support, command stream need be setup for PP uniform
    fix render fail when buffer is 800x600, maybe due to buffer alignment or command stream setup
    break the ABI come from libdrm_lima which is integrated into mesa for more efficiency especially the command submit interface
    texture support, both PP compiler and command stream need be changed
    command stream setup refine for multi FBO and dynamic buffer size
    Mali450 fully support
    EGL_ANDROID_native_fence_sync support


    PRIME export support
    Mali450 initial support
    New task scheduler which can create a per OGL context fence context. We can use the new drm_sched which is from amdgpu and will be adopted by etnaviv too. drm_sched should be in Linux kernel 4.16.
    New memory management for non-continuous buffer object
    Different GPU mCLK frequency setup, current GPU mCLK frequency is the default frequency when system boot, but GPU should be able to run on a higher frequency.
    Mali450 fully support, include multi group GP/PP, DLBU
    submit support syn fd dep
    use TTM as MM


    Lima offical site:


I think we can use it experimentally on our Replicant devices. I've started to build the kernel and driver, but it seems to take very long.

What do you think?

Replies (8)

RE: Recent updates on Mesa Lima driver - Added by Kurtis Hanna almost 6 years ago

Any updates on this? Very exciting stuff!

RE: Recent updates on Mesa Lima driver - Added by Kurtis Hanna almost 5 years ago

It was reported that the lima kernel driver is now loading on Replicant 9 with the mainline kernel:

RE: Recent updates on Mesa Lima driver - Added by Kurtis Hanna over 4 years ago

Here's a video of Lima running on Replicant 9 on an i9300:

RE: Recent updates on Mesa Lima driver - Added by robin p over 4 years ago

Kurtis Hanna wrote:

Here's a video of Lima running on Replicant 9 on an i9300:

that is smooth with a capital "smoo"

nice, good to see it coming along. looking forward to the new release, keep up the good work folx.

RE: Recent updates on Mesa Lima driver - Added by Emmett Brown over 4 years ago

My browser doesn't seems to be OK to view the video ...
But its sounds great !

Are you going to give a way to download an image of replicant 9 under developpement ?

Anyway : GOOD JOB !


RE: Recent updates on Mesa Lima driver - Added by Fil Lupin over 4 years ago

The same here for the video, but same conclusion: great! :)