2 * linux/drivers/media/video/samsung/mfc5x/mfc_inst.h
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
7 * Instance manager file for Samsung MFC (Multi Function Codec - FIMV) driver
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
15 #define __MFC_INST_H __FILE__
17 #include <linux/list.h>
20 #include "mfc_interface.h"
23 /* FIXME: instance state should be more specific */
28 INST_STATE_CREATE = 0x0001,
31 INST_STATE_SETUP = 0x0004,
34 INST_STATE_OPEN = 0x0010,
38 INST_STATE_EXE = 0x0020,
44 struct codec_operations {
45 /* initialization routines */
46 int (*alloc_ctx_buf) (struct mfc_inst_ctx *ctx);
47 int (*alloc_desc_buf) (struct mfc_inst_ctx *ctx);
48 int (*get_init_arg) (struct mfc_inst_ctx *ctx, void *arg);
49 int (*pre_seq_start) (struct mfc_inst_ctx *ctx);
50 int (*post_seq_start) (struct mfc_inst_ctx *ctx);
51 int (*set_init_arg) (struct mfc_inst_ctx *ctx, void *arg);
52 int (*set_codec_bufs) (struct mfc_inst_ctx *ctx);
53 int (*set_dpbs) (struct mfc_inst_ctx *ctx); /* decoder */
54 /* execution routines */
55 int (*get_exe_arg) (struct mfc_inst_ctx *ctx, void *arg);
56 int (*pre_frame_start) (struct mfc_inst_ctx *ctx);
57 int (*post_frame_start) (struct mfc_inst_ctx *ctx);
58 int (*multi_data_frame) (struct mfc_inst_ctx *ctx);
59 int (*set_exe_arg) (struct mfc_inst_ctx *ctx, void *arg);
60 /* configuration routines */
61 int (*get_codec_cfg) (struct mfc_inst_ctx *ctx, unsigned int type, int *value);
62 int (*set_codec_cfg) (struct mfc_inst_ctx *ctx, unsigned int type, int *value);
66 struct list_head list;
68 unsigned int value[4];
73 unsigned int pixelcache;
75 unsigned int numextradpb;
77 unsigned int postfilter; /* MPEG4 */
78 unsigned int dispdelay_en; /* H.264 */
79 unsigned int dispdelay_val; /* H.264 */
80 unsigned int width; /* FIMV1 */
81 unsigned int height; /* FIMV1 */
93 unsigned int pixelcache;
95 unsigned int frameskip;
96 unsigned int frammode;
101 unsigned int frametype;
102 unsigned int framerate;
103 unsigned int bitrate;
104 unsigned int vui; /* H.264 */
105 unsigned int hec; /* MPEG4 */
106 unsigned int seqhdrctrl;
108 unsigned int i_period;
112 enum mfc_resolution_status {
117 enum mfc_resolution_change_status {
121 RES_WAIT_FRAME_DONE = 3,
124 struct mfc_inst_ctx {
125 int id; /* assigned by driver */
126 int cmd_id; /* assigned by F/W */
129 enum instance_state state;
132 volatile unsigned char *shm;
134 unsigned int ctxbufofs;
135 unsigned int ctxbufsize;
136 unsigned int descbufofs; /* FIXME: move to decoder context */
137 unsigned int descbufsize; /* FIXME: move to decoder context */
138 unsigned long userbase;
139 SSBIP_MFC_BUFFER_TYPE buf_cache_type;
141 int resolution_status;
143 struct mfc_dec_cfg deccfg;
144 struct mfc_enc_cfg enccfg;
146 struct list_head presetcfgs;
149 struct codec_operations *c_ops;
154 #ifdef CONFIG_CPU_FREQ
155 int busfreq_flag; /* context bus frequency flag*/
159 struct mfc_inst_ctx *mfc_create_inst(void);
160 void mfc_destroy_inst(struct mfc_inst_ctx* ctx);
161 int mfc_set_inst_state(struct mfc_inst_ctx *ctx, enum instance_state state);
162 int mfc_chk_inst_state(struct mfc_inst_ctx *ctx, enum instance_state state);
163 int mfc_set_inst_cfg(struct mfc_inst_ctx *ctx, unsigned int type, int *value);
165 #endif /* __MFC_INST_H */