aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-core.h
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2010-12-08 12:05:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:31:36 -0400
commitef7af59b2cf950a44576d4364459ffd3d5d1d9bc (patch)
tree6d9134410b750457347d32307ee28d9aed16d523 /drivers/media/video/s5p-fimc/fimc-core.h
parent2dab38e2272e9b30540e2782ef7aa8bc45848144 (diff)
[media] s5p-fimc: Conversion to multiplanar formats
Conversion to multiplanar color formats and minor cleanup. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.h')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index 590fbf23079..187af60bcf6 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -84,7 +84,6 @@ enum fimc_color_fmt {
84 S5P_FIMC_RGB888, 84 S5P_FIMC_RGB888,
85 S5P_FIMC_RGB30_LOCAL, 85 S5P_FIMC_RGB30_LOCAL,
86 S5P_FIMC_YCBCR420 = 0x20, 86 S5P_FIMC_YCBCR420 = 0x20,
87 S5P_FIMC_YCBCR422,
88 S5P_FIMC_YCBYCR422, 87 S5P_FIMC_YCBYCR422,
89 S5P_FIMC_YCRYCB422, 88 S5P_FIMC_YCRYCB422,
90 S5P_FIMC_CBYCRY422, 89 S5P_FIMC_CBYCRY422,
@@ -151,18 +150,18 @@ enum fimc_color_fmt {
151 * @name: format description 150 * @name: format description
152 * @fourcc: the fourcc code for this format, 0 if not applicable 151 * @fourcc: the fourcc code for this format, 0 if not applicable
153 * @color: the corresponding fimc_color_fmt 152 * @color: the corresponding fimc_color_fmt
154 * @depth: driver's private 'number of bits per pixel' 153 * @depth: per plane driver's private 'number of bits per pixel'
155 * @buff_cnt: number of physically non-contiguous data planes 154 * @memplanes: number of physically non-contiguous data planes
156 * @planes_cnt: number of physically contiguous data planes 155 * @colplanes: number of physically contiguous data planes
157 */ 156 */
158struct fimc_fmt { 157struct fimc_fmt {
159 enum v4l2_mbus_pixelcode mbus_code; 158 enum v4l2_mbus_pixelcode mbus_code;
160 char *name; 159 char *name;
161 u32 fourcc; 160 u32 fourcc;
162 u32 color; 161 u32 color;
163 u16 buff_cnt; 162 u16 memplanes;
164 u16 planes_cnt; 163 u16 colplanes;
165 u16 depth; 164 u8 depth[VIDEO_MAX_PLANES];
166 u16 flags; 165 u16 flags;
167#define FMT_FLAGS_CAM (1 << 0) 166#define FMT_FLAGS_CAM (1 << 0)
168#define FMT_FLAGS_M2M (1 << 1) 167#define FMT_FLAGS_M2M (1 << 1)
@@ -272,7 +271,7 @@ struct fimc_vid_buffer {
272 * @height: image pixel weight 271 * @height: image pixel weight
273 * @paddr: image frame buffer physical addresses 272 * @paddr: image frame buffer physical addresses
274 * @buf_cnt: number of buffers depending on a color format 273 * @buf_cnt: number of buffers depending on a color format
275 * @size: image size in bytes 274 * @payload: image size in bytes (w x h x bpp)
276 * @color: color format 275 * @color: color format
277 * @dma_offset: DMA offset in bytes 276 * @dma_offset: DMA offset in bytes
278 */ 277 */
@@ -285,7 +284,7 @@ struct fimc_frame {
285 u32 offs_v; 284 u32 offs_v;
286 u32 width; 285 u32 width;
287 u32 height; 286 u32 height;
288 u32 size; 287 unsigned long payload[VIDEO_MAX_PLANES];
289 struct fimc_addr paddr; 288 struct fimc_addr paddr;
290 struct fimc_dma_offset dma_offset; 289 struct fimc_dma_offset dma_offset;
291 struct fimc_fmt *fmt; 290 struct fimc_fmt *fmt;
@@ -479,7 +478,7 @@ struct fimc_ctx {
479 478
480static inline int tiled_fmt(struct fimc_fmt *fmt) 479static inline int tiled_fmt(struct fimc_fmt *fmt)
481{ 480{
482 return 0; 481 return fmt->fourcc == V4L2_PIX_FMT_NV12MT;
483} 482}
484 483
485static inline void fimc_hw_clear_irq(struct fimc_dev *dev) 484static inline void fimc_hw_clear_irq(struct fimc_dev *dev)
@@ -535,12 +534,12 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx,
535{ 534{
536 struct fimc_frame *frame; 535 struct fimc_frame *frame;
537 536
538 if (V4L2_BUF_TYPE_VIDEO_OUTPUT == type) { 537 if (V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE == type) {
539 if (ctx->state & FIMC_CTX_M2M) 538 if (ctx->state & FIMC_CTX_M2M)
540 frame = &ctx->s_frame; 539 frame = &ctx->s_frame;
541 else 540 else
542 return ERR_PTR(-EINVAL); 541 return ERR_PTR(-EINVAL);
543 } else if (V4L2_BUF_TYPE_VIDEO_CAPTURE == type) { 542 } else if (V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE == type) {
544 frame = &ctx->d_frame; 543 frame = &ctx->d_frame;
545 } else { 544 } else {
546 v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev, 545 v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev,
@@ -582,7 +581,7 @@ void fimc_hw_set_input_path(struct fimc_ctx *ctx);
582void fimc_hw_set_output_path(struct fimc_ctx *ctx); 581void fimc_hw_set_output_path(struct fimc_ctx *ctx);
583void fimc_hw_set_input_addr(struct fimc_dev *fimc, struct fimc_addr *paddr); 582void fimc_hw_set_input_addr(struct fimc_dev *fimc, struct fimc_addr *paddr);
584void fimc_hw_set_output_addr(struct fimc_dev *fimc, struct fimc_addr *paddr, 583void fimc_hw_set_output_addr(struct fimc_dev *fimc, struct fimc_addr *paddr,
585 int index); 584 int index);
586int fimc_hw_set_camera_source(struct fimc_dev *fimc, 585int fimc_hw_set_camera_source(struct fimc_dev *fimc,
587 struct s3c_fimc_isp_info *cam); 586 struct s3c_fimc_isp_info *cam);
588int fimc_hw_set_camera_offset(struct fimc_dev *fimc, struct fimc_frame *f); 587int fimc_hw_set_camera_offset(struct fimc_dev *fimc, struct fimc_frame *f);
@@ -593,12 +592,12 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
593 592
594/* -----------------------------------------------------*/ 593/* -----------------------------------------------------*/
595/* fimc-core.c */ 594/* fimc-core.c */
596int fimc_vidioc_enum_fmt(struct file *file, void *priv, 595int fimc_vidioc_enum_fmt_mplane(struct file *file, void *priv,
597 struct v4l2_fmtdesc *f); 596 struct v4l2_fmtdesc *f);
598int fimc_vidioc_g_fmt(struct file *file, void *priv, 597int fimc_vidioc_g_fmt_mplane(struct file *file, void *priv,
599 struct v4l2_format *f); 598 struct v4l2_format *f);
600int fimc_vidioc_try_fmt(struct file *file, void *priv, 599int fimc_vidioc_try_fmt_mplane(struct file *file, void *priv,
601 struct v4l2_format *f); 600 struct v4l2_format *f);
602int fimc_vidioc_queryctrl(struct file *file, void *priv, 601int fimc_vidioc_queryctrl(struct file *file, void *priv,
603 struct v4l2_queryctrl *qc); 602 struct v4l2_queryctrl *qc);
604int fimc_vidioc_g_ctrl(struct file *file, void *priv, 603int fimc_vidioc_g_ctrl(struct file *file, void *priv,