From 5930efdc035e07e19cf4e641a4eabcbacfbec942 Mon Sep 17 00:00:00 2001 From: Randy Li Date: Thu, 21 Sep 2017 18:06:28 +0800 Subject: [PATCH] video: rockchip: vpu: adjust the register buffer table make me more easily to check the mapping. Also fix some compiler warnings. Change-Id: Ic28f6ce54b4dcd0c4a9d9543939c5f5e013136fc Signed-off-by: Randy Li --- drivers/video/rockchip/vcodec/vcodec_hw_info.h | 2 +- drivers/video/rockchip/vcodec/vcodec_hw_vpu2.h | 6 +++--- drivers/video/rockchip/vcodec/vcodec_service.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/video/rockchip/vcodec/vcodec_hw_info.h b/drivers/video/rockchip/vcodec/vcodec_hw_info.h index 3904f718cf75..cc7d9dbfe434 100644 --- a/drivers/video/rockchip/vcodec/vcodec_hw_info.h +++ b/drivers/video/rockchip/vcodec/vcodec_hw_info.h @@ -204,7 +204,7 @@ struct vpu_task_info { }; struct vpu_trans_info { - const int count; + const size_t count; const char * const table; }; diff --git a/drivers/video/rockchip/vcodec/vcodec_hw_vpu2.h b/drivers/video/rockchip/vcodec/vcodec_hw_vpu2.h index 96e2d4990993..a37cbc481704 100644 --- a/drivers/video/rockchip/vcodec/vcodec_hw_vpu2.h +++ b/drivers/video/rockchip/vcodec/vcodec_hw_vpu2.h @@ -219,9 +219,9 @@ DEF_FMT_TRANS_TBL(vpu2_jpegd, ); DEF_FMT_TRANS_TBL(vpu2_h264d, - 64, 63, 84, 85, 86, 87, 88, 89, + 61, 62, 63, 64, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 61, 62 + 98, 99, ); DEF_FMT_TRANS_TBL(vpu2_vp6d, @@ -238,7 +238,7 @@ DEF_FMT_TRANS_TBL(vpu2_vc1d, ); DEF_FMT_TRANS_TBL(vpu2_default_dec, - 64, 63, 131, 148, 134, 135, 61, 62 + 61, 62, 64, 63, 131, 148, 134, 135, ); DEF_FMT_TRANS_TBL(vpu2_default_pp, diff --git a/drivers/video/rockchip/vcodec/vcodec_service.c b/drivers/video/rockchip/vcodec/vcodec_service.c index 9c5fac22011e..f14b353285b7 100644 --- a/drivers/video/rockchip/vcodec/vcodec_service.c +++ b/drivers/video/rockchip/vcodec/vcodec_service.c @@ -1010,7 +1010,7 @@ static int fill_scaling_list_pps(struct vpu_subdev_data *data, static int vcodec_bufid_to_iova(struct vpu_subdev_data *data, struct vpu_session *session, const u8 *tbl, - int size, struct vpu_reg *reg, + size_t size, struct vpu_reg *reg, struct extra_info_for_iommu *ext_inf) { struct vpu_service_info *pservice = data->pservice; @@ -1018,7 +1018,7 @@ static int vcodec_bufid_to_iova(struct vpu_subdev_data *data, enum FORMAT_TYPE type; int offset = 0; int ret = 0; - int i; + u32 i; if (!tbl || size <= 0) { dev_err(pservice->dev, "input arguments invalidate\n"); @@ -1156,7 +1156,7 @@ static int vcodec_reg_address_translate(struct vpu_subdev_data *data, if (type < FMT_TYPE_BUTT) { const struct vpu_trans_info *info = ®->trans[type]; const u8 *tbl = info->table; - int size = info->count; + size_t size = info->count; return vcodec_bufid_to_iova(data, session, tbl, size, reg, ext_inf); @@ -1944,9 +1944,9 @@ static long compat_vpu_service_ioctl(struct file *file, unsigned int cmd, static int vpu_service_check_hw(struct vpu_subdev_data *data) { - int ret = -EINVAL; - u32 i = 0; u32 hw_id = readl_relaxed(data->regs); + u32 i = 0; + int ret = -EINVAL; hw_id = (hw_id >> 16) & 0xFFFF; dev_dbg(data->dev, "checking hw id %x\n", hw_id);