Go to the documentation of this file.
16 #ifndef S5P_MFC_COMMON_H_
17 #define S5P_MFC_COMMON_H_
20 #include <linux/videodev2.h>
32 #define DST_QUEUE_OFF_BASE (TASK_SIZE / 2)
34 #define MFC_BANK1_ALLOC_CTX 0
35 #define MFC_BANK2_ALLOC_CTX 1
37 #define MFC_BANK1_ALIGN_ORDER 13
38 #define MFC_BANK2_ALIGN_ORDER 13
39 #define MFC_BASE_ALIGN_ORDER 17
43 static inline dma_addr_t s5p_mfc_mem_cookie(
void *
a,
void *
b)
52 #define MFC_MAX_EXTRA_DPB 5
53 #define MFC_MAX_BUFFERS 32
54 #define MFC_NUM_CONTEXTS 4
56 #define MFC_INT_TIMEOUT 2000
58 #define MFC_BW_TIMEOUT 500
60 #define MFC_WATCHDOG_INTERVAL 1000
62 #define MFC_WATCHDOG_CNT 10
63 #define MFC_NO_INSTANCE_SET -1
64 #define MFC_ENC_CAP_PLANE_COUNT 1
65 #define MFC_ENC_OUT_PLANE_COUNT 2
67 #define MFC_MAX_CTRLS 70
69 #define S5P_MFC_CODEC_NONE -1
70 #define S5P_MFC_CODEC_H264_DEC 0
71 #define S5P_MFC_CODEC_H264_MVC_DEC 1
72 #define S5P_MFC_CODEC_VC1_DEC 2
73 #define S5P_MFC_CODEC_MPEG4_DEC 3
74 #define S5P_MFC_CODEC_MPEG2_DEC 4
75 #define S5P_MFC_CODEC_H263_DEC 5
76 #define S5P_MFC_CODEC_VC1RCV_DEC 6
77 #define S5P_MFC_CODEC_VP8_DEC 7
79 #define S5P_MFC_CODEC_H264_ENC 20
80 #define S5P_MFC_CODEC_H264_MVC_ENC 21
81 #define S5P_MFC_CODEC_MPEG4_ENC 22
82 #define S5P_MFC_CODEC_H263_ENC 23
84 #define S5P_MFC_R2H_CMD_EMPTY 0
85 #define S5P_MFC_R2H_CMD_SYS_INIT_RET 1
86 #define S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET 2
87 #define S5P_MFC_R2H_CMD_SEQ_DONE_RET 3
88 #define S5P_MFC_R2H_CMD_INIT_BUFFERS_RET 4
89 #define S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET 6
90 #define S5P_MFC_R2H_CMD_SLEEP_RET 7
91 #define S5P_MFC_R2H_CMD_WAKEUP_RET 8
92 #define S5P_MFC_R2H_CMD_COMPLETE_SEQ_RET 9
93 #define S5P_MFC_R2H_CMD_DPB_FLUSH_RET 10
94 #define S5P_MFC_R2H_CMD_NAL_ABORT_RET 11
95 #define S5P_MFC_R2H_CMD_FW_STATUS_RET 12
96 #define S5P_MFC_R2H_CMD_FRAME_DONE_RET 13
97 #define S5P_MFC_R2H_CMD_FIELD_DONE_RET 14
98 #define S5P_MFC_R2H_CMD_SLICE_DONE_RET 15
99 #define S5P_MFC_R2H_CMD_ENC_BUFFER_FUL_RET 16
100 #define S5P_MFC_R2H_CMD_ERR_RET 32
102 #define mfc_read(dev, offset) readl(dev->regs_base + (offset))
103 #define mfc_write(dev, data, offset) writel((data), dev->regs_base + \
172 #define MFC_BUF_FLAG_USED (1 << 0)
173 #define MFC_BUF_FLAG_EOS (1 << 1)
457 #define call_cop(c, op, args...) \
458 (((c)->c_ops->op) ? \
459 ((c)->c_ops->op(args)) : 0)
680 #define s5p_mfc_hw_call(f, op, args...) \
681 ((f && f->op) ? f->op(args) : -ENODEV)
683 #define fh_to_ctx(__fh) container_of(__fh, struct s5p_mfc_ctx, fh)
684 #define ctrl_to_ctx(__ctrl) \
685 container_of((__ctrl)->handler, struct s5p_mfc_ctx, ctrl_handler)
692 #define HAS_PORTNUM(dev) (dev ? (dev->variant ? \
693 (dev->variant->port_num ? 1 : 0) : 0) : 0)
694 #define IS_TWOPORT(dev) (dev->variant->port_num == 2 ? 1 : 0)
695 #define IS_MFCV6(dev) (dev->variant->version >= 0x60 ? 1 : 0)