xref: /linux/drivers/staging/media/atomisp/pci/hive_isp_css_common/vamem_global.h (revision 3503d56cc7233ced602e38a4c13caa64f00ab2aa)
1 /* SPDX-License-Identifier: GPL-2.0 */
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 
16 #ifndef __VAMEM_GLOBAL_H_INCLUDED__
17 #define __VAMEM_GLOBAL_H_INCLUDED__
18 
19 #include <type_support.h>
20 
21 #define IS_VAMEM_VERSION_2
22 
23 /* (log) stepsize of linear interpolation */
24 #define VAMEM_INTERP_STEP_LOG2	4
25 #define VAMEM_INTERP_STEP		BIT(VAMEM_INTERP_STEP_LOG2)
26 /* (physical) size of the tables */
27 #define VAMEM_TABLE_UNIT_SIZE	((1 << (ISP_VAMEM_ADDRESS_BITS - VAMEM_INTERP_STEP_LOG2)) + 1)
28 /* (logical) size of the tables */
29 #define VAMEM_TABLE_UNIT_STEP	((VAMEM_TABLE_UNIT_SIZE - 1) << 1)
30 /* Number of tables */
31 #define VAMEM_TABLE_UNIT_COUNT	(ISP_VAMEM_DEPTH / VAMEM_TABLE_UNIT_STEP)
32 
33 typedef u16				vamem_data_t;
34 
35 #endif /* __VAMEM_GLOBAL_H_INCLUDED__ */
36