# [SOLVED, more or less] radeon, gallium, and mesa-8 use flags

## cjubon

Most recent world-update gave me this: 

```
[ebuild     U  ] media-libs/mesa-8.0 [7.11.2] USE="classic egl gallium llvm nptl shared-glapi -bindist -d3d% -debug -g3dvl% -gbm -gles1% -gles2% -openvg -osmesa -pax_kernel -pic (-selinux) -shared-dricore -vdpau% -wayland% -xvmc% (-gles%) (-motif%)" VIDEO_CARDS="radeon -i915% -i965% -intel -nouveau -r100% -r200% -r300% -r600% -vmware (-mach64%) (-mga%) (-r128%) (-savage%) (-sis%) (-tdfx%) (-via%)" 5,555 kB
```

My video cards are an ATI Radeon X850XT on my desktop and an ATI Radeon Mobility X1400 on my laptop.

On both machines, I'm using the gallium driver, and I build my kernel with KMS (according to the getnoo xorg howto).

Now, which mesa USE flags should I enable to take full advantage of my specific setup? equery uses mesa is not especially helpful in this case.

classic: can I go without it?

g3dvl: do I need it?

gbm: "Enable the Graphics Buffer Manager for EGL on KMS" - ok, I have both egl and kms, so I guess I should enable this one too?

gles1, gles2: no idea what to do

openvg: does it make sense in my case?

vdpau: same question …

xvmc: is it of any use in my case?

Thanks for your suggestions.

----------

## Aquous

classic: there is no classic r300 driver, there's only r300g (the gallium driver); this use flag is irrelevant for your card

g3dvl: this gives you hardware-accelerated HD video playback, you don't need but probably want this

gbm: no idea, probably wayland-related

gles*: GLES is a subset of OpenGL which is only really relevant for embedded systems. You don't need it.

openvg: allows hardware-accelerated SVG graphics. You probably won't notice any difference, but HW accel is always better than SW, so why not?

vdpau: enables g3dvl to be used with the VDPAU API - in other words: makes g3dvl useable

xvmc: enables the XVMC front-end for g3dvl. Doesn't really make sense to enable unless you don't want to use the superior VDPAU for some reason

----------

## na641

I wasnt even able to get mesa-8.0 working. eselect mesa would not allow me to select r600 gallium... said it wasn't a valid option. I had to mask mesa-8.0 to even get this working correctly.

----------

## Gusar

 *na641 wrote:*   

> eselect mesa would not allow me to select r600 gallium... said it wasn't a valid option.

 

Gallium is the only driver still available for radeon. So of course eselect won't allow changing things - there's no options to set anymore.

----------

## cjubon

Thank you for your replies so far.

 *Aquous wrote:*   

> there is no classic r300 driver, there's only r300g (the gallium driver)

 

I don't think so: 

```
eselect mesa list

…

64bit r300 (Radeon R300-R500)

  [1]   classic

  [2]   gallium *

64bit r600 (Radeon R600-R700, Evergreen, Northern Islands)

  [1]   classic

  [2]   gallium *

…

32bit r300 (Radeon R300-R500)

  [1]   classic

  [2]   gallium *

32bit r600 (Radeon R600-R700, Evergreen, Northern Islands)

  [1]   classic

  [2]   gallium *
```

And when I do: 

```
eselect mesa set 32bit r300 classic,
```

it changes and marks “classic” as the active driver.

 *Aquous wrote:*   

> g3dvl: this gives you hardware-accelerated HD video playback, you don't need but probably want this

 

Ok, so I just wonder why it isn’t enabled by default (I mean, in the ebuild)?

Your other points are clear, Aquous, so, thanks a lot!

@na641: depends on your card, I think. It works fine here, and Gnome 3 makes heavy use of it!

----------

## Gusar

@cjubon: The classic drivers are indeed gone in mesa 8. Check the changelog. And check the code if you don't believe the changelog. I have no idea what eselect is setting there, but mesa 8 does not have classic radeon drivers.

----------

## LiquidAcid

 *Gusar wrote:*   

> @cjubon: The classic drivers are indeed gone in mesa 8. Check the changelog. And check the code if you don't believe the changelog. I have no idea what eselect is setting there, but mesa 8 does not have classic radeon drivers.

 

Precisely. Both r300c and r600c were already removed in 2011:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=de22b9018f2516a3948d920c6bb1ffe659d7f230

----------

## Joseph K.

I have a Radeon HD 4850, so I get this list, which makes sense:

```
# eselect mesa list

64bit i915 (Intel 915, 945)

64bit i965 (Intel 965, G/Q3x, G/Q4x)

64bit r300 (Radeon R300-R500)

64bit r600 (Radeon R600-R700, Evergreen, Northern Islands)

  [1]   gallium

64bit sw (Software renderer)

  [1]   classic

  [2]   gallium *

32bit i915 (Intel 915, 945)

  [1]   classic *

  [2]   gallium

32bit i965 (Intel 965, G/Q3x, G/Q4x)

  [1]   classic *

32bit r300 (Radeon R300-R500)

  [1]   gallium

32bit r600 (Radeon R600-R700, Evergreen, Northern Islands)

  [1]   gallium

32bit sw (Software renderer)

  [1]   classic

  [2]   gallium *

```

