Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
s5p_mfc_common.h File Reference
#include <linux/platform_device.h>
#include <linux/videodev2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-core.h>
#include "regs-mfc.h"
#include "regs-mfc-v6.h"
#include <media/videobuf2-dma-contig.h>

Go to the source code of this file.

Data Structures

struct  s5p_mfc_buf
 
struct  s5p_mfc_pm
 
struct  s5p_mfc_buf_size_v5
 
struct  s5p_mfc_buf_size_v6
 
struct  s5p_mfc_buf_size
 
struct  s5p_mfc_buf_align
 
struct  s5p_mfc_variant
 
struct  s5p_mfc_priv_buf
 
struct  s5p_mfc_dev
 
struct  s5p_mfc_h264_enc_params
 
struct  s5p_mfc_mpeg4_enc_params
 
struct  s5p_mfc_enc_params
 
struct  s5p_mfc_codec_ops
 
struct  s5p_mfc_ctx
 
struct  s5p_mfc_fmt
 
struct  mfc_control
 

Macros

#define DST_QUEUE_OFF_BASE   (TASK_SIZE / 2)
 
#define MFC_BANK1_ALLOC_CTX   0
 
#define MFC_BANK2_ALLOC_CTX   1
 
#define MFC_BANK1_ALIGN_ORDER   13
 
#define MFC_BANK2_ALIGN_ORDER   13
 
#define MFC_BASE_ALIGN_ORDER   17
 
#define MFC_MAX_EXTRA_DPB   5
 
#define MFC_MAX_BUFFERS   32
 
#define MFC_NUM_CONTEXTS   4
 
#define MFC_INT_TIMEOUT   2000
 
#define MFC_BW_TIMEOUT   500
 
#define MFC_WATCHDOG_INTERVAL   1000
 
#define MFC_WATCHDOG_CNT   10
 
#define MFC_NO_INSTANCE_SET   -1
 
#define MFC_ENC_CAP_PLANE_COUNT   1
 
#define MFC_ENC_OUT_PLANE_COUNT   2
 
#define STUFF_BYTE   4
 
#define MFC_MAX_CTRLS   70
 
#define S5P_MFC_CODEC_NONE   -1
 
#define S5P_MFC_CODEC_H264_DEC   0
 
#define S5P_MFC_CODEC_H264_MVC_DEC   1
 
#define S5P_MFC_CODEC_VC1_DEC   2
 
#define S5P_MFC_CODEC_MPEG4_DEC   3
 
#define S5P_MFC_CODEC_MPEG2_DEC   4
 
#define S5P_MFC_CODEC_H263_DEC   5
 
#define S5P_MFC_CODEC_VC1RCV_DEC   6
 
#define S5P_MFC_CODEC_VP8_DEC   7
 
#define S5P_MFC_CODEC_H264_ENC   20
 
#define S5P_MFC_CODEC_H264_MVC_ENC   21
 
#define S5P_MFC_CODEC_MPEG4_ENC   22
 
#define S5P_MFC_CODEC_H263_ENC   23
 
#define S5P_MFC_R2H_CMD_EMPTY   0
 
#define S5P_MFC_R2H_CMD_SYS_INIT_RET   1
 
#define S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET   2
 
#define S5P_MFC_R2H_CMD_SEQ_DONE_RET   3
 
#define S5P_MFC_R2H_CMD_INIT_BUFFERS_RET   4
 
#define S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET   6
 
#define S5P_MFC_R2H_CMD_SLEEP_RET   7
 
#define S5P_MFC_R2H_CMD_WAKEUP_RET   8
 
#define S5P_MFC_R2H_CMD_COMPLETE_SEQ_RET   9
 
#define S5P_MFC_R2H_CMD_DPB_FLUSH_RET   10
 
#define S5P_MFC_R2H_CMD_NAL_ABORT_RET   11
 
#define S5P_MFC_R2H_CMD_FW_STATUS_RET   12
 
#define S5P_MFC_R2H_CMD_FRAME_DONE_RET   13
 
#define S5P_MFC_R2H_CMD_FIELD_DONE_RET   14
 
#define S5P_MFC_R2H_CMD_SLICE_DONE_RET   15
 
#define S5P_MFC_R2H_CMD_ENC_BUFFER_FUL_RET   16
 
#define S5P_MFC_R2H_CMD_ERR_RET   32
 
#define mfc_read(dev, offset)   readl(dev->regs_base + (offset))
 
#define mfc_write(dev, data, offset)
 
#define MFC_BUF_FLAG_USED   (1 << 0)
 
#define MFC_BUF_FLAG_EOS   (1 << 1)
 
#define call_cop(c, op, args...)
 
#define s5p_mfc_hw_call(f, op, args...)   ((f && f->op) ? f->op(args) : -ENODEV)
 
#define fh_to_ctx(__fh)   container_of(__fh, struct s5p_mfc_ctx, fh)
 
#define ctrl_to_ctx(__ctrl)   container_of((__ctrl)->handler, struct s5p_mfc_ctx, ctrl_handler)
 
#define HAS_PORTNUM(dev)
 
