aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.h')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index c7f01c47b20..4e20560c73d 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -85,7 +85,9 @@ enum fimc_datapath {
85}; 85};
86 86
87enum fimc_color_fmt { 87enum fimc_color_fmt {
88 S5P_FIMC_RGB565 = 0x10, 88 S5P_FIMC_RGB444 = 0x10,
89 S5P_FIMC_RGB555,
90 S5P_FIMC_RGB565,
89 S5P_FIMC_RGB666, 91 S5P_FIMC_RGB666,
90 S5P_FIMC_RGB888, 92 S5P_FIMC_RGB888,
91 S5P_FIMC_RGB30_LOCAL, 93 S5P_FIMC_RGB30_LOCAL,
@@ -160,8 +162,11 @@ struct fimc_fmt {
160 u16 colplanes; 162 u16 colplanes;
161 u8 depth[VIDEO_MAX_PLANES]; 163 u8 depth[VIDEO_MAX_PLANES];
162 u16 flags; 164 u16 flags;
163#define FMT_FLAGS_CAM (1 << 0) 165#define FMT_FLAGS_CAM (1 << 0)
164#define FMT_FLAGS_M2M (1 << 1) 166#define FMT_FLAGS_M2M_IN (1 << 1)
167#define FMT_FLAGS_M2M_OUT (1 << 2)
168#define FMT_FLAGS_M2M (1 << 1 | 1 << 2)
169#define FMT_HAS_ALPHA (1 << 3)
165}; 170};
166 171
167/** 172/**
@@ -283,6 +288,7 @@ struct fimc_frame {
283 struct fimc_addr paddr; 288 struct fimc_addr paddr;
284 struct fimc_dma_offset dma_offset; 289 struct fimc_dma_offset dma_offset;
285 struct fimc_fmt *fmt; 290 struct fimc_fmt *fmt;
291 u8 alpha;
286}; 292};
287 293
288/** 294/**
@@ -387,6 +393,7 @@ struct samsung_fimc_variant {
387 unsigned int has_cistatus2:1; 393 unsigned int has_cistatus2:1;
388 unsigned int has_mainscaler_ext:1; 394 unsigned int has_mainscaler_ext:1;
389 unsigned int has_cam_if:1; 395 unsigned int has_cam_if:1;
396 unsigned int has_alpha:1;
390 struct fimc_pix_limit *pix_limit; 397 struct fimc_pix_limit *pix_limit;
391 u16 min_inp_pixsize; 398 u16 min_inp_pixsize;
392 u16 min_out_pixsize; 399 u16 min_out_pixsize;
@@ -482,7 +489,8 @@ struct fimc_dev {
482 * @ctrl_handler: v4l2 controls handler 489 * @ctrl_handler: v4l2 controls handler
483 * @ctrl_rotate image rotation control 490 * @ctrl_rotate image rotation control
484 * @ctrl_hflip horizontal flip control 491 * @ctrl_hflip horizontal flip control
485 * @ctrl_vflip vartical flip control 492 * @ctrl_vflip vertical flip control
493 * @ctrl_alpha RGB alpha control
486 * @ctrls_rdy: true if the control handler is initialized 494 * @ctrls_rdy: true if the control handler is initialized
487 */ 495 */
488struct fimc_ctx { 496struct fimc_ctx {
@@ -509,6 +517,7 @@ struct fimc_ctx {
509 struct v4l2_ctrl *ctrl_rotate; 517 struct v4l2_ctrl *ctrl_rotate;
510 struct v4l2_ctrl *ctrl_hflip; 518 struct v4l2_ctrl *ctrl_hflip;
511 struct v4l2_ctrl *ctrl_vflip; 519 struct v4l2_ctrl *ctrl_vflip;
520 struct v4l2_ctrl *ctrl_alpha;
512 bool ctrls_rdy; 521 bool ctrls_rdy;
513}; 522};
514 523
@@ -578,6 +587,17 @@ static inline int tiled_fmt(struct fimc_fmt *fmt)
578 return fmt->fourcc == V4L2_PIX_FMT_NV12MT; 587 return fmt->fourcc == V4L2_PIX_FMT_NV12MT;
579} 588}
580 589
590/* Return the alpha component bit mask */
591static inline int fimc_get_alpha_mask(struct fimc_fmt *fmt)
592{
593 switch (fmt->color) {
594 case S5P_FIMC_RGB444: return 0x0f;
595 case S5P_FIMC_RGB555: return 0x01;
596 case S5P_FIMC_RGB888: return 0xff;
597 default: return 0;
598 };
599}
600
581static inline void fimc_hw_clear_irq(struct fimc_dev *dev) 601static inline void fimc_hw_clear_irq(struct fimc_dev *dev)
582{ 602{
583 u32 cfg = readl(dev->regs + S5P_CIGCTRL); 603 u32 cfg = readl(dev->regs + S5P_CIGCTRL);
@@ -674,6 +694,7 @@ void fimc_hw_set_prescaler(struct fimc_ctx *ctx);
674void fimc_hw_set_mainscaler(struct fimc_ctx *ctx); 694void fimc_hw_set_mainscaler(struct fimc_ctx *ctx);
675void fimc_hw_en_capture(struct fimc_ctx *ctx); 695void fimc_hw_en_capture(struct fimc_ctx *ctx);
676void fimc_hw_set_effect(struct fimc_ctx *ctx, bool active); 696void fimc_hw_set_effect(struct fimc_ctx *ctx, bool active);
697void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx);
677void fimc_hw_set_in_dma(struct fimc_ctx *ctx); 698void fimc_hw_set_in_dma(struct fimc_ctx *ctx);
678void fimc_hw_set_input_path(struct fimc_ctx *ctx); 699void fimc_hw_set_input_path(struct fimc_ctx *ctx);
679void fimc_hw_set_output_path(struct fimc_ctx *ctx); 700void fimc_hw_set_output_path(struct fimc_ctx *ctx);
@@ -695,6 +716,7 @@ int fimc_vidioc_enum_fmt_mplane(struct file *file, void *priv,
695int fimc_ctrls_create(struct fimc_ctx *ctx); 716int fimc_ctrls_create(struct fimc_ctx *ctx);
696void fimc_ctrls_delete(struct fimc_ctx *ctx); 717void fimc_ctrls_delete(struct fimc_ctx *ctx);
697void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active); 718void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active);
719void fimc_alpha_ctrl_update(struct fimc_ctx *ctx);
698int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); 720int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f);
699void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, 721void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
700 struct v4l2_pix_format_mplane *pix); 722 struct v4l2_pix_format_mplane *pix);