But then I'm getting this weirdness:

```
# eselect mesa set --auto

!!! Warning: Invalid selection: 64bit r600 gallium.

!!! Warning: Invalid selection: 32bit r300 gallium.

!!! Warning: Invalid selection: 32bit r600 gallium.

# eselect mesa show

64bit sw gallium

32bit i915 classic

32bit i965 classic

32bit sw gallium

```

Help?

----------

## cjubon

Ok, so I re-installed mesa with the following use flags: 

```
[ebuild   R    ] media-libs/mesa-8.0  USE="egl g3dvl gallium llvm nptl openvg shared-glapi vdpau -bindist -classic -d3d -debug -gbm -gles1 -gles2 -osmesa -pax_kernel -pic (-selinux) -shared-dricore -wayland -xvmc" VIDEO_CARDS="r300 -i915 -i965 -intel -nouveau -r100 -r200 -r600 -radeon -vmware" 0 kB
```

@classic: removed flag, because it seems to be useless for my cards

@g3dvl: added flag together with vdpau

@openvg: i think I don’t really need it, maybe good for svg web fonts on iOS, but it can’t hurt either

@video_cards_radeon: removed it in favour of video_cards_r300

this works fine.

@Joseph K.: please post output of emerge -pv mesa

marked solved. Thank you for your replies.

----------

## gorkypl

Wasn't  VDPAU meant only for NVidia cards?

----------

## Gusar

 *gorkypl wrote:*   

> Wasn't  VDPAU meant only for NVidia cards?

 

No, never. VDPAU is the "Video Decode and Presentation API for UNIX". Keyword *API*. What's behind the API is just an implementation detail.

----------

## Joseph K.

I think you still need video_cards_radeon for xorg-drivers.

emerge -pv =mesa-8.0:

```
[ebuild   R   ~] media-libs/mesa-8.0  USE="egl g3dvl gallium llvm nptl shared-glapi vdpau xvmc -bindist -classic -d3d -debug -gbm -gles1 -gles2 -openvg -osmesa -pax_kernel -pic (-selinux) -shared-dricore -wayland" VIDEO_CARDS="r600 radeon -i915 -i965 -intel -nouveau -r100 -r200 -r300 -vmware" 0 kB

```

----------

## gorkypl

 *Gusar wrote:*   

>  *gorkypl wrote:*   Wasn't  VDPAU meant only for NVidia cards? 
> 
> No, never. VDPAU is the "Video Decode and Presentation API for UNIX". Keyword *API*. What's behind the API is just an implementation detail.

 

Yeah, but as far as I know it was designed by NVidia and only NVidia cards support it. Or am I wrong?

----------

## Gusar

 *gorkypl wrote:*   

> Yeah, but as far as I know it was designed by NVidia and only NVidia cards support it. Or am I wrong?

 

Considering mesa has a vdpau USE flag, yeah, you're wrong  :Smile: 

It's true that Nvidia came up with it. But note how libvdpau is a separate package from the nvidia driver, and that it's source code is hosted on freedesktop.org. It was never a nvidia-only API.

----------

## gorkypl

 *Gusar wrote:*   

>  *gorkypl wrote:*   Yeah, but as far as I know it was designed by NVidia and only NVidia cards support it. Or am I wrong? 
> 
> Considering mesa has a vdpau USE flag, yeah, you're wrong 
> 
> It's true that Nvidia came up with it. But note how libvdpau is a separate package from the nvidia driver, and that it's source code is hosted on freedesktop.org. It was never a nvidia-only API.

 

OK, thanks!

----------

## cjubon

 *gorkypl wrote:*   

> Wasn't VDPAU meant only for NVidia cards?

 

After a bit of research, I think that gorkypl is essentially right. VDPAU is an API, and libvdpau is open source, yes --- but there also must be the proper hardware to support the API. And such hardware is only implemented in Nvidia cards and in certain S3 Chrome cards. See the wikipedia article on VDPAU.

 *http://en.wikipedia.org/wiki/VDPAU wrote:*   

> Intel and ATI currently offer no support for VDPAU.

  There seems to be an AMD/ATI alternative called xvba, available only for r600 (radeon HD 4000+) and which needs catalyst drivers, so not for me.

So I suppose I can throw out the vdpau use flag again. I just wonder if the xvmc flag is of any use, instead.

----------

## Gusar

Mesa implements decoders using shaders. These decoders are exposed via the VDPAU API. So if you enable the use flag, you'll get VDPAU support on *every* graphic card with a Gallium driver. Well, if the decoders were complete, that is.

----------

## skunk

http://www.phoronix.com/scan.php?page=news_item&px=MTA0MzM

----------

## cjubon

OK, thanks for your explanations. I'll keep vdpau.

----------

## Joseph K.

