GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / modes / interface / input_buf.isp.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 _INPUT_BUF_ISP_H_
32 #define _INPUT_BUF_ISP_H_
33
34 /* Temporary include, since IA_CSS_BINARY_MODE_COPY is still needed */
35 #include "sh_css_defs.h"
36 #include "isp_const.h" /* MAX_VECTORS_PER_INPUT_LINE */
37
38 #define INPUT_BUF_HEIGHT        2 /* double buffer */
39 #define INPUT_BUF_LINES         2
40
41 #ifndef ENABLE_CONTINUOUS
42 #define ENABLE_CONTINUOUS 0
43 #endif
44
45 /* In continuous mode, the input buffer must be a fixed size for all binaries
46  * and at a fixed address since it will be used by the SP. */
47 #define EXTRA_INPUT_VECTORS     2 /* For left padding */
48 #define MAX_VECTORS_PER_INPUT_LINE_CONT (CEIL_DIV(SH_CSS_MAX_SENSOR_WIDTH, ISP_NWAY) + EXTRA_INPUT_VECTORS)
49
50 /* The input buffer should be on a fixed address in vmem, for continuous capture */
51 #define INPUT_BUF_ADDR 0x0
52 #if (defined(__ISP) && (!defined(MODE) || MODE != IA_CSS_BINARY_MODE_COPY))
53
54 #if ENABLE_CONTINUOUS
55 typedef struct {
56   tmemvectoru  raw[INPUT_BUF_HEIGHT][INPUT_BUF_LINES][MAX_VECTORS_PER_INPUT_LINE_CONT]; /* 2 bayer lines */
57   /* Two more lines for SP raw copy efficiency */
58 #ifndef ENABLE_REDUCED_INPUT_BUFFER
59   /* "Workaround" solution in the case that space needed vmem exceeds the size of the vmem. */
60   /* Since in theory this buffer is not needed for IPU 2.2/2.3,  */
61   /* the workaround solution will not be needed (and the whole buffer) after the code refactoring. */
62   tmemvectoru _raw[INPUT_BUF_HEIGHT][INPUT_BUF_LINES][MAX_VECTORS_PER_INPUT_LINE_CONT]; /* 2 bayer lines */
63 #endif
64 } input_line_type;
65 #else /* ENABLE CONTINUOUS == 0 */
66 typedef struct {
67   tmemvectoru  raw[INPUT_BUF_HEIGHT][INPUT_BUF_LINES][MAX_VECTORS_PER_INPUT_LINE]; /* 2 bayer lines */
68 } input_line_type;
69 #endif /* ENABLE_CONTINUOUS */
70
71 #endif /*MODE*/
72
73 #endif /* _INPUT_BUF_ISP_H_ */