summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2011-07-08 10:54:31 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2011-07-08 10:56:22 +0800
commitf152e21293e6fbc3a55dedb1f969137195ee56d5 (patch)
treea7dae7c8cc2b0e7a7b9ee4503feed7019ef84b51
parent8a77e4b53681ea147717a2c784ea725f365e1323 (diff)
i965_drv_video: fixes assertion failure
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r--i965_drv_video/gen6_mfd.c32
-rw-r--r--i965_drv_video/gen7_mfd.c31
-rw-r--r--i965_drv_video/i965_avc_bsd.c2
3 files changed, 39 insertions, 26 deletions
diff --git a/i965_drv_video/gen6_mfd.c b/i965_drv_video/gen6_mfd.c
index df2c5ab..19368f1 100644
--- a/i965_drv_video/gen6_mfd.c
+++ b/i965_drv_video/gen6_mfd.c
@@ -1012,7 +1012,6 @@ gen6_mfd_avc_decode_init(VADriverContextP ctx,
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
- assert(decode_state->slice_params[j]->num_elements == 1);
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) ||
@@ -1100,7 +1099,7 @@ gen6_mfd_avc_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen6_mfd_context->base.batch;
VAPictureParameterBufferH264 *pic_param;
- VASliceParameterBufferH264 *slice_param, *next_slice_param;
+ VASliceParameterBufferH264 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1121,14 +1120,12 @@ gen6_mfd_avc_decode_picture(VADriverContextP ctx,
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
slice_data_bo = decode_state->slice_datas[j]->bo;
+ gen6_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_AVC, gen6_mfd_context);
if (j == decode_state->num_slice_params - 1)
- next_slice_param = NULL;
+ next_slice_group_param = NULL;
else
- next_slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
-
- gen6_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_AVC, gen6_mfd_context);
- assert(decode_state->slice_params[j]->num_elements == 1);
+ next_slice_group_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
@@ -1140,6 +1137,8 @@ gen6_mfd_avc_decode_picture(VADriverContextP ctx,
if (i < decode_state->slice_params[j]->num_elements - 1)
next_slice_param = slice_param + 1;
+ else
+ next_slice_param = next_slice_group_param;
gen6_mfd_avc_directmode_state(ctx, pic_param, slice_param, gen6_mfd_context);
gen6_mfd_avc_slice_state(ctx, pic_param, slice_param, next_slice_param, gen6_mfd_context);
@@ -1347,7 +1346,7 @@ gen6_mfd_mpeg2_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen6_mfd_context->base.batch;
VAPictureParameterBufferMPEG2 *pic_param;
- VASliceParameterBufferMPEG2 *slice_param, *next_slice_param;
+ VASliceParameterBufferMPEG2 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1370,13 +1369,18 @@ gen6_mfd_mpeg2_decode_picture(VADriverContextP ctx,
slice_data_bo = decode_state->slice_datas[j]->bo;
gen6_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_MPEG2, gen6_mfd_context);
+ if (j == decode_state->num_slice_params - 1)
+ next_slice_group_param = NULL;
+ else
+ next_slice_group_param = (VASliceParameterBufferMPEG2 *)decode_state->slice_params[j + 1]->buffer;
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
if (i < decode_state->slice_params[j]->num_elements - 1)
next_slice_param = slice_param + 1;
else
- next_slice_param = NULL;
+ next_slice_param = next_slice_group_param;
gen6_mfd_mpeg2_bsd_object(ctx, pic_param, slice_param, next_slice_param, gen6_mfd_context);
slice_param++;
@@ -1979,7 +1983,7 @@ gen6_mfd_vc1_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen6_mfd_context->base.batch;
VAPictureParameterBufferVC1 *pic_param;
- VASliceParameterBufferVC1 *slice_param, *next_slice_param;
+ VASliceParameterBufferVC1 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1997,20 +2001,24 @@ gen6_mfd_vc1_decode_picture(VADriverContextP ctx,
gen6_mfd_vc1_pred_pipe_state(ctx, decode_state, gen6_mfd_context);
gen6_mfd_vc1_directmode_state(ctx, decode_state, gen6_mfd_context);
- assert(decode_state->num_slice_params == 1);
for (j = 0; j < decode_state->num_slice_params; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferVC1 *)decode_state->slice_params[j]->buffer;
slice_data_bo = decode_state->slice_datas[j]->bo;
gen6_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_VC1, gen6_mfd_context);
+ if (j == decode_state->num_slice_params - 1)
+ next_slice_group_param = NULL;
+ else
+ next_slice_group_param = (VASliceParameterBufferVC1 *)decode_state->slice_params[j + 1]->buffer;
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
if (i < decode_state->slice_params[j]->num_elements - 1)
next_slice_param = slice_param + 1;
else
- next_slice_param = NULL;
+ next_slice_param = next_slice_group_param;
gen6_mfd_vc1_bsd_object(ctx, pic_param, slice_param, next_slice_param, slice_data_bo, gen6_mfd_context);
slice_param++;
diff --git a/i965_drv_video/gen7_mfd.c b/i965_drv_video/gen7_mfd.c
index 00bdc0c..1188b84 100644
--- a/i965_drv_video/gen7_mfd.c
+++ b/i965_drv_video/gen7_mfd.c
@@ -959,7 +959,6 @@ gen7_mfd_avc_decode_init(VADriverContextP ctx,
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
- assert(decode_state->slice_params[j]->num_elements == 1);
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) ||
@@ -1047,7 +1046,7 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen7_mfd_context->base.batch;
VAPictureParameterBufferH264 *pic_param;
- VASliceParameterBufferH264 *slice_param, *next_slice_param;
+ VASliceParameterBufferH264 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1068,14 +1067,12 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx,
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
slice_data_bo = decode_state->slice_datas[j]->bo;
+ gen7_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_AVC, gen7_mfd_context);
if (j == decode_state->num_slice_params - 1)
- next_slice_param = NULL;
+ next_slice_group_param = NULL;
else
- next_slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
-
- gen7_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_AVC, gen7_mfd_context);
- assert(decode_state->slice_params[j]->num_elements == 1);
+ next_slice_group_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j + 1]->buffer;
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
@@ -1087,6 +1084,8 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx,
if (i < decode_state->slice_params[j]->num_elements - 1)
next_slice_param = slice_param + 1;
+ else
+ next_slice_param = next_slice_group_param;
gen7_mfd_avc_directmode_state(ctx, pic_param, slice_param, gen7_mfd_context);
gen7_mfd_avc_ref_idx_state(ctx, pic_param, slice_param, gen7_mfd_context);
@@ -1302,7 +1301,7 @@ gen7_mfd_mpeg2_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen7_mfd_context->base.batch;
VAPictureParameterBufferMPEG2 *pic_param;
- VASliceParameterBufferMPEG2 *slice_param, *next_slice_param;
+ VASliceParameterBufferMPEG2 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1319,13 +1318,17 @@ gen7_mfd_mpeg2_decode_picture(VADriverContextP ctx,
gen7_mfd_mpeg2_pic_state(ctx, decode_state, gen7_mfd_context);
gen7_mfd_mpeg2_qm_state(ctx, decode_state, gen7_mfd_context);
- assert(decode_state->num_slice_params == 1);
for (j = 0; j < decode_state->num_slice_params; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferMPEG2 *)decode_state->slice_params[j]->buffer;
slice_data_bo = decode_state->slice_datas[j]->bo;
gen7_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_MPEG2, gen7_mfd_context);
+ if (j == decode_state->num_slice_params - 1)
+ next_slice_group_param = NULL;
+ else
+ next_slice_group_param = (VASliceParameterBufferMPEG2 *)decode_state->slice_params[j + 1]->buffer;
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
@@ -1934,7 +1937,7 @@ gen7_mfd_vc1_decode_picture(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen7_mfd_context->base.batch;
VAPictureParameterBufferVC1 *pic_param;
- VASliceParameterBufferVC1 *slice_param, *next_slice_param;
+ VASliceParameterBufferVC1 *slice_param, *next_slice_param, *next_slice_group_param;
dri_bo *slice_data_bo;
int i, j;
@@ -1952,20 +1955,24 @@ gen7_mfd_vc1_decode_picture(VADriverContextP ctx,
gen7_mfd_vc1_pred_pipe_state(ctx, decode_state, gen7_mfd_context);
gen7_mfd_vc1_directmode_state(ctx, decode_state, gen7_mfd_context);
- assert(decode_state->num_slice_params == 1);
for (j = 0; j < decode_state->num_slice_params; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferVC1 *)decode_state->slice_params[j]->buffer;
slice_data_bo = decode_state->slice_datas[j]->bo;
gen7_mfd_ind_obj_base_addr_state(ctx, slice_data_bo, MFX_FORMAT_VC1, gen7_mfd_context);
+ if (j == decode_state->num_slice_params - 1)
+ next_slice_group_param = NULL;
+ else
+ next_slice_group_param = (VASliceParameterBufferVC1 *)decode_state->slice_params[j + 1]->buffer;
+
for (i = 0; i < decode_state->slice_params[j]->num_elements; i++) {
assert(slice_param->slice_data_flag == VA_SLICE_DATA_FLAG_ALL);
if (i < decode_state->slice_params[j]->num_elements - 1)
next_slice_param = slice_param + 1;
else
- next_slice_param = NULL;
+ next_slice_param = next_slice_group_param;
gen7_mfd_vc1_bsd_object(ctx, pic_param, slice_param, next_slice_param, slice_data_bo, gen7_mfd_context);
slice_param++;
diff --git a/i965_drv_video/i965_avc_bsd.c b/i965_drv_video/i965_avc_bsd.c
index 6dfd6be..2fa53fc 100644
--- a/i965_drv_video/i965_avc_bsd.c
+++ b/i965_drv_video/i965_avc_bsd.c
@@ -1027,7 +1027,6 @@ i965_avc_bsd_pipeline(VADriverContextP ctx, struct decode_state *decode_state, v
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
- assert(decode_state->slice_params[j]->num_elements == 1); /* FIXME */
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) ||
@@ -1056,7 +1055,6 @@ i965_avc_bsd_pipeline(VADriverContextP ctx, struct decode_state *decode_state, v
i965_bsd_ind_obj_base_address(ctx, decode_state, j, i965_h264_context);
- assert(decode_state->slice_params[j]->num_elements == 1); /* FIXME */
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) ||