[Libva] External buffers for surfaces

Steven Toth stoth at kernellabs.com
Thu Jul 24 10:45:16 PDT 2014


I'd like my application to allocate buffers (not DRM_PRIME or
KERNEL_PRIME) and use each of these for a surface, passing the
allocation by reference during CreateSurface. I've seen various
examples (below) of projects that demonstrate the use of
VASurfaceAttribExternalBuffers but nothing that creates via user
allocated pointers.

Based on reading the intel driver internals, I'm starting to think my
goal isn't currently possible.

Looking at the intel-driver project, function i965_CreateSurfaces2...

If you pass VA_SURFACE_ATTRIB_MEM_TYPE_VA it appears as if the i965
driver allocates the surface memory internally via
i965_surface_native_memory()

If you pass VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME or
VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM it appears as if the i965 driver
uses external surfaces via i965_suface_external_memory(), but not user
pointers, only I965_SURFACE_MEM_GEM_FLINK or
I965_SURFACE_MEM_DRM_PRIME.

The only i965 driver attempt to query the
VASurfaceAttribExternalBuffers->num_buffers/buffers member is inside
i965_suface_external_memory().

Have I missed something important, or is this simply not possible?

I assume DRM_PRIME or KERNEL_PRIME handles don't permit the use of
user allocated pointers. Correct?

Thanks,

- Steve

Related projects using ExternalBuffer capabilities in various ways:
https://gitorious.org/gst-plugins-vaapi/gst-plugins-vaapi/commit/9b59224be13e17438729623f7642c020c24410dd
https://github.com/01org/libyami/blob/master/vaapi/vaapisurface.cpp
https://github.com/seanvk/libva_wrapper/blob/master/src/wrapper_drv_video.c
https://github.com/ntanibata/weston-ivi-shell/blob/master/src/vaapi-recorder.c

-- 
Steven Toth - Kernel Labs
http://www.kernellabs.com


More information about the Libva mailing list