summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2014-08-27 01:04:49 -0600
committerZhao, Yakui <yakui.zhao@intel.com>2014-09-05 10:43:57 +0800
commit812d8d039031bf20e66748a39edcdb8f9c798ec4 (patch)
tree7b09063b60129ce8569d87e9eb765320ace8f283
parent242fb4fcb8aa7300ee47400a6c2784610e5d4a6a (diff)
downloadlibva-intel-driver-812d8d039031bf20e66748a39edcdb8f9c798ec4.tar.gz
libva-intel-driver-812d8d039031bf20e66748a39edcdb8f9c798ec4.tar.bz2
libva-intel-driver-812d8d039031bf20e66748a39edcdb8f9c798ec4.zip
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> (cherry picked from commit 9672c5ab17c32f25ce1bbdb883abda689440b116)
-rw-r--r--src/gen75_mfd.c12
-rwxr-xr-xsrc/gen7_mfd.c12
-rw-r--r--src/gen8_mfd.c12
3 files changed, 36 insertions, 0 deletions
diff --git a/src/gen75_mfd.c b/src/gen75_mfd.c
index a89640d..299f2b5 100644
--- a/src/gen75_mfd.c
+++ b/src/gen75_mfd.c
@@ -812,6 +812,15 @@ gen75_mfd_avc_directmode_state(VADriverContextP ctx,
}
static void
+gen75_mfd_avc_phantom_slice_first(VADriverContextP ctx,
+ VAPictureParameterBufferH264 *pic_param,
+ VASliceParameterBufferH264 *next_slice_param,
+ struct gen7_mfd_context *gen7_mfd_context)
+{
+ gen6_mfd_avc_phantom_slice(ctx, pic_param, next_slice_param, gen7_mfd_context->base.batch);
+}
+
+static void
gen75_mfd_avc_slice_state(VADriverContextP ctx,
VAPictureParameterBufferH264 *pic_param,
VASliceParameterBufferH264 *slice_param,
@@ -1145,6 +1154,9 @@ gen75_mfd_avc_decode_picture(VADriverContextP ctx,
else
next_slice_group_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
+ if (j == 0 && slice_param->first_mb_in_slice)
+ gen75_mfd_avc_phantom_slice_first(ctx, pic_param, slice_param, gen7_mfd_context);
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
assert((slice_param->slice_type == SLICE_TYPE_I) ||
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index 7ab2955..bfb95bf 100755
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -506,6 +506,15 @@ gen7_mfd_avc_directmode_state(VADriverContextP ctx,
}
static void
+gen7_mfd_avc_phantom_slice_first(VADriverContextP ctx,
+ VAPictureParameterBufferH264 *pic_param,
+ VASliceParameterBufferH264 *next_slice_param,
+ struct gen7_mfd_context *gen7_mfd_context)
+{
+ gen6_mfd_avc_phantom_slice(ctx, pic_param, next_slice_param, gen7_mfd_context->base.batch);
+}
+
+static void
gen7_mfd_avc_slice_state(VADriverContextP ctx,
VAPictureParameterBufferH264 *pic_param,
VASliceParameterBufferH264 *slice_param,
@@ -842,6 +851,9 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx,
else
next_slice_group_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
+ if (j == 0 && slice_param->first_mb_in_slice)
+ gen7_mfd_avc_phantom_slice_first(ctx, pic_param, slice_param, gen7_mfd_context);
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
assert((slice_param->slice_type == SLICE_TYPE_I) ||
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index 5e1b70b..b482846 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -575,6 +575,15 @@ gen8_mfd_avc_directmode_state(VADriverContextP ctx,
}
static void
+gen8_mfd_avc_phantom_slice_first(VADriverContextP ctx,
+ VAPictureParameterBufferH264 *pic_param,
+ VASliceParameterBufferH264 *next_slice_param,
+ struct gen7_mfd_context *gen7_mfd_context)
+{
+ gen6_mfd_avc_phantom_slice(ctx, pic_param, next_slice_param, gen7_mfd_context->base.batch);
+}
+
+static void
gen8_mfd_avc_slice_state(VADriverContextP ctx,
VAPictureParameterBufferH264 *pic_param,
VASliceParameterBufferH264 *slice_param,
@@ -908,6 +917,9 @@ gen8_mfd_avc_decode_picture(VADriverContextP ctx,
else
next_slice_group_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
+ if (j == 0 && slice_param->first_mb_in_slice)
+ gen8_mfd_avc_phantom_slice_first(ctx, pic_param, slice_param, gen7_mfd_context);
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
assert((slice_param->slice_type == SLICE_TYPE_I) ||