Add support for new VA buffer export APIs.

Implement va{Acquire,Release}BufferHandle() hooks so that to allow
VA surface or VA image buffer sharing with thirdparty APIs like EGL,
OpenCL, etc.

v2: made sure to sync bo before export, improved VA buffer type check.
v3: tracked internal resources on acquire, disposed them on release.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Factor out va{Get,Put}Image() implementations.

Use VA internal objects wherever possible for internal functions,
thus leaving VA object ids to the base interface implementation.
Robustify params validation earlier in there too.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Report BUSY surface state accordingly.

Return VA_STATUS_ERROR_SURFACE_BUSY for key interfaces.

This covers for va{Get,Put}Image(), as originally mandated by the
VA-API specs; vaBeginPicture() as this is the entry-point to any
decode, encode or video processing operation; but also for plain
vaMapBuffer() operation.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
H264_Encoding: Fix the incorrect Qp setting under CBR when slice_header is passed

Fix the issue in
https://bugs.freedesktop.org/show_bug.cgi?id=83143

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Tested-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>