[Libva] [RFC] OpenGL API extension

Yuan, Shengquan shengquan.yuan at gmail.com
Thu Aug 20 00:51:10 PDT 2009


On Wed, Aug 19, 2009 at 6:15 AM, Gwenole
Beauchesne<gbeauchesne at splitted-desktop.com> wrote:
> Hi,
>
> I am experimenting with OpenGL extensions to VA API. I came up with the
> following two additions, in some <va/va_glx.h>:
> - vaGetDisplayGLX(Display, GLXContext *); returns a suitable VADisplay for
> VA API
> - vaPutSurfaceGLX(VADisplay, VASurfaceID, GLuint texture, unsigned int
> flags); is used to copy VA API surface to an OpenGL texture
>
There are some discussion about XvMCCopySurfaceToGLXPbuffer or
XvMCCopySurfaceToGLXPixmap a long time ago . Since XvMC/VA and GL/GLX
context are seperate context, and they need to share the underline
frame buffer information, it is not easy to implement.

Application can vaPutSurface to a pixmap, then use texture_from_pixmap
to load texture image. It is the current feasible way to associate a
VA surface with a GL context. I will have a sample to demonstrate it.

> My constraints were:
> - A libVA shall not contain both OpenGL and raw X11 code, thus requiring
> libVA split (libva, libva-x11, libva-glx)
> - An application can link against both libva-x11 and libva-glx and there
> should be no symbol collision
> - A VA backend needs a way to know about the application GLXContext
> - A function to copy the whole VA surface to a GL texture is needed, there
> is no partial copy intended
>
> How could this be implemented:
> - (a) Direct vaPutSurfaceGLX hook
> - (b) GLX texture-from-pixmap extension with the Pixmap rendered through
> vaPutSurface() (NVIDIA)
> - (c) GLX texture-from-pixmap extension with the underlying Pixmap extracted
> from the VA Surface (Intel)
>
> Now the following question arises: who implements TFP, the driver or libVA?
> My initial idea was something among those lines in libVA:

TFP is GLX extension and implemented in DRI driver (libGL.so and DRI driver)
>
> if (ctx->vaPutSurfaceGLX)
>    return ctx->vaPutSurfaceGLX();


More information about the Libva mailing list