GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_common / gdc_global.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __GDC_GLOBAL_H_INCLUDED__
16 #define __GDC_GLOBAL_H_INCLUDED__
17
18 #define IS_GDC_VERSION_2
19
20 #include <type_support.h>
21 #include "gdc_v2_defs.h"
22
23 /*
24  * Storage addresses for packed data transfer
25  */
26 #define GDC_PARAM_ICX_LEFT_ROUNDED_IDX            0
27 #define GDC_PARAM_OXDIM_FLOORED_IDX               1
28 #define GDC_PARAM_OXDIM_LAST_IDX                  2
29 #define GDC_PARAM_WOIX_LAST_IDX                   3
30 #define GDC_PARAM_IY_TOPLEFT_IDX                  4
31 #define GDC_PARAM_CHUNK_CNT_IDX                   5
32 /*#define GDC_PARAM_ELEMENTS_PER_XMEM_ADDR_IDX    6 */          /* Derived from bpp */
33 #define GDC_PARAM_BPP_IDX                         6
34 #define GDC_PARAM_BLOCK_HEIGHT_IDX                7
35 /*#define GDC_PARAM_DMA_CHANNEL_STRIDE_A_IDX      8*/           /* The DMA stride == the GDC buffer stride */
36 #define GDC_PARAM_WOIX_IDX                        8
37 #define GDC_PARAM_DMA_CHANNEL_STRIDE_B_IDX        9
38 #define GDC_PARAM_DMA_CHANNEL_WIDTH_A_IDX        10
39 #define GDC_PARAM_DMA_CHANNEL_WIDTH_B_IDX        11
40 #define GDC_PARAM_VECTORS_PER_LINE_IN_IDX        12
41 #define GDC_PARAM_VECTORS_PER_LINE_OUT_IDX       13
42 #define GDC_PARAM_VMEM_IN_DIMY_IDX               14
43 #define GDC_PARAM_COMMAND_IDX                    15
44 #define N_GDC_PARAM                              16
45
46 /* Because of the packed parameter transfer max(params) == max(fragments) */
47 #define N_GDC_FRAGMENTS         N_GDC_PARAM
48
49 /* The GDC is capable of higher internal precision than the parameter data structures */
50 #define HRT_GDC_COORD_SCALE_BITS        6
51 #define HRT_GDC_COORD_SCALE                     (1 << HRT_GDC_COORD_SCALE_BITS)
52
53 typedef enum {
54         GDC_CH0_ID = 0,
55         N_GDC_CHANNEL_ID
56 } gdc_channel_ID_t;
57
58 typedef enum {
59         gdc_8_bpp  = 8,
60         gdc_10_bpp = 10,
61         gdc_12_bpp = 12,
62         gdc_14_bpp = 14
63 } gdc_bits_per_pixel_t;
64
65 typedef struct gdc_scale_param_mem_s {
66         uint16_t  params[N_GDC_PARAM];
67         uint16_t  ipx_start_array[N_GDC_PARAM];
68         uint16_t  ibuf_offset[N_GDC_PARAM];
69         uint16_t  obuf_offset[N_GDC_PARAM];
70 } gdc_scale_param_mem_t;
71
72 typedef struct gdc_warp_param_mem_s {
73         uint32_t      origin_x;
74         uint32_t      origin_y;
75         uint32_t      in_addr_offset;
76         uint32_t      in_block_width;
77         uint32_t      in_block_height;
78         uint32_t      p0_x;
79         uint32_t      p0_y;
80         uint32_t      p1_x;
81         uint32_t      p1_y;
82         uint32_t      p2_x;
83         uint32_t      p2_y;
84         uint32_t      p3_x;
85         uint32_t      p3_y;
86         uint32_t      padding[3];
87 } gdc_warp_param_mem_t;
88
89
90 #endif /* __GDC_GLOBAL_H_INCLUDED__ */