#define IS_TWOPORT(dev)   (dev->variant->port_num == 2 ? 1 : 0)
 
#define IS_MFCV6(dev)   (dev->variant->version >= 0x60 ? 1 : 0)
 

Enumerations

enum  s5p_mfc_fmt_type { MFC_FMT_DEC, MFC_FMT_ENC, MFC_FMT_RAW }
 
enum  s5p_mfc_node_type { MFCNODE_INVALID = -1, MFCNODE_DECODER = 0, MFCNODE_ENCODER = 1 }
 
enum  s5p_mfc_inst_type { MFCINST_INVALID, MFCINST_DECODER, MFCINST_ENCODER }
 
enum  s5p_mfc_inst_state {
  MFCINST_FREE = 0, MFCINST_INIT = 100, MFCINST_GOT_INST, MFCINST_HEAD_PARSED,
  MFCINST_BUFS_SET, MFCINST_RUNNING, MFCINST_FINISHING, MFCINST_FINISHED,
  MFCINST_RETURN_INST, MFCINST_ERROR, MFCINST_ABORT, MFCINST_RES_CHANGE_INIT,
  MFCINST_RES_CHANGE_FLUSH, MFCINST_RES_CHANGE_END
}
 
enum  s5p_mfc_queue_state { QUEUE_FREE, QUEUE_BUFS_REQUESTED, QUEUE_BUFS_QUERIED, QUEUE_BUFS_MMAPED }
 
enum  s5p_mfc_decode_arg { MFC_DEC_FRAME, MFC_DEC_LAST_FRAME, MFC_DEC_RES_CHANGE }
 

Functions

void clear_work_bit (struct s5p_mfc_ctx *ctx)
 
void set_work_bit (struct s5p_mfc_ctx *ctx)
 
void clear_work_bit_irqsave (struct s5p_mfc_ctx *ctx)
 
void set_work_bit_irqsave (struct s5p_mfc_ctx *ctx)
 

Macro Definition Documentation

#define call_cop (   c,
  op,
  args... 
)
Value:
(((c)->c_ops->op) ? \
((c)->c_ops->op(args)) : 0)

Definition at line 457 of file s5p_mfc_common.h.

#define ctrl_to_ctx (   __ctrl)    container_of((__ctrl)->handler, struct s5p_mfc_ctx, ctrl_handler)

Definition at line 684 of file s5p_mfc_common.h.

#define DST_QUEUE_OFF_BASE   (TASK_SIZE / 2)

Definition at line 32 of file s5p_mfc_common.h.

#define fh_to_ctx (   __fh)    container_of(__fh, struct s5p_mfc_ctx, fh)

Definition at line 683 of file s5p_mfc_common.h.

#define HAS_PORTNUM (   dev)
Value:
(dev ? (dev->variant ? \
(dev->variant->port_num ? 1 : 0) : 0) : 0)

Definition at line 692 of file s5p_mfc_common.h.

#define IS_MFCV6 (   dev)    (dev->variant->version >= 0x60 ? 1 : 0)

Definition at line 695 of file s5p_mfc_common.h.

#define IS_TWOPORT (   dev)    (dev->variant->port_num == 2 ? 1 : 0)

Definition at line 694 of file s5p_mfc_common.h.

#define MFC_BANK1_ALIGN_ORDER   13

Definition at line 37 of file s5p_mfc_common.h.

#define MFC_BANK1_ALLOC_CTX   0

Definition at line 34 of file s5p_mfc_common.h.

#define MFC_BANK2_ALIGN_ORDER   13

Definition at line 38 of file s5p_mfc_common.h.

#define MFC_BANK2_ALLOC_CTX   1

Definition at line 35 of file s5p_mfc_common.h.

#define MFC_BASE_ALIGN_ORDER   17

Definition at line 39 of file s5p_mfc_common.h.

#define MFC_BUF_FLAG_EOS   (1 << 1)

Definition at line 173 of file s5p_mfc_common.h.

#define MFC_BUF_FLAG_USED   (1 << 0)

Definition at line 172 of file s5p_mfc_common.h.

#define MFC_BW_TIMEOUT   500

Definition at line 58 of file s5p_mfc_common.h.

#define MFC_ENC_CAP_PLANE_COUNT   1

Definition at line 64 of file s5p_mfc_common.h.

#define MFC_ENC_OUT_PLANE_COUNT   2

Definition at line 65 of file s5p_mfc_common.h.

#define MFC_INT_TIMEOUT   2000

Definition at line 56 of file s5p_mfc_common.h.

#define MFC_MAX_BUFFERS   32

Definition at line 53 of file s5p_mfc_common.h.

#define MFC_MAX_CTRLS   70

Definition at line 67 of file s5p_mfc_common.h.

#define MFC_MAX_EXTRA_DPB   5

Definition at line 52 of file s5p_mfc_common.h.

#define MFC_NO_INSTANCE_SET   -1

Definition at line 63 of file s5p_mfc_common.h.

#define MFC_NUM_CONTEXTS   4

Definition at line 54 of file s5p_mfc_common.h.

