Skip to contentSkip to conversation

glxgears on Etnaviv: couldn't get an RGB, Double-buffered visual

DISCUSSION Alexey Brodkin 2 participants 7 messages Nov 24, 2017 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

Hello,

Being in the middle of bring-up of the new board with Vivante GPU (HSDK namely, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arc/plat-hsdk)
I was looking at simple 3D test apps to see how Etnaviv works on the hardware.

So far I was able to get kmscube working perfectly fine and the next item I took was glxgears (for some reason I was under impression that's de facto "Hello world" app in the GPU world). But apparently even with Xserver up and running glxgears doesn't work.

Moreover I tried the same thing on Wandboard Quad but to no avail as well. That's what I saw:
------------------------->8---------------------

# glxgears
Error: couldn't get an RGB, Double-buffered visual
# glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig 
------------------------->8---------------------

Googling didn't help here unfortunately so maybe some pointers could be suggested here... like what do I do wrong and if glxgears is supposed to work on top of DRM GPU at all?

Thanks a lot in advance!

-Alexey
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#1 lore raw

Hi Alexey,

Am Freitag, den 24.11.2017, 16:02 +0000 schrieb Alexey Brodkin:

Quoted 21 lines

Hello,

Being in the middle of bring-up of the new board with Vivante GPU (HSDK namely, see?https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arc/plat-hsdk) I was looking at simple 3D test apps to see how Etnaviv works on the hardware.

So far I was able to get kmscube working perfectly fine and the next item I took was glxgears (for some reason I was under impression that's de facto "Hello world" app in the GPU world). But apparently even with Xserver up and running glxgears doesn't work.

Moreover I tried the same thing on Wandboard Quad but to no avail as well. That's what I saw:
------------------------->8---------------------

# glxgears
Error: couldn't get an RGB, Double-buffered visual
# glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig?
------------------------->8---------------------
Quoted 5 lines

Googling didn't help here unfortunately so maybe some pointers could be suggested here... like what do I do wrong and if glxgears is supposed to work on top of DRM GPU at all?

Thanks a lot in advance!

For 3D acceleration to work under X you need the etnaviv specific DDX driver, which can be found here:

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

Don't let you get confused by the name, the armada driver implements support for both armada drm and imx-drm and the etnaviv DDX. This provides 2D acceleration on the Vivante 2D cores, as well a the DRI2/3 bit necessary to get a 3D context on X.

Regards,
Lucas

#2 lore raw

Hi Lucas,

Quoted 31 lines · Lucas Stach

Hi Alexey,

Am Freitag, den 24.11.2017, 16:02 +0000 schrieb Alexey Brodkin:

Quoted 28 lines

Hello,

Being in the middle of bring-up of the new board with Vivante GPU (HSDK namely,
see https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_torvalds_linux.git_tree_arch_arc_plat-2Dhsdk&d=Dw
IDaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZJSI1u6GgsRHNIcONVFfIKvn1AWaB38GmtCN1dGB3w0&e=)
I was looking at simple 3D test apps to see how Etnaviv works on the hardware.

So far I was able to get kmscube working perfectly fine and the next item I took was glxgears (for some reason I was under impression that's de facto "Hello world" app in the GPU world). But apparently even with Xserver up and running glxgears doesn't work.

Moreover I tried the same thing on Wandboard Quad but to no avail as well. That's what I saw:
------------------------->8---------------------

# glxgears
Error: couldn't get an RGB, Double-buffered visual
# glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig 
------------------------->8---------------------

Googling didn't help here unfortunately so maybe some pointers could be suggested here... like what do I do wrong and if glxgears is supposed to work on top of DRM GPU at all?

Quoted 8 lines
Quoted 1 line

Thanks a lot in advance!

For 3D acceleration to work under X you need the etnaviv specific DDX driver, which can be found here:

https://urldefense.proofpoint.com/v2/url?u=http-3A__git.arm.linux.org.uk_cgit_xf86-2Dvideo-2Darmada.git_log_-3Fh-3Dunstable-2Ddevel&d=DwIDaQ&c=DPL6_
X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZzK2fxA6_XlN6pGnf2Tpo6qKzzQh76ocWZ6IDR-WPtc&e=

Thanks for the pointer, still a couple of questions below...

Quoted 4 lines

Don't let you get confused by the name, the armada driver implements support for both armada drm and imx-drm and the etnaviv DDX. This provides 2D acceleration on the Vivante 2D cores, as well a the DRI2/3 bit necessary to get a 3D context on X.

From Wandboard's .dts I see that 2D core is a separate node with separate set of registers mapped at a different location in memory, right?

Do you know if that's possible if the same one memory-mapped register set controls both 3D and 2D engine?

If we happen to not have 2D core if that's a no go for us for anything? Like no compositing whatsoever etc?

In the meantime I'll try to figure out if we have 2D core or not.

-Alexey
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#3 lore raw

Am Freitag, den 24.11.2017, 16:25 +0000 schrieb Alexey Brodkin:

Quoted 50 lines

Hi Lucas,

Quoted 31 lines · Lucas Stach

Hi Alexey,

Am Freitag, den 24.11.2017, 16:02 +0000 schrieb Alexey Brodkin:

Quoted 28 lines

Hello,

Being in the middle of bring-up of the new board with Vivante GPU (HSDK namely, see?https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_torvalds_linux.git_tree_arch_arc_plat-2Dhsdk&d=Dw IDaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZJSI1u6GgsRHNIcONVFfIKvn1AWaB38GmtCN1dGB3w0&e=)
I was looking at simple 3D test apps to see how Etnaviv works on the hardware.

So far I was able to get kmscube working perfectly fine and the next item I took was glxgears (for some reason I was under impression that's de facto "Hello world" app in the GPU world). But apparently even with Xserver up and running glxgears doesn't work.

Moreover I tried the same thing on Wandboard Quad but to no avail as well. That's what I saw:
------------------------->8---------------------

# glxgears
Error: couldn't get an RGB, Double-buffered visual
# glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig?
------------------------->8---------------------

Googling didn't help here unfortunately so maybe some pointers could be suggested here... like what do I do wrong and if glxgears is supposed to work on top of DRM GPU at all?

Quoted 8 lines
Quoted 1 line

Thanks a lot in advance!

For 3D acceleration to work under X you need the etnaviv specific DDX driver, which can be found here:

https://urldefense.proofpoint.com/v2/url?u=http-3A__git.arm.linux.org.uk_cgit_xf86-2Dvideo-2Darmada.git_log_-3Fh-3Dunstable-2Ddevel&d=DwIDaQ&c=DPL6_
X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZzK2fxA6_XlN6pGnf2Tpo6qKzzQh76ocWZ6IDR-WPtc&e=

Thanks for the pointer, still a couple of questions below...

Quoted 4 lines

Don't let you get confused by the name, the armada driver implements support for both armada drm and imx-drm and the etnaviv DDX. This provides 2D acceleration on the Vivante 2D cores, as well a the DRI2/3 bit necessary to get a 3D context on X.

Quoted 5 lines

From Wandboard's .dts I see that 2D core is a separate node with separate set of registers mapped at a different location in memory, right?

Do you know if that's possible if the same one memory-mapped register set controls both 3D and 2D engine?

Yes, a "core" in Vivante speak is a GPU with one DMA frontend. A single frontend can feed both 3D and 2D acceleration engines behind it. On i.MX6 the 2D and 3D engine are on separate cores, but Marvell Dove has a combined 2D/3D core.

Quoted 1 line

If we happen to not have 2D core if that's a no go for us for anything?

I don't know if the DDX works properly without 2D acceleration. Weston on the other hand only relies on the 3D accel core for doing compositing, so even if you don't have a 2D engine you will be able to launch a modern Linux graphics stack.

The etnaviv DDX could also emulate 2D accel over the 3D core by using the X.Org glamor module, but no one has bothered to implement this yet.

Quoted 2 lines

In the meantime I'll try to figure out if we have 2D core or not.

You can find out what your GPU provides by looking at the feature bits. chipFeatures_PIPE_2D, chipFeatures_PIPE_3D and chipFeatures_PIPE_VG is what you are looking out for.

Regards,
Lucas

#4 lore raw

Hi Lucas,

Quoted 60 lines · Lucas Stach

Am Freitag, den 24.11.2017, 16:25 +0000 schrieb Alexey Brodkin:

Quoted 59 lines

Hi Lucas,

Quoted 36 lines · Lucas Stach

Hi Alexey,

Am Freitag, den 24.11.2017, 16:02 +0000 schrieb Alexey Brodkin:

Quoted 26 lines

Hello,

Being in the middle of bring-up of the new board with Vivante GPU (HSDK namely,
see https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_torvalds_linux.git_tree_arch_arc_plat-2Dhsdk&
d=Dw IDaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZJSI1u6GgsRHNIcONVFfIKvn1AWaB38GmtCN1dGB3w0&e=)
I was looking at simple 3D test apps to see how Etnaviv works on the hardware.

So far I was able to get kmscube working perfectly fine and the next item I took was glxgears (for some reason I was under impression that's de facto "Hello world" app in the GPU world). But apparently even with Xserver up and running glxgears doesn't work.

Moreover I tried the same thing on Wandboard Quad but to no avail as well. That's what I saw:
------------------------->8---------------------

# glxgears
Error: couldn't get an RGB, Double-buffered visual
# glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig 
------------------------->8---------------------
Quoted 5 lines

Googling didn't help here unfortunately so maybe some pointers could be suggested here... like what do I do wrong and if glxgears is supposed to work on top of DRM GPU at all?

Thanks a lot in advance!

Quoted 7 lines

For 3D acceleration to work under X you need the etnaviv specific DDX driver, which can be found here:

https://urldefense.proofpoint.com/v2/url?u=http-3A__git.arm.linux.org.uk_cgit_xf86-2Dvideo-2Darmada.git_log_-3Fh-3Dunstable-2Ddevel&d=DwIDaQ&c=D
PL6_ X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=ZXa-564Jm43PXsqGXCf2US2DY7C0qIlCw6c56pL- bLY&s=ZzK2fxA6_XlN6pGnf2Tpo6qKzzQh76ocWZ6IDR-WPtc&e=

Thanks for the pointer, still a couple of questions below...

Quoted 5 lines

Don't let you get confused by the name, the armada driver implements support for both armada drm and imx-drm and the etnaviv DDX. This provides 2D acceleration on the Vivante 2D cores, as well a the DRI2/3 bit necessary to get a 3D context on X.

From Wandboard's .dts I see that 2D core is a separate node with separate set of registers mapped at a different location in memory, right?

Quoted 7 lines
Quoted 2 lines

Do you know if that's possible if the same one memory-mapped register set controls both 3D and 2D engine?

Yes, a "core" in Vivante speak is a GPU with one DMA frontend. A single frontend can feed both 3D and 2D acceleration engines behind it. On i.MX6 the 2D and 3D engine are on separate cores, but Marvell Dove has a combined 2D/3D core.

Hm, that sounds encouraging. The next question would be if Marvel Dove is supported in Etnaviv DDX? I guess it's called Armada so the answer if yes, right?

Quoted 6 lines
Quoted 1 line

If we happen to not have 2D core if that's a no go for us for anything?

I don't know if the DDX works properly without 2D acceleration. Weston on the other hand only relies on the 3D accel core for doing compositing, so even if you don't have a 2D engine you will be able to launch a modern Linux graphics stack.

That's really cool! I'm much more interested in Weston ATM, which is actually another separate question :)
I tried to find some details on how to run Weston on Wandboard but seems like I was looking at wrong Google again... do you know any good manuals for doing that?

Quoted 3 lines

The etnaviv DDX could also emulate 2D accel over the 3D core by using the X.Org glamor module, but no one has bothered to implement this yet.

Ok we'll see if above case (combined cores) is applicable to us and then we'll see what to do.

Quoted 5 lines
Quoted 1 line

In the meantime I'll try to figure out if we have 2D core or not.

You can find out what your GPU provides by looking at the feature bits. chipFeatures_PIPE_2D, chipFeatures_PIPE_3D and chipFeatures_PIPE_VG is what you are looking out for.

Does that info helps to decipher these bits? -------------------------->8------------------------------

# dmesg | grep etnaviv
etnaviv soc:gpu-subsystem: bound f0090000.gpu (ops 0x9075271c)
etnaviv-gpu f0090000.gpu: model: GC880, revision: 5124
[drm] Initialized etnaviv 1.1.0 20151214 for soc:gpu-subsystem on minor 0
# cat /sys/kernel/debug/dri/0/gpu 
f0090000.gpu Status:
        features
         minor_features0: 0x41f99efb
         minor_features1: 0xfefbf2d9
         minor_features2: 0x4a180285
         minor_features3: 0x00000001
         minor_features4: 0x00000000
         minor_features5: 0x00020000
        specs
         stream_count:  8
         register_max: 64
         thread_count: 256
         vertex_cache_size: 8
         shader_core_count: 1
         pixel_pipes: 1
         vertex_output_buffer_size: 512
         buffer_size: 0
         instruction_count: 512
         num_constants: 576
         varyings_count: 12
        axi: 0x00000050
        idle: 0x7ffffffe
         FE is not idle
        DMA address is constant
         address 0: 0x00000000
         address 1: 0x00000000
         state 0: 0x00000000
         state 1: 0x00000800
         last fetch 64 bit word: 0x40000002 0x00000000
-------------------------->8------------------------------

-Alexey
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#5 lore raw

Am Freitag, den 24.11.2017, 16:49 +0000 schrieb Alexey Brodkin:
[...]

Quoted 11 lines
Quoted 6 lines

Yes, a "core" in Vivante speak is a GPU with one DMA frontend. A single
frontend can feed both 3D and 2D acceleration engines behind it. On i.MX6 the 2D and 3D engine are on separate cores, but Marvell Dove has
a combined 2D/3D core.

Hm, that sounds encouraging. The next question would be if Marvel Dove is
supported in Etnaviv DDX? I guess it's called Armada so the answer if yes, right?

Yes, the Dove was the original platform for the Armada X.Org driver. Combined 2D/3D cores are supported just fine by etnaviv.

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

If we happen to not have 2D core if that's a no go for us for anything?

I don't know if the DDX works properly without 2D acceleration. Weston
on the other hand only relies on the 3D accel core for doing compositing, so even if you don't have a 2D engine you will be able to
launch a modern Linux graphics stack.

Quoted 5 lines

That's really cool! I'm much more interested in Weston ATM, which is actually another separate question :)
I tried to find some details on how to run Weston on Wandboard but seems like I was looking at wrong Google again... do you know any good manuals for doing that?

There really is no magic to it. Or better there is, but it's all hidden in the Mesa implementation.

You need at least Mesa 17.2 and Weston 3.0 for etnaviv to work properly. Other than that just set XDG_RUNTIME_DIR to something sensible and launch Weston with "weston --tty=63", done.

Quoted 12 lines
Quoted 5 lines

The etnaviv DDX could also emulate 2D accel over the 3D core by using
the X.Org glamor module, but no one has bothered to implement this yet.

Ok we'll see if above case (combined cores) is applicable to us and then
we'll see what to do.

Quoted 2 lines
Quoted 1 line

In the meantime I'll try to figure out if we have 2D core or not.

Quoted 7 lines
Quoted 5 lines

You can find out what your GPU provides by looking at the feature bits.
chipFeatures_PIPE_2D, chipFeatures_PIPE_3D and chipFeatures_PIPE_VG is
what you are looking out for.

Does that info helps to decipher these bits?

Unfortunately we forgot to expose the major feature bits register in debugfs. It's gpu->identity.features in the kernel driver, the interesting bits in there are chipFeatures_PIPE_3D and chipFeatures_PIPE_2D.

Regards,
Lucas

#6 lore raw

Hi Lucas,

Quoted 11 lines · Lucas Stach

Am Freitag, den 24.11.2017, 16:49 +0000 schrieb Alexey Brodkin:
[...]

Quoted 9 lines
Quoted 8 lines

Yes, a "core" in Vivante speak is a GPU with one DMA frontend. A single
frontend can feed both 3D and 2D acceleration engines behind it. On i.MX6 the 2D and 3D engine are on separate cores, but Marvell Dove has
a combined 2D/3D core.

Quoted 7 lines
Quoted 4 lines

Hm, that sounds encouraging. The next question would be if Marvel Dove is
supported in Etnaviv DDX? I guess it's called Armada so the answer if yes, right?

Yes, the Dove was the original platform for the Armada X.Org driver. Combined 2D/3D cores are supported just fine by etnaviv.

Sweet!
Maybe another question then.
To get kmscube working on our board which uses essentially different bit-streamer device "udl" as opposed to "imx-drm" I had just to say:
---------------------->8----------------------
export MESA_LOADER_DRIVER_OVERRIDE=imx-drm ---------------------->8----------------------
and then all the magic has happened.

Will it be
 a) required
 b) enough
for Vivante X.org driver?

Quoted 16 lines
Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

If we happen to not have 2D core if that's a no go for us for anything?

I don't know if the DDX works properly without 2D acceleration. Weston
on the other hand only relies on the 3D accel core for doing compositing, so even if you don't have a 2D engine you will be able to
launch a modern Linux graphics stack.

Quoted 5 lines

That's really cool! I'm much more interested in Weston ATM, which is actually another separate question :)
I tried to find some details on how to run Weston on Wandboard but seems like I was looking at wrong Google again... do you know any good manuals for doing that?

