[Libva] linux vaapi without graphical env

Matt Pekar mpekar at raineyelectronics.com
Thu Mar 27 09:00:57 PDT 2014


I'm not sure of the exact relationship between dri and drm (maybe dri
became drm?), but you can use it/them to run libva without X.

In our code, we first attempt to initialize libva with X11 (for desktop
development), then a secondary attempt is made to initialize through DRM
(which is how our program runs in production).

The tricky part is that DRM requires some elevated permissions, and we made
some changes to the va_drm_auth.c file to accommodate that better for us.

The code is something along these lines:

VADisplay va_display;

printf("attempting to connect through X");
Display* x11_display = XOpenDisplay(":0.0");
if(x11_display != NULL)
{
printf("connected through X");
va_display = vaGetDisplay(x11_display);
return;
}

printf("attempting to connect through drm");
int drm_fd = open("/dev/dri/card0", O_RDWR);
if (element->drm_fd > 0)
{
printf("connected through drm on /dev/dri/card0");
va_display = vaGetDisplayDRM(element->drm_fd);
return;
}

//error



On Thu, Mar 27, 2014 at 8:32 AM, Nik Orlov <nikitos1550 at yandex.ru> wrote:

> Hello!
>
> As I have read here (http://www.freedesktop.org/wiki/Software/vaapi/)
>
> The current video decode/encode interface is window system independent, so
> that potentially it can be used with graphics sub-systems other than X. In
> a nutshell it is basically a scheme to pass various types of data buffers
> from the application to the GPU for decoding or encoding. Feedback on the
> API is greatly welcomed, as this is intended to be a community
> collaborative effort.
>
> So, there is some way to setup debian or ubuntu without Xorg to use libva.
> Maybe someone show me right way? At the moment I don`t know infrustructure
> of libva.
>
> There is schem from wiki (
> http://en.wikipedia.org/wiki/Video_Acceleration_API)
> http://en.wikipedia.org/wiki/File:Vaapi_illustration.svg
> I don`t understand VA Hardware Driver needs to use all DRILib, DRMLib and
> direct access to hardware OR it can use one of them?
>
> According to sources of h264encoding test from libva-1.1.1 it uses some
> functions with display
>
>
>     va_dpy = va_open_display();
>     va_status = vaInitialize(va_dpy, &major_ver, &minor_ver);
>     CHECK_VASTATUS(va_status, "vaInitialize");
>
> It seems I still Xorg to use this features, or there is another way?
>
>
> --
> Ник Орлов mailto:nikitos1550 at yandex.ru
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libva/attachments/20140327/6d64fcc1/attachment.html>


More information about the Libva mailing list