CHROMIUM: [media] rk3288-vpu: Fix hangout corruption
authorZhiChao Yu <zhichao.yu@rock-chips.com>
Fri, 23 Jan 2015 02:25:20 +0000 (10:25 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 30 Jun 2016 11:53:57 +0000 (19:53 +0800)
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 <zhichao.yu@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/242732
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Commit-Queue: Tomasz Figa <tfiga@chromium.org>

Change-Id: I86c00c27d3c97854db8c4164289fa434b29819ff
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
drivers/media/platform/rk3288-vpu/rk3288_vpu_hw_vp8d.c

index 60cdc7e12a3e58f1ba73574d0d873220c7db8d42..6e03398d451dfd4dd50703309ef75f80349d1ad2 100644 (file)
@@ -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 */