#define mfc_read (   dev,
  offset 
)    readl(dev->regs_base + (offset))

Definition at line 102 of file s5p_mfc_common.h.

#define MFC_WATCHDOG_CNT   10

Definition at line 62 of file s5p_mfc_common.h.

#define MFC_WATCHDOG_INTERVAL   1000

Definition at line 60 of file s5p_mfc_common.h.

#define mfc_write (   dev,
  data,
  offset 
)
Value:
writel((data), dev->regs_base + \
(offset))

Definition at line 103 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H263_DEC   5

Definition at line 75 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H263_ENC   23

Definition at line 82 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H264_DEC   0

Definition at line 70 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H264_ENC   20

Definition at line 79 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H264_MVC_DEC   1

Definition at line 71 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_H264_MVC_ENC   21

Definition at line 80 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_MPEG2_DEC   4

Definition at line 74 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_MPEG4_DEC   3

Definition at line 73 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_MPEG4_ENC   22

Definition at line 81 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_NONE   -1

Definition at line 69 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_VC1_DEC   2

Definition at line 72 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_VC1RCV_DEC   6

Definition at line 76 of file s5p_mfc_common.h.

#define S5P_MFC_CODEC_VP8_DEC   7

Definition at line 77 of file s5p_mfc_common.h.

#define s5p_mfc_hw_call (   f,
  op,
  args... 
)    ((f && f->op) ? f->op(args) : -ENODEV)

Definition at line 680 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET   6

Definition at line 89 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_COMPLETE_SEQ_RET   9

Definition at line 92 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_DPB_FLUSH_RET   10

Definition at line 93 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_EMPTY   0

Definition at line 84 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_ENC_BUFFER_FUL_RET   16

Definition at line 99 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_ERR_RET   32

Definition at line 100 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_FIELD_DONE_RET   14

Definition at line 97 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_FRAME_DONE_RET   13

Definition at line 96 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_FW_STATUS_RET   12

Definition at line 95 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_INIT_BUFFERS_RET   4

Definition at line 88 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_NAL_ABORT_RET   11

Definition at line 94 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET   2

Definition at line 86 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_SEQ_DONE_RET   3

Definition at line 87 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_SLEEP_RET   7

Definition at line 90 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_SLICE_DONE_RET   15

Definition at line 98 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_SYS_INIT_RET   1

Definition at line 85 of file s5p_mfc_common.h.

#define S5P_MFC_R2H_CMD_WAKEUP_RET   8

Definition at line 91 of file s5p_mfc_common.h.

#define STUFF_BYTE   4

Definition at line 66 of file s5p_mfc_common.h.

Enumeration Type Documentation

enum s5p_mfc_decode_arg - type of frame decoding

Enumerator:
MFC_DEC_FRAME 
MFC_DEC_LAST_FRAME 
MFC_DEC_RES_CHANGE 

Definition at line 166 of file s5p_mfc_common.h.

enum s5p_mfc_fmt_type - type of the pixelformat

Enumerator:
MFC_FMT_DEC 
MFC_FMT_ENC 
MFC_FMT_RAW 

Definition at line 109 of file s5p_mfc_common.h.

enum s5p_mfc_inst_state - The state of an MFC instance.

Enumerator:
MFCINST_FREE 
MFCINST_INIT 
MFCINST_GOT_INST 
MFCINST_HEAD_PARSED 
MFCINST_BUFS_SET 
MFCINST_RUNNING 
MFCINST_FINISHING 
MFCINST_FINISHED 
MFCINST_RETURN_INST 
MFCINST_ERROR 
MFCINST_ABORT 
MFCINST_RES_CHANGE_INIT 
MFCINST_RES_CHANGE_FLUSH 
MFCINST_RES_CHANGE_END 

Definition at line 136 of file s5p_mfc_common.h.

enum s5p_mfc_inst_type - The type of an MFC instance.

Enumerator:
MFCINST_INVALID 
MFCINST_DECODER 
MFCINST_ENCODER 

Definition at line 127 of file s5p_mfc_common.h.

enum s5p_mfc_node_type - The type of an MFC device node.

Enumerator:
MFCNODE_INVALID 
MFCNODE_DECODER 
MFCNODE_ENCODER 

Definition at line 118 of file s5p_mfc_common.h.

enum s5p_mfc_queue_state - The state of buffer queue.

Enumerator:
QUEUE_FREE 
QUEUE_BUFS_REQUESTED 
QUEUE_BUFS_QUERIED 
QUEUE_BUFS_MMAPED 

Definition at line 156 of file s5p_mfc_common.h.

Function Documentation

void clear_work_bit ( struct s5p_mfc_ctx ctx)

Definition at line 46 of file s5p_mfc.c.

void clear_work_bit_irqsave ( struct s5p_mfc_ctx ctx)

Definition at line 66 of file s5p_mfc.c.

void set_work_bit ( struct s5p_mfc_ctx ctx)

Definition at line 56 of file s5p_mfc.c.

void set_work_bit_irqsave ( struct s5p_mfc_ctx ctx)

Definition at line 77 of file s5p_mfc.c.