Commit 39213b36 authored by Xiang, Haihao's avatar Xiang, Haihao

i965_drv_video: fix mpeg2 decoding on Sandybridge

Signed-off-by: default avatarXiang, Haihao <haihao.xiang@intel.com>
parent efe2cdd4
...@@ -1181,12 +1181,19 @@ gen6_mfd_mpeg2_decode_init(VADriverContextP ctx, struct decode_state *decode_sta ...@@ -1181,12 +1181,19 @@ gen6_mfd_mpeg2_decode_init(VADriverContextP ctx, struct decode_state *decode_sta
} }
/* reference picture */ /* reference picture */
gen6_mfd_context->reference_surface[0].surface_id = pic_param->forward_reference_picture; obj_surface = SURFACE(pic_param->forward_reference_picture);
if (pic_param->backward_reference_picture == VA_INVALID_ID) if (obj_surface && obj_surface->bo)
gen6_mfd_context->reference_surface[1].surface_id = pic_param->forward_reference_picture; gen6_mfd_context->reference_surface[0].surface_id = pic_param->forward_reference_picture;
else else
gen6_mfd_context->reference_surface[0].surface_id = VA_INVALID_ID;
obj_surface = SURFACE(pic_param->backward_reference_picture);
if (obj_surface && obj_surface->bo)
gen6_mfd_context->reference_surface[1].surface_id = pic_param->backward_reference_picture; gen6_mfd_context->reference_surface[1].surface_id = pic_param->backward_reference_picture;
else
gen6_mfd_context->reference_surface[1].surface_id = pic_param->forward_reference_picture;
/* must do so !!! */ /* must do so !!! */
for (i = 2; i < ARRAY_ELEMS(gen6_mfd_context->reference_surface); i++) for (i = 2; i < ARRAY_ELEMS(gen6_mfd_context->reference_surface); i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment