mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
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 <herman.chen@rock-chips.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user