aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
diff options
context:
space:
mode:
authorKamil Debski <k.debski@samsung.com>2011-06-21 09:51:26 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:00 -0400
commitaf935746781088f28904601469671d244d2f653b (patch)
tree0961dd7f98843d250abc5ff7ef3c4d37962b661f /drivers/media/video/s5p-mfc/s5p_mfc_opr.h
parentc53f9f00e5ddf72046698d6a378384e29fc9795f (diff)
[media] MFC: Add MFC 5.1 V4L2 driver
Multi Format Codec 5.1 is a hardware video coding acceleration module found in the S5PV210 and Exynos4 Samsung SoCs. It is capable of handling a range of video codecs and this driver provides a V4L2 interface for video decoding and encoding. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Jeongtae Park <jtp.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-mfc/s5p_mfc_opr.h')
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_opr.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_opr.h b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
new file mode 100644
index 000000000000..db83836e6a9f
--- /dev/null
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
@@ -0,0 +1,91 @@
1/*
2 * drivers/media/video/samsung/mfc5/s5p_mfc_opr.h
3 *
4 * Header file for Samsung MFC (Multi Function Codec - FIMV) driver
5 * Contains declarations of hw related functions.
6 *
7 * Kamil Debski, Copyright (C) 2011 Samsung Electronics
8 * http://www.samsung.com/
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef S5P_MFC_OPR_H_
16#define S5P_MFC_OPR_H_
17
18#include "s5p_mfc_common.h"
19
20int s5p_mfc_init_decode(struct s5p_mfc_ctx *ctx);
21int s5p_mfc_init_encode(struct s5p_mfc_ctx *mfc_ctx);
22
23/* Decoding functions */
24int s5p_mfc_set_dec_frame_buffer(struct s5p_mfc_ctx *ctx);
25int s5p_mfc_set_dec_stream_buffer(struct s5p_mfc_ctx *ctx, int buf_addr,
26 unsigned int start_num_byte,
27 unsigned int buf_size);
28
29/* Encoding functions */
30void s5p_mfc_set_enc_frame_buffer(struct s5p_mfc_ctx *ctx,
31 unsigned long y_addr, unsigned long c_addr);
32int s5p_mfc_set_enc_stream_buffer(struct s5p_mfc_ctx *ctx,
33 unsigned long addr, unsigned int size);
34void s5p_mfc_get_enc_frame_buffer(struct s5p_mfc_ctx *ctx,
35 unsigned long *y_addr, unsigned long *c_addr);
36int s5p_mfc_set_enc_ref_buffer(struct s5p_mfc_ctx *mfc_ctx);
37
38int s5p_mfc_decode_one_frame(struct s5p_mfc_ctx *ctx,
39 enum s5p_mfc_decode_arg last_frame);
40int s5p_mfc_encode_one_frame(struct s5p_mfc_ctx *mfc_ctx);
41
42/* Memory allocation */
43int s5p_mfc_alloc_dec_temp_buffers(struct s5p_mfc_ctx *ctx);
44void s5p_mfc_set_dec_desc_buffer(struct s5p_mfc_ctx *ctx);
45void s5p_mfc_release_dec_desc_buffer(struct s5p_mfc_ctx *ctx);
46
47int s5p_mfc_alloc_codec_buffers(struct s5p_mfc_ctx *ctx);
48void s5p_mfc_release_codec_buffers(struct s5p_mfc_ctx *ctx);
49
50int s5p_mfc_alloc_instance_buffer(struct s5p_mfc_ctx *ctx);
51void s5p_mfc_release_instance_buffer(struct s5p_mfc_ctx *ctx);
52
53void s5p_mfc_try_run(struct s5p_mfc_dev *dev);
54void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
55
56#define s5p_mfc_get_dspl_y_adr() (readl(dev->regs_base + \
57 S5P_FIMV_SI_DISPLAY_Y_ADR) << \
58 MFC_OFFSET_SHIFT)
59#define s5p_mfc_get_dec_y_adr() (readl(dev->regs_base + \
60 S5P_FIMV_SI_DISPLAY_Y_ADR) << \
61 MFC_OFFSET_SHIFT)
62#define s5p_mfc_get_dspl_status() readl(dev->regs_base + \
63 S5P_FIMV_SI_DISPLAY_STATUS)
64#define s5p_mfc_get_frame_type() (readl(dev->regs_base + \
65 S5P_FIMV_DECODE_FRAME_TYPE) \
66 & S5P_FIMV_DECODE_FRAME_MASK)
67#define s5p_mfc_get_consumed_stream() readl(dev->regs_base + \
68 S5P_FIMV_SI_CONSUMED_BYTES)
69#define s5p_mfc_get_int_reason() (readl(dev->regs_base + \
70 S5P_FIMV_RISC2HOST_CMD) & \
71 S5P_FIMV_RISC2HOST_CMD_MASK)
72#define s5p_mfc_get_int_err() readl(dev->regs_base + \
73 S5P_FIMV_RISC2HOST_ARG2)
74#define s5p_mfc_err_dec(x) (((x) & S5P_FIMV_ERR_DEC_MASK) >> \
75 S5P_FIMV_ERR_DEC_SHIFT)
76#define s5p_mfc_err_dspl(x) (((x) & S5P_FIMV_ERR_DSPL_MASK) >> \
77 S5P_FIMV_ERR_DSPL_SHIFT)
78#define s5p_mfc_get_img_width() readl(dev->regs_base + \
79 S5P_FIMV_SI_HRESOL)
80#define s5p_mfc_get_img_height() readl(dev->regs_base + \
81 S5P_FIMV_SI_VRESOL)
82#define s5p_mfc_get_dpb_count() readl(dev->regs_base + \
83 S5P_FIMV_SI_BUF_NUMBER)
84#define s5p_mfc_get_inst_no() readl(dev->regs_base + \
85 S5P_FIMV_RISC2HOST_ARG1)
86#define s5p_mfc_get_enc_strm_size() readl(dev->regs_base + \
87 S5P_FIMV_ENC_SI_STRM_SIZE)
88#define s5p_mfc_get_enc_slice_type() readl(dev->regs_base + \
89 S5P_FIMV_ENC_SI_SLICE_TYPE)
90
91#endif /* S5P_MFC_OPR_H_ */