Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
fimc-core.h File Reference
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <linux/io.h>
#include <linux/sizes.h>
#include <media/media-entity.h>
#include <media/videobuf2-core.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-mediabus.h>
#include <media/s5p_fimc.h>

Go to the source code of this file.

Data Structures

struct  fimc_fmt
 
struct  fimc_dma_offset
 
struct  fimc_effect
 
struct  fimc_scaler
 
struct  fimc_addr
 
struct  fimc_vid_buffer
 
struct  fimc_frame
 
struct  fimc_m2m_device
 
struct  fimc_vid_cap
 
struct  fimc_pix_limit
 
struct  fimc_variant
 
struct  fimc_drvdata
 
struct  fimc_dev
 
struct  fimc_ctrls
 
struct  fimc_ctx
 

Macros

#define dbg(fmt, args...)   pr_debug("%s:%d: " fmt "\n", __func__, __LINE__, ##args)
 
#define FIMC_SHUTDOWN_TIMEOUT   ((100*HZ)/1000)
 
#define MAX_FIMC_CLOCKS   2
 
#define FIMC_MODULE_NAME   "s5p-fimc"
 
#define FIMC_MAX_DEVS   4
 
#define FIMC_MAX_OUT_BUFS   4
 
#define SCALER_MAX_HRATIO   64
 
#define SCALER_MAX_VRATIO   64
 
#define DMA_MIN_SIZE   8
 
#define FIMC_CAMIF_MAX_HEIGHT   0x2000
 
#define FIMC_MAX_JPEG_BUF_SIZE   (10 * SZ_1M)
 
#define FIMC_MAX_PLANES   3
 
#define fimc_m2m_active(dev)   test_bit(ST_M2M_RUN, &(dev)->state)
 
#define fimc_m2m_pending(dev)   test_bit(ST_M2M_PEND, &(dev)->state)
 
#define fimc_capture_running(dev)   test_bit(ST_CAPT_RUN, &(dev)->state)
 
#define fimc_capture_pending(dev)   test_bit(ST_CAPT_PEND, &(dev)->state)
 
#define fimc_capture_busy(dev)   test_bit(ST_CAPT_BUSY, &(dev)->state)
 
#define fimc_fmt_is_user_defined(x)   (!!((x) & 0x180))
 
#define fimc_fmt_is_rgb(x)   (!!((x) & 0x10))
 
#define IS_M2M(__strt)
 
#define FIMC_PARAMS   (1 << 0)
 
#define FIMC_SRC_FMT   (1 << 3)
 
#define FIMC_DST_FMT   (1 << 4)
 
#define FIMC_COMPOSE   (1 << 5)
 
#define FIMC_CTX_M2M   (1 << 16)
 
#define FIMC_CTX_CAP   (1 << 17)
 
#define FIMC_CTX_SHUT   (1 << 18)
 
#define FIMC_IN_DMA_ACCESS_TILED   (1 << 0)
 
#define FIMC_IN_DMA_ACCESS_LINEAR   (0 << 0)
 
#define FIMC_OUT_DMA_ACCESS_TILED   (1 << 1)
 
#define FIMC_OUT_DMA_ACCESS_LINEAR   (0 << 1)
 
#define FIMC_SCAN_MODE_PROGRESSIVE   (0 << 2)
 
#define FIMC_SCAN_MODE_INTERLACED   (1 << 2)
 
#define FIMC_COLOR_RANGE_WIDE   (0 << 3)
 
#define FIMC_COLOR_RANGE_NARROW   (1 << 3)
 
#define FMT_FLAGS_CAM   (1 << 0)
 
#define FMT_FLAGS_M2M_IN   (1 << 1)
 
#define FMT_FLAGS_M2M_OUT   (1 << 2)
 
#define FMT_FLAGS_M2M   (1 << 1 | 1 << 2)
 
#define FMT_HAS_ALPHA   (1 << 3)
 
#define FMT_FLAGS_COMPRESSED   (1 << 4)
 

Enumerations

enum  { CLK_BUS, CLK_GATE }
 
