Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Etnaviv drm driver for AM57x GC320

978 views
Skip to first unread message

Julien

unread,
Nov 16, 2016, 5:10:26 PM11/16/16
to BeagleBoard
Hi,

I recently bought a BeagleBoard X15 and started playing with it, the first thing I noticed is despite there is three GPU on AM57x SOC, there is no hardware acceleration in X11
I searched and found that the 3D GPUs are not only proprietary, but TI actually does not support X11 at all ... it is bad because I actually love X11 and want to use it.
Then I tried the GC320 2D GPU with TI galcore driver (https://git.ti.com/graphics/ti-gc320-driver) and armada X driver (https://github.com/xobs/xserver-xorg-video-armada with galcore/libGAL) : it works, but sometimes it freezes : actually it freezes everytimes when quitting X. I made some tests with proprietary libGAL (https://git.ti.com/graphics/ti-gc320-libs), and I finally found that either the driver or the userspace lib make the computer freezing.

I decided to look further and discovered that project that aim to open-sourcing Vivante GPU chips Etnaviv is pretty well advanced (https://github.com/etnaviv). The project initially support GCxxx chips in IMX6 and Armada SOC, and I wondered if it could works on AM57x. It appears that it works ! I backported the etnaviv from mainline kernel to use it with the linux 4.4 kernel provided with the default board Debian (http://repos.rcn-ee.com/debian/), and with very little changes, it can be used with Beagleboard X15.

More details on how it works in this repository :
https://github.com/julbouln/etnaviv_x15

I think it can be really easy to add the support in mainline kernel (some minor changes to DTS + etnadiv driver compatibility)

I hope this can be useful !
Regards



Robert Nelson

unread,
Nov 16, 2016, 5:14:21 PM11/16/16
to Beagle Board
Nice Work!!! ;)

>
> I think it can be really easy to add the support in mainline kernel (some
> minor changes to DTS + etnadiv driver compatibility)


Regards,

--
Robert Nelson
https://rcn-ee.com/

Robert Nelson

unread,
Nov 16, 2016, 6:11:48 PM11/16/16
to Beagle Board, jbou...@gmail.com
This is now pushed:

https://github.com/RobertCNelson/ti-linux-kernel-dev/commit/745855e6c0d728c1245ed4f4768b51046d5adb39

Ran out of time today to test it.. Will do that tomorrow. ;)

Julien

unread,
Nov 16, 2016, 6:26:50 PM11/16/16
to BeagleBoard, jbou...@gmail.com
Hi Robert,

Thanks you for that express integration :) I just discovered that I have pushed the wrong fork (a first try I made that did not work properly), I just fixed that and commited the correct one https://github.com/julbouln/etnaviv_x15/commit/72759d9b41d3bc1bcdd3bfb389afbf135d8a20d3

Sorry about that

Jason Kridner

unread,
Nov 16, 2016, 7:22:59 PM11/16/16
to beagl...@googlegroups.com, jbou...@gmail.com
This is fantastic! Thanks for doing the research and backport on this. It is a real benefit to the community.

>>>
>>> More details on how it works in this repository :
>>> https://github.com/julbouln/etnaviv_x15
>
> This is now pushed:
>
> https://github.com/RobertCNelson/ti-linux-kernel-dev/commit/745855e6c0d728c1245ed4f4768b51046d5adb39
>
> Ran out of time today to test it.. Will do that tomorrow. ;)
>
> Regards,
>
> --
> Robert Nelson
> https://rcn-ee.com/
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYjd3YY40DCb1-KMfY8D7xuGfhwtJ5C_aQ1yTY7QSmw_Hg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Robert Nelson

unread,
Nov 16, 2016, 7:58:42 PM11/16/16
to Beagle Board, Julien Boulnois
On Wed, Nov 16, 2016 at 5:26 PM, Julien <jbou...@gmail.com> wrote:
> Hi Robert,
>
> Thanks you for that express integration :) I just discovered that I have
> pushed the wrong fork (a first try I made that did not work properly), I
> just fixed that and commited the correct one
> https://github.com/julbouln/etnaviv_x15/commit/72759d9b41d3bc1bcdd3bfb389afbf135d8a20d3
>
> Sorry about that

No worries! Yeah that looks a lot closer to v4.9-rc5.. ;)

Resync'ed and pushed out..

https://github.com/RobertCNelson/ti-linux-kernel-dev/commit/396ed5da36066858f06640f1cc665d8bf84f1093

Robert Nelson

unread,
Nov 16, 2016, 9:02:45 PM11/16/16
to Beagle Board, Julien Boulnois
build tested now taged and pushed out:

