diff options
author | Tiffany Lin <tiffany.lin@mediatek.com> | 2016-08-14 23:33:32 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-24 10:28:11 -0400 |
commit | 2d683b6dad73b5636297ac4978f73f2c638a0b19 (patch) | |
tree | 9b821c88265f833d4e1a20d2db640f92384ddec1 | |
parent | 158d6071bc0aad6663109d2fe9249c3cf570d423 (diff) |
[media] vcodec:mediatek: Refine H264 encoder driver
This patch :
1. remove field and function that unused anymore
2. add support V4L2_MPEG_VIDEO_H264_LEVEL_4_2
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index 9a600525b3c1..63d4be4ff327 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c | |||
@@ -61,6 +61,8 @@ enum venc_h264_bs_mode { | |||
61 | 61 | ||
62 | /* | 62 | /* |
63 | * struct venc_h264_vpu_config - Structure for h264 encoder configuration | 63 | * struct venc_h264_vpu_config - Structure for h264 encoder configuration |
64 | * AP-W/R : AP is writer/reader on this item | ||
65 | * VPU-W/R: VPU is write/reader on this item | ||
64 | * @input_fourcc: input fourcc | 66 | * @input_fourcc: input fourcc |
65 | * @bitrate: target bitrate (in bps) | 67 | * @bitrate: target bitrate (in bps) |
66 | * @pic_w: picture width. Picture size is visible stream resolution, in pixels, | 68 | * @pic_w: picture width. Picture size is visible stream resolution, in pixels, |
@@ -94,13 +96,13 @@ struct venc_h264_vpu_config { | |||
94 | 96 | ||
95 | /* | 97 | /* |
96 | * struct venc_h264_vpu_buf - Structure for buffer information | 98 | * struct venc_h264_vpu_buf - Structure for buffer information |
97 | * @align: buffer alignment (in bytes) | 99 | * AP-W/R : AP is writer/reader on this item |
100 | * VPU-W/R: VPU is write/reader on this item | ||
98 | * @iova: IO virtual address | 101 | * @iova: IO virtual address |
99 | * @vpua: VPU side memory addr which is used by RC_CODE | 102 | * @vpua: VPU side memory addr which is used by RC_CODE |
100 | * @size: buffer size (in bytes) | 103 | * @size: buffer size (in bytes) |
101 | */ | 104 | */ |
102 | struct venc_h264_vpu_buf { | 105 | struct venc_h264_vpu_buf { |
103 | u32 align; | ||
104 | u32 iova; | 106 | u32 iova; |
105 | u32 vpua; | 107 | u32 vpua; |
106 | u32 size; | 108 | u32 size; |
@@ -108,6 +110,8 @@ struct venc_h264_vpu_buf { | |||
108 | 110 | ||
109 | /* | 111 | /* |
110 | * struct venc_h264_vsi - Structure for VPU driver control and info share | 112 | * struct venc_h264_vsi - Structure for VPU driver control and info share |
113 | * AP-W/R : AP is writer/reader on this item | ||
114 | * VPU-W/R: VPU is write/reader on this item | ||
111 | * This structure is allocated in VPU side and shared to AP side. | 115 | * This structure is allocated in VPU side and shared to AP side. |
112 | * @config: h264 encoder configuration | 116 | * @config: h264 encoder configuration |
113 | * @work_bufs: working buffer information in VPU side | 117 | * @work_bufs: working buffer information in VPU side |
@@ -150,12 +154,6 @@ struct venc_h264_inst { | |||
150 | struct mtk_vcodec_ctx *ctx; | 154 | struct mtk_vcodec_ctx *ctx; |
151 | }; | 155 | }; |
152 | 156 | ||
153 | static inline void h264_write_reg(struct venc_h264_inst *inst, u32 addr, | ||
154 | u32 val) | ||
155 | { | ||
156 | writel(val, inst->hw_base + addr); | ||
157 | } | ||
158 | |||
159 | static inline u32 h264_read_reg(struct venc_h264_inst *inst, u32 addr) | 157 | static inline u32 h264_read_reg(struct venc_h264_inst *inst, u32 addr) |
160 | { | 158 | { |
161 | return readl(inst->hw_base + addr); | 159 | return readl(inst->hw_base + addr); |
@@ -214,6 +212,8 @@ static unsigned int h264_get_level(struct venc_h264_inst *inst, | |||
214 | return 40; | 212 | return 40; |
215 | case V4L2_MPEG_VIDEO_H264_LEVEL_4_1: | 213 | case V4L2_MPEG_VIDEO_H264_LEVEL_4_1: |
216 | return 41; | 214 | return 41; |
215 | case V4L2_MPEG_VIDEO_H264_LEVEL_4_2: | ||
216 | return 42; | ||
217 | default: | 217 | default: |
218 | mtk_vcodec_debug(inst, "unsupported level %d", level); | 218 | mtk_vcodec_debug(inst, "unsupported level %d", level); |
219 | return 31; | 219 | return 31; |