Move gen6 phantom slice function as common

Following haihao's suggestion, make gen6 phantom slice funcion can be
re-used by SNB+.

v1->v2: Remove an unnessary comment.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Reviewed-by: Xiang Haihao <haihao.xiang@intel.com>
             Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Add phantom slice support on IVB+

HW requires driver to add a phantom slice when FirstMbX and FirstMbY are
not 0, in order to avc decoding error concealment. Otherwise, GPU may hang.
This patch is a workround for bug: https://bugs.freedesktop.org/show_bug.cgi?id=81447

v1->v2: Follow haihao's suggestion to use common funcion of gen6 phantom slice.
v2->v3: Remove an extraneous newline.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Reviewed-by: Xiang Haihao <haihao.xiang@intel.com>
             Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Revert "Add old version vme shaders"

This reverts commit 3f33fa214f559f12c1b9e170815da22a02733122.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Use the same shader to configure quality level

Using the same shader to configure gen7 avc quality level,
it is benefit to make code clear and reduce profile limitation.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Revert gen6_mfc.c after using same shader

Signed-off-by: Zhong Li <zhong.li@intel.com>
Gen7 avc encoding: remove profile limitation

Signed-off-by: Zhong Li <zhong.li@intel.com>
Enabling SNB avc encoding configuration

Signed-off-by: Zhong Li <zhong.li@intel.com>
Enabling HSW avc encoding configuration

Signed-off-by: Zhong Li <zhong.li@intel.com>
Enabling BDW avc encoding configuration

Signed-off-by: Zhong Li <zhong.li@intel.com>
Remove gen7 only limitation for encoding configuration

Since all generations from gen6 can support avc encoding configuration,
remove gen7 only limitation.
MVC also can be support with little change, but it is low priority,
it will be support when necessary and this function is stable.

Signed-off-by: Zhong Li <zhong.li@intel.com>
initial export_refcount for obj_buffer
vpp: expose BGRA surface formats on Ivybridge and Haswell.

Allow for vaQuerySurfaceAttributes() to return BGRA and BGRX formats
for VPP on Ivybridge and Haswell. This is supported as both source
and target surface formats.

This fixes VA/EGL interop on Gen7 processors when a BGR[AX] surface
is exported into an EGLImage.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
fix the broken package generated by make dist

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 01b39f7ef75c028a99a02e98af6ec9ca2a9c6773)
build: fix make dist for packaging.

If the intel-gen4asm tool is not available, ship with the pre-built
EU kernels instead of trying to regenerate them. In particular, just
don't expose the build rules if intel-gen4asm is not installed.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit 238d8077705711036d62a6d536311def3ef35035)
i965_drv_video: factor out and robustify vendor string.

Move out generation of the vendor string to its specific helper function,
while also making it more robust and aware of possible overflows.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit d12dcedd6d3de29b9c7764d8b112d351c2830025)
i965_drv_video: add git commit id to VA driver version string.

v2: renamed i965_drv_version.h to intel_version.h, changed macro
  definition to INTEL_DRIVER_GIT_VERSION, and displayed the git
  version string only in "pre" version modes.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit cf00f065fd5bb3dfc06e98ceacc2e218bd8f4e92)
vebox: silence compilation warning.

Silence the following compilation warning:
  CC     i965_drv_video_la-gen75_vpp_vebox.lo
gen75_vpp_vebox.c: In function 'bdw_veb_dndi_iecp_command':
gen75_vpp_vebox.c:1537:5: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]

Also simplify the calculation of the VEB_DI_IECP::endingX variable
with existing helper macros.

v2: renamed endingX to width64, which represents the width aligned
  on to 64 columns, dropped obsolete startingX [Yakui]

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
vebox: drop magic numbers in filters mask.

Use the existing VPP_{DNDI,IECP}_xxx flags instead of magic numbers.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
vebox: fix indication of field ordering in sequence.

VEBOX_DNDI_STATE::dndi_top_first indicates whether the top field is
first in sequence (TFF), or if the bottom field comes first. This is
an indication of the temporal sequence for input frames, available
in the "history" buffer. As such, the correct flag to check against,
from a VA-API perspective, is VA_DEINTERLACING_BOTTOM_FIELD_FIRST.

https://bugs.freedesktop.org/show_bug.cgi?id=72518
https://bugs.freedesktop.org/show_bug.cgi?id=72522

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
vebox: fix order of submitted commands.

For each frame, the Intel HD Graphics hardware specification mandates
that the following commands should be submitted, in-order: VEBOX_STATE,
VEBOX_SURFACE_STATE(input), VEBOX_SURFACE_STATE(output), VEB_DI_IECP.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>