From 9a0431b2ca77ea2ac23989f7b34f234395b73938 Mon Sep 17 00:00:00 2001 From: ZhiChao Yu Date: Fri, 23 Jan 2015 10:25:20 +0800 Subject: [PATCH] CHROMIUM: [media] rk3288-vpu: Fix hangout corruption If segmentation_enable flag is zero, no matter what segmentation_update_flag is, we cannot set it to HW. Before this patch, incorrect segmentation_update_flag might be set to HW which caused hangout corruption. BUG=chrome-os-partner:35531 TEST=make a video chat by hangout with other device. Signed-off-by: ZhiChao Yu Reviewed-on: https://chromium-review.googlesource.com/242732 Reviewed-by: Tomasz Figa Tested-by: Tomasz Figa Commit-Queue: Tomasz Figa Change-Id: I86c00c27d3c97854db8c4164289fa434b29819ff Signed-off-by: Jeffy Chen Signed-off-by: Yakir Yang --- drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c b/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c index 60cdc7e12a3e..6e03398d451d 100644 --- a/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c +++ b/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c @@ -629,10 +629,11 @@ static void rk3288_vp8d_cfg_buffers(struct rk3288_vpu_ctx *ctx) /* set segment map address */ reg = 0; reg = VDPU_REG_FWD_PIC1_SEGMENT_BASE(ctx->hw.vp8d.segment_map.dma); - if (hdr->sgmnt_hdr.flags & V4L2_VP8_SEGMNT_HDR_FLAG_ENABLED) + if (hdr->sgmnt_hdr.flags & V4L2_VP8_SEGMNT_HDR_FLAG_ENABLED) { reg |= VDPU_REG_FWD_PIC1_SEGMENT_E; - if (hdr->sgmnt_hdr.flags & V4L2_VP8_SEGMNT_HDR_FLAG_UPDATE_MAP) - reg |= VDPU_REG_FWD_PIC1_SEGMENT_UPD_E; + if (hdr->sgmnt_hdr.flags & V4L2_VP8_SEGMNT_HDR_FLAG_UPDATE_MAP) + reg |= VDPU_REG_FWD_PIC1_SEGMENT_UPD_E; + } vdpu_write_relaxed(vpu, reg, VDPU_REG_FWD_PIC(0)); /* set output frame buffer address */ -- 2.34.1