GNU Linux-libre 4.14.266-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / modes / interface / isp_types.h
1 #ifndef ISP2401
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 #else
16 /**
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
19
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
23
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
27 more details.
28 */
29 #endif
30
31 #ifndef _ISP_TYPES_H_
32 #define _ISP_TYPES_H_
33
34 /* Workaround: hivecc complains about "tag "sh_css_3a_output" already declared"
35    without this extra decl. */
36 struct ia_css_3a_output;
37
38 #if defined(__ISP)
39 struct isp_uds_config {
40         int      hive_dx;
41         int      hive_dy;
42         unsigned hive_woix;
43         unsigned hive_bpp; /* gdc_bits_per_pixel */
44         unsigned hive_bci;
45 };
46
47 struct s_isp_gdcac_config {
48         unsigned nbx;
49         unsigned nby;
50 };
51
52 /* output.hive.c request information */
53 typedef enum {
54   output_y_channel,
55   output_c_channel,
56   OUTPUT_NUM_CHANNELS
57 } output_channel_type;
58
59 typedef struct s_output_dma_info {
60   unsigned            cond;             /* Condition for transfer */
61   output_channel_type channel_type;
62   dma_channel         channel;
63   unsigned            width_a;
64   unsigned            width_b;
65   unsigned            stride;
66   unsigned            v_delta;          /* Offset for v address to do cropping */
67   char               *x_base;           /* X base address */
68 } output_dma_info_type;
69 #endif
70
71 /* Input stream formats, these correspond to the MIPI formats and the way
72  * the CSS receiver sends these to the input formatter.
73  * The bit depth of each pixel element is stored in the global variable
74  * isp_bits_per_pixel.
75  * NOTE: for rgb565, we set isp_bits_per_pixel to 565, for all other rgb
76  * formats it's the actual depth (4, for 444, 8 for 888 etc).
77  */
78 enum sh_stream_format {
79         sh_stream_format_yuv420_legacy,
80         sh_stream_format_yuv420,
81         sh_stream_format_yuv422,
82         sh_stream_format_rgb,
83         sh_stream_format_raw,
84         sh_stream_format_binary,        /* bytestream such as jpeg */
85 };
86
87 struct s_isp_frames {
88         /* global variables that are written to by either the SP or the host,
89            every ISP binary needs these. */
90         /* output frame */
91         char *xmem_base_addr_y;
92         char *xmem_base_addr_uv;
93         char *xmem_base_addr_u;
94         char *xmem_base_addr_v;
95         /* 2nd output frame */
96         char *xmem_base_addr_second_out_y;
97         char *xmem_base_addr_second_out_u;
98         char *xmem_base_addr_second_out_v;
99         /* input yuv frame */
100         char *xmem_base_addr_y_in;
101         char *xmem_base_addr_u_in;
102         char *xmem_base_addr_v_in;
103         /* input raw frame */
104         char *xmem_base_addr_raw;
105         /* output raw frame */
106         char *xmem_base_addr_raw_out;
107         /* viewfinder output (vf_veceven) */
108         char *xmem_base_addr_vfout_y;
109         char *xmem_base_addr_vfout_u;
110         char *xmem_base_addr_vfout_v;
111         /* overlay frame (for vf_pp) */
112         char *xmem_base_addr_overlay_y;
113         char *xmem_base_addr_overlay_u;
114         char *xmem_base_addr_overlay_v;
115         /* pre-gdc output frame (gdc input) */
116         char *xmem_base_addr_qplane_r;
117         char *xmem_base_addr_qplane_ratb;
118         char *xmem_base_addr_qplane_gr;
119         char *xmem_base_addr_qplane_gb;
120         char *xmem_base_addr_qplane_b;
121         char *xmem_base_addr_qplane_batr;
122         /* YUV as input, used by postisp binary */
123         char *xmem_base_addr_yuv_16_y;
124         char *xmem_base_addr_yuv_16_u;
125         char *xmem_base_addr_yuv_16_v;
126 };
127
128 #endif /* _ISP_TYPES_H_ */