summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2010-11-16 10:15:56 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2010-12-06 12:50:05 +0800
commit39213b368e518f93477972155f00823edcd937f5 (patch)
treead82703379f0e80506a812b8f82540914a45448f
parentefe2cdd4b4c005b70b0e14baee32be59e8fad6a6 (diff)
i965_drv_video: fix mpeg2 decoding on Sandybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r--i965_drv_video/gen6_mfd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/i965_drv_video/gen6_mfd.c b/i965_drv_video/gen6_mfd.c
index c6fab96..71d9944 100644
--- a/i965_drv_video/gen6_mfd.c
+++ b/i965_drv_video/gen6_mfd.c
@@ -1181,12 +1181,19 @@ gen6_mfd_mpeg2_decode_init(VADriverContextP ctx, struct decode_state *decode_sta
}
/* 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)
- gen6_mfd_context->reference_surface[1].surface_id = pic_param->forward_reference_picture;
+ if (obj_surface && obj_surface->bo)
+ gen6_mfd_context->reference_surface[0].surface_id = pic_param->forward_reference_picture;
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;
+ else
+ gen6_mfd_context->reference_surface[1].surface_id = pic_param->forward_reference_picture;
/* must do so !!! */
for (i = 2; i < ARRAY_ELEMS(gen6_mfd_context->reference_surface); i++)