From e1755f0a1966e9512ee84657e21b8d74dd907fdf Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Mon, 3 Dec 2018 17:39:50 +0800 Subject: [PATCH] video: rockchip: vpu: Fix address translate error Some hardware need to translate scaling list table address to u32 address in register. The dma_addr_t on 64bit kernel will cause overwriting to later register file. Change-Id: Ib01d8e260b3e83dabafc13b3bfac02595faa6d63 Signed-off-by: Herman Chen --- drivers/video/rockchip/vcodec/vcodec_service.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/rockchip/vcodec/vcodec_service.c b/drivers/video/rockchip/vcodec/vcodec_service.c index d7ff1572cb7b..ba4382f443a8 100644 --- a/drivers/video/rockchip/vcodec/vcodec_service.c +++ b/drivers/video/rockchip/vcodec/vcodec_service.c @@ -1016,17 +1016,18 @@ static int fill_scaling_list_pps(struct vpu_subdev_data *data, if (scaling_fd > 0) { int i = 0; + u32 val; dma_addr_t tmp = vcodec_fd_to_iova(data, reg->session, reg, scaling_fd, -1); if (IS_ERR_VALUE(tmp)) return tmp; tmp += scaling_offset; - tmp = cpu_to_le32(tmp); + val = cpu_to_le32(tmp); /* Fill the scaling list address in each pps entries */ for (i = 0; i < count; i++, base += pps_info_size) - memcpy(pps + base, &tmp, sizeof(tmp)); + memcpy(pps + base, &val, sizeof(val)); } dma_buf_vunmap(dmabuf, vaddr);