[Mesa-dev] Can I build mesa swrast on system without GPU? And how I should do it?

Dylan Baker dylan at pnwbakers.com
Wed Dec 18 17:04:21 UTC 2019


Quoting Oleg Gavrilchenko (2019-12-17 00:07:24)
> Hello!
> Sorry for my English. It is no my first language(Russian).
> I have embedded system with XILINX ZYNQ-7000 processor(ARM Cortex-A9 2 
> cores). This system also has framebuffer video device. Framebuffer with 
> image contains in DDR memory and is transmitted in display by HDMI 
> interface through special DMA(Framebuffer DMA in FPGA). I write simple 
> fbdev driver for this device and it work fine. This system not has any GPU.
> I found out, that mesa can perform software rasterization for Open GL 
> swrast. Can I build mesa swrast for my device and how can I do it?
> 
> I try do this with use cross compilation file.
> 
> This is a cross compilation file for meson, cross_file.txt:
> 
> [binaries]
> c = 'arm-linux-gnueabihf-gcc'
> cpp = 'arm-linux-gnueabihf-g++'
> ar = 'arm-linux-gnueabihf-ar'
> strip = 'arm-linux-gnueabihf-strip'
> pkgconfig = 'pkg-config'
> 
> [host_machine]
> system = 'linux'
> cpu_family = 'arm'
> cpu = 'armv7hl'
> endian = 'little'
> 
> [properties]
> needs_exe_wrapper = true
> sys_root = '/home/oleg/work/z-turn-dvi/sysroot'
> 
> [paths]
> prefix ='/usr'
> 
> 
> 
> I build mesa with that options:
> 
> meson  build/ --cross-file cross_file.txt \
>         -Dplatforms=surfaceless \
>         -Dosmesa=gallium \
>         -Dgallium-drivers=swrast \
>         -Ddri-drivers=[] \
>         -Dvulkan-drivers=[] \
>         -Degl=true \
>         -Dgles1=true \
>         -Dgles2=true \
>         -Dglx=disabled
> 
> ninja -C build/
> 
> build fail with errors:
> 
> [84/882] Linking target src/mapi/es1api/libGLESv1_CM.so.1.1.0.
> FAILED: src/mapi/es1api/libGLESv1_CM.so.1.1.0
> arm-linux-gnueabihf-gcc  -o src/mapi/es1api/libGLESv1_CM.so.1.1.0 
> 'src/mapi/es1api/ffa5f0c@@GLESv1_CM at sha/.._entry.c.o' -Wl,--as-needed 
> -Wl,--no-undefined -shared -fPIC -Wl,--start-group 
> -Wl,-soname,libGLESv1_CM.so.1 src/mapi/shared-glapi/libglapi.so.0.0.0 
> -Wl,--gc-sections -pthread -L/home/oleg/work/z-turn-dvi/sysroot/usr/lib 
> -ldrm -lm -ldl -Wl,--end-group '-Wl,-rpath,$ORIGIN/../shared-glapi' 
> -Wl,-rpath-link,/home/oleg/src/mesa-19.2.7/build/src/mapi/shared-glapi
> /opt/Xilinx/SDK/2018.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.2.1/../../../../arm-linux-gnueabihf/bin/ld: 
> cannot find -ldrm
> collect2: error: ld returned 1 exit status
> 
> DRM option enable in Linux kernel, but I do not install libdrm on my 
> system. Should I do it? And how it will work with my fbdev?
> Thank you for answers. And sorry for my English.
> 

The build system enforces libdrm if you enable egl, because it assumes that
you're going to compile the drm platform. I'm not sure if it'll work, but in the
root meson.build around line 215 is this code:

```meson
if with_gallium and system_has_kms_drm
  _glx = get_option('glx')
  _egl = get_option('egl')
  if _glx == 'dri' or _egl == 'true' or (_glx == 'disabled' and _egl != 'false')
    with_dri = true
  endif
endif
```

You can try deleting that whole block and see if it things compile and work.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20191218/37da6d44/attachment.sig>


More information about the mesa-dev mailing list