4.4.32-ti-r68/4.4.32-ti-rt-r68

Should hopefully have a *.deb in the apt repo sometime shortly tomorrow..

Robert Nelson

unread,
Nov 17, 2016, 10:13:07 AM11/17/16
to Beagle Board
Okay these are now in the repo:

debian@beagle-x15:~$ uname -r ; dmesg | grep gpu
4.4.32-ti-r68
[ 9.354296] etnaviv gpu-subsystem: bound 59000000.bb2d (ops gpu_ops
[etnaviv])
[ 9.354311] etnaviv-gpu 59000000.bb2d: model: GC320, revision: 5301

For most x15 users, just run:

cd /opt/scripts/tools/ ; git pull ; sudo ./update_kernel.sh

and reboot

* now to package the userspace side.. ;)

Robert Nelson

unread,
Nov 17, 2016, 11:46:29 AM11/17/16
to Beagle Board, Julien Boulnois, Jason Kridner, Nishanth Menon
This is awesome Julien!!!

2d is soooo much smoother...

debian@beaglebone:~$ uname -r ; dmesg | grep etnaviv
4.4.32-ti-r68
[ 10.101371] etnaviv gpu-subsystem: bound 59000000.bb2d (ops gpu_ops
[etnaviv])
[ 10.101392] etnaviv-gpu 59000000.bb2d: model: GC320, revision: 5301

Here's my current step-by-step

https://gist.github.com/RobertCNelson/fc6d07157b0fcc13b9c28c5832fdc74b

I'll start packing those git repo's so that this sunday we'll have 2d
acceleration out of the box!!

Nishanth Menon

unread,
Nov 17, 2016, 12:13:52 PM11/17/16
to Robert Nelson, Beagle Board, Julien Boulnois, Jason Kridner, Tomi Valkeinen
I am curious to know if there are plans of sending the kernel patches
upstream to k.org (if not already there)

dumb question: What about the userspace - is this from some variant of
official repository?

--
Regards,
Nishanth Menon

Robert Nelson

unread,
Nov 17, 2016, 12:26:10 PM11/17/16
to Nishanth Menon, Beagle Board, Julien Boulnois, Jason Kridner, Tomi Valkeinen
On Thu, Nov 17, 2016 at 11:13 AM, Nishanth Menon <n...@ti.com> wrote:
> On 11/17/2016 10:45 AM, Robert Nelson wrote:
>>
>> This is awesome Julien!!!
>>
>> 2d is soooo much smoother...
>>
>> debian@beaglebone:~$ uname -r ; dmesg | grep etnaviv
>> 4.4.32-ti-r68
>> [ 10.101371] etnaviv gpu-subsystem: bound 59000000.bb2d (ops gpu_ops
>> [etnaviv])
>> [ 10.101392] etnaviv-gpu 59000000.bb2d: model: GC320, revision: 5301
>>
>> Here's my current step-by-step
>>
>> https://gist.github.com/RobertCNelson/fc6d07157b0fcc13b9c28c5832fdc74b
>>
>> I'll start packing those git repo's so that this sunday we'll have 2d
>> acceleration out of the box!!
>>
>> Regards,
>>

> I am curious to know if there are plans of sending the kernel patches
> upstream to k.org (if not already there)

I think we should ;)

Here's the current patchset:

patches 1/2 are just a backport of etnaviv

3rd patch enables etnaviv for omap2plus

4th patch is Julien work in pprogress

https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-4.4.y/patches/backports/etnaviv

For the dts:

https://github.com/RobertCNelson/ti-linux-kernel-dev/blob/ti-linux-4.4.y/patches/x15/fixes/0005-x15-gpu-2d-vivante-gc.patch

> dumb question: What about the userspace - is this from some variant of
> official repository?

https://github.com/etnaviv

One issue with the current working userspace, the developers behind
etnaviv want users to move to libdrm instead of galcore-headers

Julien

unread,
Nov 17, 2016, 1:29:52 PM11/17/16
to BeagleBoard, n...@ti.com, jbou...@gmail.com, jkri...@gmail.com, tomi.va...@ti.com

Thanks Robert, I will test the new kernel!


For kernel part, I don't know about omap2plus, but except backport the only thing I modified is the compatible list in etnaviv driver to add "ti,dra7-gpu-subsystem", and the dts to enable bb2d and etnaviv required gpu-subsystem.


For userspace, armada xorg driver contains a lot of things. As I understand it :
- vivante part is an older driver using gal headers and libGAL proprietary lib.
- etnaviv is a driver using libGAL as well, but through the libetnaviv which was I guess intended to help etnaviv folks to reverse engineering and now deprecated
- etnadrm is actually the driver used, and for some reason (know what to pass to etnaviv kernel for optimizatio) it use libetnaviv which need gal headers. It is apparently just a shim and in fact only use open source drm driver.