I enabled vdpau in mesa, but the vdpauinfo utility reports:

```
# vdpauinfo 

display: :0   screen: 0                                                                             

Failed to open VDPAU backend libvdpau_r600.so: cannot open shared object file: No such file or directory                                                                                                

Error creating VDPAU device: 1                                                                      

```

even though the file is there:

```
# locate libvdpau_r600.so

/usr/lib64/vdpau/libvdpau_r600.so

/usr/lib64/vdpau/libvdpau_r600.so.1

/usr/lib64/vdpau/libvdpau_r600.so.1.0

```

Do you reckon this is just a bug in vdpauinfo, or are other programs also likely to not find the necessary shared library?

----------

## cjubon

Thank you again for additional discussion of this almost solved topic  :Smile: .

 *Joseph K. wrote:*   

> vdpauinfo utility reports:
> 
> ```
> # vdpauinfo
> 
> ...

 

Yeah, I forgot to mention this before, i had the same error:

```
# vdpauinfo 

display: :0   screen: 0

Failed to open VDPAU backend libvdpau_r300.so: cannot open shared object file: No such file or directory

Error creating VDPAU device: 1
```

Solution was to create a symbolic link, as so: 

```
# cd /usr/lib/

# ln -s vdpau/libvdpau_r300.so libvdpau_r300.so

```

After that, I indeed get the following:

```
 # vdpauinfo 

display: :0   screen: 0

API version: 1

Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types

-------------------------------------------

420     4096  4096  NV12 YV12 

Decoder capabilities:

name               level macbs width height

-------------------------------------------

MPEG1                16 65536  4096  4096

MPEG2_SIMPLE         16 65536  4096  4096

MPEG2_MAIN           16 65536  4096  4096

Output surface:

name              width height nat types

----------------------------------------------------

Bitmap surface:

name              width height

------------------------------

Video mixer:

feature name                    sup

------------------------------------

DEINTERLACE_TEMPORAL             -

DEINTERLACE_TEMPORAL_SPATIAL     -

INVERSE_TELECINE                 -

NOISE_REDUCTION                  -

SHARPNESS                        -

LUMA_KEY                         -

HIGH QUALITY SCALING - L1        -

HIGH QUALITY SCALING - L2        -

HIGH QUALITY SCALING - L3        -

HIGH QUALITY SCALING - L4        -

HIGH QUALITY SCALING - L5        -

HIGH QUALITY SCALING - L6        -

HIGH QUALITY SCALING - L7        -

HIGH QUALITY SCALING - L8        -

HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max

-----------------------------------------------------

VIDEO_SURFACE_WIDTH              y        48     4096

VIDEO_SURFACE_HEIGHT             y        48     4096

CHROMA_TYPE                      y  

LAYERS                           y         0        4

attribute name                  sup      min      max

-----------------------------------------------------

BACKGROUND_COLOR                 y  

CSC_MATRIX                       y  

NOISE_REDUCTION_LEVEL            y      0.00     1.00

SHARPNESS_LEVEL                  y     -1.00     1.00

LUMA_KEY_MIN_LUMA                y  

LUMA_KEY_MAX_LUMA                y
```

And just another point you mentioned earlier in this thread:

 *Joseph K. wrote:*   

> I think you still need video_cards_radeon for xorg-drivers. 

 

For other packages, yes, you're right. But not so for mesa: 

```
# grep radeon /etc/make.conf

VIDEO_CARDS="radeon"

# cat /etc/portage/package.use/mesa 

media-libs/mesa -classic g3dvl openvg -video_cards_radeon video_cards_r300
```

Cheers

----------

## kernelOfTruth

@cjubon:

setting that symbolic link helped - thanks !

edit:

you guys also get a blue-ish touch to the vdpau-accelerated videos you play ?

if no - what mesa libdrm xf86-video-ati driver

and graphics card are you using ?

I get a blue touch (http://phoronix.com/forums/showthread.php?70037-r600-gallium-vdpau-weird-color-shift)

with my 5850

----------

## Joseph K.

I don't get any blueish touch, but I'm not using the latest git at the moment, I'm just using ~ on an HD 4850.

----------

## Gusar

 *kernelOfTruth wrote:*   

> you guys also get a blue-ish touch to the vdpau-accelerated videos you play ?

 

In general, or just with Flash? If just with Flash, then https://forums.gentoo.org/viewtopic-t-918540-highlight-.html

----------

## kernelOfTruth

 *Gusar wrote:*   

>  *kernelOfTruth wrote:*   you guys also get a blue-ish touch to the vdpau-accelerated videos you play ? 
> 
> In general, or just with Flash? If just with Flash, then https://forums.gentoo.org/viewtopic-t-918540-highlight-.html

 

with flash so far,

I haven't had the chance to re-compile all the other apps to support vdpau (haven't used it in the past & started using it today)

seems like it's a flash-issue

(see the answers posted on the thread over at http://phoronix.com/forums/showthread.php?70037-r600-gallium-vdpau-weird-color-shift)

thanks !

edit:

now updating libvdpau

----------