enum  fimc_dev_flags {
  ST_LPM, ST_M2M_RUN, ST_M2M_PEND, ST_M2M_SUSPENDING,
  ST_M2M_SUSPENDED, ST_CAPT_PEND, ST_CAPT_RUN, ST_CAPT_STREAM,
  ST_CAPT_ISP_STREAM, ST_CAPT_SUSPENDED, ST_CAPT_SHUT, ST_CAPT_BUSY,
  ST_CAPT_APPLY_CFG, ST_CAPT_JPEG
}
 
enum  fimc_datapath {
  FIMC_IO_NONE, FIMC_IO_CAMERA, FIMC_IO_DMA, FIMC_IO_LCDFIFO,
  FIMC_IO_WRITEBACK, FIMC_IO_ISP
}
 
enum  fimc_color_fmt {
  FIMC_FMT_RGB444 = 0x10, FIMC_FMT_RGB555, FIMC_FMT_RGB565, FIMC_FMT_RGB666,
  FIMC_FMT_RGB888, FIMC_FMT_RGB30_LOCAL, FIMC_FMT_YCBCR420 = 0x20, FIMC_FMT_YCBYCR422,
  FIMC_FMT_YCRYCB422, FIMC_FMT_CBYCRY422, FIMC_FMT_CRYCBY422, FIMC_FMT_YCBCR444_LOCAL,
  FIMC_FMT_RAW8 = 0x40, FIMC_FMT_RAW10, FIMC_FMT_RAW12, FIMC_FMT_JPEG = 0x80,
  FIMC_FMT_YUYV_JPEG = 0x100
}
 

: format description

struct fimc_fmt - the driver's internal color format data : Media Bus pixel code, -1 if not applicable

: the fourcc code for this format, 0 if not applicable : the corresponding fimc_color_fmt : number of physically non-contiguous data planes : number of physically contiguous data planes : per plane driver's private 'number of bits per pixel' : bitmask indicating meta data plane(s), (1 << plane_no) : flags indicating which operation mode format applies to

#define FIMC_SD_PAD_SINK   0
 
#define FIMC_SD_PAD_SOURCE   1
 
#define FIMC_SD_PADS_NUM   2
 
#define fimc_get_drvdata(_pdev)   ((struct fimc_drvdata *) platform_get_device_id(_pdev)->driver_data)
 
#define fh_to_ctx(__fh)   container_of(__fh, struct fimc_ctx, fh)
 
int fimc_vidioc_enum_fmt_mplane (struct file *file, void *priv, struct v4l2_fmtdesc *f)
 
int fimc_ctrls_create (struct fimc_ctx *ctx)
 
void fimc_ctrls_delete (struct fimc_ctx *ctx)
 
void fimc_ctrls_activate (struct fimc_ctx *ctx, bool active)
 
void fimc_alpha_ctrl_update (struct fimc_ctx *ctx)
 
int fimc_fill_format (struct fimc_frame *frame, struct v4l2_format *f)
 
void fimc_adjust_mplane_format (struct fimc_fmt *fmt, u32 width, u32 height, struct v4l2_pix_format_mplane *pix)
 
struct fimc_fmtfimc_find_format (const u32 *pixelformat, const u32 *mbus_code, unsigned int mask, int index)
 
struct fimc_fmtfimc_get_format (unsigned int index)
 
int fimc_check_scaler_ratio (struct fimc_ctx *ctx, int sw, int sh, int dw, int dh, int rotation)
 
int fimc_set_scaler_info (struct fimc_ctx *ctx)
 
int fimc_prepare_config (struct fimc_ctx *ctx, u32 flags)
 
int fimc_prepare_addr (struct fimc_ctx *ctx, struct vb2_buffer *vb, struct fimc_frame *frame, struct fimc_addr *paddr)
 
void fimc_prepare_dma_offset (struct fimc_ctx *ctx, struct fimc_frame *f)
 
void fimc_set_yuv_order (struct fimc_ctx *ctx)
 
void fimc_fill_frame (struct fimc_frame *frame, struct v4l2_format *f)
 
void fimc_capture_irq_handler (struct fimc_dev *fimc, int deq_buf)
 
int fimc_register_m2m_device (struct fimc_dev *fimc, struct v4l2_device *v4l2_dev)
 
void fimc_unregister_m2m_device (struct fimc_dev *fimc)
 
int fimc_register_driver (void)
 
void fimc_unregister_driver (void)
 
void fimc_m2m_job_finish (struct fimc_ctx *ctx, int vb_state)
 
int fimc_initialize_capture_subdev (struct fimc_dev *fimc)
 
void fimc_unregister_capture_subdev (struct fimc_dev *fimc)
 
int fimc_capture_ctrls_create (struct fimc_dev *fimc)
 
void fimc_sensor_notify (struct v4l2_subdev *sd, unsigned int notification, void *arg)
 
int fimc_capture_suspend (struct fimc_dev *fimc)
 
int fimc_capture_resume (struct fimc_dev *fimc)
 

Macro Definition Documentation

#define dbg (   fmt,
  args... 
)    pr_debug("%s:%d: " fmt "\n", __func__, __LINE__, ##args)

Definition at line 30 of file fimc-core.h.

#define DMA_MIN_SIZE   8

Definition at line 41 of file fimc-core.h.

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

Definition at line 520 of file fimc-core.h.

#define FIMC_CAMIF_MAX_HEIGHT   0x2000

Definition at line 42 of file fimc-core.h.

#define fimc_capture_busy (   dev)    test_bit(ST_CAPT_BUSY, &(dev)->state)

Definition at line 76 of file fimc-core.h.

#define fimc_capture_pending (   dev)    test_bit(ST_CAPT_PEND, &(dev)->state)

Definition at line 75 of file fimc-core.h.

#define fimc_capture_running (   dev)    test_bit(ST_CAPT_RUN, &(dev)->state)

Definition at line 74 of file fimc-core.h.

#define FIMC_COLOR_RANGE_NARROW   (1 << 3)

Definition at line 134 of file fimc-core.h.

#define FIMC_COLOR_RANGE_WIDE   (0 << 3)

Definition at line 132 of file fimc-core.h.

#define FIMC_COMPOSE   (1 << 5)

Definition at line 117 of file fimc-core.h.

#define FIMC_CTX_CAP   (1 << 17)

Definition at line 119 of file fimc-core.h.

#define FIMC_CTX_M2M   (1 << 16)

Definition at line 118 of file fimc-core.h.

#define FIMC_CTX_SHUT   (1 << 18)

Definition at line 120 of file fimc-core.h.

#define FIMC_DST_FMT   (1 << 4)

Definition at line 116 of file fimc-core.h.

#define fimc_fmt_is_rgb (   x)    (!!((x) & 0x10))

Definition at line 108 of file fimc-core.h.

#define fimc_fmt_is_user_defined (   x)    (!!((x) & 0x180))

Definition at line 107 of file fimc-core.h.

#define fimc_get_drvdata (   _pdev)    ((struct fimc_drvdata *) platform_get_device_id(_pdev)->driver_data)

Definition at line 410 of file fimc-core.h.

#define FIMC_IN_DMA_ACCESS_LINEAR   (0 << 0)

Definition at line 124 of file fimc-core.h.

#define FIMC_IN_DMA_ACCESS_TILED   (1 << 0)

Definition at line 123 of file fimc-core.h.

#define fimc_m2m_active (   dev)    test_bit(ST_M2M_RUN, &(dev)->state)

Definition at line 71 of file fimc-core.h.

#define fimc_m2m_pending (   dev)    test_bit(ST_M2M_PEND, &(dev)->state)

Definition at line 72 of file fimc-core.h.

#define FIMC_MAX_DEVS   4

Definition at line 37 of file fimc-core.h.

#define FIMC_MAX_JPEG_BUF_SIZE   (10 * SZ_1M)

Definition at line 43 of file fimc-core.h.

#define FIMC_MAX_OUT_BUFS   4

Definition at line 38 of file fimc-core.h.

#define FIMC_MAX_PLANES   3

Definition at line 44 of file fimc-core.h.

#define FIMC_MODULE_NAME   "s5p-fimc"

Definition at line 36 of file fimc-core.h.

#define FIMC_OUT_DMA_ACCESS_LINEAR   (0 << 1)

Definition at line 126 of file fimc-core.h.

#define FIMC_OUT_DMA_ACCESS_TILED   (1 << 1)

Definition at line 125 of file fimc-core.h.

#define FIMC_PARAMS   (1 << 0)

Definition at line 114 of file fimc-core.h.

#define FIMC_SCAN_MODE_INTERLACED   (1 << 2)

Definition at line 128 of file fimc-core.h.

#define FIMC_SCAN_MODE_PROGRESSIVE   (0 << 2)

Definition at line 127 of file fimc-core.h.

#define FIMC_SD_PAD_SINK   0

Definition at line 302 of file fimc-core.h.

#define FIMC_SD_PAD_SOURCE   1

Definition at line 303 of file fimc-core.h.

#define FIMC_SD_PADS_NUM   2

Definition at line 304 of file fimc-core.h.

#define FIMC_SHUTDOWN_TIMEOUT   ((100*HZ)/1000)

Definition at line 34 of file fimc-core.h.

#define FIMC_SRC_FMT   (1 << 3)

Definition at line 115 of file fimc-core.h.

#define FMT_FLAGS_CAM   (1 << 0)

Definition at line 158 of file fimc-core.h.

#define FMT_FLAGS_COMPRESSED   (1 << 4)

Definition at line 163 of file fimc-core.h.

#define FMT_FLAGS_M2M   (1 << 1 | 1 << 2)

Definition at line 161 of file fimc-core.h.

#define FMT_FLAGS_M2M_IN   (1 << 1)

Definition at line 159 of file fimc-core.h.

#define FMT_FLAGS_M2M_OUT   (1 << 2)

Definition at line 160 of file fimc-core.h.

#define FMT_HAS_ALPHA   (1 << 3)

Definition at line 162 of file fimc-core.h.

#define IS_M2M (   __strt)
Value:

Definition at line 110 of file fimc-core.h.

#define MAX_FIMC_CLOCKS   2

Definition at line 35 of file fimc-core.h.

#define SCALER_MAX_HRATIO   64

Definition at line 39 of file fimc-core.h.

#define SCALER_MAX_VRATIO   64

Definition at line 40 of file fimc-core.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
CLK_BUS 
CLK_GATE 

Definition at line 47 of file fimc-core.h.

Enumerator:
FIMC_FMT_RGB444 
FIMC_FMT_RGB555 
FIMC_FMT_RGB565 
FIMC_FMT_RGB666 
FIMC_FMT_RGB888 
FIMC_FMT_RGB30_LOCAL 
FIMC_FMT_YCBCR420 
FIMC_FMT_YCBYCR422 
FIMC_FMT_YCRYCB422 
FIMC_FMT_CBYCRY422 
FIMC_FMT_CRYCBY422 
FIMC_FMT_YCBCR444_LOCAL 
FIMC_FMT_RAW8 
FIMC_FMT_RAW10 
FIMC_FMT_RAW12 
FIMC_FMT_JPEG 
FIMC_FMT_YUYV_JPEG 

Definition at line 87 of file fimc-core.h.

Enumerator:
FIMC_IO_NONE 
FIMC_IO_CAMERA 
FIMC_IO_DMA 
FIMC_IO_LCDFIFO 
FIMC_IO_WRITEBACK 
FIMC_IO_ISP 

Definition at line 78 of file fimc-core.h.

Enumerator:
ST_LPM 
ST_M2M_RUN 
ST_M2M_PEND 
ST_M2M_SUSPENDING 
ST_M2M_SUSPENDED 
ST_CAPT_PEND 
ST_CAPT_RUN 
ST_CAPT_STREAM 
ST_CAPT_ISP_STREAM 
ST_CAPT_SUSPENDED 
ST_CAPT_SHUT 
ST_CAPT_BUSY 
ST_CAPT_APPLY_CFG 
ST_CAPT_JPEG 

Definition at line 52 of file fimc-core.h.

Function Documentation

void fimc_adjust_mplane_format ( struct fimc_fmt fmt,
u32  width,
u32  height,
struct v4l2_pix_format_mplane pix 
)

fimc_adjust_mplane_format - adjust bytesperline/sizeimage for each plane : fimc pixel format description (input) : requested pixel width : requested pixel height : multi-plane format to adjust

Definition at line 745 of file fimc-core.c.

void fimc_alpha_ctrl_update ( struct fimc_ctx ctx)

Definition at line 677 of file fimc-core.c.

int fimc_capture_ctrls_create ( struct fimc_dev fimc)

fimc_capture_ctrls_create - initialize the control handler Initialize the capture video node control handler and fill it with the FIMC controls. Inherit any sensor's controls if the 'user_subdev_api' flag is false (default behaviour). This function need to be called with the graph mutex held.

Definition at line 486 of file fimc-capture.c.

void fimc_capture_irq_handler ( struct fimc_dev fimc,
int  deq_buf 
)

Definition at line 178 of file fimc-capture.c.

int fimc_capture_resume ( struct fimc_dev fimc)

Definition at line 319 of file fimc-capture.c.

int fimc_capture_suspend ( struct fimc_dev fimc)

Definition at line 307 of file fimc-capture.c.

int fimc_check_scaler_ratio ( struct fimc_ctx ctx,
int  sw,
int  sh,
int  dw,
int  dh,
int  rotation 
)

Definition at line 209 of file fimc-core.c.

void fimc_ctrls_activate ( struct fimc_ctx ctx,
bool  active 
)

Definition at line 646 of file fimc-core.c.

int fimc_ctrls_create ( struct fimc_ctx ctx)

Definition at line 592 of file fimc-core.c.

void fimc_ctrls_delete ( struct fimc_ctx ctx)

Definition at line 635 of file fimc-core.c.

int fimc_fill_format ( struct fimc_frame frame,
struct v4l2_format f 
)

Definition at line 694 of file fimc-core.c.

void fimc_fill_frame ( struct fimc_frame frame,
struct v4l2_format f 
)

Definition at line 722 of file fimc-core.c.

struct fimc_fmt* fimc_find_format ( const u32 pixelformat,
const u32 mbus_code,
unsigned int  mask,
int  index 
)
read

fimc_find_format - lookup fimc color format by fourcc or media bus format : fourcc to match, ignored if null : media bus code to match, ignored if null : the color flags to match : offset in the fimc_formats array, ignored if negative

Definition at line 785 of file fimc-core.c.

struct fimc_fmt* fimc_get_format ( unsigned int  index)
read

Definition at line 201 of file fimc-core.c.

int fimc_initialize_capture_subdev ( struct fimc_dev fimc)

Definition at line 1810 of file fimc-capture.c.

void fimc_m2m_job_finish ( struct fimc_ctx ctx,
int  vb_state 
)

Definition at line 43 of file fimc-m2m.c.

int fimc_prepare_addr ( struct fimc_ctx ctx,
struct vb2_buffer vb,
struct fimc_frame frame,
struct fimc_addr paddr 
)

Definition at line 344 of file fimc-core.c.

int fimc_prepare_config ( struct fimc_ctx ctx,
u32  flags 
)
void fimc_prepare_dma_offset ( struct fimc_ctx ctx,
struct fimc_frame f 
)

Definition at line 441 of file fimc-core.c.

int fimc_register_driver ( void  )

Definition at line 1246 of file fimc-core.c.

int fimc_register_m2m_device ( struct fimc_dev fimc,
struct v4l2_device v4l2_dev 
)

Definition at line 782 of file fimc-m2m.c.

void fimc_sensor_notify ( struct v4l2_subdev sd,
unsigned int  notification,
void arg 
)

fimc_sensor_notify - v4l2_device notification from a sensor subdev : pointer to a subdev generating the notification : the notification type, must be S5P_FIMC_TX_END_NOTIFY

  • : pointer to an u32 type integer that stores the frame payload value

The End Of Frame notification sent by sensor subdev in its still capture mode. If there is only a single VSYNC generated by the sensor at the beginning of a frame transmission, FIMC does not issue the LastIrq (end of frame) interrupt. And this notification is used to complete the frame capture and returning a buffer to user-space. Subdev drivers should call this notification from their last 'End of frame capture' interrupt.

Definition at line 1418 of file fimc-capture.c.

int fimc_set_scaler_info ( struct fimc_ctx ctx)

Definition at line 242 of file fimc-core.c.

void fimc_set_yuv_order ( struct fimc_ctx ctx)

Definition at line 399 of file fimc-core.c.

void fimc_unregister_capture_subdev ( struct fimc_dev fimc)

Definition at line 1832 of file fimc-capture.c.

void fimc_unregister_driver ( void  )

Definition at line 1251 of file fimc-core.c.

void fimc_unregister_m2m_device ( struct fimc_dev fimc)

Definition at line 827 of file fimc-m2m.c.

int fimc_vidioc_enum_fmt_mplane ( struct file file,
void priv,
struct v4l2_fmtdesc f 
)