Robert Nelson

unread,
Nov 17, 2016, 4:02:22 PM11/17/16
to Beagle Board, Nishanth Menon, Julien Boulnois, Jason Kridner, Tomi Valkeinen
Okay this all packaged. ;)

#####
#https://gist.github.com/RobertCNelson/fc6d07157b0fcc13b9c28c5832fdc74b

cd /opt/scripts/tools/ ; git pull ; sudo ./update_kernel.sh

sudo apt-get install xserver-xorg-video-armada-etnaviv

sudo sed -i -e 's:omap:armada:g' /etc/X11/xorg.conf

sudo reboot

#####

Now i'm going to enable it by default, so after 20161120 all images
should have this by default

* time to patch v4.9.0-rc5 and get that working too. ;)

John Syne

unread,
Nov 17, 2016, 4:35:50 PM11/17/16
to beagl...@googlegroups.com, Nishanth Menon, Julien Boulnois, Jason Kridner, Tomi Valkeinen
Do you really want to enable X11 by default? I would prefer Wayland as the default windows manager.

Regards,
John
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYh5Cp4TaPfcV0U41OpwcxH79UVKdfo9Lf8xzHYc3ZuuHQ%40mail.gmail.com.

Robert Nelson

unread,
Nov 17, 2016, 4:42:38 PM11/17/16
to Beagle Board, John Syn, Nishanth Menon, Julien Boulnois, Jason Kridner, Tomi Valkeinen
On Thu, Nov 17, 2016 at 3:35 PM, John Syne <john...@gmail.com> wrote:
> Do you really want to enable X11 by default? I would prefer Wayland as the default windows manager.

Well, we have X11 now with a usable desktop... Wayland on Debian is
still a few months out at the minimal..

For the x15, there's always been a noticeable delay when moving
windows around, by enabling the 2D core via etnaviv, we now have dri2
support and desktop is fast.

With all the development going on with the etnaviv project for
Marvel/IMX based soc's (they have 2D & 3D Vivantee Cores), it's nice
to take advantage of their 2D core support

Julien

unread,
Nov 17, 2016, 5:17:08 PM11/17/16
to BeagleBoard, john...@gmail.com, n...@ti.com, jbou...@gmail.com, jkri...@gmail.com, tomi.va...@ti.com

Few months, or years to have something truly competitive : reinventing the wheel of the 25 year old xf86 software is something that takes times ...
And the Beagleboard X15 is a very powerfull machine that can be used for desktop, and today X is the best at it.

I think what really miss is an improved xorg driver for etnaviv drm with standard optimizations extension (EXA), I m looking at that, but can't say the complexity of the task for now.

Robert Nelson

unread,
Nov 17, 2016, 5:51:09 PM11/17/16
to Beagle Board, John Syn, Nishanth Menon, Julien Boulnois, Jason Kridner, Tomi Valkeinen
and it works great on v4.9-rc5:

Here's the 28 line diff patch:

https://github.com/RobertCNelson/linux-dev/blob/master/patches/drivers/ti/etnaviv/0001-ti-dra7-etnaviv-2d-acceleration.patch

I believe Tony, said the "ti,hwmods" are on the chopping block, for
something more dt-ish. So the dra7.dtsi change will have to be
modified down the road again..

John Syne

unread,
Nov 17, 2016, 8:19:52 PM11/17/16
to Julien, BeagleBoard, n...@ti.com, jkri...@gmail.com, tomi.va...@ti.com
On Nov 17, 2016, at 2:17 PM, Julien <jbou...@gmail.com> wrote:


Few months, or years to have something truly competitive : reinventing the wheel of the 25 year old xf86 software is something that takes times ...
And the Beagleboard X15 is a very powerfull machine that can be used for desktop, and today X is the best at it.
My main concern with X11 are the security flaws. Anyway, thank you for getting this driver working. This was really good work. 

Regards,
John

Julien Boulnois

unread,
Nov 18, 2016, 8:45:40 AM11/18/16
to Tomi Valkeinen, BeagleBoard, n...@ti.com, jkri...@gmail.com
Yes, I agree. xorg armada driver is very confusing, after a close up looking it seems that libdrm-etnaviv is not used at all and a sort of backport of it is integrated directly in armada (https://github.com/xobs/xserver-xorg-video-armada/blob/novena-r2/etnaviv/etnadrm.c). Optizations is not used via a standard way like EXA, but in every places around.

I saw some problems too when playing video, vlc rendering is undoubtedly faster, but etnaviv driver complains (can't remember messages right now).

As I said previously, it seems relevant to have an updated driver, I'm looking at a way of implementing an EXA acceleration in omap driver, but I think it is a lot of work :)





2016-11-18 14:30 GMT+01:00 Tomi Valkeinen <tomi.va...@ti.com>:

On 17/11/16 20:29, Julien wrote:
> Thanks Robert, I will test the new kernel!
>
>
> For kernel part, I don't know about omap2plus, but except backport the
> only thing I modified is the compatible list in etnaviv driver to add
> "ti,dra7-gpu-subsystem", and the dts to enable bb2d and etnaviv required
> gpu-subsystem.
>
>
> For userspace, armada xorg driver contains a lot of things. As I
> understand it :
> - vivante part is an older driver using gal headers and libGAL
> proprietary lib.
> - etnaviv is a driver using libGAL as well, but through the libetnaviv
> which was I guess intended to help etnaviv folks to reverse engineering
> and now deprecated
> - etnadrm is actually the driver used, and for some reason (know what to
> pass to etnaviv kernel for optimizatio) it use libetnaviv which need gal
> headers. It is apparently just a shim and in fact only use open source
> drm driver.

I got this working on my x15. Nice!

The userspace side is confusing. There's libdrm-etnaviv in the mainline
libdrm, but afaics that's not used at all (I got the few tests working
that were included). Everything above are out-of-mainline-branches and I
don't quite get what they all are doing.

Also, when testing x11perf, I see a lot of:

alloc_contig_range: [fdd38, fdd3f) PFNs busy

So I don't think everything is fine.

 Tomi




--
Julien Boulnois

Robert Nelson

unread,
Nov 18, 2016, 9:59:32 AM11/18/16
to Beagle Board, Tomi Valkeinen, Nishanth Menon, Jason Kridner
btw, Russell's unstable-devel branch has a few more patches over xobs's repo:

http://git.arm.linux.org.uk/cgit/xf86-video-armada.git/?h=unstable-devel

Regards,
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/CAB8EWQCNiZUt_gEYBNETLqcNKobENf56AndypV7_6s7%3DTU5-AQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



Julien

unread,
Nov 20, 2016, 6:40:29 PM11/20/16
to BeagleBoard, tomi.va...@ti.com, n...@ti.com, jkri...@gmail.com
Hi,

After some work, I have been able to had some EXA support to omap xorg driver :
- only Solid and Copy are implemented, which already add some speed improvement
- Composite is WIP and does not work yet
- it's really alpha software and may be bugged

https://github.com/julbouln/xf86-video-omap-exa

Robert Nelson

unread,
Nov 21, 2016, 11:52:31 AM11/21/16
to Beagle Board, Tomi Valkeinen, Nishanth Menon, Jason Kridner
On Sun, Nov 20, 2016 at 5:40 PM, Julien <jbou...@gmail.com> wrote:
> Hi,
>
> After some work, I have been able to had some EXA support to omap xorg
> driver :
> - only Solid and Copy are implemented, which already add some speed
> improvement
> - Composite is WIP and does not work yet
> - it's really alpha software and may be bugged
>
> https://github.com/julbouln/xf86-video-omap-exa

Very cool, i hope we can push this back to etnaviv folks, or is it
tied to a feature of the omap4's dss2 video engine?

PS, for users testing, 2D acceleration doesn't work when booting from
the eMMC*.. (same image works fine when booted on the microSD)..

* using the B1 version.. latest v4.4.x-ti:

http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=refs/heads/ti-rt-linux-4.4.y

Regards,

Robert Nelson

unread,
Nov 21, 2016, 11:57:14 AM11/21/16
to Beagle Board, Tomi Valkeinen, Nishanth Menon, Jason Kridner
Hot-plugging the microSD, like we did in the x15-A1 days to fix the
HDMI doesn't seem to fix it, so it's not the i2c/mmc regulator..

Julien Boulnois

unread,
Nov 21, 2016, 1:11:39 PM11/21/16
to BeagleBoard, Tomi Valkeinen, Nishanth Menon, Jason Kridner
Theoretically with some refactoring it could be used with any 2D Vivante chip supported by etnaviv.

I needed to include etnaviv_drm.h and etnaviv_drmif.h because it seems they are not properly integrated in libdrm-dev package.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/S5UFHnIc11o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYh-iA468zJztvnDaVQYf_8mQbRK8f11Vty4A%3D%2B48O733w%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Julien Boulnois
Reply all
Reply to author
Forward
0 new messages