Quoted 6 lines

There really is no magic to it. Or better there is, but it's all hidden in the Mesa implementation.

You need at least Mesa 17.2 and Weston 3.0 for etnaviv to work properly. Other than that just set XDG_RUNTIME_DIR to something sensible and launch Weston with "weston --tty=63", done.

Cool, will try that!

Quoted 20 lines
Quoted 19 lines
Quoted 4 lines

The etnaviv DDX could also emulate 2D accel over the 3D core by using
the X.Org glamor module, but no one has bothered to implement this yet.

Ok we'll see if above case (combined cores) is applicable to us and then
we'll see what to do.

Quoted 9 lines
Quoted 3 lines

In the meantime I'll try to figure out if we have 2D core or not.

You can find out what your GPU provides by looking at the feature bits.
chipFeatures_PIPE_2D, chipFeatures_PIPE_3D and chipFeatures_PIPE_VG is
what you are looking out for.

Quoted 6 lines
Quoted 1 line

Does that info helps to decipher these bits?

Unfortunately we forgot to expose the major feature bits register in debugfs. It's gpu->identity.features in the kernel driver, the interesting bits in there are chipFeatures_PIPE_3D and chipFeatures_PIPE_2D.

Noted!

Are you going to add that yourself sometime soon or shall I do it?

-Alexey
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc