Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
gsc-core.h File Reference
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <linux/io.h>
#include <linux/pm_runtime.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/videobuf2-dma-contig.h>
#include "gsc-regs.h"

Go to the source code of this file.

Data Structures

struct  gsc_fmt
 
struct  gsc_input_buf
 
struct  gsc_addr
 
struct  gsc_ctrls
 
struct  gsc_scaler
 
struct  gsc_frame
 
struct  gsc_m2m_device
 
struct  gsc_pix_max
 
struct  gsc_pix_min
 
struct  gsc_pix_align
 
struct  gsc_variant
 
struct  gsc_driverdata
 
struct  gsc_dev
 
struct  gsc_ctx
 

Macros

#define CONFIG_VB2_GSC_DMA_CONTIG   1
 
#define GSC_MODULE_NAME   "exynos-gsc"
 
#define GSC_SHUTDOWN_TIMEOUT   ((100*HZ)/1000)
 
#define GSC_MAX_DEVS   4
 
#define GSC_M2M_BUF_NUM   0
 
#define GSC_MAX_CTRL_NUM   10
 
#define GSC_SC_ALIGN_4   4
 
#define GSC_SC_ALIGN_2   2
 
#define DEFAULT_CSC_EQ   1
 
#define DEFAULT_CSC_RANGE   1
 
#define GSC_PARAMS   (1 << 0)
 
#define GSC_SRC_FMT   (1 << 1)
 
#define GSC_DST_FMT   (1 << 2)
 
#define GSC_CTX_M2M   (1 << 3)
 
#define GSC_CTX_STOP_REQ   (1 << 6)
 
#define fh_to_ctx(__fh)   container_of(__fh, struct gsc_ctx, fh)
 
#define is_rgb(x)   (!!((x) & 0x1))
 
#define is_yuv420(x)   (!!((x) & 0x2))
 
#define is_yuv422(x)   (!!((x) & 0x4))
 
#define gsc_m2m_active(dev)   test_bit(ST_M2M_RUN, &(dev)->state)
 
#define gsc_m2m_pending(dev)   test_bit(ST_M2M_PEND, &(dev)->state)
 
#define gsc_m2m_opened(dev)   test_bit(ST_M2M_OPEN, &(dev)->state)
 
#define ctrl_to_ctx(__ctrl)   container_of((__ctrl)->handler, struct gsc_ctx, ctrl_handler)
 

Enumerations

enum  gsc_dev_flags {
  ST_SUSPEND, ST_M2M_OPEN, ST_M2M_RUN, ST_M2M_PEND,
  ST_M2M_SUSPENDED, ST_M2M_SUSPENDING
}
 
enum  gsc_irq { GSC_IRQ_DONE, GSC_IRQ_OVERRUN }
 
enum  gsc_datapath {
  GSC_CAMERA = 0x1, GSC_DMA, GSC_MIXER, GSC_FIMD,
  GSC_WRITEBACK
}
 
enum  gsc_color_fmt { GSC_RGB = 0x1, GSC_YUV420 = 0x2, GSC_YUV422 = 0x4, GSC_YUV444 = 0x8 }
 
enum  gsc_yuv_fmt { GSC_LSB_Y = 0x10, GSC_LSB_C, GSC_CBCR = 0x20, GSC_CRCB }
 

Functions

: format description

struct gsc_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 : Y/C order : Chrominance order control : number of physically non-contiguous data planes : number of physically contiguous data planes : per plane driver's private 'number of bits per pixel' : flags indicating which operation mode format applies to

void gsc_set_prefbuf (struct gsc_dev *gsc, struct gsc_frame *frm)
 
int gsc_register_m2m_device (struct gsc_dev *gsc)
 
void gsc_unregister_m2m_device (struct gsc_dev *gsc)
 
void gsc_m2m_job_finish (struct gsc_ctx *ctx, int vb_state)
 
u32 get_plane_size (struct gsc_frame *fr, unsigned int plane)
 
struct gsc_fmtget_format (int index)
 
struct gsc_fmtfind_fmt (u32 *pixelformat, u32 *mbus_code, u32 index)
 
int gsc_enum_fmt_mplane (struct v4l2_fmtdesc *f)
 
int gsc_try_fmt_mplane (struct gsc_ctx *ctx, struct v4l2_format *f)
 
void gsc_set_frame_size (struct gsc_frame *frame, int width, int height)
 
int gsc_g_fmt_mplane (struct gsc_ctx *ctx, struct v4l2_format *f)
 
void gsc_check_crop_change (u32 tmp_w, u32 tmp_h, u32 *w, u32 *h)
 
int gsc_g_crop (struct gsc_ctx *ctx, struct v4l2_crop *cr)
 
int gsc_try_crop (struct gsc_ctx *ctx, struct v4l2_crop *cr)
 
int gsc_cal_prescaler_ratio (struct gsc_variant *var, u32 src, u32 dst, u32 *ratio)
 
void gsc_get_prescaler_shfactor (u32 hratio, u32 vratio, u32 *sh)
 
void gsc_check_src_scale_info (struct gsc_variant *var, struct gsc_frame *s_frame, u32 *wratio, u32 tx, u32 ty, u32 *hratio)
 
int gsc_check_scaler_ratio (struct gsc_variant *var, int sw, int sh, int dw, int dh, int rot, int out_path)
 
int gsc_set_scaler_info (struct gsc_ctx *ctx)
 
int gsc_ctrls_create (struct gsc_ctx *ctx)
 
void gsc_ctrls_delete (struct gsc_ctx *ctx)
 
int gsc_prepare_addr (struct gsc_ctx *ctx, struct vb2_buffer *vb, struct gsc_frame *frame, struct gsc_addr *addr)
 
void gsc_hw_set_sw_reset (struct gsc_dev *dev)
 
int gsc_wait_reset (struct gsc_dev *dev)
 
void gsc_hw_set_frm_done_irq_mask (struct gsc_dev *dev, bool mask)
 
void gsc_hw_set_gsc_irq_enable (struct gsc_dev *dev, bool mask)
 
void gsc_hw_set_input_buf_masking (struct gsc_dev *dev, u32 shift, bool enable)
 
void gsc_hw_set_output_buf_masking (struct gsc_dev *dev, u32 shift, bool enable)
 
void gsc_hw_set_input_addr (struct gsc_dev *dev, struct gsc_addr *addr, int index)
 
void gsc_hw_set_output_addr (struct gsc_dev *dev, struct gsc_addr *addr, int index)
 
void gsc_hw_set_input_path (struct gsc_ctx *ctx)
 
void gsc_hw_set_in_size (struct gsc_ctx *ctx)
 
void gsc_hw_set_in_image_rgb (struct gsc_ctx *ctx)
 
void gsc_hw_set_in_image_format (struct gsc_ctx *ctx)
 
void gsc_hw_set_output_path (struct gsc_ctx *ctx)
 
void gsc_hw_set_out_size (struct gsc_ctx *ctx)
 
void gsc_hw_set_out_image_rgb (struct gsc_ctx *ctx)
 
void gsc_hw_set_out_image_format (struct gsc_ctx *ctx)
 
void gsc_hw_set_prescaler (struct gsc_ctx *ctx)
 
void gsc_hw_set_mainscaler (struct gsc_ctx *ctx)
 
void gsc_hw_set_rotation (struct gsc_ctx *ctx)
 
void gsc_hw_set_global_alpha (struct gsc_ctx *ctx)
 
void gsc_hw_set_sfr_update (struct gsc_ctx *ctx)
 

Macro Definition Documentation

#define CONFIG_VB2_GSC_DMA_CONTIG   1

Definition at line 31 of file gsc-core.h.

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

Definition at line 104 of file gsc-core.h.

#define DEFAULT_CSC_EQ   1

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

#define DEFAULT_CSC_RANGE   1

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

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

Definition at line 95 of file gsc-core.h.

#define GSC_CTX_M2M   (1 << 3)

Definition at line 46 of file gsc-core.h.

#define GSC_CTX_STOP_REQ   (1 << 6)

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

#define GSC_DST_FMT   (1 << 2)

Definition at line 45 of file gsc-core.h.

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

Definition at line 100 of file gsc-core.h.

#define GSC_M2M_BUF_NUM   0

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

#define gsc_m2m_opened (   dev)    test_bit(ST_M2M_OPEN, &(dev)->state)

Definition at line 102 of file gsc-core.h.

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

Definition at line 101 of file gsc-core.h.

#define GSC_MAX_CTRL_NUM   10

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

#define GSC_MAX_DEVS   4

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

#define GSC_MODULE_NAME   "exynos-gsc"

Definition at line 32 of file gsc-core.h.

#define GSC_PARAMS   (1 << 0)

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

#define GSC_SC_ALIGN_2   2

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

#define GSC_SC_ALIGN_4   4

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

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

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

#define GSC_SRC_FMT   (1 << 1)

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

#define is_rgb (   x)    (!!((x) & 0x1))

Definition at line 96 of file gsc-core.h.

#define is_yuv420 (   x)    (!!((x) & 0x2))

Definition at line 97 of file gsc-core.h.

#define is_yuv422 (   x)    (!!((x) & 0x4))

Definition at line 98 of file gsc-core.h.

Enumeration Type Documentation

Enumerator:
GSC_RGB 
GSC_YUV420 
GSC_YUV422 
GSC_YUV444 

Definition at line 81 of file gsc-core.h.

enum gsc_datapath - the path of data used for G-Scaler : from camera : from/to DMA : to local path : from FIMD

Enumerator:
GSC_CAMERA 
GSC_DMA 
GSC_MIXER 
GSC_FIMD 
GSC_WRITEBACK 

Definition at line 73 of file gsc-core.h.

Enumerator:
ST_SUSPEND 
ST_M2M_OPEN 
ST_M2M_RUN 
ST_M2M_PEND 
ST_M2M_SUSPENDED 
ST_M2M_SUSPENDING 

Definition at line 49 of file gsc-core.h.

enum gsc_irq
Enumerator:
GSC_IRQ_DONE 
GSC_IRQ_OVERRUN 

Definition at line 61 of file gsc-core.h.

Enumerator:
GSC_LSB_Y 
GSC_LSB_C 
GSC_CBCR 
GSC_CRCB 

Definition at line 88 of file gsc-core.h.

Function Documentation

struct gsc_fmt* find_fmt ( u32 pixelformat,
u32 mbus_code,
u32  index 
)
read

Definition at line 199 of file gsc-core.c.

struct gsc_fmt* get_format ( int  index)
read

Definition at line 191 of file gsc-core.c.

u32 get_plane_size ( struct gsc_frame fr,
unsigned int  plane 
)
int gsc_cal_prescaler_ratio ( struct gsc_variant var,
u32  src,
u32  dst,
u32 ratio 
)

Definition at line 230 of file gsc-core.c.

void gsc_check_crop_change ( u32  tmp_w,
u32  tmp_h,
u32 w,
u32 h 
)

Definition at line 484 of file gsc-core.c.

int gsc_check_scaler_ratio ( struct gsc_variant var,
int  sw,
int  sh,
int  dw,
int  dh,
int  rot,
int  out_path 
)

Definition at line 596 of file gsc-core.c.

void gsc_check_src_scale_info ( struct gsc_variant var,
struct gsc_frame s_frame,
u32 wratio,
u32  tx,
u32  ty,
u32 hratio 
)

Definition at line 265 of file gsc-core.c.

int gsc_ctrls_create ( struct gsc_ctx ctx)

Definition at line 750 of file gsc-core.c.

void gsc_ctrls_delete ( struct gsc_ctx ctx)

Definition at line 780 of file gsc-core.c.

int gsc_enum_fmt_mplane ( struct v4l2_fmtdesc f)

Definition at line 299 of file gsc-core.c.

int gsc_g_crop ( struct gsc_ctx ctx,
struct v4l2_crop cr 
)

Definition at line 494 of file gsc-core.c.

int gsc_g_fmt_mplane ( struct gsc_ctx ctx,
struct v4l2_format f 
)

Definition at line 455 of file gsc-core.c.

void gsc_get_prescaler_shfactor ( u32  hratio,
u32  vratio,
u32 sh 
)

Definition at line 248 of file gsc-core.c.

void gsc_hw_set_frm_done_irq_mask ( struct gsc_dev dev,
bool  mask 
)

Definition at line 39 of file gsc-regs.c.

void gsc_hw_set_global_alpha ( struct gsc_ctx ctx)

Definition at line 399 of file gsc-regs.c.

void gsc_hw_set_gsc_irq_enable ( struct gsc_dev dev,
bool  mask 
)

Definition at line 51 of file gsc-regs.c.

void gsc_hw_set_in_image_format ( struct gsc_ctx ctx)

Definition at line 167 of file gsc-regs.c.

void gsc_hw_set_in_image_rgb ( struct gsc_ctx ctx)

Definition at line 147 of file gsc-regs.c.

void gsc_hw_set_in_size ( struct gsc_ctx ctx)

Definition at line 125 of file gsc-regs.c.

void gsc_hw_set_input_addr ( struct gsc_dev dev,
struct gsc_addr addr,
int  index 
)

Definition at line 91 of file gsc-regs.c.

void gsc_hw_set_input_buf_masking ( struct gsc_dev dev,
u32  shift,
bool  enable 
)

Definition at line 63 of file gsc-regs.c.

void gsc_hw_set_input_path ( struct gsc_ctx ctx)

Definition at line 112 of file gsc-regs.c.

void gsc_hw_set_mainscaler ( struct gsc_ctx ctx)

Definition at line 353 of file gsc-regs.c.

void gsc_hw_set_out_image_format ( struct gsc_ctx ctx)

Definition at line 284 of file gsc-regs.c.

void gsc_hw_set_out_image_rgb ( struct gsc_ctx ctx)

Definition at line 264 of file gsc-regs.c.

void gsc_hw_set_out_size ( struct gsc_ctx ctx)

Definition at line 235 of file gsc-regs.c.

void gsc_hw_set_output_addr ( struct gsc_dev dev,
struct gsc_addr addr,
int  index 
)

Definition at line 102 of file gsc-regs.c.

void gsc_hw_set_output_buf_masking ( struct gsc_dev dev,
u32  shift,
bool  enable 
)

Definition at line 77 of file gsc-regs.c.

void gsc_hw_set_output_path ( struct gsc_ctx ctx)

Definition at line 220 of file gsc-regs.c.

void gsc_hw_set_prescaler ( struct gsc_ctx ctx)

Definition at line 341 of file gsc-regs.c.

void gsc_hw_set_rotation ( struct gsc_ctx ctx)

Definition at line 366 of file gsc-regs.c.

void gsc_hw_set_sfr_update ( struct gsc_ctx ctx)

Definition at line 417 of file gsc-regs.c.

void gsc_hw_set_sw_reset ( struct gsc_dev dev)

Definition at line 19 of file gsc-regs.c.

void gsc_m2m_job_finish ( struct gsc_ctx ctx,
int  vb_state 
)

Definition at line 72 of file gsc-m2m.c.

int gsc_prepare_addr ( struct gsc_ctx ctx,
struct vb2_buffer vb,
struct gsc_frame frame,
struct gsc_addr addr 
)

Definition at line 789 of file gsc-core.c.

int gsc_register_m2m_device ( struct gsc_dev gsc)

Definition at line 720 of file gsc-m2m.c.

void gsc_set_frame_size ( struct gsc_frame frame,
int  width,
int  height 
)

Definition at line 220 of file gsc-core.c.

void gsc_set_prefbuf ( struct gsc_dev gsc,
struct gsc_frame frm 
)

Definition at line 330 of file gsc-core.c.

int gsc_set_scaler_info ( struct gsc_ctx ctx)

Definition at line 623 of file gsc-core.c.

int gsc_try_crop ( struct gsc_ctx ctx,
struct v4l2_crop cr 
)

Definition at line 507 of file gsc-core.c.

int gsc_try_fmt_mplane ( struct gsc_ctx ctx,
struct v4l2_format f 
)

Definition at line 378 of file gsc-core.c.

void gsc_unregister_m2m_device ( struct gsc_dev gsc)

Definition at line 766 of file gsc-m2m.c.

int gsc_wait_reset ( struct gsc_dev dev)

Definition at line 24 of file gsc-regs.c.