From andre.wagner at richard-wolf.com Mon Aug 4 11:11:13 2025 From: andre.wagner at richard-wolf.com (Wagner Andre) Date: Mon, 4 Aug 2025 11:11:13 +0000 Subject: running etnaviv driver on i.mx6 References: Message-ID: Hello everyone, I try to run a run an (qt) app accelerated by the upstream etnaviv driver on an i.MX6 DL based SBC, but I just cannot get it working... What I did so far: * I patched the imx-drm back from NXP version (since its adapted to their closed source galcore driver) to vanilla version, which should work with etnaviv. Dmesg shows also "Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0" and " Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1". So I expect both kernel drivers to work. * I installed a Ubuntu 22.04 with a slightly modified NXP Linux kernel in version 5.15.148 and used from Ubuntu 22.04 mesa in version 23.2.1 * I put my qt application on it based on qt 5.15.3. When i select the linuxfb backend i can see the qt application on my screen. So the hardware is ok. * After adjusting the device tree from NXP galcore to etnaviv i can see the /dev/dri/card0, /dev/dri/renderD128 and /dev/dri/card1 After starting my Qt application i got following error: qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms") qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms") qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms" qt.qpa.eglfs.kms: Loading KMS setup from "/etc/eglfs_hdmi.json" qt.qpa.eglfs.kms: Requested configuration (some settings may be ignored): ?????headless: false ?????hwcursor: false ?????pbuffers: true ?????separateScreens: false ?????virtualDesktopLayout: 0 ?????outputs: QMap(("LVDS-1", QMap(("mode", QVariant(QString, "800x600"))("name", QVariant(QString, "LVDS-1"))))) qt.qpa.eglfs.kms: New DRM/KMS via GBM integration created qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms" qt.qpa.eglfs.kms: platformInit: Opening DRM device qt.qpa.eglfs.kms: GBM: Using DRM device "/dev/dri/card1" specified in config file qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card1 qt.qpa.eglfs.kms: Creating GBM device for file descriptor 4 obtained from "/dev/dri/card1" qt.qpa.eglfs.kms: Initalizing event reader for device 0x1a51248 fd 4 qt.qpa.eglfs.kms: Querying EGLDisplay qt.qpa.eglfs.kms: Event reader thread: entering event loop qt.qpa.eglfs.kms: No eglGetPlatformDisplay for GBM, falling back to eglGetDisplay Could not open egl display Aborted What i think i understood: 1. the etnaviv kernel driver exposes the Vivante GPU as /dev/dri/card0 and /dev/dri/renderD128 2. the imx-drm kernel driver exposes the IPU as /dev/dri/card1 3. kms works on /dev/dri/card1 since I can see output with modetest 4. the LVDS output is attached to the IPU so to /dev/dri/card1, modetest shows also that 5. the Qt5 eglfs backend triggers the MESA-LOADER looks all /dev/dri/card* to find a device which supports modesetting 6. the only device which supports modesetting is /dev/dri/card1 since /dev/dri/card0 has no screens/outputs 7. via libdrm the MESA-LOADER finds that /dev/dri/card1 is a device which runs on imx-drm kernel driver 8. since the kernel drivers name is imx-drm the MESA-LOADER loads imx-drm_dri 9. Problem is not specific to qt, since kmscube ("failed to initialize EGL") and weston-simple-dmabuf-egl ("../clients/simple-dmabuf-egl.c:1375: create_display: Assertion `display->display' failed." also fail. 10. In /sys/kernel/debug/dma_buf/bufinfo i should see something like exp_name and imp_name + etnaviv and imx-drm. But right now it shows only "Total 0 objects, 0 bytes", so handling from etnaviv to imx-drm does not work at all. 11. Ubuntu's mesa build uses the mega mesa driver so all drivers are include in one shared object. Which drivers are contained i can see with strings etnaviv_dri.so | grep __driDriverGetExtensions. Since i see __driDriverGetExtensions_etnaviv and __driDriverGetExtensions_imx_drm the necessary driver / stub driver is included. The drivers filename needs to correspond _dri.so Please correct me if one or more of these assumptions is wrong. But now the points where i am missing understanding: 1. imx-drm_dri is only a stub which should trigger etnaviv_dri via KMSRO ? 2. Somehow a dmabuf with GBM is shared between etnaviv_dri (/dev/dri/renderD128) and imx-drm_dri stub (/dev/dri/card1) which is called PRIME ? 3. Which mesa compile options i do really need for getting this setup working, am i missing some ? 4. What is a really useful test program, how can i debug further ? 5. Do i miss a kernel config option ? Thank you already very much for your help in advance. Greetings, Andr? [https://www.richard-wolf.com/mam/data/Typo3/banner/e-mail-banner-DGU25.png] Richard Wolf GmbH, Pforzheimer Strasse 32, 75438 Knittlingen Managing Directors: Juergen Pfab, Juergen Steinbeck. Trade Register: Mannheim HRB 510031 Richard Wolf GmbH routinely monitors the content of e-mail sent and received via its network for the purposes of ensuring compliance with its policies and procedures. Richard Wolf GmbH is not responsible for any changes made to the message after it has been sent. Where opinions are expressed, they are not necessarily those of Richard Wolf GmbH. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward, disclose, or otherwise use it or any part of it in any way. To do so may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately. Data Protection Policy | Legal Information | Terms & Conditions -------------- next part -------------- An HTML attachment was scrubbed... URL: From festevam at gmail.com Mon Aug 4 14:39:15 2025 From: festevam at gmail.com (Fabio Estevam) Date: Mon, 4 Aug 2025 11:39:15 -0300 Subject: running etnaviv driver on i.mx6 In-Reply-To: References: Message-ID: Hi Andre, On Mon, Aug 4, 2025 at 8:11?AM Wagner Andre wrote: > > Hello everyone, > > I try to run a run an (qt) app accelerated by the upstream etnaviv driver on an i.MX6 DL based SBC, but I just cannot get it working... > > What I did so far: > > I patched the imx-drm back from NXP version (since its adapted to their closed source galcore driver) to vanilla version, which should work with etnaviv. Dmesg shows also "Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0" and " Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1". So I expect both kernel drivers to work. > I installed a Ubuntu 22.04 with a slightly modified NXP Linux kernel in version 5.15.148 and used from Ubuntu 22.04 mesa in version 23.2.1 It's better not to use the NXP kernel at all if you want to use Etnaviv. Just use a mainline kernel from kernel.org with the imx_v6_v7_defconfig, boot it, and the Etnaviv driver will be loaded by default. You can then try to run the 'kmscube' application to confirm that the driver is functional. From andre.wagner at richard-wolf.com Mon Aug 4 15:39:00 2025 From: andre.wagner at richard-wolf.com (Wagner Andre) Date: Mon, 4 Aug 2025 15:39:00 +0000 Subject: AW: running etnaviv driver on i.mx6 In-Reply-To: References: Message-ID: Hi Fabio, thanks for your fast answer! A few hours ago, i just found an old article of you where you described howto do it ;): https://imxdev.gitlab.io/tutorial/Running_kmscube_with_Etnaviv_on_mx6sabresd_board/ I try to do the setup you described there, but i still got no plan how to port the devicetree i got for my board from the NXP kernel variant to the mainline, without causing a bunch of new problems. A thing I directly noticed as a difference between the setup you described there and mine is that the "2204000.gpu" (i think thats the imx-drm) does not show up in /proc/interrupts only the other two (130000.gpu and 134000.gpu) also with interrupt 10 and 11 as yours. The imx-drm shows up as /dev/dri/card1. Do you have a guess if i am just missing something obvious? Would be nice if i would only need a small change and not changing everything... Grettings, Andr? [https://www.richard-wolf.com/mam/data/Typo3/banner/e-mail-banner-DGU25.png] Richard Wolf GmbH, Pforzheimer Strasse 32, 75438 Knittlingen Managing Directors: Juergen Pfab, Juergen Steinbeck. Trade Register: Mannheim HRB 510031 Richard Wolf GmbH routinely monitors the content of e-mail sent and received via its network for the purposes of ensuring compliance with its policies and procedures. Richard Wolf GmbH is not responsible for any changes made to the message after it has been sent. Where opinions are expressed, they are not necessarily those of Richard Wolf GmbH. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward, disclose, or otherwise use it or any part of it in any way. To do so may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately. Data Protection Policy | Legal Information | Terms & Conditions ________________________________ Von: Fabio Estevam Gesendet: Montag, 4. August 2025 16:39 An: Wagner Andre Cc: etnaviv at lists.freedesktop.org Betreff: Re: running etnaviv driver on i.mx6 Hi Andre, On Mon, Aug 4, 2025 at 8:11?AM Wagner Andre wrote: > > Hello everyone, > > I try to run a run an (qt) app accelerated by the upstream etnaviv driver on an i.MX6 DL based SBC, but I just cannot get it working... > > What I did so far: > > I patched the imx-drm back from NXP version (since its adapted to their closed source galcore driver) to vanilla version, which should work with etnaviv. Dmesg shows also "Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0" and " Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1". So I expect both kernel drivers to work. > I installed a Ubuntu 22.04 with a slightly modified NXP Linux kernel in version 5.15.148 and used from Ubuntu 22.04 mesa in version 23.2.1 It's better not to use the NXP kernel at all if you want to use Etnaviv. Just use a mainline kernel from kernel.org with the imx_v6_v7_defconfig, boot it, and the Etnaviv driver will be loaded by default. You can then try to run the 'kmscube' application to confirm that the driver is functional. -------------- next part -------------- An HTML attachment was scrubbed... URL: From festevam at gmail.com Mon Aug 4 19:50:41 2025 From: festevam at gmail.com (Fabio Estevam) Date: Mon, 4 Aug 2025 16:50:41 -0300 Subject: running etnaviv driver on i.mx6 In-Reply-To: References: Message-ID: Hi Andre, On Mon, Aug 4, 2025 at 12:39?PM Wagner Andre wrote: > > Hi Fabio, > > thanks for your fast answer! > A few hours ago, i just found an old article of you where you described howto do it ;): > > https://imxdev.gitlab.io/tutorial/Running_kmscube_with_Etnaviv_on_mx6sabresd_board/ > > I try to do the setup you described there, but i still got no plan how to port the devicetree i got for my board from the NXP kernel variant to the mainline, without causing a bunch of new problems. The display subsystem representation in the devicetree is different between the mainline kernel and the NXP kernel. Try getting the i.MX6 display interface to work with the mainline kernel first. There are many i.MX6-based boards are supported by the mainline kernel, which you can use as a reference for adapting your devicetree. From andre.wagner at richard-wolf.com Wed Aug 6 15:49:22 2025 From: andre.wagner at richard-wolf.com (Wagner Andre) Date: Wed, 6 Aug 2025 15:49:22 +0000 Subject: AW: running etnaviv driver on i.mx6 In-Reply-To: References: Message-ID: Hi Fabio, I got it working! I didn't port everything to the mainline kernel but I ensured that drivers/gpu/drm/etnaviv and drivers/gpu/drm/imx match the mainline kernel and I ported the devicetree to mainline style for the gpu node and the ldb node (LVDS device bridge). Then i realized that i need to compile mesa different: I used: meson setup \ -Dplatforms=wayland \ -Degl-native-platform=drm \ -Dgallium-drivers=etnaviv,kmsro \ -Ddri3=enabled \ -Dvulkan-drivers= \ -Dllvm=disabled \ -Dshared-llvm=disabled \ -Dshared-glapi=enabled \ -Dgles1=enabled \ -Dgles2=enabled \ -Dopengl=false \ -Degl=enabled \ -Dgbm=enabled \ -Dglx=disabled \ -Dglvnd=true \ -Dbuild-tests=true \ -Dtools= \ -Db_ndebug=true \ -Ddri-drivers-path=/usr/lib/$(DEB_HOST_MULTIARCH)/dri \ -Ddri-search-path='/usr/lib/$(DEB_HOST_MULTIARCH)/dri:\$$$${ORIGIN}/dri:/usr/lib/dri' On my first run I didn't set egl's native platform to drm and compared to your old article (i tested the buildroot you meantioned there) i used dri3 and disabled dri2 completly. So my running setup is now: * Linux 5.15.148, NXP branch with mainline /driver/gpu/drm/{etnaviv,imx} of mainline branch * Custom devicetree for NXP branch with adapted gpu- and lbd-node to mainline branch * Mesa 23.2.1 with dri3, egl on drm using gbm * Qt Application 5.15 with eglfs platform Greetings, Andr? [https://www.richard-wolf.com/mam/data/Typo3/banner/e-mail-banner-DGU25.png] Richard Wolf GmbH, Pforzheimer Strasse 32, 75438 Knittlingen Managing Directors: Juergen Pfab, Juergen Steinbeck. Trade Register: Mannheim HRB 510031 Richard Wolf GmbH routinely monitors the content of e-mail sent and received via its network for the purposes of ensuring compliance with its policies and procedures. Richard Wolf GmbH is not responsible for any changes made to the message after it has been sent. Where opinions are expressed, they are not necessarily those of Richard Wolf GmbH. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward, disclose, or otherwise use it or any part of it in any way. To do so may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately. Data Protection Policy | Legal Information | Terms & Conditions ________________________________ Von: etnaviv im Auftrag von Fabio Estevam Gesendet: Montag, 4. August 2025 21:50 An: Wagner Andre Cc: etnaviv at lists.freedesktop.org Betreff: Re: running etnaviv driver on i.mx6 Hi Andre, On Mon, Aug 4, 2025 at 12:39?PM Wagner Andre wrote: > > Hi Fabio, > > thanks for your fast answer! > A few hours ago, i just found an old article of you where you described howto do it ;): > > https://imxdev.gitlab.io/tutorial/Running_kmscube_with_Etnaviv_on_mx6sabresd_board/ > > I try to do the setup you described there, but i still got no plan how to port the devicetree i got for my board from the NXP kernel variant to the mainline, without causing a bunch of new problems. The display subsystem representation in the devicetree is different between the mainline kernel and the NXP kernel. Try getting the i.MX6 display interface to work with the mainline kernel first. There are many i.MX6-based boards are supported by the mainline kernel, which you can use as a reference for adapting your devicetree. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cphealy at gmail.com Wed Aug 6 15:56:51 2025 From: cphealy at gmail.com (Chris Healy) Date: Wed, 6 Aug 2025 08:56:51 -0700 Subject: running etnaviv driver on i.mx6 In-Reply-To: References: Message-ID: I'm not sure what your goal is but I would recommend using a newer version of Mesa than 23.2.1. Many changes have landed in Mesa over the last 2 years related to etnaviv bringing features, performance, and bug fixes. On Wed, Aug 6, 2025 at 8:49?AM Wagner Andre wrote: > Hi Fabio, > > I got it working! I didn't port everything to the mainline kernel but I > ensured that drivers/gpu/drm/etnaviv and drivers/gpu/drm/imx match the > mainline kernel and I ported the devicetree to mainline style for the gpu > node and the ldb node (LVDS device bridge). Then i realized that i need to > compile mesa different: > > I used: > *meson setup \* > * -Dplatforms=wayland \* > * -Degl-native-platform=drm \* > * -Dgallium-drivers=etnaviv,kmsro \* > * -Ddri3=enabled \* > * -Dvulkan-drivers= \* > * -Dllvm=disabled \* > * -Dshared-llvm=disabled \* > * -Dshared-glapi=enabled \* > * -Dgles1=enabled \* > * -Dgles2=enabled \* > * -Dopengl=false \* > * -Degl=enabled \* > * -Dgbm=enabled \* > * -Dglx=disabled \* > * -Dglvnd=true \* > * -Dbuild-tests=true \* > * -Dtools= \* > * -Db_ndebug=true \* > * -Ddri-drivers-path=/usr/lib/$(DEB_HOST_MULTIARCH)/dri \* > * > -Ddri-search-path='/usr/lib/$(DEB_HOST_MULTIARCH)/dri:\$$$${ORIGIN}/dri:/usr/lib/dri'* > > On my first run I didn't set egl's native platform to drm and compared to > your old article (i tested the buildroot you meantioned there) i used dri3 > and disabled dri2 completly. > > So my running setup is now: > > - Linux 5.15.148, NXP branch with mainline > /driver/gpu/drm/{etnaviv,imx} of mainline branch > - Custom devicetree for NXP branch with adapted gpu- and lbd-node to > mainline branch > - Mesa 23.2.1 with dri3, egl on drm using gbm > - Qt Application 5.15 with eglfs platform > > > Greetings, > Andr? > > > > > > Richard Wolf GmbH, Pforzheimer Strasse 32, 75438 Knittlingen > Managing Directors: Juergen Pfab, Juergen Steinbeck. Trade Register: > Mannheim HRB 510031 > > Richard Wolf GmbH routinely monitors the content of e-mail sent and > received via its network for the purposes of ensuring compliance with its > policies and procedures. Richard Wolf GmbH is not responsible for any > changes made to the message after it has been sent. Where opinions are > expressed, they are not necessarily those of Richard Wolf GmbH. This e-mail > and any files transmitted with it are confidential and intended solely for > the use of the individual or entity to which they are addressed. If you are > not the intended addressee, or the person responsible for delivering it to > them, you may not copy, forward, disclose, or otherwise use it or any part > of it in any way. To do so may be unlawful. If you receive this e-mail by > mistake, please advise the sender immediately. > > Data Protection Policy > | Legal > Information | Terms > & Conditions > ------------------------------ > *Von:* etnaviv im Auftrag von > Fabio Estevam > *Gesendet:* Montag, 4. August 2025 21:50 > *An:* Wagner Andre > *Cc:* etnaviv at lists.freedesktop.org > *Betreff:* Re: running etnaviv driver on i.mx6 > > Hi Andre, > > On Mon, Aug 4, 2025 at 12:39?PM Wagner Andre > wrote: > > > > Hi Fabio, > > > > thanks for your fast answer! > > A few hours ago, i just found an old article of you where you described > howto do it ;): > > > > > https://imxdev.gitlab.io/tutorial/Running_kmscube_with_Etnaviv_on_mx6sabresd_board/ > > > > I try to do the setup you described there, but i still got no plan how > to port the devicetree i got for my board from the NXP kernel variant to > the mainline, without causing a bunch of new problems. > > The display subsystem representation in the devicetree is different > between the mainline kernel and the NXP kernel. > > Try getting the i.MX6 display interface to work with the mainline kernel > first. > > There are many i.MX6-based boards are supported by the mainline > kernel, which you can use as a reference for adapting your devicetree. > -------------- next part -------------- An HTML attachment was scrubbed... URL: