Bug 815569 - Enabling VDPAU within Mesa
Enabling VDPAU within Mesa
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: mesa (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tom "spot" Callaway
Dan Mashal
:
: 768145 (view as bug list)
Depends On:
Blocks: FE-Legal F18-accepted/F18FinalFreezeExcept
  Show dependency treegraph
 
Reported: 2012-04-23 17:42 EDT by Nicolas Chauvet (kwizart)
Modified: 2013-12-03 05:43 EST (History)
19 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-24 20:05:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Enable VDPAU within mesa (1.87 KB, patch)
2012-04-23 17:42 EDT, Nicolas Chauvet (kwizart)
no flags Details | Diff
Add --with=vdpau option to mesa.spec (2.33 KB, patch)
2013-01-06 15:12 EST, Stefan Becker
no flags Details | Diff

  None (edit)
Description Nicolas Chauvet (kwizart) 2012-04-23 17:42:42 EDT
Created attachment 579702 [details]
Enable VDPAU within mesa

Description of problem:
Current  support a vdpau state tracker

Version-Release number of selected component (if applicable):
Mesa 8.0.x in F-17 and later.

How reproducible:
always

Steps to Reproduce:
1. vdpauinfo with nouveau,r300,r600 should reports some decoders capabilities.

  
Actual results:
output nothing

Expected results:
$ vdpauinfo
...
Decoder capabilities:

name               level macbs width height
-------------------------------------------
MPEG1                16 262144  8192  8192
MPEG2_SIMPLE         16 262144  8192  8192
MPEG2_MAIN           16 262144  8192  8192
...

Additional info:
I've successfully tested a captured DVB-t stream with a VDPAU enabled player.
I'm not sure of either VDPAU can be enabled in the "without hardware" case.
I will try to reproduce on an Intel card.
Comment 1 Nicolas Chauvet (kwizart) 2012-04-23 17:54:15 EDT
Scratch built:
http://koji.fedoraproject.org/koji/taskinfo?taskID=4016470

Related components:
(Open)
Review Request: libva-vdpau-driver - HW video decode support for VDPAU platforms
https://bugzilla.redhat.com/show_bug.cgi?id=771254

(Closed)
gstreamer-plugins-bad-free can enable libvdpau-devel
https://bugzilla.redhat.com/show_bug.cgi?id=734242
Comment 2 Nicolas Chauvet (kwizart) 2012-04-23 17:57:11 EDT
*** Bug 768145 has been marked as a duplicate of this bug. ***
Comment 3 Nicolas Chauvet (kwizart) 2012-04-23 18:01:22 EDT
The previous report was worded as VA-API activation but was searching for libvdpau_r600.so which is the result of the VDPAU activation. VA-API state tracker is marked as un-maintained in mesa-8.0.x. So I guess VDPAU was actually intended in this previous report.
Comment 4 Gianluca Cecchi 2012-06-06 05:03:09 EDT
Hello I would like to use vdpau with nouveau too.
Currently my F17 has:
mesa-dri-drivers-8.0.3-1.fc17.x86_64
mesa-libOSMesa-8.0.3-1.fc17.x86_64
mesa-libGL-8.0.3-1.fc17.x86_64
mesa-libxatracker-8.0.3-1.fc17.x86_64
mesa-libglapi-8.0.3-1.fc17.x86_64
mesa-libGLU-8.0.3-1.fc17.x86_64
mesa-dri-filesystem-8.0.3-1.fc17.x86_64

I'm going to test with 
- Asus U36sd and hybrid graphics (nVidia is GeForce GT520M):
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller: nVidia Corporation Device 1050 (rev ff) (prog-if ff)

- pc with GeForce 9600GT

I have not understood how to download mesa-8.0.2-4.fc18.src.rpm as in comment#1 and compare the spec file with current F17 one.
Is it possible to rebase the source?
Or can you give the changes to put inside the F17 spec file, so that I can recompile myself and test?
Thanks in advance
Comment 5 Martin Dengler 2012-06-11 10:25:06 EDT
(In reply to comment #4)
> Or can you give the changes to put inside the F17 spec file, so that I can
> recompile myself and test?
> Thanks in advance

Nicolas's scratch builds have expired.  I have built a F17 RPM; you can download it and the SRPM at http://koji.fedoraproject.org/koji/taskinfo?taskID=4150636 .  You will also want the libva-vdpau radeon driver RPM/SRPM at http://koji.fedoraproject.org/koji/taskinfo?taskID=4150630 .
Comment 6 Gianluca Cecchi 2012-08-07 04:35:57 EDT
I missed that scratch build... I don't know if current updates include vdpau support
At this moment my packages from standard F17 repo are:
mesa-dri-drivers-8.0.3-3.fc17.x86_64
libva-vdpau-driver-0.7.3-2.fc17.x86_64
libvdpau-0.4.1-7.fc17.x86_64
mesa-libGL-8.0.3-3.fc17.x86_64
mesa-libGLU-8.0.3-3.fc17.x86_64
mesa-libOSMesa-8.0.3-3.fc17.x86_64
libvdpau-docs-0.4.1-7.fc17.x86_64
vdpauinfo-0.0.6-4.fc17.x86_64
mesa-libGL-8.0.3-3.fc17.i686
mesa-dri-filesystem-8.0.3-3.fc17.x86_64
mesa-libglapi-8.0.3-3.fc17.x86_64
mesa-libxatracker-8.0.3-3.fc17.x86_64
mesa-libglapi-8.0.3-3.fc17.i686
libva-utils-1.0.15-2.fc17.x86_64
libva-1.0.15-2.fc17.x86_64


$ sudo optirun /usr/bin/vdpauinfo
display: :0   screen: 0
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Error creating VDPAU device: 1

While I see in libva-vdpau-driver rpm only

/usr/lib64/dri/nvidia_drv_video.so
/usr/lib64/dri/s3g_drv_video.so
/usr/lib64/dri/vdpau_drv_video.so
/usr/share/doc/libva-vdpau-driver-0.7.3
/usr/share/doc/libva-vdpau-driver-0.7.3/AUTHORS
/usr/share/doc/libva-vdpau-driver-0.7.3/COPYING
/usr/share/doc/libva-vdpau-driver-0.7.3/NEWS
/usr/share/doc/libva-vdpau-driver-0.7.3/README

Do I have to create any soft link to have it working?
Comment 7 Kevin DeKorte 2012-09-19 10:01:23 EDT
I have an r600 based video card and while I can build mesa with the --enable-vdpau and get some support, I would prefer if mesa came with this feature enabled.

vdpauinfo currently reports the following

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
Comment 8 Kevin DeKorte 2012-12-21 11:13:49 EST
Any update on mesa being built with the --enable-vdpau option? Would be nice to have for F18
Comment 9 Dan Mashal 2012-12-21 23:12:26 EST
The method to add this as noted in the patch is extremely trivial. What's the hold up? This is not enabled on 16,17,or 18. 

Adding to f18-nth to get some response here.
Comment 10 drago01 2012-12-26 05:51:53 EST
I have not looked at the code but there is a potential problem here:

If the vdpau support is implemented using the hardware decoders it should be fine but if it is implemented using shaders we can't due to patents. That would be the same as allowing ffmpeg in.
Comment 11 Dan Mashal 2012-12-26 07:12:47 EST
(In reply to comment #10)
> I have not looked at the code but there is a potential problem here:
> 
> If the vdpau support is implemented using the hardware decoders it should be
> fine but if it is implemented using shaders we can't due to patents. That
> would be the same as allowing ffmpeg in.

Please look at the patch and comment, it's very a simple patch to the spec file.
Comment 12 drago01 2012-12-26 07:17:26 EST
(In reply to comment #11)
> (In reply to comment #10)
> > I have not looked at the code but there is a potential problem here:
> > 
> > If the vdpau support is implemented using the hardware decoders it should be
> > fine but if it is implemented using shaders we can't due to patents. That
> > would be the same as allowing ffmpeg in.
> 
> Please look at the patch and comment, it's very a simple patch to the spec
> file.

It has nothing to do with the spec file itself. But with the VDPAU code in mesa that gets enabled.

If that code implements patented codecs using shaders we cannot enable it in fedora.
Comment 13 Dan Mashal 2012-12-26 07:18:25 EST
It doesn't look like it does. I will attempt a scratch build and see what happens.
Comment 14 Dan Mashal 2012-12-26 16:54:14 EST
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > I have not looked at the code but there is a potential problem here:
> > > 
> > > If the vdpau support is implemented using the hardware decoders it should be
> > > fine but if it is implemented using shaders we can't due to patents. That
> > > would be the same as allowing ffmpeg in.
> > 
> > Please look at the patch and comment, it's very a simple patch to the spec
> > file.
> 
> It has nothing to do with the spec file itself. But with the VDPAU code in
> mesa that gets enabled.
> 
> If that code implements patented codecs using shaders we cannot enable it in
> fedora.


https://koji.fedoraproject.org/koji/taskinfo?taskID=4820643

Scratch build successful. Not seeing any licensing issues here. Please double check it or let me know how I can check if there is an issue.
Comment 15 drago01 2012-12-26 17:31:10 EST
I have no idea how you can conclude that there is a no license issue by doing a scratch build. You have to checkout and review the *code* and verify that the implementation is actually just sending and getting frames from dedicated hardware rather then implement the decoding using shaders.
Comment 16 Dan Mashal 2012-12-26 17:56:43 EST
Yeah I have no idea how to do that offhand. The rpmbuild just generated some libs. I guess I'll have to look at the code that generated those libs. Thanks.
Comment 17 Dan Mashal 2012-12-26 18:39:38 EST
Looking at the code with an untrained eye it looks like it does direct hardware rendering (briefly looked at r600).

spot, can you take a look?
Comment 18 Stefan Becker 2013-01-06 15:12:45 EST
Created attachment 673465 [details]
Add --with=vdpau option to mesa.spec

I understand that Fedora has problems with legally encumbered code. But what about a solution so that, e.g. RPMFusion, could rebuild the Fedora SRPM and *only* generate the VDPAU driver package? If Fedora integrates the attached patch to the mesa package then there would be no need to fork the package downstream.

I've opened a discussion about this solution on the RPMFusion bugzilla:

   https://bugzilla.rpmfusion.org/show_bug.cgi?id=2633
Comment 19 Dan Mashal 2013-01-22 21:50:36 EST
spot is working on this.
Comment 20 Kevin DeKorte 2013-03-22 09:31:46 EDT
Any update on this?
Comment 21 Liang Suilong 2013-05-05 11:36:28 EDT
I build some package and create a repo for UVD VDPAU hardware decoding. 

Here is the repo URL. All the RPMs, SRPMs and SPECs are there.
http://www.liangsuilong.info/repo/

I wrote a blog post to describe the repo.
http://www.liangsuilong.info/?p=1609

I fetch the latest mesa master branch code. but fails to compile mesa-libOSMesa. I just drop it in this build. All pacakges are not built on koji, just built on my local machine. Because mesa-git requires libdrm-2.4.44. At this time, Fedora 18 just contains libdrm-2.4.42.
Comment 22 Dan Mashal 2013-05-24 20:05:14 EDT
Without much response from maintainers it looks like this is getting enabled in Fedora 19 officially.
Comment 23 Kevin DeKorte 2013-06-01 10:42:51 EDT
Looks like they enabled vdpau, but disabled all the decoders. 

Video surface:

name   width height types
-------------------------------------------
420     8192  8192  NV12 YV12 
422     8192  8192  NV12 YV12 UYVY YUYV 
444     8192  8192  NV12 YV12 Y8U8V8A8 V8U8Y8A8 

Decoder capabilities:

name               level macbs width height
-------------------------------------------

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 
R8G8B8A8          8192  8192    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 
R10G10B10A2       8192  8192    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 
B10G10R10A2       8192  8192    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8

Note You need to log in before you can comment on or make changes to this bug.