summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Xiaowei <xiaowei.a.li@intel.com>2013-03-12 13:25:39 +0800
committerLi Xiaowei <xiaowei.a.li@intel.com>2013-03-12 13:56:10 +0800
commite4f243b6ed58d832f1ca6ecf1ec15f72dd3e6ef6 (patch)
treeb0bca48f831b3dfaf66f4954cba2c9aeca484c71 /src
parent7d34921055b21f195cea5346210f86f8292db282 (diff)
downloadvaapi-intel-driver-e4f243b6ed58d832f1ca6ecf1ec15f72dd3e6ef6.tar.gz
vaapi-intel-driver-e4f243b6ed58d832f1ca6ecf1ec15f72dd3e6ef6.tar.bz2
vaapi-intel-driver-e4f243b6ed58d832f1ca6ecf1ec15f72dd3e6ef6.zip
Fix H264 YUV400 surface render issue on IVB
All decoded frame are considered as NV12 format in driver, for YUV400 stream format decoding senerios, we need set the chroma component of NV12 to a constant value(0x80), otherwise the converted ARGB from NV12 format is not correct and cause blue screen when rending. Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gen7_mfd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index ae36fce..0d583b5 100755
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -911,6 +911,17 @@ gen7_mfd_avc_decode_init(VADriverContextP ctx,
obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
obj_surface->flags |= (pic_param->pic_fields.bits.reference_pic_flag ? SURFACE_REFERENCED : 0);
i965_check_alloc_surface_bo(ctx, obj_surface, 1, VA_FOURCC('N','V','1','2'), SUBSAMPLE_YUV420);
+
+ /* initial uv component for YUV400 case */
+ if (pic_param->seq_fields.bits.chroma_format_idc == 0) {
+ unsigned int uv_offset = obj_surface->width * obj_surface->height;
+ unsigned int uv_size = obj_surface->width * obj_surface->height / 2;
+
+ drm_intel_gem_bo_map_gtt(obj_surface->bo);
+ memset(obj_surface->bo->virtual + uv_offset, 0x80, uv_size);
+ drm_intel_gem_bo_unmap_gtt(obj_surface->bo);
+ }
+
gen7_mfd_init_avc_surface(ctx, pic_param, obj_surface);
dri_bo_unreference(gen7_mfd_context->post_deblocking_output.bo);