diff options
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include')
91 files changed, 9349 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/assert_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/assert_support.h new file mode 100644 index 0000000..92fb15d --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/assert_support.h @@ -0,0 +1,103 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ASSERT_SUPPORT_H_INCLUDED__ +#define __ASSERT_SUPPORT_H_INCLUDED__ + +#include "storage_class.h" + +/** + * The following macro can help to test the size of a struct at compile + * time rather than at run-time. It does not work for all compilers; see + * below. + * + * Depending on the value of 'condition', the following macro is expanded to: + * - condition==true: + * an expression containing an array declaration with negative size, + * usually resulting in a compilation error + * - condition==false: + * (void) 1; // C statement with no effect + * + * example: + * COMPILATION_ERROR_IF( sizeof(struct host_sp_queues) != SIZE_OF_HOST_SP_QUEUES_STRUCT); + * + * verify that the macro indeed triggers a compilation error with your compiler: + * COMPILATION_ERROR_IF( sizeof(struct host_sp_queues) != (sizeof(struct host_sp_queues)+1) ); + * + * Not all compilers will trigger an error with this macro; use a search engine to search for + * BUILD_BUG_ON to find other methods. + */ +#define COMPILATION_ERROR_IF(condition) ((void)sizeof(char[1 - 2*!!(condition)])) + +/* Compile time assertion */ +#ifndef CT_ASSERT +#define CT_ASSERT(cnd) ((void)sizeof(char[(cnd)?1:-1])) +#endif /* CT_ASSERT */ + +#ifdef NDEBUG + +#define assert(cnd) ((void)0) + +#else + +#if defined(_MSC_VER) +#ifdef _KERNEL_MODE +/* Windows kernel mode compilation */ +#include <wdm.h> +#define assert(cnd) ASSERT(cnd) +#else +/* Windows usermode compilation */ +#include <assert.h> +#endif + +#elif defined(__KERNEL__) +#include <linux/bug.h> + +/* TODO: it would be cleaner to use this: + * #define assert(cnd) BUG_ON(cnd) + * but that causes many compiler warnings (==errors) under Android + * because it seems that the BUG_ON() macro is not seen as a check by + * gcc like the BUG() macro is. */ +#define assert(cnd) \ + do { \ + if (!(cnd)) \ + BUG(); \ + } while (0) + +#elif defined(__FIST__) || defined(__GNUC__) + +/* enable assert for crun */ +#include "assert.h" + +#else /* default for unknown environments */ +#define assert(cnd) ((void)0) +#endif + +#endif /* NDEBUG */ + +#ifndef PIPE_GENERATION +/* Deprecated OP___assert, this is still used in ~1000 places + * in the code. This will be removed over time. + * The implemenation for the pipe generation tool is in see support.isp.h */ +#define OP___assert(cnd) assert(cnd) + +STORAGE_CLASS_INLINE void compile_time_assert (unsigned cond) +{ + /* Call undefined function if cond is false */ + extern void _compile_time_assert (void); + if (!cond) _compile_time_assert(); +} +#endif /* PIPE_GENERATION */ + +#endif /* __ASSERT_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bamem.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bamem.h new file mode 100644 index 0000000..d71e08f --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bamem.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __BAMEM_H_INCLUDED__ +#define __BAMEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the BAMEM device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "bamem_local.h" + +#ifndef __INLINE_BAMEM__ +#define STORAGE_CLASS_BAMEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_BAMEM_C +#include "bamem_public.h" +#else /* __INLINE_BAMEM__ */ +#define STORAGE_CLASS_BAMEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_BAMEM_C STORAGE_CLASS_INLINE +#include "bamem_private.h" +#endif /* __INLINE_BAMEM__ */ + +#endif /* __BAMEM_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bbb_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bbb_config.h new file mode 100644 index 0000000..18bc5ef --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bbb_config.h @@ -0,0 +1,27 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __BBB_CONFIG_H_INCLUDED__ +#define __BBB_CONFIG_H_INCLUDED__ +/* This header contains BBB defines common to ISP and host */ + +#define BFA_MAX_KWAY (49) +#define BFA_RW_LUT_SIZE (7) + +#define SAD3x3_IN_SHIFT (2) /* input right shift value for SAD3x3 */ +#define SAD3x3_OUT_SHIFT (2) /* output right shift value for SAD3x3 */ + +/* XCU and BMA related defines shared between host and ISP + * also need to be moved here */ +#endif /* __BBB_CONFIG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bitop_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bitop_support.h new file mode 100644 index 0000000..1b271c3 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/bitop_support.h @@ -0,0 +1,25 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __BITOP_SUPPORT_H_INCLUDED__ +#define __BITOP_SUPPORT_H_INCLUDED__ + +#define bitop_setbit(a, b) ((a) |= (1UL << (b))) + +#define bitop_getbit(a, b) (((a) & (1UL << (b))) != 0) + +#define bitop_clearbit(a, b) ((a) &= ~(1UL << (b))) + +#endif /* __BITOP_SUPPORT_H_INCLUDED__ */ + diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/cpu_mem_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/cpu_mem_support.h new file mode 100644 index 0000000..6d014fa --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/cpu_mem_support.h @@ -0,0 +1,59 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CPU_MEM_SUPPORT_H_INCLUDED__ +#define __CPU_MEM_SUPPORT_H_INCLUDED__ + +#if defined (__KERNEL__) +#include <linux/string.h> /* memset */ +#else +#include <string.h> /* memset */ +#endif + +#include "sh_css_internal.h" /* sh_css_malloc and sh_css_free */ + +static inline void* +ia_css_cpu_mem_alloc(unsigned int size) +{ + return sh_css_malloc(size); +} + +static inline void* +ia_css_cpu_mem_copy(void* dst, const void* src, unsigned int size) +{ + if(!src || !dst) + return NULL; + + return memcpy(dst, src, size); +} + +static inline void* +ia_css_cpu_mem_set_zero(void* dst, unsigned int size) +{ + if(!dst) + return NULL; + + return memset(dst, 0, size); +} + +static inline void +ia_css_cpu_mem_free(void* ptr) +{ + if(!ptr) + return; + + sh_css_free(ptr); +} + +#endif /* __CPU_MEM_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/csi_rx.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/csi_rx.h new file mode 100644 index 0000000..0398f58 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/csi_rx.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSI_RX_H_INCLUDED__ +#define __CSI_RX_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & + * inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "csi_rx_local.h" + +#ifndef __INLINE_CSI_RX__ +#define STORAGE_CLASS_CSI_RX_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_CSI_RX_C +#include "csi_rx_public.h" +#else /* __INLINE_CSI_RX__ */ +#define STORAGE_CLASS_CSI_RX_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_CSI_RX_C STORAGE_CLASS_INLINE +#include "csi_rx_private.h" +#endif /* __INLINE_CSI_RX__ */ + +#endif /* __CSI_RX_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/debug.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/debug.h new file mode 100644 index 0000000..7d80117 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/debug.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __DEBUG_H_INCLUDED__ +#define __DEBUG_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the DMA device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "debug_local.h" + +#ifndef __INLINE_DEBUG__ +#define STORAGE_CLASS_DEBUG_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_DEBUG_C +#include "debug_public.h" +#else /* __INLINE_DEBUG__ */ +#define STORAGE_CLASS_DEBUG_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_DEBUG_C STORAGE_CLASS_INLINE +#include "debug_private.h" +#endif /* __INLINE_DEBUG__ */ + +#endif /* __DEBUG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/device_access/device_access.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/device_access/device_access.h new file mode 100644 index 0000000..834e7c3 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/device_access/device_access.h @@ -0,0 +1,194 @@ +#ifndef ISP2401 +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ +#else +/** +Support for Intel Camera Imaging ISP subsystem. +Copyright (c) 2010 - 2015, Intel Corporation. + +This program is free software; you can redistribute it and/or modify it +under the terms and conditions of the GNU General Public License, +version 2, as published by the Free Software Foundation. + +This program is distributed in the hope it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. +*/ +#endif + +#ifndef __DEVICE_ACCESS_H_INCLUDED__ +#define __DEVICE_ACCESS_H_INCLUDED__ + +/*! + * \brief + * Define the public interface for physical system + * access functions to SRAM and registers. Access + * types are limited to those defined in <stdint.h> + * All accesses are aligned + * + * The address representation is private to the system + * and represented as/stored in "hrt_address". + * + * The system global address can differ by an offset; + * The device base address. This offset must be added + * by the implementation of the access function + * + * "store" is a transfer to the device + * "load" is a transfer from the device + */ + +#include <type_support.h> + +/* + * User provided file that defines the system address types: + * - hrt_address a type that can hold the (sub)system address range + */ +#include "system_types.h" +/* + * We cannot assume that the global system address size is the size of + * a pointer because a (say) 64-bit host can be simulated in a 32-bit + * environment. Only if the host environment is modelled as on the target + * we could use a pointer. Even then, prototyping may need to be done + * before the target environment is available. AS we cannot wait for that + * we are stuck with integer addresses + */ + +/*typedef char *sys_address;*/ +typedef hrt_address sys_address; + +/*! Set the (sub)system base address + + \param base_addr[in] The offset on which the (sub)system is located + in the global address map + + \return none, + */ +extern void device_set_base_address( + const sys_address base_addr); + + +/*! Get the (sub)system base address + + \return base_address, + */ +extern sys_address device_get_base_address(void); + +/*! Read an 8-bit value from a device register or memory in the device + + \param addr[in] Local address + + \return device[addr] + */ +extern uint8_t ia_css_device_load_uint8( + const hrt_address addr); + +/*! Read a 16-bit value from a device register or memory in the device + + \param addr[in] Local address + + \return device[addr] + */ +extern uint16_t ia_css_device_load_uint16( + const hrt_address addr); + +/*! Read a 32-bit value from a device register or memory in the device + + \param addr[in] Local address + + \return device[addr] + */ +extern uint32_t ia_css_device_load_uint32( + const hrt_address addr); + +/*! Read a 64-bit value from a device register or memory in the device + + \param addr[in] Local address + + \return device[addr] + */ +extern uint64_t ia_css_device_load_uint64( + const hrt_address addr); + +/*! Write an 8-bit value to a device register or memory in the device + + \param addr[in] Local address + \param data[in] value + + \return none, device[addr] = value + */ +extern void ia_css_device_store_uint8( + const hrt_address addr, + const uint8_t data); + +/*! Write a 16-bit value to a device register or memory in the device + + \param addr[in] Local address + \param data[in] value + + \return none, device[addr] = value + */ +extern void ia_css_device_store_uint16( + const hrt_address addr, + const uint16_t data); + +/*! Write a 32-bit value to a device register or memory in the device + + \param addr[in] Local address + \param data[in] value + + \return none, device[addr] = value + */ +extern void ia_css_device_store_uint32( + const hrt_address addr, + const uint32_t data); + +/*! Write a 64-bit value to a device register or memory in the device + + \param addr[in] Local address + \param data[in] value + + \return none, device[addr] = value + */ +extern void ia_css_device_store_uint64( + const hrt_address addr, + const uint64_t data); + +/*! Read an array of bytes from device registers or memory in the device + + \param addr[in] Local address + \param data[out] pointer to the destination array + \param size[in] number of bytes to read + + \return none + */ +extern void ia_css_device_load( + const hrt_address addr, + void *data, + const size_t size); + +/*! Write an array of bytes to device registers or memory in the device + + \param addr[in] Local address + \param data[in] pointer to the source array + \param size[in] number of bytes to write + + \return none + */ +extern void ia_css_device_store( + const hrt_address addr, + const void *data, + const size_t size); + +#endif /* __DEVICE_ACCESS_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/dma.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/dma.h new file mode 100644 index 0000000..b266191 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/dma.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __DMA_H_INCLUDED__ +#define __DMA_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the DMA device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "dma_local.h" + +#ifndef __INLINE_DMA__ +#define STORAGE_CLASS_DMA_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_DMA_C +#include "dma_public.h" +#else /* __INLINE_DMA__ */ +#define STORAGE_CLASS_DMA_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_DMA_C STORAGE_CLASS_INLINE +#include "dma_private.h" +#endif /* __INLINE_DMA__ */ + +#endif /* __DMA_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/error_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/error_support.h new file mode 100644 index 0000000..6e5e5dd --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/error_support.h @@ -0,0 +1,70 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ERROR_SUPPORT_H_INCLUDED__ +#define __ERROR_SUPPORT_H_INCLUDED__ + +#if defined(_MSC_VER) +#include <errno.h> +/* + * Put here everything _MSC_VER specific not covered in + * "errno.h" + */ +#define EINVAL 22 +#define EBADE 52 +#define ENODATA 61 +#define ENOTCONN 107 +#define ENOTSUP 252 +#define ENOBUFS 233 + + +#elif defined(__KERNEL__) +#include <linux/errno.h> +/* + * Put here everything __KERNEL__ specific not covered in + * "errno.h" + */ +#define ENOTSUP 252 + +#elif defined(__GNUC__) +#include <errno.h> +/* + * Put here everything __GNUC__ specific not covered in + * "errno.h" + */ + +#else /* default is for the FIST environment */ +#include <errno.h> +/* + * Put here everything FIST specific not covered in + * "errno.h" + */ + +#endif + +#define verifexit(cond,error_tag) \ +do { \ + if (!(cond)){ \ + goto EXIT; \ + } \ +} while(0) + +#define verifjmpexit(cond) \ +do { \ + if (!(cond)){ \ + goto EXIT; \ + } \ +} while(0) + +#endif /* __ERROR_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/event_fifo.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/event_fifo.h new file mode 100644 index 0000000..78827c5 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/event_fifo.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __EVENT_FIFO_H +#define __EVENT_FIFO_H + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the IRQ device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "event_fifo_local.h" + +#ifndef __INLINE_EVENT__ +#define STORAGE_CLASS_EVENT_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_EVENT_C +#include "event_fifo_public.h" +#else /* __INLINE_EVENT__ */ +#define STORAGE_CLASS_EVENT_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_EVENT_C STORAGE_CLASS_INLINE +#include "event_fifo_private.h" +#endif /* __INLINE_EVENT__ */ + +#endif /* __EVENT_FIFO_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/fifo_monitor.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/fifo_monitor.h new file mode 100644 index 0000000..3bdd260 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/fifo_monitor.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __FIFO_MONITOR_H_INCLUDED__ +#define __FIFO_MONITOR_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "fifo_monitor_local.h" + +#ifndef __INLINE_FIFO_MONITOR__ +#define STORAGE_CLASS_FIFO_MONITOR_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_FIFO_MONITOR_C +#include "fifo_monitor_public.h" +#else /* __INLINE_FIFO_MONITOR__ */ +#define STORAGE_CLASS_FIFO_MONITOR_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_FIFO_MONITOR_C STORAGE_CLASS_INLINE +#include "fifo_monitor_private.h" +#endif /* __INLINE_FIFO_MONITOR__ */ + +#endif /* __FIFO_MONITOR_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gdc_device.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gdc_device.h new file mode 100644 index 0000000..016132b --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gdc_device.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GDC_DEVICE_H_INCLUDED__ +#define __GDC_DEVICE_H_INCLUDED__ + +/* The file gdc.h already exists */ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the GDC device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "gdc_local.h" + +#ifndef __INLINE_GDC__ +#define STORAGE_CLASS_GDC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_GDC_C +#include "gdc_public.h" +#else /* __INLINE_GDC__ */ +#define STORAGE_CLASS_GDC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_GDC_C STORAGE_CLASS_INLINE +#include "gdc_private.h" +#endif /* __INLINE_GDC__ */ + +#endif /* __GDC_DEVICE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_device.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_device.h new file mode 100644 index 0000000..766d253 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_device.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GP_DEVICE_H_INCLUDED__ +#define __GP_DEVICE_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "gp_device_local.h" + +#ifndef __INLINE_GP_DEVICE__ +#define STORAGE_CLASS_GP_DEVICE_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_GP_DEVICE_C +#include "gp_device_public.h" +#else /* __INLINE_GP_DEVICE__ */ +#define STORAGE_CLASS_GP_DEVICE_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_GP_DEVICE_C STORAGE_CLASS_INLINE +#include "gp_device_private.h" +#endif /* __INLINE_GP_DEVICE__ */ + +#endif /* __GP_DEVICE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_timer.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_timer.h new file mode 100644 index 0000000..ca70f56 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gp_timer.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GP_TIMER_H_INCLUDED__ +#define __GP_TIMER_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" /*GP_TIMER_BASE address */ +#include "gp_timer_local.h" /*GP_TIMER register offsets */ + +#ifndef __INLINE_GP_TIMER__ +#define STORAGE_CLASS_GP_TIMER_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_GP_TIMER_C +#include "gp_timer_public.h" /* functions*/ +#else /* __INLINE_GP_TIMER__ */ +#define STORAGE_CLASS_GP_TIMER_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_GP_TIMER_C STORAGE_CLASS_INLINE +#include "gp_timer_private.h" /* inline functions*/ +#endif /* __INLINE_GP_TIMER__ */ + +#endif /* __GP_TIMER_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gpio.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gpio.h new file mode 100644 index 0000000..dec21bc --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/gpio.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GPIO_H_INCLUDED__ +#define __GPIO_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "gpio_local.h" + +#ifndef __INLINE_GPIO__ +#define STORAGE_CLASS_GPIO_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_GPIO_C +#include "gpio_public.h" +#else /* __INLINE_GPIO__ */ +#define STORAGE_CLASS_GPIO_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_GPIO_C STORAGE_CLASS_INLINE +#include "gpio_private.h" +#endif /* __INLINE_GPIO__ */ + +#endif /* __GPIO_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/hmem.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/hmem.h new file mode 100644 index 0000000..671dd5b5 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/hmem.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __HMEM_H_INCLUDED__ +#define __HMEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the HMEM device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "hmem_local.h" + +#ifndef __INLINE_HMEM__ +#define STORAGE_CLASS_HMEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_HMEM_C +#include "hmem_public.h" +#else /* __INLINE_HMEM__ */ +#define STORAGE_CLASS_HMEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_HMEM_C STORAGE_CLASS_INLINE +#include "hmem_private.h" +#endif /* __INLINE_HMEM__ */ + +#endif /* __HMEM_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/csi_rx_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/csi_rx_public.h new file mode 100644 index 0000000..3962409 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/csi_rx_public.h @@ -0,0 +1,135 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSI_RX_PUBLIC_H_INCLUDED__ +#define __CSI_RX_PUBLIC_H_INCLUDED__ + +#ifdef USE_INPUT_SYSTEM_VERSION_2401 +/***************************************************** + * + * Native command interface (NCI). + * + *****************************************************/ +/** + * @brief Get the csi rx frontend state. + * Get the state of the csi rx frontend regiester-set. + * + * @param[in] id The global unique ID of the csi rx fe controller. + * @param[out] state Point to the register-state. + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_fe_ctrl_get_state( + const csi_rx_frontend_ID_t ID, + csi_rx_fe_ctrl_state_t *state); +/** + * @brief Dump the csi rx frontend state. + * Dump the state of the csi rx frontend regiester-set. + * + * @param[in] id The global unique ID of the csi rx fe controller. + * @param[in] state Point to the register-state. + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_fe_ctrl_dump_state( + const csi_rx_frontend_ID_t ID, + csi_rx_fe_ctrl_state_t *state); +/** + * @brief Get the state of the csi rx fe dlane. + * Get the state of the register set per dlane process. + * + * @param[in] id The global unique ID of the input-buffer controller. + * @param[in] lane The lane ID. + * @param[out] state Point to the dlane state. + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_fe_ctrl_get_dlane_state( + const csi_rx_frontend_ID_t ID, + const uint32_t lane, + csi_rx_fe_ctrl_lane_t *dlane_state); +/** + * @brief Get the csi rx backend state. + * Get the state of the csi rx backend regiester-set. + * + * @param[in] id The global unique ID of the csi rx be controller. + * @param[out] state Point to the register-state. + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_be_ctrl_get_state( + const csi_rx_backend_ID_t ID, + csi_rx_be_ctrl_state_t *state); +/** + * @brief Dump the csi rx backend state. + * Dump the state of the csi rx backend regiester-set. + * + * @param[in] id The global unique ID of the csi rx be controller. + * @param[in] state Point to the register-state. + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_be_ctrl_dump_state( + const csi_rx_backend_ID_t ID, + csi_rx_be_ctrl_state_t *state); +/** end of NCI */ + +/***************************************************** + * + * Device level interface (DLI). + * + *****************************************************/ +/** + * @brief Load the register value. + * Load the value of the register of the csi rx fe. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * + * @return the value of the register. + */ +STORAGE_CLASS_CSI_RX_H hrt_data csi_rx_fe_ctrl_reg_load( + const csi_rx_frontend_ID_t ID, + const hrt_address reg); +/** + * @brief Store a value to the register. + * Store a value to the registe of the csi rx fe. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * @param[in] value The value to be stored. + * + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_fe_ctrl_reg_store( + const csi_rx_frontend_ID_t ID, + const hrt_address reg, + const hrt_data value); +/** + * @brief Load the register value. + * Load the value of the register of the csirx be. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * + * @return the value of the register. + */ +STORAGE_CLASS_CSI_RX_H hrt_data csi_rx_be_ctrl_reg_load( + const csi_rx_backend_ID_t ID, + const hrt_address reg); +/** + * @brief Store a value to the register. + * Store a value to the registe of the csi rx be. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * @param[in] value The value to be stored. + * + */ +STORAGE_CLASS_CSI_RX_H void csi_rx_be_ctrl_reg_store( + const csi_rx_backend_ID_t ID, + const hrt_address reg, + const hrt_data value); +/** end of DLI */ +#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ +#endif /* __CSI_RX_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/debug_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/debug_public.h new file mode 100644 index 0000000..90b4ba7 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/debug_public.h @@ -0,0 +1,99 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __DEBUG_PUBLIC_H_INCLUDED__ +#define __DEBUG_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#include "system_types.h" + +/*! brief + * + * Simple queuing trace buffer for debug data + * instantiatable in SP DMEM + * + * The buffer has a remote and and a local store + * which contain duplicate data (when in sync). + * The buffers are automatically synched when the + * user dequeues, or manualy using the synch function + * + * An alternative (storage efficient) implementation + * could manage the buffers to contain unique data + * + * The buffer empty status is computed from local + * state which does not reflect the presence of data + * in the remote buffer (unless the alternative + * implementation is followed) + */ + +typedef struct debug_data_s debug_data_t; +typedef struct debug_data_ddr_s debug_data_ddr_t; + +extern debug_data_t *debug_data_ptr; +extern hrt_address debug_buffer_address; +extern hrt_vaddress debug_buffer_ddr_address; + +/*! Check the empty state of the local debug data buffer + + \return isEmpty(buffer) + */ +STORAGE_CLASS_DEBUG_H bool is_debug_buffer_empty(void); + +/*! Dequeue a token from the debug data buffer + + \return isEmpty(buffer)?0:buffer[head] + */ +STORAGE_CLASS_DEBUG_H hrt_data debug_dequeue(void); + +/*! Synchronise the remote buffer to the local buffer + + \return none + */ +STORAGE_CLASS_DEBUG_H void debug_synch_queue(void); + +/*! Synchronise the remote buffer to the local buffer + + \return none + */ +STORAGE_CLASS_DEBUG_H void debug_synch_queue_isp(void); + + +/*! Synchronise the remote buffer to the local buffer + + \return none + */ +STORAGE_CLASS_DEBUG_H void debug_synch_queue_ddr(void); + +/*! Set the offset/address of the (remote) debug buffer + + \return none + */ +extern void debug_buffer_init( + const hrt_address addr); + +/*! Set the offset/address of the (remote) debug buffer + + \return none + */ +extern void debug_buffer_ddr_init( + const hrt_vaddress addr); + +/*! Set the (remote) operating mode of the debug buffer + + \return none + */ +extern void debug_buffer_setmode( + const debug_buf_mode_t mode); + +#endif /* __DEBUG_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/dma_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/dma_public.h new file mode 100644 index 0000000..1d5e38f --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/dma_public.h @@ -0,0 +1,73 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __DMA_PUBLIC_H_INCLUDED__ +#define __DMA_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +typedef struct dma_state_s dma_state_t; + +/*! Read the control registers of DMA[ID] + + \param ID[in] DMA identifier + \param state[out] input formatter state structure + + \return none, state = DMA[ID].state + */ +extern void dma_get_state( + const dma_ID_t ID, + dma_state_t *state); + +/*! Write to a control register of DMA[ID] + + \param ID[in] DMA identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, DMA[ID].ctrl[reg] = value + */ +STORAGE_CLASS_DMA_H void dma_reg_store( + const dma_ID_t ID, + const unsigned int reg, + const hrt_data value); + +/*! Read from a control register of DMA[ID] + + \param ID[in] DMA identifier + \param reg[in] register index + \param value[in] The data to be written + + \return DMA[ID].ctrl[reg] + */ +STORAGE_CLASS_DMA_H hrt_data dma_reg_load( + const dma_ID_t ID, + const unsigned int reg); + + +/*! Set maximum burst size of DMA[ID] + + \param ID[in] DMA identifier + \param conn[in] Connection to set max burst size for + \param max_burst_size[in] Maximum burst size in words + + \return none +*/ +void +dma_set_max_burst_size( + dma_ID_t ID, + dma_connection conn, + uint32_t max_burst_size); + +#endif /* __DMA_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/event_fifo_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/event_fifo_public.h new file mode 100644 index 0000000..d95bc70 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/event_fifo_public.h @@ -0,0 +1,79 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __EVENT_FIFO_PUBLIC_H +#define __EVENT_FIFO_PUBLIC_H + +#include <type_support.h> +#include "system_types.h" + +/*! Blocking read from an event source EVENT[ID] + + \param ID[in] EVENT identifier + + \return none, dequeue(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H void event_wait_for( + const event_ID_t ID); + +/*! Conditional blocking wait for an event source EVENT[ID] + + \param ID[in] EVENT identifier + \param cnd[in] predicate + + \return none, if(cnd) dequeue(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H void cnd_event_wait_for( + const event_ID_t ID, + const bool cnd); + +/*! Blocking read from an event source EVENT[ID] + + \param ID[in] EVENT identifier + + \return dequeue(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H hrt_data event_receive_token( + const event_ID_t ID); + +/*! Blocking write to an event sink EVENT[ID] + + \param ID[in] EVENT identifier + \param token[in] token to be written on the event + + \return none, enqueue(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H void event_send_token( + const event_ID_t ID, + const hrt_data token); + +/*! Query an event source EVENT[ID] + + \param ID[in] EVENT identifier + + \return !isempty(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H bool is_event_pending( + const event_ID_t ID); + +/*! Query an event sink EVENT[ID] + + \param ID[in] EVENT identifier + + \return !isfull(event_queue[ID]) + */ +STORAGE_CLASS_EVENT_H bool can_event_send_token( + const event_ID_t ID); + +#endif /* __EVENT_FIFO_PUBLIC_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/fifo_monitor_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/fifo_monitor_public.h new file mode 100644 index 0000000..329f5d5 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/fifo_monitor_public.h @@ -0,0 +1,110 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __FIFO_MONITOR_PUBLIC_H_INCLUDED__ +#define __FIFO_MONITOR_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +typedef struct fifo_channel_state_s fifo_channel_state_t; +typedef struct fifo_switch_state_s fifo_switch_state_t; +typedef struct fifo_monitor_state_s fifo_monitor_state_t; + +/*! Set a fifo switch multiplex + + \param ID[in] FIFO_MONITOR identifier + \param switch_id[in] fifo switch identifier + \param sel[in] fifo switch selector + + \return none, fifo_switch[switch_id].sel = sel + */ +STORAGE_CLASS_FIFO_MONITOR_H void fifo_switch_set( + const fifo_monitor_ID_t ID, + const fifo_switch_t switch_id, + const hrt_data sel); + +/*! Get a fifo switch multiplex + + \param ID[in] FIFO_MONITOR identifier + \param switch_id[in] fifo switch identifier + + \return fifo_switch[switch_id].sel + */ +STORAGE_CLASS_FIFO_MONITOR_H hrt_data fifo_switch_get( + const fifo_monitor_ID_t ID, + const fifo_switch_t switch_id); + +/*! Read the state of FIFO_MONITOR[ID] + + \param ID[in] FIFO_MONITOR identifier + \param state[out] fifo monitor state structure + + \return none, state = FIFO_MONITOR[ID].state + */ +extern void fifo_monitor_get_state( + const fifo_monitor_ID_t ID, + fifo_monitor_state_t *state); + +/*! Read the state of a fifo channel + + \param ID[in] FIFO_MONITOR identifier + \param channel_id[in] fifo channel identifier + \param state[out] fifo channel state structure + + \return none, state = fifo_channel[channel_id].state + */ +extern void fifo_channel_get_state( + const fifo_monitor_ID_t ID, + const fifo_channel_t channel_id, + fifo_channel_state_t *state); + +/*! Read the state of a fifo switch + + \param ID[in] FIFO_MONITOR identifier + \param switch_id[in] fifo switch identifier + \param state[out] fifo switch state structure + + \return none, state = fifo_switch[switch_id].state + */ +extern void fifo_switch_get_state( + const fifo_monitor_ID_t ID, + const fifo_switch_t switch_id, + fifo_switch_state_t *state); + +/*! Write to a control register of FIFO_MONITOR[ID] + + \param ID[in] FIFO_MONITOR identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, FIFO_MONITOR[ID].ctrl[reg] = value + */ +STORAGE_CLASS_FIFO_MONITOR_H void fifo_monitor_reg_store( + const fifo_monitor_ID_t ID, + const unsigned int reg, + const hrt_data value); + +/*! Read from a control register of FIFO_MONITOR[ID] + + \param ID[in] FIFO_MONITOR identifier + \param reg[in] register index + \param value[in] The data to be written + + \return FIFO_MONITOR[ID].ctrl[reg] + */ +STORAGE_CLASS_FIFO_MONITOR_H hrt_data fifo_monitor_reg_load( + const fifo_monitor_ID_t ID, + const unsigned int reg); + +#endif /* __FIFO_MONITOR_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gdc_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gdc_public.h new file mode 100644 index 0000000..d27f87a --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gdc_public.h @@ -0,0 +1,59 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GDC_PUBLIC_H_INCLUDED__ +#define __GDC_PUBLIC_H_INCLUDED__ + +/*! Write the bicubic interpolation table of GDC[ID] + + \param ID[in] GDC identifier + \param data[in] The data matrix to be written + + \pre + - data must point to a matrix[4][HRT_GDC_N] + + \implementation dependent + - The value of "HRT_GDC_N" is device specific + - The LUT should not be partially written + - The LUT format is a quadri-phase interpolation + table. The layout is device specific + - The range of the values data[n][m] is device + specific + + \return none, GDC[ID].lut[0...3][0...HRT_GDC_N-1] = data + */ +STORAGE_CLASS_EXTERN void gdc_lut_store( + const gdc_ID_t ID, + const int data[4][HRT_GDC_N]); + +/*! Convert the bicubic interpolation table of GDC[ID] to the ISP-specific format + + \param ID[in] GDC identifier + \param in_lut[in] The data matrix to be converted + \param out_lut[out] The data matrix as the output of conversion + */ +STORAGE_CLASS_EXTERN void gdc_lut_convert_to_isp_format( + const int in_lut[4][HRT_GDC_N], + int out_lut[4][HRT_GDC_N]); + +/*! Return the integer representation of 1.0 of GDC[ID] + + \param ID[in] GDC identifier + + \return unity + */ +STORAGE_CLASS_EXTERN int gdc_get_unity( + const gdc_ID_t ID); + +#endif /* __GDC_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_device_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_device_public.h new file mode 100644 index 0000000..acbce0f --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_device_public.h @@ -0,0 +1,58 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GP_DEVICE_PUBLIC_H_INCLUDED__ +#define __GP_DEVICE_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +typedef struct gp_device_state_s gp_device_state_t; + +/*! Read the state of GP_DEVICE[ID] + + \param ID[in] GP_DEVICE identifier + \param state[out] gp device state structure + + \return none, state = GP_DEVICE[ID].state + */ +extern void gp_device_get_state( + const gp_device_ID_t ID, + gp_device_state_t *state); + +/*! Write to a control register of GP_DEVICE[ID] + + \param ID[in] GP_DEVICE identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return none, GP_DEVICE[ID].ctrl[reg] = value + */ +STORAGE_CLASS_GP_DEVICE_H void gp_device_reg_store( + const gp_device_ID_t ID, + const unsigned int reg_addr, + const hrt_data value); + +/*! Read from a control register of GP_DEVICE[ID] + + \param ID[in] GP_DEVICE identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return GP_DEVICE[ID].ctrl[reg] + */ +STORAGE_CLASS_GP_DEVICE_H hrt_data gp_device_reg_load( + const gp_device_ID_t ID, + const hrt_address reg_addr); + +#endif /* __GP_DEVICE_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_timer_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_timer_public.h new file mode 100644 index 0000000..276e2fa --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gp_timer_public.h @@ -0,0 +1,34 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GP_TIMER_PUBLIC_H_INCLUDED__ +#define __GP_TIMER_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +/*! initialize mentioned timer +param ID timer_id +*/ +extern void +gp_timer_init(gp_timer_ID_t ID); + + +/*! read timer value for (platform selected)selected timer. +param ID timer_id + \return uint32_t 32 bit timer value +*/ +extern uint32_t +gp_timer_read(gp_timer_ID_t ID); + +#endif /* __GP_TIMER_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gpio_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gpio_public.h new file mode 100644 index 0000000..82eaa0d --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/gpio_public.h @@ -0,0 +1,45 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __GPIO_PUBLIC_H_INCLUDED__ +#define __GPIO_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +/*! Write to a control register of GPIO[ID] + + \param ID[in] GPIO identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return none, GPIO[ID].ctrl[reg] = value + */ +STORAGE_CLASS_GPIO_H void gpio_reg_store( + const gpio_ID_t ID, + const unsigned int reg_addr, + const hrt_data value); + +/*! Read from a control register of GPIO[ID] + + \param ID[in] GPIO identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return GPIO[ID].ctrl[reg] + */ +STORAGE_CLASS_GPIO_H hrt_data gpio_reg_load( + const gpio_ID_t ID, + const unsigned int reg_addr); + +#endif /* __GPIO_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/hmem_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/hmem_public.h new file mode 100644 index 0000000..9b8e7c9 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/hmem_public.h @@ -0,0 +1,32 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __HMEM_PUBLIC_H_INCLUDED__ +#define __HMEM_PUBLIC_H_INCLUDED__ + +#include <stddef.h> /* size_t */ + +/*! Return the size of HMEM[ID] + + \param ID[in] HMEM identifier + + \Note: The size is the byte size of the area it occupies + in the address map. I.e. disregarding internal structure + + \return sizeof(HMEM[ID]) + */ +STORAGE_CLASS_HMEM_H size_t sizeof_hmem( + const hmem_ID_t ID); + +#endif /* __HMEM_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ibuf_ctrl_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ibuf_ctrl_public.h new file mode 100644 index 0000000..1ac0e64 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ibuf_ctrl_public.h @@ -0,0 +1,93 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __IBUF_CTRL_PUBLIC_H_INCLUDED__ +#define __IBUF_CTRL_PUBLIC_H_INCLUDED__ + +#ifdef USE_INPUT_SYSTEM_VERSION_2401 +/***************************************************** + * + * Native command interface (NCI). + * + *****************************************************/ +/** + * @brief Get the ibuf-controller state. + * Get the state of the ibuf-controller regiester-set. + * + * @param[in] id The global unique ID of the input-buffer controller. + * @param[out] state Point to the register-state. + */ +STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_get_state( + const ibuf_ctrl_ID_t ID, + ibuf_ctrl_state_t *state); + +/** + * @brief Get the state of the ibuf-controller process. + * Get the state of the register set per buf-controller process. + * + * @param[in] id The global unique ID of the input-buffer controller. + * @param[in] proc_id The process ID. + * @param[out] state Point to the process state. + */ +STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_get_proc_state( + const ibuf_ctrl_ID_t ID, + const uint32_t proc_id, + ibuf_ctrl_proc_state_t *state); +/** + * @brief Dump the ibuf-controller state. + * Dump the state of the ibuf-controller regiester-set. + * + * @param[in] id The global unique ID of the input-buffer controller. + * @param[in] state Pointer to the register-state. + */ +STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_dump_state( + const ibuf_ctrl_ID_t ID, + ibuf_ctrl_state_t *state); +/** end of NCI */ + +/***************************************************** + * + * Device level interface (DLI). + * + *****************************************************/ +/** + * @brief Load the register value. + * Load the value of the register of the ibuf-controller. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * + * @return the value of the register. + */ +STORAGE_CLASS_IBUF_CTRL_H hrt_data ibuf_ctrl_reg_load( + const ibuf_ctrl_ID_t ID, + const hrt_address reg); + +/** + * @brief Store a value to the register. + * Store a value to the registe of the ibuf-controller. + * + * @param[in] ID The global unique ID for the ibuf-controller instance. + * @param[in] reg The offet address of the register. + * @param[in] value The value to be stored. + * + */ +STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_reg_store( + const ibuf_ctrl_ID_t ID, + const hrt_address reg, + const hrt_data value); +/** end of DLI */ + +#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ +#endif /* __IBUF_CTRL_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_formatter_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_formatter_public.h new file mode 100644 index 0000000..2db7089 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_formatter_public.h @@ -0,0 +1,115 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ +#define __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#include "system_types.h" + +/*! Reset INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + + \return none, reset(INPUT_FORMATTER[ID]) + */ +extern void input_formatter_rst( + const input_formatter_ID_t ID); + +/*! Set the blocking mode of INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param enable[in] blocking enable flag + + \use + - In HW, the capture unit will deliver an infinite stream of frames, + the input formatter will synchronise on the first SOF. In simulation + there are only a fixed number of frames, presented only once. By + enabling blocking the inputformatter will wait on the first presented + frame, thus avoiding race in the simulation setup. + + \return none, INPUT_FORMATTER[ID].blocking_mode = enable + */ +extern void input_formatter_set_fifo_blocking_mode( + const input_formatter_ID_t ID, + const bool enable); + +/*! Return the data alignment of INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + + \return alignment(INPUT_FORMATTER[ID].data) + */ +extern unsigned int input_formatter_get_alignment( + const input_formatter_ID_t ID); + +/*! Read the source switch state into INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param state[out] input formatter switch state structure + + \return none, state = INPUT_FORMATTER[ID].switch_state + */ +extern void input_formatter_get_switch_state( + const input_formatter_ID_t ID, + input_formatter_switch_state_t *state); + +/*! Read the control registers of INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param state[out] input formatter state structure + + \return none, state = INPUT_FORMATTER[ID].state + */ +extern void input_formatter_get_state( + const input_formatter_ID_t ID, + input_formatter_state_t *state); + +/*! Read the control registers of bin copy INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param state[out] input formatter state structure + + \return none, state = INPUT_FORMATTER[ID].state + */ +extern void input_formatter_bin_get_state( + const input_formatter_ID_t ID, + input_formatter_bin_state_t *state); + +/*! Write to a control register of INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return none, INPUT_FORMATTER[ID].ctrl[reg] = value + */ +STORAGE_CLASS_INPUT_FORMATTER_H void input_formatter_reg_store( + const input_formatter_ID_t ID, + const hrt_address reg_addr, + const hrt_data value); + +/*! Read from a control register of INPUT_FORMATTER[ID] + + \param ID[in] INPUT_FORMATTER identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return INPUT_FORMATTER[ID].ctrl[reg] + */ +STORAGE_CLASS_INPUT_FORMATTER_H hrt_data input_formatter_reg_load( + const input_formatter_ID_t ID, + const unsigned int reg_addr); + +#endif /* __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h new file mode 100644 index 0000000..1596757 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h @@ -0,0 +1,376 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ +#define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#ifdef USE_INPUT_SYSTEM_VERSION_2401 +#include "isys_public.h" +#else + +typedef struct input_system_state_s input_system_state_t; +typedef struct receiver_state_s receiver_state_t; + +/*! Read the state of INPUT_SYSTEM[ID] + + \param ID[in] INPUT_SYSTEM identifier + \param state[out] input system state structure + + \return none, state = INPUT_SYSTEM[ID].state + */ +extern void input_system_get_state( + const input_system_ID_t ID, + input_system_state_t *state); + +/*! Read the state of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param state[out] receiver state structure + + \return none, state = RECEIVER[ID].state + */ +extern void receiver_get_state( + const rx_ID_t ID, + receiver_state_t *state); + +/*! Flag whether a MIPI format is YUV420 + + \param mipi_format[in] MIPI format + + \return mipi_format == YUV420 + */ +extern bool is_mipi_format_yuv420( + const mipi_format_t mipi_format); + +/*! Set compression parameters for cfg[cfg_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param cfg_ID[in] Configuration identifier + \param comp[in] Compression method + \param pred[in] Predictor method + + \NOTE: the storage of compression configuration is + implementation specific. The config can be + carried either on MIPI ports or on MIPI channels + + \return none, RECEIVER[ID].cfg[cfg_ID] = {comp, pred} + */ +extern void receiver_set_compression( + const rx_ID_t ID, + const unsigned int cfg_ID, + const mipi_compressor_t comp, + const mipi_predictor_t pred); + +/*! Enable PORT[port_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + \param cnd[in] irq predicate + + \return None, enable(RECEIVER[ID].PORT[port_ID]) + */ +extern void receiver_port_enable( + const rx_ID_t ID, + const mipi_port_ID_t port_ID, + const bool cnd); + +/*! Flag if PORT[port_ID] of RECEIVER[ID] is enabled + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + + \return enable(RECEIVER[ID].PORT[port_ID]) == true + */ +extern bool is_receiver_port_enabled( + const rx_ID_t ID, + const mipi_port_ID_t port_ID); + +/*! Enable the IRQ channels of PORT[port_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + \param irq_info[in] irq channels + + \return None, enable(RECEIVER[ID].PORT[port_ID].irq_info) + */ +extern void receiver_irq_enable( + const rx_ID_t ID, + const mipi_port_ID_t port_ID, + const rx_irq_info_t irq_info); + +/*! Return the IRQ status of PORT[port_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + + \return RECEIVER[ID].PORT[port_ID].irq_info + */ +extern rx_irq_info_t receiver_get_irq_info( + const rx_ID_t ID, + const mipi_port_ID_t port_ID); + +/*! Clear the IRQ status of PORT[port_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + \param irq_info[in] irq status + + \return None, clear(RECEIVER[ID].PORT[port_ID].irq_info) + */ +extern void receiver_irq_clear( + const rx_ID_t ID, + const mipi_port_ID_t port_ID, + const rx_irq_info_t irq_info); + +/*! Write to a control register of INPUT_SYSTEM[ID] + + \param ID[in] INPUT_SYSTEM identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, INPUT_SYSTEM[ID].ctrl[reg] = value + */ +STORAGE_CLASS_INPUT_SYSTEM_H void input_system_reg_store( + const input_system_ID_t ID, + const hrt_address reg, + const hrt_data value); + +/*! Read from a control register of INPUT_SYSTEM[ID] + + \param ID[in] INPUT_SYSTEM identifier + \param reg[in] register index + \param value[in] The data to be written + + \return INPUT_SYSTEM[ID].ctrl[reg] + */ +STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_reg_load( + const input_system_ID_t ID, + const hrt_address reg); + +/*! Write to a control register of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, RECEIVER[ID].ctrl[reg] = value + */ +STORAGE_CLASS_INPUT_SYSTEM_H void receiver_reg_store( + const rx_ID_t ID, + const hrt_address reg, + const hrt_data value); + +/*! Read from a control register of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param reg[in] register index + \param value[in] The data to be written + + \return RECEIVER[ID].ctrl[reg] + */ +STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_reg_load( + const rx_ID_t ID, + const hrt_address reg); + +/*! Write to a control register of PORT[port_ID] of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, RECEIVER[ID].PORT[port_ID].ctrl[reg] = value + */ +STORAGE_CLASS_INPUT_SYSTEM_H void receiver_port_reg_store( + const rx_ID_t ID, + const mipi_port_ID_t port_ID, + const hrt_address reg, + const hrt_data value); + +/*! Read from a control register PORT[port_ID] of of RECEIVER[ID] + + \param ID[in] RECEIVER identifier + \param port_ID[in] mipi PORT identifier + \param reg[in] register index + \param value[in] The data to be written + + \return RECEIVER[ID].PORT[port_ID].ctrl[reg] + */ +STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_port_reg_load( + const rx_ID_t ID, + const mipi_port_ID_t port_ID, + const hrt_address reg); + +/*! Write to a control register of SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID] + + \param ID[in] INPUT_SYSTEM identifier + \param port_ID[in] sub system identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg] = value + */ +STORAGE_CLASS_INPUT_SYSTEM_H void input_system_sub_system_reg_store( + const input_system_ID_t ID, + const sub_system_ID_t sub_ID, + const hrt_address reg, + const hrt_data value); + +/*! Read from a control register SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID] + + \param ID[in] INPUT_SYSTEM identifier + \param port_ID[in] sub system identifier + \param reg[in] register index + \param value[in] The data to be written + + \return INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg] + */ +STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_sub_system_reg_load( + const input_system_ID_t ID, + const sub_system_ID_t sub_ID, + const hrt_address reg); + + + +/////////////////////////////////////////////////////////////////////////// +// +// Functions for configuration phase on input system. +// +/////////////////////////////////////////////////////////////////////////// + +// Function that resets current configuration. +// remove the argument since it should be private. +input_system_error_t input_system_configuration_reset(void); + +// Function that commits current configuration. +// remove the argument since it should be private. +input_system_error_t input_system_configuration_commit(void); + +/////////////////////////////////////////////////////////////////////////// +// +// User functions: +// (encoded generic function) +// - no checking +// - decoding name and agruments into the generic (channel) configuration +// function. +// +/////////////////////////////////////////////////////////////////////////// + + +// FIFO channel config function user + +input_system_error_t input_system_csi_fifo_channel_cfg( + uint32_t ch_id, + input_system_csi_port_t port, + backend_channel_cfg_t backend_ch, + target_cfg2400_t target +); + +input_system_error_t input_system_csi_fifo_channel_with_counting_cfg( + uint32_t ch_id, + uint32_t nof_frame, + input_system_csi_port_t port, + backend_channel_cfg_t backend_ch, + uint32_t mem_region_size, + uint32_t nof_mem_regions, + target_cfg2400_t target +); + + +// SRAM channel config function user + +input_system_error_t input_system_csi_sram_channel_cfg( + uint32_t ch_id, + input_system_csi_port_t port, + backend_channel_cfg_t backend_ch, + uint32_t csi_mem_region_size, + uint32_t csi_nof_mem_regions, + target_cfg2400_t target +); + + +//XMEM channel config function user + +input_system_error_t input_system_csi_xmem_channel_cfg( + uint32_t ch_id, + input_system_csi_port_t port, + backend_channel_cfg_t backend_ch, + uint32_t mem_region_size, + uint32_t nof_mem_regions, + uint32_t acq_mem_region_size, + uint32_t acq_nof_mem_regions, + target_cfg2400_t target, + uint32_t nof_xmem_buffers +); + +input_system_error_t input_system_csi_xmem_capture_only_channel_cfg( + uint32_t ch_id, + uint32_t nof_frames, + input_system_csi_port_t port, + uint32_t csi_mem_region_size, + uint32_t csi_nof_mem_regions, + uint32_t acq_mem_region_size, + uint32_t acq_nof_mem_regions, + target_cfg2400_t target +); + +input_system_error_t input_system_csi_xmem_acquire_only_channel_cfg( + uint32_t ch_id, + uint32_t nof_frames, + input_system_csi_port_t port, + backend_channel_cfg_t backend_ch, + uint32_t acq_mem_region_size, + uint32_t acq_nof_mem_regions, + target_cfg2400_t target +); + +// Non - CSI channel config function user + +input_system_error_t input_system_prbs_channel_cfg( + uint32_t ch_id, + uint32_t nof_frames, + uint32_t seed, + uint32_t sync_gen_width, + uint32_t sync_gen_height, + uint32_t sync_gen_hblank_cycles, + uint32_t sync_gen_vblank_cycles, + target_cfg2400_t target +); + + +input_system_error_t input_system_tpg_channel_cfg( + uint32_t ch_id, + uint32_t nof_frames,//not used yet + uint32_t x_mask, + uint32_t y_mask, + uint32_t x_delta, + uint32_t y_delta, + uint32_t xy_mask, + uint32_t sync_gen_width, + uint32_t sync_gen_height, + uint32_t sync_gen_hblank_cycles, + uint32_t sync_gen_vblank_cycles, + target_cfg2400_t target +); + + +input_system_error_t input_system_gpfifo_channel_cfg( + uint32_t ch_id, + uint32_t nof_frames, + target_cfg2400_t target +); +#endif /* #ifdef USE_INPUT_SYSTEM_VERSION_2401 */ + +#endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/irq_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/irq_public.h new file mode 100644 index 0000000..9aeaf8f --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/irq_public.h @@ -0,0 +1,184 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __IRQ_PUBLIC_H_INCLUDED__ +#define __IRQ_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#include "system_types.h" + +/*! Read the control registers of IRQ[ID] + + \param ID[in] IRQ identifier + \param state[out] irq controller state structure + + \return none, state = IRQ[ID].state + */ +extern void irq_controller_get_state( + const irq_ID_t ID, + irq_controller_state_t *state); + +/*! Write to a control register of IRQ[ID] + + \param ID[in] IRQ identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, IRQ[ID].ctrl[reg] = value + */ +STORAGE_CLASS_IRQ_H void irq_reg_store( + const irq_ID_t ID, + const unsigned int reg, + const hrt_data value); + +/*! Read from a control register of IRQ[ID] + + \param ID[in] IRQ identifier + \param reg[in] register index + \param value[in] The data to be written + + \return IRQ[ID].ctrl[reg] + */ +STORAGE_CLASS_IRQ_H hrt_data irq_reg_load( + const irq_ID_t ID, + const unsigned int reg); + +/*! Enable an IRQ channel of IRQ[ID] with a mode + + \param ID[in] IRQ (device) identifier + \param irq[in] IRQ (channel) identifier + + \return none, enable(IRQ[ID].channel[irq_ID]) + */ +extern void irq_enable_channel( + const irq_ID_t ID, + const unsigned int irq_ID); + +/*! Enable pulse interrupts for IRQ[ID] with a mode + + \param ID[in] IRQ (device) identifier + \param enable enable/disable pulse interrupts + + \return none + */ +extern void irq_enable_pulse( + const irq_ID_t ID, + bool pulse); + +/*! Disable an IRQ channel of IRQ[ID] + + \param ID[in] IRQ (device) identifier + \param irq[in] IRQ (channel) identifier + + \return none, disable(IRQ[ID].channel[irq_ID]) + */ +extern void irq_disable_channel( + const irq_ID_t ID, + const unsigned int irq); + +/*! Clear the state of all IRQ channels of IRQ[ID] + + \param ID[in] IRQ (device) identifier + + \return none, clear(IRQ[ID].channel[]) + */ +extern void irq_clear_all( + const irq_ID_t ID); + +/*! Return the ID of a signalling IRQ channel of IRQ[ID] + + \param ID[in] IRQ (device) identifier + \param irq_id[out] active IRQ (channel) identifier + + \Note: This function operates as strtok(), based on the return + state the user is informed if there are additional signalling + channels + + \return state(IRQ[ID]) + */ +extern enum hrt_isp_css_irq_status irq_get_channel_id( + const irq_ID_t ID, + unsigned int *irq_id); + +/*! Raise an interrupt on channel irq_id of device IRQ[ID] + + \param ID[in] IRQ (device) identifier + \param irq_id[in] IRQ (channel) identifier + + \return none, signal(IRQ[ID].channel[irq_id]) + */ +extern void irq_raise( + const irq_ID_t ID, + const irq_sw_channel_id_t irq_id); + +/*! Test if any IRQ channel of the virtual super IRQ has raised a signal + + \return any(VIRQ.channel[irq_ID] != 0) + */ +extern bool any_virq_signal(void); + +/*! Enable an IRQ channel of the virtual super IRQ + + \param irq[in] IRQ (channel) identifier + \param en[in] predicate channel enable + + \return none, VIRQ.channel[irq_ID].enable = en + */ +extern void cnd_virq_enable_channel( + const virq_id_t irq_ID, + const bool en); + +/*! Clear the state of all IRQ channels of the virtual super IRQ + + \return none, clear(VIRQ.channel[]) + */ +extern void virq_clear_all(void); + +/*! Clear the IRQ info state of the virtual super IRQ + + \param irq_info[in/out] The IRQ (channel) state + + \return none + */ +extern void virq_clear_info( + virq_info_t *irq_info); + +/*! Return the ID of a signalling IRQ channel of the virtual super IRQ + + \param irq_id[out] active IRQ (channel) identifier + + \Note: This function operates as strtok(), based on the return + state the user is informed if there are additional signalling + channels + + \return state(IRQ[...]) + */ +extern enum hrt_isp_css_irq_status virq_get_channel_id( + virq_id_t *irq_id); + +/*! Return the IDs of all signaling IRQ channels of the virtual super IRQ + + \param irq_info[out] all active IRQ (channel) identifiers + + \Note: Unlike "irq_get_channel_id()" this function returns all + channel signaling info. The new info is OR'd with the current + info state. N.B. this is the same as repeatedly calling the function + "irq_get_channel_id()" in a (non-blocked) handler routine + + \return (error(state(IRQ[...])) + */ +extern enum hrt_isp_css_irq_status virq_get_channel_signals( + virq_info_t *irq_info); + +#endif /* __IRQ_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2400_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2400_config.h new file mode 100644 index 0000000..ab33917 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2400_config.h @@ -0,0 +1,24 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP2400_CONFIG_H_INCLUDED__ +#define __ISP2400_CONFIG_H_INCLUDED__ + +#define NUM_BITS 14 +#define NUM_SLICE_ELEMS 4 +#define ROUNDMODE ROUND_NEAREST_EVEN +#define MAX_SHIFT_1W (NUM_BITS-1) /* Max number of bits a 1w input can be shifted */ +#define MAX_SHIFT_2W (2*NUM_BITS-1) /* Max number of bits a 2w input can be shifted */ + +#endif /* __ISP2400_CONFIG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2500_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2500_config.h new file mode 100644 index 0000000..4fae856 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2500_config.h @@ -0,0 +1,29 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP2500_CONFIG_H_INCLUDED__ +#define __ISP2500_CONFIG_H_INCLUDED__ + +#define NUM_BITS 12 +#define NUM_SLICE_ELEMS 4 +#define ROUNDMODE ROUND_NEAREST_EVEN +#define MAX_SHIFT_1W (NUM_BITS-1) /* Max number of bits a 1w input can be shifted */ +#define MAX_SHIFT_2W (2*NUM_BITS-1) /* Max number of bits a 2w input can be shifted */ + + +#define HAS_div_unit + +#define HAS_vec_sub + +#endif /* __ISP2500_CONFIG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2600_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2600_config.h new file mode 100644 index 0000000..6086be8 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2600_config.h @@ -0,0 +1,34 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP2600_CONFIG_H_INCLUDED__ +#define __ISP2600_CONFIG_H_INCLUDED__ + + +#define NUM_BITS 16 + + +#define NUM_SLICE_ELEMS 8 +#define ROUNDMODE ROUND_NEAREST_EVEN +#define MAX_SHIFT_1W (NUM_BITS-1) /* Max number of bits a 1w input can be shifted */ +#define MAX_SHIFT_2W (2*NUM_BITS-1) /* Max number of bits a 2w input can be shifted */ +#define ISP_NWAY 32 /* Number of elements in a vector in ISP 2600 */ + +#define HAS_div_unit +#define HAS_1w_sqrt_u_unit +#define HAS_2w_sqrt_u_unit + +#define HAS_vec_sub + +#endif /* __ISP2600_CONFIG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2601_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2601_config.h new file mode 100644 index 0000000..beceefa --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp2601_config.h @@ -0,0 +1,70 @@ +#ifndef ISP2401 +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP2601_CONFIG_H_INCLUDED__ +#define __ISP2601_CONFIG_H_INCLUDED__ + +#define NUM_BITS 16 +#define ISP_VEC_ELEMBITS NUM_BITS +#define ISP_NWAY 32 +#define NUM_SLICE_ELEMS 4 +#define ROUNDMODE ROUND_NEAREST_EVEN +#define MAX_SHIFT_1W (NUM_BITS-1) /* Max number of bits a 1w input can be shifted */ +#define MAX_SHIFT_2W (2*NUM_BITS-1) /* Max number of bits a 2w input can be shifted */ + +#define HAS_div_unit +#define HAS_bfa_unit +#define HAS_1w_sqrt_u_unit +#define HAS_2w_sqrt_u_unit + +#define HAS_vec_sub + +/* Bit widths and element widths defined in HW implementation of BFA */ +#define BFA_THRESHOLD_BIT_CNT (8) +#define BFA_THRESHOLD_MASK ((1<<BFA_THRESHOLD_BIT_CNT)-1) +#define BFA_SW_BIT_CNT (7) +#define BFA_SW_MASK ((1<<BFA_SW_BIT_CNT)-1) + +#define BFA_RW_BIT_CNT (7) +#define BFA_RW_MASK ((1<<BFA_RW_BIT_CNT)-1) +#define BFA_RW_SLOPE_BIT_POS (8) +#define BFA_RW_SLOPE_BIT_SHIFT (5) + +#define BFA_RW_IDX_BIT_CNT (3) +#define BFA_RW_FRAC_BIT_CNT (5) +#define BFA_RW_LUT0_FRAC_START_BIT (0) +#define BFA_RW_LUT0_FRAC_END_BIT (BFA_RW_LUT0_FRAC_START_BIT+BFA_RW_FRAC_BIT_CNT-1) /* 4 */ +#define BFA_RW_LUT1_FRAC_START_BIT (2) +#define BFA_RW_LUT1_FRAC_END_BIT (BFA_RW_LUT1_FRAC_START_BIT+BFA_RW_FRAC_BIT_CNT-1) /* 6 */ +/* LUT IDX end bit computation, start+idx_bit_cnt-2, one -1 comes as we count + * bits from 0, another -1 comes as we use 2 lut table, so idx_bit_cnt is one + * bit more */ +#define BFA_RW_LUT0_IDX_START_BIT (BFA_RW_LUT0_FRAC_END_BIT+1) /* 5 */ +#define BFA_RW_LUT0_IDX_END_BIT (BFA_RW_LUT0_IDX_START_BIT+BFA_RW_IDX_BIT_CNT-2) /* 6 */ +#define BFA_RW_LUT1_IDX_START_BIT (BFA_RW_LUT1_FRAC_END_BIT + 1) /* 7 */ +#define BFA_RW_LUT1_IDX_END_BIT (BFA_RW_LUT1_IDX_START_BIT+BFA_RW_IDX_BIT_CNT-2) /* 8 */ +#define BFA_RW_LUT_THRESHOLD (1<<(BFA_RW_LUT1_IDX_END_BIT-1)) /* 0x80 : next bit after lut1 end is set */ +#define BFA_RW_LUT1_IDX_OFFSET ((1<<(BFA_RW_IDX_BIT_CNT-1))-1) /* 3 */ + +#define BFA_CP_MASK (0xFFFFFF80) +#define BFA_SUBABS_SHIFT (6) +#define BFA_SUBABS_BIT_CNT (8) +#define BFA_SUBABS_MAX ((1<<BFA_SUBABS_BIT_CNT)-1) +#define BFA_SUBABSSAT_BIT_CNT (9) +#define BFA_SUBABSSAT_MAX ((1<<BFA_SUBABSSAT_BIT_CNT)-1) +#define BFA_WEIGHT_SHIFT (6) + +#endif /* __ISP2601_CONFIG_H_INCLUDED__ */ +#endif diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_config.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_config.h new file mode 100644 index 0000000..80506f2 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_config.h @@ -0,0 +1,24 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_CONFIG_H_INCLUDED__ +#define __ISP_CONFIG_H_INCLUDED__ + +#if defined(ISP2400) || defined(ISP2401) +#include "isp2400_config.h" +#else +#error "Please define a core {ISP2400, ISP2401}" +#endif + +#endif /* __ISP_CONFIG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w.h new file mode 100644 index 0000000..2251f37 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w.h @@ -0,0 +1,845 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_OP1W_H_INCLUDED__ +#define __ISP_OP1W_H_INCLUDED__ + +/* + * This file is part of the Multi-precision vector operations exstension package. + */ + +/* + * Single-precision vector operations + */ + +/* + * Prerequisites: + * + */ +#include "storage_class.h" + +#ifdef INLINE_ISP_OP1W +#define STORAGE_CLASS_ISP_OP1W_FUNC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_ISP_OP1W_DATA_H STORAGE_CLASS_INLINE_DATA +#else /* INLINE_ISP_OP1W */ +#define STORAGE_CLASS_ISP_OP1W_FUNC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_ISP_OP1W_DATA_H STORAGE_CLASS_EXTERN_DATA +#endif /* INLINE_ISP_OP1W */ + +/* + * Single-precision data type specification + */ + +#include "isp_op1w_types.h" +#include "isp_op2w_types.h" // for doubling operations. + +/* + * Single-precision prototype specification + */ + +/* Arithmetic */ + +/** @brief bitwise AND + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise and of both input arguments + * + * This function will calculate the bitwise and. + * result = _a & _b + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_and( + const tvector1w _a, + const tvector1w _b); + +/** @brief bitwise OR + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise or of both input arguments + * + * This function will calculate the bitwise or. + * result = _a | _b + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_or( + const tvector1w _a, + const tvector1w _b); + +/** @brief bitwise XOR + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise xor of both input arguments + * + * This function will calculate the bitwise xor. + * result = _a ^ _b + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_xor( + const tvector1w _a, + const tvector1w _b); + +/** @brief bitwise inverse + * + * @param[in] _a first argument + * + * @return bitwise inverse of both input arguments + * + * This function will calculate the bitwise inverse. + * result = ~_a + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_inv( + const tvector1w _a); + +/* Additive */ + +/** @brief addition + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return sum of both input arguments + * + * This function will calculate the sum of the input arguments. + * in case of overflow it will wrap around. + * result = _a + _b + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_add( + const tvector1w _a, + const tvector1w _b); + +/** @brief subtraction + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _b subtracted from _a. + * + * This function will subtract _b from _a. + * in case of overflow it will wrap around. + * result = _a - _b + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_sub( + const tvector1w _a, + const tvector1w _b); + +/** @brief saturated addition + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated sum of both input arguments + * + * This function will calculate the sum of the input arguments. + * in case of overflow it will saturate. + * result = CLIP(_a + _b, MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_addsat( + const tvector1w _a, + const tvector1w _b); + +/** @brief saturated subtraction + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated subtraction of both input arguments + * + * This function will subtract _b from _a. + * in case of overflow it will saturate. + * result = CLIP(_a - _b, MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_subsat( + const tvector1w _a, + const tvector1w _b); + +#ifdef ISP2401 +/** @brief Unsigned saturated subtraction + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated subtraction of both input arguments + * + * This function will subtract _b from _a. + * in case of overflow it will saturate. + * result = CLIP(_a - _b, 0, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w_unsigned OP_1w_subsat_u( + const tvector1w_unsigned _a, + const tvector1w_unsigned _b); + +#endif +/** @brief subtraction with shift right and rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (a - b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit with rounding. + * No overflow can occur. + * result = (_a - _b) >> 1 + * + * Note: This function will be deprecated due to + * the naming confusion and it will be replaced + * by "OP_1w_subhalfrnd". + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_subasr1( + const tvector1w _a, + const tvector1w _b); + +/** @brief Subtraction with shift right and rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a - _b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit with rounding. + * No overflow can occur. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_subhalfrnd( + const tvector1w _a, + const tvector1w _b); + +/** @brief Subtraction with shift right and no rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a - _b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit without rounding (i.e. truncation). + * No overflow can occur. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_subhalf( + const tvector1w _a, + const tvector1w _b); + + +/** @brief saturated absolute value + * + * @param[in] _a input + * + * @return saturated absolute value of the input + * + * This function will calculate the saturated absolute value of the input. + * in case of overflow it will saturate. + * if (_a > 0) return _a;<br> + * else return CLIP(-_a, MIN_RANGE, MAX_RANGE);<br> + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_abs( + const tvector1w _a); + +/** @brief saturated absolute difference + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return sat(abs(a-b)); + * + * This function will calculate the saturated absolute value + * of the saturated difference of both inputs. + * result = sat(abs(sat(_a - _b))); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_subabssat( + const tvector1w _a, + const tvector1w _b); + +/* Multiplicative */ + +/** @brief doubling multiply + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return product of _a and _b + * + * This function will calculate the product + * of the input arguments and returns a double + * precision result. + * No overflow can occur. + * result = _a * _b; + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector2w OP_1w_muld( + const tvector1w _a, + const tvector1w _b); + +/** @brief integer multiply + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return product of _a and _b + * + * This function will calculate the product + * of the input arguments and returns the LSB + * aligned single precision result. + * In case of overflow it will wrap around. + * result = _a * _b; + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_mul( + const tvector1w _a, + const tvector1w _b); + +/** @brief fractional saturating multiply + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated product of _a and _b + * + * This function will calculate the fixed point + * product of the input arguments + * and returns a single precision result. + * In case of overflow it will saturate. + * FP_UNITY * FP_UNITY => FP_UNITY. + * result = CLIP(_a * _b >> (NUM_BITS-1), MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_qmul( + const tvector1w _a, + const tvector1w _b); + +/** @brief fractional saturating multiply with rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return product of _a and _b + * + * This function will calculate the fixed point + * product of the input arguments + * and returns a single precision result. + * FP_UNITY * FP_UNITY => FP_UNITY. + * Depending on the rounding mode of the core + * it will round to nearest or to nearest even. + * result = CLIP(_a * _b >> (NUM_BITS-1), MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_qrmul( + const tvector1w _a, + const tvector1w _b); + +/* Comparative */ + +/** @brief equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a == _b + * + * This function will return true if both inputs + * are equal, and false if not equal. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_eq( + const tvector1w _a, + const tvector1w _b); + +/** @brief not equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a != _b + * + * This function will return false if both inputs + * are equal, and true if not equal. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_ne( + const tvector1w _a, + const tvector1w _b); + +/** @brief less or equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a <= _b + * + * This function will return true if _a is smaller + * or equal than _b. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_le( + const tvector1w _a, + const tvector1w _b); + +/** @brief less then + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a < _b + * + * This function will return true if _a is smaller + * than _b. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_lt( + const tvector1w _a, + const tvector1w _b); + +/** @brief greater or equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a >= _b + * + * This function will return true if _a is greater + * or equal than _b. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_ge( + const tvector1w _a, + const tvector1w _b); + +/** @brief greater than + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a > _b + * + * This function will return true if _a is greater + * than _b. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tflags OP_1w_gt( + const tvector1w _a, + const tvector1w _b); + +/* Shift */ + +/** @brief aritmetic shift right + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * This function will shift _a with _b bits to the right, + * preserving the sign bit. + * It asserts 0 <= _b <= MAX_SHIFT_1W. + * + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_asr( + const tvector1w _a, + const tvector1w _b); + +/** @brief aritmetic shift right with rounding + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * If _b < NUM_BITS, this function will shift _a with _b bits to the right, + * preserving the sign bit, and depending on the rounding mode of the core + * it will round to nearest or to nearest even. + * If _b >= NUM_BITS, this function will return 0. + * It asserts 0 <= _b <= MAX_SHIFT_1W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_asrrnd( + const tvector1w _a, + const tvector1w _b); + +/** @brief saturating arithmetic shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * If _b < MAX_BITDEPTH, this function will shift _a with _b bits to the left, + * saturating at MIN_RANGE/MAX_RANGE in case of overflow. + * If _b >= MAX_BITDEPTH, this function will return MIN_RANGE if _a < 0, + * MAX_RANGE if _a > 0, 0 if _a == 0. + * (with MAX_BITDEPTH=64) + * It asserts 0 <= _b <= MAX_SHIFT_1W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_asl( + const tvector1w _a, + const tvector1w _b); + +/** @brief saturating aritmetic shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * This function is identical to OP_1w_asl( ) + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_aslsat( + const tvector1w _a, + const tvector1w _b); + +/** @brief logical shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * This function will shift _a with _b bits to the left. + * It will insert zeroes on the right. + * It asserts 0 <= _b <= MAX_SHIFT_1W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_lsl( + const tvector1w _a, + const tvector1w _b); + +/** @brief logical shift right + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * This function will shift _a with _b bits to the right. + * It will insert zeroes on the left. + * It asserts 0 <= _b <= MAX_SHIFT_1W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_lsr( + const tvector1w _a, + const tvector1w _b); + +#ifdef ISP2401 +/** @brief bidirectional saturating arithmetic shift + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << |_b| if _b is positive + * _a >> |_b| if _b is negative + * + * If _b > 0, this function will shift _a with _b bits to the left, + * saturating at MIN_RANGE/MAX_RANGE in case of overflow. + * if _b < 0, this function will shift _a with _b bits to the right. + * It asserts -MAX_SHIFT_1W <= _b <= MAX_SHIFT_1W. + * If _b = 0, it returns _a. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_ashift_sat( + const tvector1w _a, + const tvector1w _b); + +/** @brief bidirectional non-saturating arithmetic shift + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << |_b| if _b is positive + * _a >> |_b| if _b is negative + * + * If _b > 0, this function will shift _a with _b bits to the left, + * no saturation is performed in case of overflow. + * if _b < 0, this function will shift _a with _b bits to the right. + * It asserts -MAX_SHIFT_1W <= _b <= MAX_SHIFT_1W. + * If _b = 0, it returns _a. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_ashift( + const tvector1w _a, + const tvector1w _b); + + +/** @brief bidirectional logical shift + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << |_b| if _b is positive + * _a >> |_b| if _b is negative + * + * This function will shift _a with _b bits to the left if _b is positive. + * This function will shift _a with _b bits to the right if _b is negative. + * It asserts -MAX_SHIFT_1W <= _b <= MAX_SHIFT_1W. + * It inserts zeros on the left or right depending on the shift direction: + * right or left. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_lshift( + const tvector1w _a, + const tvector1w _b); + +#endif +/* Cast */ + +/** @brief Cast from int to 1w + * + * @param[in] _a input + * + * @return _a + * + * This function casts the input from integer type to + * single precision. It asserts there is no overflow. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_int_cast_to_1w( + const int _a); + +/** @brief Cast from 1w to int + * + * @param[in] _a input + * + * @return _a + * + * This function casts the input from single precision type to + * integer, preserving value and sign. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H int OP_1w_cast_to_int( + const tvector1w _a); + +/** @brief Cast from 1w to 2w + * + * @param[in] _a input + * + * @return _a + * + * This function casts the input from single precision type to + * double precision, preserving value and sign. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector2w OP_1w_cast_to_2w( + const tvector1w _a); + +/** @brief Cast from 2w to 1w + * + * @param[in] _a input + * + * @return _a + * + * This function casts the input from double precision type to + * single precision. In case of overflow it will wrap around. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_2w_cast_to_1w( + const tvector2w _a); + + +/** @brief Cast from 2w to 1w with saturation + * + * @param[in] _a input + * + * @return _a + * + * This function casts the input from double precision type to + * single precision after saturating it to the range of single + * precision. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_2w_sat_cast_to_1w( + const tvector2w _a); + +/* clipping */ + +/** @brief Clip asymmetrical + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a clipped between ~_b and b + * + * This function will clip the first argument between + * (-_b - 1) and _b. + * It asserts _b >= 0. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_clip_asym( + const tvector1w _a, + const tvector1w _b); + +/** @brief Clip zero + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a clipped beteween 0 and _b + * + * This function will clip the first argument between + * zero and _b. + * It asserts _b >= 0. + * + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_clipz( + const tvector1w _a, + const tvector1w _b); + +/* division */ + +/** @brief Truncated division + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return trunc( _a / _b ) + * + * This function will divide the first argument by + * the second argument, with rounding toward 0. + * If _b == 0 and _a < 0, the function will return MIN_RANGE. + * If _b == 0 and _a == 0, the function will return 0. + * If _b == 0 and _a > 0, the function will return MAX_RANGE. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_div( + const tvector1w _a, + const tvector1w _b); + +/** @brief Fractional saturating divide + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a / _b + * + * This function will perform fixed point division of + * the first argument by the second argument, with rounding toward 0. + * In case of overflow it will saturate. + * If _b == 0 and _a < 0, the function will return MIN_RANGE. + * If _b == 0 and _a == 0, the function will return 0. + * If _b == 0 and _a > 0, the function will return MAX_RANGE. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_qdiv( + const tvector1w _a, + const tvector1w _b); + +/** @brief Modulo + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a % _b + * + * This function will return the remainder r = _a - _b * trunc( _a / _b ), + * Note that the sign of the remainder is always equal to the sign of _a. + * If _b == 0 the function will return _a. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_mod( + const tvector1w _a, + const tvector1w _b); + +/** @brief Unsigned integer Square root + * + * @param[in] _a input + * + * @return Integer square root of _a + * + * This function will calculate the Integer square root of _a + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w_unsigned OP_1w_sqrt_u( + const tvector1w_unsigned _a); + +/* Miscellaneous */ + +/** @brief Multiplexer + * + * @param[in] _a first argument + * @param[in] _b second argument + * @param[in] _c condition + * + * @return _c ? _a : _b + * + * This function will return _a if the condition _c + * is true and _b otherwise. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_mux( + const tvector1w _a, + const tvector1w _b, + const tflags _c); + +/** @brief Average without rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a + _b) >> 1 + * + * This function will add _a and _b, and right shift + * the result by one without rounding. No overflow + * will occur because addition is performed in the + * proper precision. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_avg( + const tvector1w _a, + const tvector1w _b); + +/** @brief Average with rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a + _b) >> 1 + * + * This function will add _a and _b at full precision, + * and right shift with rounding the result with 1 bit. + * Depending on the rounding mode of the core + * it will round to nearest or to nearest even. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_avgrnd( + const tvector1w _a, + const tvector1w _b); + +/** @brief Minimum + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a < _b) ? _a : _b; + * + * This function will return the smallest of both + * input arguments. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_min( + const tvector1w _a, + const tvector1w _b); + +/** @brief Maximum + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a > _b) ? _a : _b; + * + * This function will return the largest of both + * input arguments. + */ +STORAGE_CLASS_ISP_OP1W_FUNC_H tvector1w OP_1w_max( + const tvector1w _a, + const tvector1w _b); + +#ifndef INLINE_ISP_OP1W +#define STORAGE_CLASS_ISP_OP1W_FUNC_C +#define STORAGE_CLASS_ISP_OP1W_DATA_C const +#else /* INLINE_ISP_OP1W */ +#define STORAGE_CLASS_ISP_OP1W_FUNC_C STORAGE_CLASS_ISP_OP1W_FUNC_H +#define STORAGE_CLASS_ISP_OP1W_DATA_C STORAGE_CLASS_ISP_OP1W_DATA_H +#include "isp_op1w.c" +#define ISP_OP1W_INLINED +#endif /* INLINE_ISP_OP1W */ + +#endif /* __ISP_OP1W_H_INCLUDED__ */ + diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w_types.h new file mode 100644 index 0000000..c81e587 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op1w_types.h @@ -0,0 +1,54 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_OP1W_TYPES_H_INCLUDED__ +#define __ISP_OP1W_TYPES_H_INCLUDED__ + +/* + * This file is part of the Multi-precision vector operations exstension package. + */ + +/* + * Single-precision vector operations + */ + +/* + * Prerequisites: + * + */ + +#include "mpmath.h" + +/* + * Single-precision data type specification + */ + + +typedef mpsdata_t tvector1w; +typedef mpsdata_t tscalar1w; +typedef spsdata_t tflags; +typedef mpudata_t tvector1w_unsigned; +typedef mpsdata_t tscalar1w_weight; +typedef mpsdata_t tvector1w_signed_positive; +typedef mpsdata_t tvector1w_weight; +#ifdef ISP2401 +typedef bool tscalar_bool; +#endif + +typedef struct { + tvector1w d; + tflags f; +} tvector1w_tflags1w; + +#endif /* __ISP_OP1W_TYPES_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w.h new file mode 100644 index 0000000..1cfe6d7 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w.h @@ -0,0 +1,675 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_OP2W_H_INCLUDED__ +#define __ISP_OP2W_H_INCLUDED__ + +/* + * This file is part of the Multi-precision vector operations exstension package. + */ + +/* + * Double-precision vector operations + */ + +/* + * Prerequisites: + * + */ +#include "storage_class.h" + +#ifdef INLINE_ISP_OP2W +#define STORAGE_CLASS_ISP_OP2W_FUNC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_ISP_OP2W_DATA_H STORAGE_CLASS_INLINE_DATA +#else /* INLINE_ISP_OP2W */ +#define STORAGE_CLASS_ISP_OP2W_FUNC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_ISP_OP2W_DATA_H STORAGE_CLASS_EXTERN_DATA +#endif /* INLINE_ISP_OP2W */ + +/* + * Double-precision data type specification + */ + +#include "isp_op2w_types.h" + +/* + * Double-precision prototype specification + */ + +/* Arithmetic */ + +/** @brief bitwise AND + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise and of both input arguments + * + * This function will calculate the bitwise and. + * result = _a & _b + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_and( + const tvector2w _a, + const tvector2w _b); + +/** @brief bitwise OR + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise or of both input arguments + * + * This function will calculate the bitwise or. + * result = _a | _b + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_or( + const tvector2w _a, + const tvector2w _b); + +/** @brief bitwise XOR + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return bitwise xor of both input arguments + * + * This function will calculate the bitwise xor. + * result = _a ^ _b + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_xor( + const tvector2w _a, + const tvector2w _b); + +/** @brief bitwise inverse + * + * @param[in] _a first argument + * + * @return bitwise inverse of both input arguments + * + * This function will calculate the bitwise inverse. + * result = ~_a + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_inv( + const tvector2w _a); + +/* Additive */ + +/** @brief addition + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return sum of both input arguments + * + * This function will calculate the sum of the input arguments. + * in case of overflow it will wrap around. + * result = _a + _b + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_add( + const tvector2w _a, + const tvector2w _b); + +/** @brief subtraction + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _b subtracted from _a. + * + * This function will subtract _b from _a. + * in case of overflow it will wrap around. + * result = _a - _b + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_sub( + const tvector2w _a, + const tvector2w _b); + +/** @brief saturated addition + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated sum of both input arguments + * + * This function will calculate the sum of the input arguments. + * in case of overflow it will saturate + * result = CLIP(_a + _b, MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_addsat( + const tvector2w _a, + const tvector2w _b); + +/** @brief saturated subtraction + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated subtraction of both input arguments + * + * This function will subtract _b from _a. + * in case of overflow it will saturate + * result = CLIP(_a - _b, MIN_RANGE, MAX_RANGE); + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_subsat( + const tvector2w _a, + const tvector2w _b); + +/** @brief subtraction with shift right and rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (a - b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit with rounding. + * No overflow can occur. + * result = (_a - _b) >> 1 + * + * Note: This function will be deprecated due to + * the naming confusion and it will be replaced + * by "OP_2w_subhalfrnd". + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_subasr1( + const tvector2w _a, + const tvector2w _b); + +/** @brief Subtraction with shift right and rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a - _b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit with rounding. + * No overflow can occur. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_subhalfrnd( + const tvector2w _a, + const tvector2w _b); + +/** @brief Subtraction with shift right and no rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a - _b) >> 1 + * + * This function subtracts _b from _a and right shifts + * the result by 1 bit without rounding (i.e. truncation). + * No overflow can occur. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_subhalf( + const tvector2w _a, + const tvector2w _b); + +/** @brief saturated absolute value + * + * @param[in] _a input + * + * @return saturated absolute value of the input + * + * This function will calculate the saturated absolute value of the input. + * In case of overflow it will saturate. + * if (_a > 0) return _a;<br> + * else return CLIP(-_a, MIN_RANGE, MAX_RANGE);<br> + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_abs( + const tvector2w _a); + +/** @brief saturated absolute difference + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return sat(abs(sat(a-b))); + * + * This function will calculate the saturated absolute value + * of the saturated difference of both inputs. + * result = sat(abs(sat(_a - _b))); + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_subabssat( + const tvector2w _a, + const tvector2w _b); + +/* Multiplicative */ + +/** @brief integer multiply + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return product of _a and _b + * + * This function will calculate the product + * of the input arguments and returns the LSB + * aligned double precision result. + * In case of overflow it will wrap around. + * result = _a * _b; + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_mul( + const tvector2w _a, + const tvector2w _b); + +/** @brief fractional saturating multiply + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return saturated product of _a and _b + * + * This function will calculate the fixed point + * product of the input arguments + * and returns a double precision result. + * In case of overflow it will saturate. + * result =((_a * _b) << 1) >> (2*NUM_BITS); + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_qmul( + const tvector2w _a, + const tvector2w _b); + +/** @brief fractional saturating multiply with rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return product of _a and _b + * + * This function will calculate the fixed point + * product of the input arguments + * and returns a double precision result. + * Depending on the rounding mode of the core + * it will round to nearest or to nearest even. + * In case of overflow it will saturate. + * result = ((_a * _b) << 1) >> (2*NUM_BITS); + */ + +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_qrmul( + const tvector2w _a, + const tvector2w _b); + +/* Comparative */ + +/** @brief equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a == _b + * + * This function will return true if both inputs + * are equal, and false if not equal. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_eq( + const tvector2w _a, + const tvector2w _b); + +/** @brief not equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a != _b + * + * This function will return false if both inputs + * are equal, and true if not equal. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_ne( + const tvector2w _a, + const tvector2w _b); + +/** @brief less or equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a <= _b + * + * This function will return true if _a is smaller + * or equal than _b. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_le( + const tvector2w _a, + const tvector2w _b); + +/** @brief less then + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a < _b + * + * This function will return true if _a is smaller + * than _b. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_lt( + const tvector2w _a, + const tvector2w _b); + +/** @brief greater or equal + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a >= _b + * + * This function will return true if _a is greater + * or equal than _b. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_ge( + const tvector2w _a, + const tvector2w _b); + +/** @brief greater than + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a > _b + * + * This function will return true if _a is greater + * than _b. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tflags OP_2w_gt( + const tvector2w _a, + const tvector2w _b); + +/* Shift */ + +/** @brief aritmetic shift right + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * This function will shift _a with _b bits to the right, + * preserving the sign bit. + * It asserts 0 <= _b <= MAX_SHIFT_2W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_asr( + const tvector2w _a, + const tvector2w _b); + +/** @brief aritmetic shift right with rounding + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * If _b < 2*NUM_BITS, this function will shift _a with _b bits to the right, + * preserving the sign bit, and depending on the rounding mode of the core + * it will round to nearest or to nearest even. + * If _b >= 2*NUM_BITS, this function will return 0. + * It asserts 0 <= _b <= MAX_SHIFT_2W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_asrrnd( + const tvector2w _a, + const tvector2w _b); + +/** @brief saturating aritmetic shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * If _b < MAX_BITDEPTH, this function will shift _a with _b bits to the left, + * saturating at MIN_RANGE/MAX_RANGE in case of overflow. + * If _b >= MAX_BITDEPTH, this function will return MIN_RANGE if _a < 0, + * MAX_RANGE if _a > 0, 0 if _a == 0. + * (with MAX_BITDEPTH=64) + * It asserts 0 <= _b <= MAX_SHIFT_2W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_asl( + const tvector2w _a, + const tvector2w _b); + +/** @brief saturating aritmetic shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * This function is identical to OP_2w_asl( ) + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_aslsat( + const tvector2w _a, + const tvector2w _b); + +/** @brief logical shift left + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a << _b + * + * This function will shift _a with _b bits to the left. + * It will insert zeroes on the right. + * It asserts 0 <= _b <= MAX_SHIFT_2W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_lsl( + const tvector2w _a, + const tvector2w _b); + +/** @brief logical shift right + * + * @param[in] _a input + * @param[in] _b shift amount + * + * @return _a >> _b + * + * This function will shift _a with _b bits to the right. + * It will insert zeroes on the left. + * It asserts 0 <= _b <= MAX_SHIFT_2W. + * The operation count for this function assumes that + * the shift amount is a cloned scalar input. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_lsr( + const tvector2w _a, + const tvector2w _b); + +/* clipping */ + +/** @brief Clip asymmetrical + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a clipped between ~_b and b + * + * This function will clip the first argument between + * (-_b - 1) and _b. + * It asserts _b >= 0. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_clip_asym( + const tvector2w _a, + const tvector2w _b); + +/** @brief Clip zero + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return _a clipped beteween 0 and _b + * + * This function will clip the first argument between + * zero and _b. + * It asserts _b >= 0. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_clipz( + const tvector2w _a, + const tvector2w _b); + +/* division */ + +/** @brief Truncated division + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return trunc( _a / _b ) + * + * This function will divide the first argument by + * the second argument, with rounding toward 0. + * If _b == 0 and _a < 0, the function will return MIN_RANGE. + * If _b == 0 and _a == 0, the function will return 0. + * If _b == 0 and _a > 0, the function will return MAX_RANGE. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_div( + const tvector2w _a, + const tvector2w _b); + +/** @brief Saturating truncated division + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return CLIP( trunc( _a / _b ), MIN_RANGE1w, MAX_RANGE1w ) + * + * This function will divide the first argument by + * the second argument, with rounding toward 0, and + * saturate the result to the range of single precision. + * If _b == 0 and _a < 0, the function will return MIN_RANGE. + * If _b == 0 and _a == 0, the function will return 0. + * If _b == 0 and _a > 0, the function will return MAX_RANGE. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector1w OP_2w_divh( + const tvector2w _a, + const tvector1w _b); + +/** @brief Modulo + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return n/a + * + * This function has not yet been implemented. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_mod( + const tvector2w _a, + const tvector2w _b); + +/** @brief Unsigned Integer Square root + * + * @param[in] _a input + * + * @return square root of _a + * + * This function will calculate the unsigned integer square root of _a + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector1w_unsigned OP_2w_sqrt_u( + const tvector2w_unsigned _a); + +/* Miscellaneous */ + +/** @brief Multiplexer + * + * @param[in] _a first argument + * @param[in] _b second argument + * @param[in] _c condition + * + * @return _c ? _a : _b + * + * This function will return _a if the condition _c + * is true and _b otherwise. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_mux( + const tvector2w _a, + const tvector2w _b, + const tflags _c); + +/** @brief Average without rounding + * + * @param[in] _a first operand + * @param[in] _b second operand + * + * @return (_a + _b) >> 1 + * + * This function will add _a and _b, and right shift + * the result by one without rounding. No overflow + * will occur because addition is performed in the + * proper precision. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_avg( + const tvector2w _a, + const tvector2w _b); + +/** @brief Average with rounding + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a + _b) >> 1 + * + * This function will add _a and _b at full precision, + * and right shift with rounding the result with 1 bit. + * Depending on the rounding mode of the core + * it will round to nearest or to nearest even. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_avgrnd( + const tvector2w _a, + const tvector2w _b); + +/** @brief Minimum + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a < _b) ? _a : _b; + * + * This function will return the smallest of both + * input arguments. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_min( + const tvector2w _a, + const tvector2w _b); + +/** @brief Maximum + * + * @param[in] _a first argument + * @param[in] _b second argument + * + * @return (_a > _b) ? _a : _b; + * + * This function will return the largest of both + * input arguments. + */ +STORAGE_CLASS_ISP_OP2W_FUNC_H tvector2w OP_2w_max( + const tvector2w _a, + const tvector2w _b); + +#ifndef INLINE_ISP_OP2W +#define STORAGE_CLASS_ISP_OP2W_FUNC_C +#define STORAGE_CLASS_ISP_OP2W_DATA_C const +#else /* INLINE_ISP_OP2W */ +#define STORAGE_CLASS_ISP_OP2W_FUNC_C STORAGE_CLASS_ISP_OP2W_FUNC_H +#define STORAGE_CLASS_ISP_OP2W_DATA_C STORAGE_CLASS_ISP_OP2W_DATA_H +#include "isp_op2w.c" +#define ISP_OP2W_INLINED +#endif /* INLINE_ISP_OP2W */ + +#endif /* __ISP_OP2W_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w_types.h new file mode 100644 index 0000000..7e86083 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op2w_types.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_OP2W_TYPES_H_INCLUDED__ +#define __ISP_OP2W_TYPES_H_INCLUDED__ + +/* + * This file is part of the Multi-precision vector operations exstension package. + */ + +/* + * Double-precision vector operations + */ + +/* + * Prerequisites: + * + */ +#include "mpmath.h" +#include "isp_op1w_types.h" + +/* + * Single-precision data type specification + */ + + +typedef mpsdata_t tvector2w; +typedef mpsdata_t tscalar2w; +typedef mpsdata_t tvector2w_signed_positive; +typedef mpudata_t tvector2w_unsigned; + + +typedef struct { + tvector2w d; + tflags f; +} tvector2w_tflags; + +#endif /* __ISP_OP2W_TYPES_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op_count.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op_count.h new file mode 100644 index 0000000..8e7b48d --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_op_count.h @@ -0,0 +1,226 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_OP_COUNT_H_INCLUDED__ +#define __ISP_OP_COUNT_H_INCLUDED__ + +#include <stdio.h> + +typedef struct { + long long bbb_cnt; /* number of bbb */ + int bbb_op; /* operations per bbb */ + long long total_cnt; /* bbb_cnt * bbb_op */ +} bbb_stat_t; + +typedef enum { + bbb_func_OP_1w_and, + bbb_func_OP_1w_or, + bbb_func_OP_1w_xor, + bbb_func_OP_1w_inv, + bbb_func_OP_1w_add, + bbb_func_OP_1w_sub, + bbb_func_OP_1w_addsat, + bbb_func_OP_1w_subsat, + bbb_func_OP_1w_subasr1, + bbb_func_OP_1w_subhalf, + bbb_func_OP_1w_subhalfrnd, + bbb_func_OP_1w_abs, + bbb_func_OP_1w_subabssat, +#ifdef ISP2401 + bbb_func_OP_1w_subsat_u, +#endif + bbb_func_OP_1w_muld, + bbb_func_OP_1w_mul, + bbb_func_OP_1w_qmul, + bbb_func_OP_1w_qrmul, + bbb_func_OP_1w_eq, + bbb_func_OP_1w_ne, + bbb_func_OP_1w_le, + bbb_func_OP_1w_lt, + bbb_func_OP_1w_ge, + bbb_func_OP_1w_gt, + bbb_func_OP_1w_asr, + bbb_func_OP_1w_asrrnd, + bbb_func_OP_1w_asl, + bbb_func_OP_1w_aslsat, + bbb_func_OP_1w_lsl, + bbb_func_OP_1w_lsr, +#ifdef ISP2401 + bbb_func_OP_1w_ashift, + bbb_func_OP_1w_lshift, +#endif + bbb_func_OP_int_cast_to_1w , + bbb_func_OP_1w_cast_to_int , + bbb_func_OP_1w_cast_to_2w , + bbb_func_OP_2w_cast_to_1w , + bbb_func_OP_2w_sat_cast_to_1w , + bbb_func_OP_1w_clip_asym, + bbb_func_OP_1w_clipz, + bbb_func_OP_1w_div, + bbb_func_OP_1w_qdiv, + bbb_func_OP_1w_mod, + bbb_func_OP_1w_sqrt_u, + bbb_func_OP_1w_mux, + bbb_func_OP_1w_avg, + bbb_func_OP_1w_avgrnd, + bbb_func_OP_1w_min, + bbb_func_OP_1w_max, + bbb_func_OP_2w_and, + bbb_func_OP_2w_or, + bbb_func_OP_2w_xor, + bbb_func_OP_2w_inv, + bbb_func_OP_2w_add, + bbb_func_OP_2w_sub, + bbb_func_OP_2w_addsat, + bbb_func_OP_2w_subsat, + bbb_func_OP_2w_subasr1, + bbb_func_OP_2w_subhalf, + bbb_func_OP_2w_subhalfrnd, + bbb_func_OP_2w_abs, + bbb_func_OP_2w_subabssat, + bbb_func_OP_2w_mul, + bbb_func_OP_2w_qmul, + bbb_func_OP_2w_qrmul, + bbb_func_OP_2w_eq, + bbb_func_OP_2w_ne, + bbb_func_OP_2w_le, + bbb_func_OP_2w_lt, + bbb_func_OP_2w_ge, + bbb_func_OP_2w_gt, + bbb_func_OP_2w_asr, + bbb_func_OP_2w_asrrnd, + bbb_func_OP_2w_asl, + bbb_func_OP_2w_aslsat, + bbb_func_OP_2w_lsl, + bbb_func_OP_2w_lsr, + bbb_func_OP_2w_clip_asym, + bbb_func_OP_2w_clipz, + bbb_func_OP_2w_div, + bbb_func_OP_2w_divh, + bbb_func_OP_2w_mod, + bbb_func_OP_2w_sqrt_u, + bbb_func_OP_2w_mux, + bbb_func_OP_2w_avg, + bbb_func_OP_2w_avgrnd, + bbb_func_OP_2w_min, + bbb_func_OP_2w_max, + bbb_func_OP_1w_mul_realigning, +#ifdef ISP2401 + bbb_func_OP_1w_imax32, + bbb_func_OP_1w_imaxidx32, + bbb_func_OP_1w_cond_add, +#endif + + bbb_func_num_functions +} bbb_functions_t; + +typedef enum { + core_func_OP_and, + core_func_OP_or, + core_func_OP_xor, + core_func_OP_inv, + core_func_OP_add, + core_func_OP_sub, + core_func_OP_addsat, + core_func_OP_subsat, + core_func_OP_subasr1, + core_func_OP_abs, + core_func_OP_subabssat, +#ifdef ISP2401 + core_func_OP_subsat_u, +#endif + core_func_OP_muld, + core_func_OP_mul, + core_func_OP_qrmul, + core_func_OP_eq, + core_func_OP_ne, + core_func_OP_le, + core_func_OP_lt, + core_func_OP_ge, + core_func_OP_gt, + core_func_OP_asr, + core_func_OP_asl, + core_func_OP_asrrnd, + core_func_OP_lsl, + core_func_OP_lslsat, + core_func_OP_lsr, + core_func_OP_lsrrnd, + core_func_OP_clip_asym, + core_func_OP_clipz, + core_func_OP_div, + core_func_OP_mod, + core_func_OP_sqrt, + core_func_OP_mux, + core_func_OP_avgrnd, + core_func_OP_min, + core_func_OP_max, + + core_func_num_functions + +} core_functions_t; + +/* inc_bbb_count() can be used for building blocks that are implemented with one operation + inc_bbb_count_ext() will be used in case the operation count is not known or greater than one. + + For some operations there is a difference in operation count for the cloned version and the + not cloned version. this difference is not vissible on the reference code side. + We could add a min and max operation count for those operations, and keep track of those counts + separately. That way in the report the impact can be seen. */ + +#ifdef DISABLE_OPCNT +#define inc_bbb_count(func) +#define inc_bbb_count_ext(func, cnt) +#define enable_bbb_count() +#define disable_bbb_count() +#else +#define inc_bbb_count(func) _inc_bbb_count(func) +#define inc_bbb_count_ext(func, cnt) _inc_bbb_count_ext(func, cnt) +#define enable_bbb_count() _enable_bbb_count() +#define disable_bbb_count() _disable_bbb_count() +#endif + +void +inc_core_count_n( + core_functions_t func, + unsigned n); + +void +_enable_bbb_count(void); + +void +_disable_bbb_count(void); + +void +_inc_bbb_count( + bbb_functions_t func); + +void +_inc_bbb_count_ext( + bbb_functions_t func, + int op_count); + +void +bbb_func_reset_count(void); + +void +bbb_func_print_totals( + FILE * fp, + unsigned non_zero_only); + +void +core_func_print_totals( + FILE* fp, + unsigned non_zero_only); + +#endif diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_public.h new file mode 100644 index 0000000..808ec050 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isp_public.h @@ -0,0 +1,186 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_PUBLIC_H_INCLUDED__ +#define __ISP_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#include "system_types.h" + +/*! Enable or disable the program complete irq signal of ISP[ID] + + \param ID[in] SP identifier + \param cnd[in] predicate + + \return none, if(cnd) enable(ISP[ID].irq) else disable(ISP[ID].irq) + */ +extern void cnd_isp_irq_enable( + const isp_ID_t ID, + const bool cnd); + +/*! Read the state of cell ISP[ID] + + \param ID[in] ISP identifier + \param state[out] isp state structure + \param stall[out] isp stall conditions + + \return none, state = ISP[ID].state, stall = ISP[ID].stall + */ +extern void isp_get_state( + const isp_ID_t ID, + isp_state_t *state, + isp_stall_t *stall); + + +/*! Write to the status and control register of ISP[ID] + + \param ID[in] ISP identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, ISP[ID].sc[reg] = value + */ +STORAGE_CLASS_ISP_H void isp_ctrl_store( + const isp_ID_t ID, + const unsigned int reg, + const hrt_data value); + +/*! Read from the status and control register of ISP[ID] + + \param ID[in] ISP identifier + \param reg[in] register index + \param value[in] The data to be written + + \return ISP[ID].sc[reg] + */ +STORAGE_CLASS_ISP_H hrt_data isp_ctrl_load( + const isp_ID_t ID, + const unsigned int reg); + +/*! Get the status of a bitfield in the control register of ISP[ID] + + \param ID[in] ISP identifier + \param reg[in] register index + \param bit[in] The bit index to be checked + + \return (ISP[ID].sc[reg] & (1<<bit)) != 0 + */ +STORAGE_CLASS_ISP_H bool isp_ctrl_getbit( + const isp_ID_t ID, + const unsigned int reg, + const unsigned int bit); + +/*! Set a bitfield in the control register of ISP[ID] + + \param ID[in] ISP identifier + \param reg[in] register index + \param bit[in] The bit index to be set + + \return none, ISP[ID].sc[reg] |= (1<<bit) + */ +STORAGE_CLASS_ISP_H void isp_ctrl_setbit( + const isp_ID_t ID, + const unsigned int reg, + const unsigned int bit); + +/*! Clear a bitfield in the control register of ISP[ID] + + \param ID[in] ISP identifier + \param reg[in] register index + \param bit[in] The bit index to be set + + \return none, ISP[ID].sc[reg] &= ~(1<<bit) + */ +STORAGE_CLASS_ISP_H void isp_ctrl_clearbit( + const isp_ID_t ID, + const unsigned int reg, + const unsigned int bit); + +/*! Write to the DMEM of ISP[ID] + + \param ID[in] ISP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, ISP[ID].dmem[addr...addr+size-1] = data + */ +STORAGE_CLASS_ISP_H void isp_dmem_store( + const isp_ID_t ID, + unsigned int addr, + const void *data, + const size_t size); + +/*! Read from the DMEM of ISP[ID] + + \param ID[in] ISP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = ISP[ID].dmem[addr...addr+size-1] + */ +STORAGE_CLASS_ISP_H void isp_dmem_load( + const isp_ID_t ID, + const unsigned int addr, + void *data, + const size_t size); + +/*! Write a 32-bit datum to the DMEM of ISP[ID] + + \param ID[in] ISP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, ISP[ID].dmem[addr] = data + */ +STORAGE_CLASS_ISP_H void isp_dmem_store_uint32( + const isp_ID_t ID, + unsigned int addr, + const uint32_t data); + +/*! Load a 32-bit datum from the DMEM of ISP[ID] + + \param ID[in] ISP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = ISP[ID].dmem[addr] + */ +STORAGE_CLASS_ISP_H uint32_t isp_dmem_load_uint32( + const isp_ID_t ID, + const unsigned int addr); + +/*! Concatenate the LSW and MSW into a double precision word + + \param x0[in] Integer containing the LSW + \param x1[in] Integer containing the MSW + + \return x0 | (x1 << bits_per_vector_element) + */ +STORAGE_CLASS_ISP_H uint32_t isp_2w_cat_1w( + const uint16_t x0, + const uint16_t x1); + +unsigned isp_is_ready(isp_ID_t ID); + +unsigned isp_is_sleeping(isp_ID_t ID); + +void isp_start(isp_ID_t ID); + +void isp_wake(isp_ID_t ID); + +#endif /* __ISP_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_dma_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_dma_public.h new file mode 100644 index 0000000..4b16038 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_dma_public.h @@ -0,0 +1,38 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_DMA_PUBLIC_H_INCLUDED__ +#define __ISYS_DMA_PUBLIC_H_INCLUDED__ + +#ifdef USE_INPUT_SYSTEM_VERSION_2401 + +#include "system_types.h" +#include "type_support.h" + +STORAGE_CLASS_ISYS2401_DMA_H void isys2401_dma_reg_store( + const isys2401_dma_ID_t dma_id, + const unsigned int reg, + const hrt_data value); + +STORAGE_CLASS_ISYS2401_DMA_H hrt_data isys2401_dma_reg_load( + const isys2401_dma_ID_t dma_id, + const unsigned int reg); + +extern void isys2401_dma_set_max_burst_size( + const isys2401_dma_ID_t dma_id, + uint32_t max_burst_size); + +#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ + +#endif /* __ISYS_DMA_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_irq_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_irq_public.h new file mode 100644 index 0000000..c3e6f76 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_irq_public.h @@ -0,0 +1,45 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_IRQ_PUBLIC_H__ +#define __ISYS_IRQ_PUBLIC_H__ + +#include "isys_irq_global.h" +#include "isys_irq_local.h" + +#if defined(USE_INPUT_SYSTEM_VERSION_2401) + +STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_state_get( + const isys_irq_ID_t isys_irqc_id, + isys_irqc_state_t *state); + +STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_state_dump( + const isys_irq_ID_t isys_irqc_id, + const isys_irqc_state_t *state); + +STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_reg_store( + const isys_irq_ID_t isys_irqc_id, + const unsigned int reg_idx, + const hrt_data value); + +STORAGE_CLASS_ISYS2401_IRQ_H hrt_data isys_irqc_reg_load( + const isys_irq_ID_t isys_irqc_id, + const unsigned int reg_idx); + +STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_status_enable( + const isys_irq_ID_t isys_irqc_id); + +#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ + +#endif /* __ISYS_IRQ_PUBLIC_H__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_public.h new file mode 100644 index 0000000..097dde8 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_public.h @@ -0,0 +1,37 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_PUBLIC_H_INCLUDED__ +#define __ISYS_PUBLIC_H_INCLUDED__ + +#ifdef USE_INPUT_SYSTEM_VERSION_2401 +/*! Read the state of INPUT_SYSTEM[ID] + \param ID[in] INPUT_SYSTEM identifier + \param state[out] pointer to input system state structure + \return none, state = INPUT_SYSTEM[ID].state + */ +STORAGE_CLASS_INPUT_SYSTEM_H input_system_err_t input_system_get_state( + const input_system_ID_t ID, + input_system_state_t *state); +/*! Dump the state of INPUT_SYSTEM[ID] + \param ID[in] INPUT_SYSTEM identifier + \param state[in] pointer to input system state structure + \return none + \depends on host supplied print function as part of ia_css_init() + */ +STORAGE_CLASS_INPUT_SYSTEM_H void input_system_dump_state( + const input_system_ID_t ID, + input_system_state_t *state); +#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ +#endif /* __ISYS_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_stream2mmio_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_stream2mmio_public.h new file mode 100644 index 0000000..5624cfc --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/isys_stream2mmio_public.h @@ -0,0 +1,101 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_STREAM2MMIO_PUBLIC_H_INCLUDED__ +#define __ISYS_STREAM2MMIO_PUBLIC_H_INCLUDED__ + +/***************************************************** + * + * Native command interface (NCI). + * + *****************************************************/ +/** + * @brief Get the stream2mmio-controller state. + * Get the state of the stream2mmio-controller regiester-set. + * + * @param[in] id The global unique ID of the steeam2mmio controller. + * @param[out] state Point to the register-state. + */ +STORAGE_CLASS_STREAM2MMIO_H void stream2mmio_get_state( + const stream2mmio_ID_t ID, + stream2mmio_state_t *state); + +/** + * @brief Get the state of the stream2mmio-controller sidess. + * Get the state of the register set per buf-controller sidess. + * + * @param[in] id The global unique ID of the steeam2mmio controller. + * @param[in] sid_id The sid ID. + * @param[out] state Point to the sid state. + */ +STORAGE_CLASS_STREAM2MMIO_H void stream2mmio_get_sid_state( + const stream2mmio_ID_t ID, + const stream2mmio_sid_ID_t sid_id, + stream2mmio_sid_state_t *state); +/** end of NCI */ + +/***************************************************** + * + * Device level interface (DLI). + * + *****************************************************/ +/** + * @brief Load the register value. + * Load the value of the register of the stream2mmio-controller. + * + * @param[in] ID The global unique ID for the stream2mmio-controller instance. + * @param[in] sid_id The SID in question. + * @param[in] reg_idx The offet address of the register. + * + * @return the value of the register. + */ +STORAGE_CLASS_STREAM2MMIO_H hrt_data stream2mmio_reg_load( + const stream2mmio_ID_t ID, + const stream2mmio_sid_ID_t sid_id, + const uint32_t reg_idx); + +/** + * @brief Dump the SID processor state. + * Dump the state of the sid regiester-set. + * + * @param[in] state Pointer to the register-state. + */ +STORAGE_CLASS_STREAM2MMIO_H void stream2mmio_print_sid_state( + stream2mmio_sid_state_t *state); +/** + * @brief Dump the stream2mmio state. + * Dump the state of the ibuf-controller regiester-set. + * + * @param[in] id The global unique ID of the st2mmio + * @param[in] state Pointer to the register-state. + */ +STORAGE_CLASS_STREAM2MMIO_H void stream2mmio_dump_state( + const stream2mmio_ID_t ID, + stream2mmio_state_t *state); +/** + * @brief Store a value to the register. + * Store a value to the registe of the stream2mmio-controller. + * + * @param[in] ID The global unique ID for the stream2mmio-controller instance. + * @param[in] reg The offet address of the register. + * @param[in] value The value to be stored. + * + */ +STORAGE_CLASS_STREAM2MMIO_H void stream2mmio_reg_store( + const stream2mmio_ID_t ID, + const hrt_address reg, + const hrt_data value); +/** end of DLI */ + +#endif /* __ISYS_STREAM2MMIO_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/mmu_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/mmu_public.h new file mode 100644 index 0000000..4258fa8 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/mmu_public.h @@ -0,0 +1,82 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MMU_PUBLIC_H_INCLUDED__ +#define __MMU_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +/*! Set the page table base index of MMU[ID] + + \param ID[in] MMU identifier + \param base_index[in] page table base index + + \return none, MMU[ID].page_table_base_index = base_index + */ +STORAGE_CLASS_EXTERN void mmu_set_page_table_base_index( + const mmu_ID_t ID, + const hrt_data base_index); + +/*! Get the page table base index of MMU[ID] + + \param ID[in] MMU identifier + \param base_index[in] page table base index + + \return MMU[ID].page_table_base_index + */ +STORAGE_CLASS_EXTERN hrt_data mmu_get_page_table_base_index( + const mmu_ID_t ID); + +/*! Invalidate the page table cache of MMU[ID] + + \param ID[in] MMU identifier + + \return none + */ +STORAGE_CLASS_EXTERN void mmu_invalidate_cache( + const mmu_ID_t ID); + + +/*! Invalidate the page table cache of all MMUs + + \return none + */ +STORAGE_CLASS_EXTERN void mmu_invalidate_cache_all(void); + +/*! Write to a control register of MMU[ID] + + \param ID[in] MMU identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, MMU[ID].ctrl[reg] = value + */ +STORAGE_CLASS_MMU_H void mmu_reg_store( + const mmu_ID_t ID, + const unsigned int reg, + const hrt_data value); + +/*! Read from a control register of MMU[ID] + + \param ID[in] MMU identifier + \param reg[in] register index + \param value[in] The data to be written + + \return MMU[ID].ctrl[reg] + */ +STORAGE_CLASS_MMU_H hrt_data mmu_reg_load( + const mmu_ID_t ID, + const unsigned int reg); + +#endif /* __MMU_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/osys_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/osys_public.h new file mode 100644 index 0000000..8695e3c --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/osys_public.h @@ -0,0 +1,20 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __OSYS_PUBLIC_H_INCLUDED__ +#define __OSYS_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +#endif /* __OSYS_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pipeline_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pipeline_public.h new file mode 100644 index 0000000..32cea58 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pipeline_public.h @@ -0,0 +1,18 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PIPELINE_PUBLIC_H_INCLUDED__ +#define __PIPELINE_PUBLIC_H_INCLUDED__ + +#endif /* __PIPELINE_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pixelgen_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pixelgen_public.h new file mode 100644 index 0000000..c0f3f3e --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/pixelgen_public.h @@ -0,0 +1,79 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PIXELGEN_PUBLIC_H_INCLUDED__ +#define __PIXELGEN_PUBLIC_H_INCLUDED__ + +#ifdef USE_INPUT_SYSTEM_VERSION_2401 +/***************************************************** + * + * Native command interface (NCI). + * + *****************************************************/ +/** + * @brief Get the pixelgen state. + * Get the state of the pixelgen regiester-set. + * + * @param[in] id The global unique ID of the pixelgen controller. + * @param[out] state Point to the register-state. + */ +STORAGE_CLASS_PIXELGEN_H void pixelgen_ctrl_get_state( + const pixelgen_ID_t ID, + pixelgen_ctrl_state_t *state); +/** + * @brief Dump the pixelgen state. + * Dump the state of the pixelgen regiester-set. + * + * @param[in] id The global unique ID of the pixelgen controller. + * @param[in] state Point to the register-state. + */ +STORAGE_CLASS_PIXELGEN_H void pixelgen_ctrl_dump_state( + const pixelgen_ID_t ID, + pixelgen_ctrl_state_t *state); +/** end of NCI */ + +/***************************************************** + * + * Device level interface (DLI). + * + *****************************************************/ +/** + * @brief Load the register value. + * Load the value of the register of the pixelgen + * + * @param[in] ID The global unique ID for the pixelgen instance. + * @param[in] reg The offet address of the register. + * + * @return the value of the register. + */ +STORAGE_CLASS_PIXELGEN_H hrt_data pixelgen_ctrl_reg_load( + const pixelgen_ID_t ID, + const hrt_address reg); +/** + * @brief Store a value to the register. + * Store a value to the registe of the pixelgen + * + * @param[in] ID The global unique ID for the pixelgen. + * @param[in] reg The offet address of the register. + * @param[in] value The value to be stored. + * + */ +STORAGE_CLASS_PIXELGEN_H void pixelgen_ctrl_reg_store( + const pixelgen_ID_t ID, + const hrt_address reg, + const hrt_data value); +/** end of DLI */ + +#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ +#endif /* __PIXELGEN_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func.h new file mode 100644 index 0000000..3e955fc --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func.h @@ -0,0 +1,1222 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef _REF_VECTOR_FUNC_H_INCLUDED_ +#define _REF_VECTOR_FUNC_H_INCLUDED_ + +#include "storage_class.h" + +#ifdef INLINE_VECTOR_FUNC +#define STORAGE_CLASS_REF_VECTOR_FUNC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_REF_VECTOR_DATA_H STORAGE_CLASS_INLINE_DATA +#else /* INLINE_VECTOR_FUNC */ +#define STORAGE_CLASS_REF_VECTOR_FUNC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_REF_VECTOR_DATA_H STORAGE_CLASS_EXTERN_DATA +#endif /* INLINE_VECTOR_FUNC */ + + +#include "ref_vector_func_types.h" + +/** @brief Doubling multiply accumulate with saturation + * + * @param[in] acc accumulator + * @param[in] a multiply input + * @param[in] b multiply input + * + * @return acc + (a*b) + * + * This function will do a doubling multiply ont + * inputs a and b, and will add the result to acc. + * in case of an overflow of acc, it will saturate. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector2w OP_1w_maccd_sat( + tvector2w acc, + tvector1w a, + tvector1w b ); + +/** @brief Doubling multiply accumulate + * + * @param[in] acc accumulator + * @param[in] a multiply input + * @param[in] b multiply input + * + * @return acc + (a*b) + * + * This function will do a doubling multiply ont + * inputs a and b, and will add the result to acc. + * in case of overflow it will not saturate but wrap around. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector2w OP_1w_maccd( + tvector2w acc, + tvector1w a, + tvector1w b ); + +/** @brief Re-aligning multiply + * + * @param[in] a multiply input + * @param[in] b multiply input + * @param[in] shift shift amount + * + * @return (a*b)>>shift + * + * This function will multiply a with b, followed by a right + * shift with rounding. the result is saturated and casted + * to single precision. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_mul_realigning( + tvector1w a, + tvector1w b, + tscalar1w shift ); + +/** @brief Leading bit index + * + * @param[in] a input + * + * @return index of the leading bit of each element + * + * This function finds the index of leading one (set) bit of the + * input. The index starts with 0 for the LSB and can go upto + * ISP_VEC_ELEMBITS-1 for the MSB. For an input equal to zero, + * the returned index is -1. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_lod( + tvector1w a); + +/** @brief Config Unit Input Processing + * + * @param[in] a input + * @param[in] input_scale input scaling factor + * @param[in] input_offset input offset factor + * + * @return scaled & offset added input clamped to MAXVALUE + * + * As part of input processing for piecewise linear estimation config unit, + * this function will perform scaling followed by adding offset and + * then clamping to the MAX InputValue + * It asserts -MAX_SHIFT_1W <= input_scale <= MAX_SHIFT_1W, and + * -MAX_SHIFT_1W <= input_offset <= MAX_SHIFT_1W + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_input_scaling_offset_clamping( + tvector1w a, + tscalar1w_5bit_signed input_scale, + tscalar1w_5bit_signed input_offset); + +/** @brief Config Unit Output Processing + * + * @param[in] a output + * @param[in] output_scale output scaling factor + * + * @return scaled & clamped output value + * + * As part of output processing for piecewise linear estimation config unit, + * This function will perform scaling and then clamping to output + * MAX value. + * It asserts -MAX_SHIFT_1W <= output_scale <= MAX_SHIFT_1W + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_output_scaling_clamping( + tvector1w a, + tscalar1w_5bit_signed output_scale); + +/** @brief Config Unit Piecewiselinear estimation + * + * @param[in] a input + * @param[in] config_points config parameter structure + * + * @return piecewise linear estimated output + * + * Given a set of N points {(x1,y1),()x2,y2), ....,(xn,yn)}, to find + * the functional value at an arbitrary point around the input set, + * this function will perform input processing followed by piecewise + * linear estimation and then output processing to yield the final value. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_piecewise_estimation( + tvector1w a, + ref_config_points config_points); + +/** @brief Fast Config Unit + * + * @param[in] x input + * @param[in] init_vectors LUT data structure + * + * @return piecewise linear estimated output + * This block gets an input x and a set of input configuration points stored in a look-up + * table of 32 elements. First, the x input is clipped to be within the range [x1, xn+1]. + * Then, it computes the interval in which the input lies. Finally, the output is computed + * by performing linear interpolation based on the interval properties (i.e. x_prev, slope, + * and offset). This block assumes that the points are equally spaced and that the interval + * size is a power of 2. + **/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_XCU( + tvector1w x, + xcu_ref_init_vectors init_vectors); + + +/** @brief LXCU + * + * @param[in] x input + * @param[in] init_vectors LUT data structure + * + * @return logarithmic piecewise linear estimated output. + * This block gets an input x and a set of input configuration points stored in a look-up + * table of 32 elements. It computes the interval in which the input lies. + * Then output is computed by performing linear interpolation based on the interval + * properties (i.e. x_prev, slope, * and offset). + * This BBB assumes spacing x-coordinates of "init vectors" increase exponentially as + * shown below. + * interval size : 2^0 2^1 2^2 2^3 + * x-coordinates: x0<--->x1<---->x2<---->x3<----> + **/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_LXCU( + tvector1w x, + xcu_ref_init_vectors init_vectors); + +/** @brief Coring + * + * @param[in] coring_vec Amount of coring based on brightness level + * @param[in] filt_input Vector of input pixels on which Coring is applied + * @param[in] m_CnrCoring0 Coring Level0 + * + * @return vector of filtered pixels after coring is applied + * + * This function will perform adaptive coring based on brightness level to + * remove noise + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w coring( + tvector1w coring_vec, + tvector1w filt_input, + tscalar1w m_CnrCoring0 ); + +/** @brief Normalised FIR with coefficients [3,4,1] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [3,4,1], + *-5dB at Fs/2, -90 degree phase shift (quarter pixel) + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_5dB_m90_nrm ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [1,4,3] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1,4,3], + *-5dB at Fs/2, +90 degree phase shift (quarter pixel) + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_5dB_p90_nrm ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [1,2,1] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1,2,1], -6dB at Fs/2 + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [13,16,3] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [13,16,3], + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm_ph0 ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [9,16,7] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [9,16,7], + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm_ph1 ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [5,16,11] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [5,16,11], + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm_ph2 ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with coefficients [1,16,15] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1,16,15], + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm_ph3 ( + const s_1w_1x3_matrix m); + +/** @brief Normalised FIR with programable phase shift + * + * @param[in] m 1x3 matrix with pixels + * @param[in] coeff phase shift + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [8-coeff,16,8+coeff], + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_6dB_nrm_calc_coeff ( + const s_1w_1x3_matrix m, tscalar1w_3bit coeff); + +/** @brief 3 tap FIR with coefficients [1,1,1] + * + * @param[in] m 1x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * FIR with coefficients [1,1,1], -9dB at Fs/2 normalized with factor 1/2 + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x3m_9dB_nrm ( + const s_1w_1x3_matrix m); + +#ifdef ISP2401 +/** @brief symmetric 3 tap FIR acts as LPF or BSF + * + * @param[in] m 1x3 matrix with pixels + * @param[in] k filter coefficient shift + * @param[in] bsf_flag 1 for BSF and 0 for LPF + * + * @return filtered output + * + * This function performs variable coefficient symmetric 3 tap filter which can + * be either used as Low Pass Filter or Band Stop Filter. + * Symmetric 3tap tap filter with DC gain 1 has filter coefficients [a, 1-2a, a] + * For LPF 'a' can be approximated as (1 - 2^(-k))/4, k = 0, 1, 2, ... + * and filter output can be approximated as: + * out_LPF = ((v00 + v02) - ((v00 + v02) >> k) + (2 * (v01 + (v01 >> k)))) >> 2 + * For BSF 'a' can be approximated as (1 + 2^(-k))/4, k = 0, 1, 2, ... + * and filter output can be approximated as: + * out_BSF = ((v00 + v02) + ((v00 + v02) >> k) + (2 * (v01 - (v01 >> k)))) >> 2 + * For a given filter coefficient shift 'k' and bsf_flag this function + * behaves either as LPF or BSF. + * All computation is done using 1w arithmetic and implementation does not use + * any multiplication. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +sym_fir1x3m_lpf_bsf(s_1w_1x3_matrix m, + tscalar1w k, + tscalar_bool bsf_flag); +#endif + +/** @brief Normalised 2D FIR with coefficients [1;2;1] * [1,2,1] + * + * @param[in] m 3x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1;2;1] * [1,2,1] + * Unity gain filter through repeated scaling and rounding + * - 6 rotate operations per output + * - 8 vector operations per output + * _______ + * 14 total operations + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir3x3m_6dB_nrm ( + const s_1w_3x3_matrix m); + +/** @brief Normalised 2D FIR with coefficients [1;1;1] * [1,1,1] + * + * @param[in] m 3x3 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1;1;1] * [1,1,1] + * + * (near) Unity gain filter through repeated scaling and rounding + * - 6 rotate operations per output + * - 8 vector operations per output + * _______ + * 14 operations + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir3x3m_9dB_nrm ( + const s_1w_3x3_matrix m); + +/** @brief Normalised dual output 2D FIR with coefficients [1;2;1] * [1,2,1] + * + * @param[in] m 4x3 matrix with pixels + * + * @return two filtered outputs (2x1 matrix) + * + * This function will calculate the + * Normalised FIR with coefficients [1;2;1] * [1,2,1] + * and produce two outputs (vertical) + * Unity gain filter through repeated scaling and rounding + * compute two outputs per call to re-use common intermediates + * - 4 rotate operations per output + * - 6 vector operations per output (alternative possible, but in this + * form it's not obvious to re-use variables) + * _______ + * 10 total operations + */ + STORAGE_CLASS_REF_VECTOR_FUNC_H s_1w_2x1_matrix fir3x3m_6dB_out2x1_nrm ( + const s_1w_4x3_matrix m); + +/** @brief Normalised dual output 2D FIR with coefficients [1;1;1] * [1,1,1] + * + * @param[in] m 4x3 matrix with pixels + * + * @return two filtered outputs (2x1 matrix) + * + * This function will calculate the + * Normalised FIR with coefficients [1;1;1] * [1,1,1] + * and produce two outputs (vertical) + * (near) Unity gain filter through repeated scaling and rounding + * compute two outputs per call to re-use common intermediates + * - 4 rotate operations per output + * - 7 vector operations per output (alternative possible, but in this + * form it's not obvious to re-use variables) + * _______ + * 11 total operations + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H s_1w_2x1_matrix fir3x3m_9dB_out2x1_nrm ( + const s_1w_4x3_matrix m); + +/** @brief Normalised 2D FIR 5x5 + * + * @param[in] m 5x5 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1;1;1] * [1;2;1] * [1,2,1] * [1,1,1] + * and produce a filtered output + * (near) Unity gain filter through repeated scaling and rounding + * - 20 rotate operations per output + * - 28 vector operations per output + * _______ + * 48 total operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir5x5m_15dB_nrm ( + const s_1w_5x5_matrix m); + +/** @brief Normalised FIR 1x5 + * + * @param[in] m 1x5 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1,2,1] * [1,1,1] = [1,4,6,4,1] + * and produce a filtered output + * (near) Unity gain filter through repeated scaling and rounding + * - 4 rotate operations per output + * - 5 vector operations per output + * _______ + * 9 total operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x5m_12dB_nrm ( + const s_1w_1x5_matrix m); + +/** @brief Normalised 2D FIR 5x5 + * + * @param[in] m 5x5 matrix with pixels + * + * @return filtered output + * + * This function will calculate the + * Normalised FIR with coefficients [1;2;1] * [1;2;1] * [1,2,1] * [1,2,1] + * and produce a filtered output + * (near) Unity gain filter through repeated scaling and rounding + * - 20 rotate operations per output + * - 30 vector operations per output + * _______ + * 50 total operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir5x5m_12dB_nrm ( + const s_1w_5x5_matrix m); + +/** @brief Approximate averaging FIR 1x5 + * + * @param[in] m 1x5 matrix with pixels + * + * @return filtered output + * + * This function will produce filtered output by + * applying the filter coefficients (1/8) * [1,1,1,1,1] + * _______ + * 5 vector operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x5m_box ( + s_1w_1x5_matrix m); + +/** @brief Approximate averaging FIR 1x9 + * + * @param[in] m 1x9 matrix with pixels + * + * @return filtered output + * + * This function will produce filtered output by + * applying the filter coefficients (1/16) * [1,1,1,1,1,1,1,1,1] + * _______ + * 9 vector operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x9m_box ( + s_1w_1x9_matrix m); + +/** @brief Approximate averaging FIR 1x11 + * + * @param[in] m 1x11 matrix with pixels + * + * @return filtered output + * + * This function will produce filtered output by + * applying the filter coefficients (1/16) * [1,1,1,1,1,1,1,1,1,1,1] + * _______ + * 12 vector operations +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w fir1x11m_box ( + s_1w_1x11_matrix m); + +/** @brief Symmetric 7 tap filter with normalization + * + * @param[in] in 1x7 matrix with pixels + * @param[in] coeff 1x4 matrix with coefficients + * @param[in] out_shift output pixel shift value for normalization + * + * @return symmetric 7 tap filter output + * + * This function performs symmetric 7 tap filter over input pixels. + * Filter sum is normalized by shifting out_shift bits. + * Filter sum: p0*c3 + p1*c2 + p2*c1 + p3*c0 + p4*c1 + p5*c2 + p6*c3 + * is implemented as: (p0 + p6)*c3 + (p1 + p5)*c2 + (p2 + p4)*c1 + p3*c0 to + * reduce multiplication. + * Input pixels should to be scaled, otherwise overflow is possible during + * addition +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x7m_sym_nrm(s_1w_1x7_matrix in, + s_1w_1x4_matrix coeff, + tvector1w out_shift); + +/** @brief Symmetric 7 tap filter with normalization at input side + * + * @param[in] in 1x7 matrix with pixels + * @param[in] coeff 1x4 matrix with coefficients + * + * @return symmetric 7 tap filter output + * + * This function performs symmetric 7 tap filter over input pixels. + * Filter sum: p0*c3 + p1*c2 + p2*c1 + p3*c0 + p4*c1 + p5*c2 + p6*c3 + * = (p0 + p6)*c3 + (p1 + p5)*c2 + (p2 + p4)*c1 + p3*c0 + * Input pixels and coefficients are in Qn format, where n = + * ISP_VEC_ELEMBITS - 1 (ie Q15 for Broxton) + * To avoid double precision arithmetic input pixel sum and final sum is + * implemented using avgrnd and coefficient multiplication using qrmul. + * Final result is in Qm format where m = ISP_VEC_ELEMBITS - 2 (ie Q14 for + * Broxton) +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x7m_sym_innrm_approx(s_1w_1x7_matrix in, + s_1w_1x4_matrix coeff); + +/** @brief Symmetric 7 tap filter with normalization at output side + * + * @param[in] in 1x7 matrix with pixels + * @param[in] coeff 1x4 matrix with coefficients + * + * @return symmetric 7 tap filter output + * + * This function performs symmetric 7 tap filter over input pixels. + * Filter sum: p0*c3 + p1*c2 + p2*c1 + p3*c0 + p4*c1 + p5*c2 + p6*c3 + * = (p0 + p6)*c3 + (p1 + p5)*c2 + (p2 + p4)*c1 + p3*c0 + * Input pixels are in Qn and coefficients are in Qm format, where n = + * ISP_VEC_ELEMBITS - 2 and m = ISP_VEC_ELEMBITS - 1 (ie Q14 and Q15 + * respectively for Broxton) + * To avoid double precision arithmetic input pixel sum and final sum is + * implemented using addsat and coefficient multiplication using qrmul. + * Final sum is left shifted by 2 and saturated to produce result is Qm format + * (ie Q15 for Broxton) +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x7m_sym_outnrm_approx(s_1w_1x7_matrix in, + s_1w_1x4_matrix coeff); + +/** @brief 4 tap filter with normalization + * + * @param[in] in 1x4 matrix with pixels + * @param[in] coeff 1x4 matrix with coefficients + * @param[in] out_shift output pixel shift value for normalization + * + * @return 4 tap filter output + * + * This function performs 4 tap filter over input pixels. + * Filter sum is normalized by shifting out_shift bits. + * Filter sum: p0*c0 + p1*c1 + p2*c2 + p3*c3 +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x4m_nrm(s_1w_1x4_matrix in, + s_1w_1x4_matrix coeff, + tvector1w out_shift); + +/** @brief 4 tap filter with normalization for half pixel interpolation + * + * @param[in] in 1x4 matrix with pixels + * + * @return 4 tap filter output with filter tap [-1 9 9 -1]/16 + * + * This function performs 4 tap filter over input pixels. + * Filter sum: -p0 + 9*p1 + 9*p2 - p3 + * This filter implementation is completely free from multiplication and double + * precision arithmetic. + * Typical usage of this filter is to half pixel interpolation of Bezier + * surface + * */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x4m_bicubic_bezier_half(s_1w_1x4_matrix in); + +/** @brief 4 tap filter with normalization for quarter pixel interpolation + * + * @param[in] in 1x4 matrix with pixels + * @param[in] coeff 1x4 matrix with coefficients + * + * @return 4 tap filter output + * + * This function performs 4 tap filter over input pixels. + * Filter sum: p0*c0 + p1*c1 + p2*c2 + p3*c3 + * To avoid double precision arithmetic we implemented multiplication using + * qrmul and addition using avgrnd. Coefficients( c0 to c3) formats are assumed + * to be: Qm, Qn, Qo, Qm, where m = n + 2 and o = n + 1. + * Typical usage of this filter is to quarter pixel interpolation of Bezier + * surface with filter coefficients:[-9 111 29 -3]/128. For which coefficient + * values should be: [-9216/2^17 28416/2^15 1484/2^16 -3072/2^17] for + * ISP_VEC_ELEMBITS = 16. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x4m_bicubic_bezier_quarter(s_1w_1x4_matrix in, + s_1w_1x4_matrix coeff); + + +/** @brief Symmetric 3 tap filter with normalization + * + * @param[in] in 1x3 matrix with pixels + * @param[in] coeff 1x2 matrix with coefficients + * @param[in] out_shift output pixel shift value for normalization + * + * @return symmetric 3 tap filter output + * + * This function performs symmetric 3 tap filter input pixels. + * Filter sum is normalized by shifting out_shift bits. + * Filter sum: p0*c1 + p1*c0 + p2*c1 + * is implemented as: (p0 + p2)*c1 + p1*c0 to reduce multiplication. + * Input pixels should to be scaled, otherwise overflow is possible during + * addition +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x3m_sym_nrm(s_1w_1x3_matrix in, + s_1w_1x2_matrix coeff, + tvector1w out_shift); + +/** @brief Symmetric 3 tap filter with normalization + * + * @param[in] in 1x3 matrix with pixels + * @param[in] coeff 1x2 matrix with coefficients + * + * @return symmetric 3 tap filter output + * + * This function performs symmetric 3 tap filter over input pixels. + * Filter sum: p0*c1 + p1*c0 + p2*c1 = (p0 + p2)*c1 + p1*c0 + * Input pixels are in Qn and coefficient c0 is in Qm and c1 is in Qn format, + * where n = ISP_VEC_ELEMBITS - 1 and m = ISP_VEC_ELEMBITS - 2 ( ie Q15 and Q14 + * respectively for Broxton) + * To avoid double precision arithmetic input pixel sum is implemented using + * avgrnd, coefficient multiplication using qrmul and final sum using addsat + * Final sum is Qm format (ie Q14 for Broxton) +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +fir1x3m_sym_nrm_approx(s_1w_1x3_matrix in, + s_1w_1x2_matrix coeff); + +/** @brief Mean of 1x3 matrix + * + * @param[in] m 1x3 matrix with pixels + * + * @return mean of 1x3 matrix + * + * This function calculates the mean of 1x3 pixels, + * with a factor of 4/3. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean1x3m( + s_1w_1x3_matrix m); + +/** @brief Mean of 3x3 matrix + * + * @param[in] m 3x3 matrix with pixels + * + * @return mean of 3x3 matrix + * + * This function calculates the mean of 3x3 pixels, + * with a factor of 16/9. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean3x3m( + s_1w_3x3_matrix m); + +/** @brief Mean of 1x4 matrix + * + * @param[in] m 1x4 matrix with pixels + * + * @return mean of 1x4 matrix + * + * This function calculates the mean of 1x4 pixels +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean1x4m( + s_1w_1x4_matrix m); + +/** @brief Mean of 4x4 matrix + * + * @param[in] m 4x4 matrix with pixels + * + * @return mean of 4x4 matrix + * + * This function calculates the mean of 4x4 matrix with pixels +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean4x4m( + s_1w_4x4_matrix m); + +/** @brief Mean of 2x3 matrix + * + * @param[in] m 2x3 matrix with pixels + * + * @return mean of 2x3 matrix + * + * This function calculates the mean of 2x3 matrix with pixels + * with a factor of 8/6. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean2x3m( + s_1w_2x3_matrix m); + +/** @brief Mean of 1x5 matrix + * + * @param[in] m 1x5 matrix with pixels + * + * @return mean of 1x5 matrix + * + * This function calculates the mean of 1x5 matrix with pixels + * with a factor of 8/5. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean1x5m(s_1w_1x5_matrix m); + +/** @brief Mean of 1x6 matrix + * + * @param[in] m 1x6 matrix with pixels + * + * @return mean of 1x6 matrix + * + * This function calculates the mean of 1x6 matrix with pixels + * with a factor of 8/6. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean1x6m( + s_1w_1x6_matrix m); + +/** @brief Mean of 5x5 matrix + * + * @param[in] m 5x5 matrix with pixels + * + * @return mean of 5x5 matrix + * + * This function calculates the mean of 5x5 matrix with pixels + * with a factor of 32/25. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean5x5m( + s_1w_5x5_matrix m); + +/** @brief Mean of 6x6 matrix + * + * @param[in] m 6x6 matrix with pixels + * + * @return mean of 6x6 matrix + * + * This function calculates the mean of 6x6 matrix with pixels + * with a factor of 64/36. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w mean6x6m( + s_1w_6x6_matrix m); + +/** @brief Minimum of 4x4 matrix + * + * @param[in] m 4x4 matrix with pixels + * + * @return minimum of 4x4 matrix + * + * This function calculates the minimum of + * 4x4 matrix with pixels. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w min4x4m( + s_1w_4x4_matrix m); + +/** @brief Maximum of 4x4 matrix + * + * @param[in] m 4x4 matrix with pixels + * + * @return maximum of 4x4 matrix + * + * This function calculates the maximum of + * 4x4 matrix with pixels. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w max4x4m( + s_1w_4x4_matrix m); + +/** @brief SAD between two 3x3 matrices + * + * @param[in] a 3x3 matrix with pixels + * + * @param[in] b 3x3 matrix with pixels + * + * @return 3x3 matrix SAD + * + * This function calculates the sum of absolute difference between two matrices. + * Both input pixels and SAD are normalized by a factor of SAD3x3_IN_SHIFT and + * SAD3x3_OUT_SHIFT respectively. + * Computed SAD is 1/(2 ^ (SAD3x3_IN_SHIFT + SAD3x3_OUT_SHIFT)) ie 1/16 factor + * of original SAD and it's more precise than sad3x3m() +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w sad3x3m_precise( + s_1w_3x3_matrix a, + s_1w_3x3_matrix b); + +/** @brief SAD between two 3x3 matrices + * + * @param[in] a 3x3 matrix with pixels + * + * @param[in] b 3x3 matrix with pixels + * + * @return 3x3 matrix SAD + * + * This function calculates the sum of absolute difference between two matrices. + * This version saves cycles by avoiding input normalization and wide vector + * operation during sum computation + * Input pixel differences are computed by absolute of rounded, halved + * subtraction. Normalized sum is computed by rounded averages. + * Computed SAD is (1/2)*(1/16) = 1/32 factor of original SAD. Factor 1/2 comes + * from input halving operation and factor 1/16 comes from mean operation +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w sad3x3m( + s_1w_3x3_matrix a, + s_1w_3x3_matrix b); + +/** @brief SAD between two 5x5 matrices + * + * @param[in] a 5x5 matrix with pixels + * + * @param[in] b 5x5 matrix with pixels + * + * @return 5x5 matrix SAD + * + * Computed SAD is = 1/32 factor of original SAD. +*/ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w sad5x5m( + s_1w_5x5_matrix a, + s_1w_5x5_matrix b); + +/** @brief Absolute gradient between two sets of 1x5 matrices + * + * @param[in] m0 first set of 1x5 matrix with pixels + * @param[in] m1 second set of 1x5 matrix with pixels + * + * @return absolute gradient between two 1x5 matrices + * + * This function computes mean of two input 1x5 matrices and returns + * absolute difference between two mean values. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w +absgrad1x5m(s_1w_1x5_matrix m0, s_1w_1x5_matrix m1); + +/** @brief Bi-linear Interpolation optimized(approximate) + * + * @param[in] a input0 + * @param[in] b input1 + * @param[in] c cloned weight factor + * + * @return (a-b)*c + b + * + * This function will do bi-linear Interpolation on + * inputs a and b using constant weight factor c + * + * Inputs a,b are assumed in S1.15 format + * Weight factor has to be in range [0,1] and is assumed to be in S2.14 format + * + * The bilinear interpolation equation is (a*c) + b*(1-c), + * But this is implemented as (a-b)*c + b for optimization + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_bilinear_interpol_approx_c( + tvector1w a, + tvector1w b, + tscalar1w_weight c); + +/** @brief Bi-linear Interpolation optimized(approximate) + * + * @param[in] a input0 + * @param[in] b input1 + * @param[in] c weight factor + * + * @return (a-b)*c + b + * + * This function will do bi-linear Interpolation on + * inputs a and b using weight factor c + * + * Inputs a,b are assumed in S1.15 format + * Weight factor has to be in range [0,1] and is assumed to be in S2.14 format + * + * The bilinear interpolation equation is (a*c) + b*(1-c), + * But this is implemented as (a-b)*c + b for optimization + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_bilinear_interpol_approx( + tvector1w a, + tvector1w b, + tvector1w_weight c); + +/** @brief Bi-linear Interpolation + * + * @param[in] a input0 + * @param[in] b input1 + * @param[in] c weight factor + * + * @return (a*c) + b*(1-c) + * + * This function will do bi-linear Interpolation on + * inputs a and b using weight factor c + * + * Inputs a,b are assumed in S1.15 format + * Weight factor has to be in range [0,1] and is assumed to be in S2.14 format + * + * The bilinear interpolation equation is (a*c) + b*(1-c), + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_bilinear_interpol( + tvector1w a, + tvector1w b, + tscalar1w_weight c); + +/** @brief Generic Block Matching Algorithm + * @param[in] search_window pointer to input search window of 16x16 pixels + * @param[in] ref_block pointer to input reference block of 8x8 pixels, where N<=M + * @param[in] output pointer to output sads + * @param[in] search_sz search size for SAD computation + * @param[in] ref_sz block size + * @param[in] pixel_shift pixel shift to search the data + * @param[in] search_block_sz search window block size + * @param[in] shift shift value, with which the output is shifted right + * + * @return 0 when the computation is successful. + + * * This function compares the reference block with a block of size NxN in the search + * window. Sum of absolute differences for each pixel in the reference block and the + * corresponding pixel in the search block. Whole search window os traversed with the + * reference block with the given pixel shift. + * + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H int generic_block_matching_algorithm( + tscalar1w **search_window, + tscalar1w **ref_block, + tscalar1w *output, + int search_sz, + int ref_sz, + int pixel_shift, + int search_block_sz, + tscalar1w_4bit_bma_shift shift); + +#ifndef ISP2401 +/** @brief OP_1w_asp_bma_16_1_32way +#else +/** @brief OP_1w_asp_bma_16_1_32way_nomask +#endif + * + * @param[in] search_area input search window of 16x16 pixels + * @param[in] input_block input reference block of 8x8 pixels, where N<=M + * @param[in] shift shift value, with which the output is shifted right + * + * @return 81 SADs for all the search blocks. + + * This function compares the reference block with a block of size 8x8 pixels in the + * search window of 16x16 pixels. Sum of absolute differences for each pixel in the + * reference block and the corresponding pixel in the search block is calculated. + * Whole search window is traversed with the reference block with the pixel shift of 1 + * pixels. The output is right shifted with the given shift value. The shift value is + * a 4 bit value. + * + */ + +#ifndef ISP2401 +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_16_1 OP_1w_asp_bma_16_1_32way( +#else +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_16_1 OP_1w_asp_bma_16_1_32way_nomask( +#endif + bma_16x16_search_window search_area, + ref_block_8x8 input_block, + tscalar1w_4bit_bma_shift shift); + +#ifndef ISP2401 +/** @brief OP_1w_asp_bma_16_2_32way +#else +/** @brief OP_1w_asp_bma_16_2_32way_nomask +#endif + * + * @param[in] search_area input search window of 16x16 pixels + * @param[in] input_block input reference block of 8x8 pixels, where N<=M + * @param[in] shift shift value, with which the output is shifted right + * + * @return 25 SADs for all the search blocks. + * This function compares the reference block with a block of size 8x8 in the search + * window of 16x61. Sum of absolute differences for each pixel in the reference block + * and the corresponding pixel in the search block is computed. Whole search window is + * traversed with the reference block with the given pixel shift of 2 pixels. The output + * is right shifted with the given shift value. The shift value is a 4 bit value. + * + */ + +#ifndef ISP2401 +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_16_2 OP_1w_asp_bma_16_2_32way( +#else +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_16_2 OP_1w_asp_bma_16_2_32way_nomask( +#endif + bma_16x16_search_window search_area, + ref_block_8x8 input_block, + tscalar1w_4bit_bma_shift shift); +#ifndef ISP2401 +/** @brief OP_1w_asp_bma_14_1_32way +#else +/** @brief OP_1w_asp_bma_14_1_32way_nomask +#endif + * + * @param[in] search_area input search block of 16x16 pixels with search window of 14x14 pixels + * @param[in] input_block input reference block of 8x8 pixels, where N<=M + * @param[in] shift shift value, with which the output is shifted right + * + * @return 49 SADs for all the search blocks. + * This function compares the reference block with a block of size 8x8 in the search + * window of 14x14. Sum of absolute differences for each pixel in the reference block + * and the corresponding pixel in the search block. Whole search window is traversed + * with the reference block with 2 pixel shift. The output is right shifted with the + * given shift value. The shift value is a 4 bit value. Input is always a 16x16 block + * but the search window is 14x14, with last 2 pixels of row and column are not used + * for computation. + * + */ + +#ifndef ISP2401 +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_14_1 OP_1w_asp_bma_14_1_32way( +#else +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_14_1 OP_1w_asp_bma_14_1_32way_nomask( +#endif + bma_16x16_search_window search_area, + ref_block_8x8 input_block, + tscalar1w_4bit_bma_shift shift); + +#ifndef ISP2401 +/** @brief OP_1w_asp_bma_14_2_32way +#else +/** @brief OP_1w_asp_bma_14_2_32way_nomask +#endif + * + * @param[in] search_area input search block of 16x16 pixels with search window of 14x14 pixels + * @param[in] input_block input reference block of 8x8 pixels, where N<=M + * @param[in] shift shift value, with which the output is shifted right + * + * @return 16 SADs for all the search blocks. + * This function compares the reference block with a block of size 8x8 in the search + * window of 14x14. Sum of absolute differences for each pixel in the reference block + * and the corresponding pixel in the search block. Whole search window is traversed + * with the reference block with 2 pixels shift. The output is right shifted with the + * given shift value. The shift value is a 4 bit value. + * + */ + +#ifndef ISP2401 +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_14_2 OP_1w_asp_bma_14_2_32way( +#else +STORAGE_CLASS_REF_VECTOR_FUNC_H bma_output_14_2 OP_1w_asp_bma_14_2_32way_nomask( +#endif + bma_16x16_search_window search_area, + ref_block_8x8 input_block, + tscalar1w_4bit_bma_shift shift); + +#ifdef ISP2401 +/** @brief multiplex addition and passing + * + * @param[in] _a first pixel + * @param[in] _b second pixel + * @param[in] _c condition flag + * + * @return (_a + _b) if condition flag is true + * _a if condition flag is false + * + * This function does multiplex addition depending on the input condition flag + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H tvector1w OP_1w_cond_add( + tvector1w _a, + tvector1w _b, + tflags _c); + +#endif +#ifdef HAS_bfa_unit +/** @brief OP_1w_single_bfa_7x7 + * + * @param[in] weights - spatial and range weight lut + * @param[in] threshold - threshold plane, for range weight scaling + * @param[in] central_pix - central pixel plane + * @param[in] src_plane - src pixel plane + * + * @return Bilateral filter output + * + * This function implements, 7x7 single bilateral filter. + * Output = {sum(pixel * weight), sum(weight)} + * Where sum is summation over 7x7 block set. + * weight = spatial weight * range weight + * spatial weights are loaded from spatial_weight_lut depending on src pixel + * position in the 7x7 block + * range weights are computed by table look up from range_weight_lut depending + * on scaled absolute difference between src and central pixels. + * threshold is used as scaling factor. range_weight_lut consists of + * BFA_RW_LUT_SIZE numbers of LUT entries to model any distribution function. + * Piecewise linear approximation technique is used to compute range weight + * It computes absolute difference between central pixel and 61 src pixels. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H bfa_7x7_output OP_1w_single_bfa_7x7( + bfa_weights weights, + tvector1w threshold, + tvector1w central_pix, + s_1w_7x7_matrix src_plane); + +/** @brief OP_1w_joint_bfa_7x7 + * + * @param[in] weights - spatial and range weight lut + * @param[in] threshold0 - 1st threshold plane, for range weight scaling + * @param[in] central_pix0 - 1st central pixel plane + * @param[in] src0_plane - 1st pixel plane + * @param[in] threshold1 - 2nd threshold plane, for range weight scaling + * @param[in] central_pix1 - 2nd central pixel plane + * @param[in] src1_plane - 2nd pixel plane + * + * @return Joint bilateral filter output + * + * This function implements, 7x7 joint bilateral filter. + * Output = {sum(pixel * weight), sum(weight)} + * Where sum is summation over 7x7 block set. + * weight = spatial weight * range weight + * spatial weights are loaded from spatial_weight_lut depending on src pixel + * position in the 7x7 block + * range weights are computed by table look up from range_weight_lut depending + * on sum of scaled absolute difference between central pixel and two src pixel + * planes. threshold is used as scaling factor. range_weight_lut consists of + * BFA_RW_LUT_SIZE numbers of LUT entries to model any distribution function. + * Piecewise linear approximation technique is used to compute range weight + * It computes absolute difference between central pixel and 61 src pixels. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H bfa_7x7_output OP_1w_joint_bfa_7x7( + bfa_weights weights, + tvector1w threshold0, + tvector1w central_pix0, + s_1w_7x7_matrix src0_plane, + tvector1w threshold1, + tvector1w central_pix1, + s_1w_7x7_matrix src1_plane); + +/** @brief bbb_bfa_gen_spatial_weight_lut + * + * @param[in] in - 7x7 matrix of spatial weights + * @param[in] out - generated LUT + * + * @return None + * + * This function implements, creates spatial weight look up table used + * for bilaterl filter instruction. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H void bbb_bfa_gen_spatial_weight_lut( + s_1w_7x7_matrix in, + tvector1w out[BFA_MAX_KWAY]); + +/** @brief bbb_bfa_gen_range_weight_lut + * + * @param[in] in - input range weight, + * @param[in] out - generated LUT + * + * @return None + * + * This function implements, creates range weight look up table used + * for bilaterl filter instruction. + * 8 unsigned 7b weights are represented in 7 16bits LUT + * LUT formation is done as follows: + * higher 8 bit: Point(N) = Point(N+1) - Point(N) + * lower 8 bit: Point(N) = Point(N) + * Weight function can be any monotonic decreasing function for x >= 0 + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H void bbb_bfa_gen_range_weight_lut( + tvector1w in[BFA_RW_LUT_SIZE+1], + tvector1w out[BFA_RW_LUT_SIZE]); +#endif + +#ifdef ISP2401 +/** @brief OP_1w_imax32 + * + * @param[in] src - structure that holds an array of 32 elements. + * + * @return maximum element among input array. + * + *This function gets maximum element from an array of 32 elements. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H int OP_1w_imax32( + imax32_ref_in_vector src); + +/** @brief OP_1w_imaxidx32 + * + * @param[in] src - structure that holds a vector of elements. + * + * @return index of first element with maximum value among array. + * + * This function gets index of first element with maximum value + * from 32 elements. + */ +STORAGE_CLASS_REF_VECTOR_FUNC_H int OP_1w_imaxidx32( + imax32_ref_in_vector src); + +#endif +#ifndef INLINE_VECTOR_FUNC +#define STORAGE_CLASS_REF_VECTOR_FUNC_C +#define STORAGE_CLASS_REF_VECTOR_DATA_C const +#else /* INLINE_VECTOR_FUNC */ +#define STORAGE_CLASS_REF_VECTOR_FUNC_C STORAGE_CLASS_REF_VECTOR_FUNC_H +#define STORAGE_CLASS_REF_VECTOR_DATA_C STORAGE_CLASS_REF_VECTOR_DATA_H +#include "ref_vector_func.c" +#define VECTOR_FUNC_INLINED +#endif /* INLINE_VECTOR_FUNC */ + +#endif /*_REF_VECTOR_FUNC_H_INCLUDED_*/ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func_types.h new file mode 100644 index 0000000..4dd05eb --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/ref_vector_func_types.h @@ -0,0 +1,385 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __REF_VECTOR_FUNC_TYPES_H_INCLUDED__ +#define __REF_VECTOR_FUNC_TYPES_H_INCLUDED__ + + +/* + * Prerequisites: + * + */ +#include "mpmath.h" +#include "bbb_config.h" +#include "isp_op1w_types.h" +#include "isp_op2w_types.h" + +/* Defines for the Config Unit */ +#define MAX_CONFIG_POINTS 5 +#define INPUT_OFFSET_FACTOR 10 +#define INPUT_SCALE_FACTOR 10 +#define OUTPUT_SCALE_FACTOR 10 +#define SLOPE_A_RESOLUTION 10 +#define CONFIG_UNIT_LUT_SIZE_32 32 /*XCU works for ISP_NWAY = 32 */ +#define LXCU_LUT_SIZE 16 +#ifdef ISP2401 +#define IMAX32_ELEM_SIZE 32 +#endif + +#define ONE_IN_Q14 (1<<(NUM_BITS-2)) +#define Q29_TO_Q15_SHIFT_VAL (NUM_BITS-2) +#define Q28_TO_Q15_SHIFT_VAL (NUM_BITS-3) +#define MAX_ELEM(width_in_bits) ((1<<(width_in_bits))-1) + +/* Block matching algorithm related data */ +/* NUM_OF_SADS = ((SEARCH_AREA_HEIGHT - REF_BLOCK_HEIGHT)/PIXEL_SHIFT + 1)* \ + ((SEARCH_AREA_WIDTH - REF_BLOCK_WIDTH)/PIXEL_SHIFT + 1) */ + +#define SADS(sw_h,sw_w, ref_h, ref_w, p_sh) (((sw_h - ref_h)/p_sh + 1)*((sw_w - ref_w)/p_sh + 1)) +#define SADS_16x16_1 SADS(16, 16, 8, 8, 1) +#define SADS_16x16_2 SADS(16, 16, 8, 8, 2) +#define SADS_14x14_1 SADS(14, 14, 8, 8, 1) +#define SADS_14x14_2 SADS(14, 14, 8, 8, 2) + +#define BMA_OUTPUT_MATRIX_DIM(sw_h, ref_h, p_sh) ((sw_h - ref_h)/p_sh + 1) +#define BMA_OUT_16x16_2_32 BMA_OUTPUT_MATRIX_DIM(16, 8, 2) +#define BMA_OUT_14x14_2_32 BMA_OUTPUT_MATRIX_DIM(14, 8, 2) +#define BMA_OUT_16x16_1_32 BMA_OUTPUT_MATRIX_DIM(16, 8, 1) +#define BMA_OUT_14x14_1_32 BMA_OUTPUT_MATRIX_DIM(14, 8, 1) +#define BMA_SEARCH_BLOCK_SZ_16 16 +#define BMA_REF_BLOCK_SZ_8 8 +#define PIXEL_SHIFT_2 2 +#define PIXEL_SHIFT_1 1 +#define BMA_SEARCH_WIN_SZ_16 16 +#define BMA_SEARCH_WIN_SZ_14 14 + + +/* + * Struct type specification + */ + +typedef unsigned short tscalar1w_3bit; /* tscalar1w in interval [0, 2^3) */ +typedef short tscalar1w_5bit_signed; /* tscalar1w in interval [-2^(5-1), 2^(5-1)) */ +typedef unsigned short tscalar1w_5bit; /* tscalar1w in interval [0, 2^5) */ +typedef short tscalar1w_range1wbit; /* tscalar1w in interval [-NUM_BITS, NUM_BITS] */ +typedef short tscalar1w_unsigned_range1wbit; /* tscalar1w in interval [0, NUM_BITS] */ +typedef unsigned short tvector_8bit; /* 8 bit positive number */ +typedef unsigned short tvector_5bit; +typedef unsigned short tvector_4bit; +typedef unsigned short tscalar1w_16bit; +typedef unsigned short tscalar1w_4bit_bma_shift; + +typedef struct { + tvector1w v0 ; + tvector1w v1 ; +} s_1w_2x1_matrix; + +#define S_1W_2X1_MATRIX_DEFAULT ((s_1w_2x1_matrix)\ + { 0, 0 }) + +typedef struct { + tvector1w v00; + tvector1w v01; +} s_1w_1x2_matrix; + +#define S_1W_1X2_MATRIX_DEFAULT ((s_1w_1x2_matrix)\ + { 0, 0 }) + +typedef struct { + tvector1w v00 ; + tvector1w v01 ; + tvector1w v02 ; +} s_1w_1x3_matrix; + +#define S_1W_1X3_MATRIX_DEFAULT ((s_1w_1x3_matrix)\ + { 0, 0, 0, }) + +typedef struct { + tvector1w v00; tvector1w v01; tvector1w v02; + tvector1w v10; tvector1w v11; tvector1w v12; +} s_1w_2x3_matrix; + +#define S_1W_2X3_MATRIX_DEFAULT ((s_1w_2x3_matrix)\ + { 0, 0, 0, \ + 0, 0, 0 }) + +typedef struct { + tvector1w v00 ; tvector1w v01 ; tvector1w v02 ; + tvector1w v10 ; tvector1w v11 ; tvector1w v12 ; + tvector1w v20 ; tvector1w v21 ; tvector1w v22 ; +} s_1w_3x3_matrix; + +#define S_1W_3X3_MATRIX_DEFAULT ((s_1w_3x3_matrix)\ + { 0, 0, 0, \ + 0, 0, 0, \ + 0, 0, 0 }) + +typedef struct { + tvector1w v00 ; tvector1w v01 ; tvector1w v02 ; + tvector1w v10 ; tvector1w v11 ; tvector1w v12 ; + tvector1w v20 ; tvector1w v21 ; tvector1w v22 ; + tvector1w v30 ; tvector1w v31 ; tvector1w v32 ; +} s_1w_4x3_matrix; + +#define S_1W_4X3_MATRIX_DEFAULT ((s_1w_4x3_matrix)\ + { 0, 0, 0, \ + 0, 0, 0, \ + 0, 0, 0, \ + 0, 0, 0 }) + +typedef struct { + tvector1w v00 ; + tvector1w v01 ; + tvector1w v02 ; + tvector1w v03 ; + tvector1w v04 ; +} s_1w_1x5_matrix; + +#define S_1W_1X5_MATRIX_DEFAULT ((s_1w_1x5_matrix)\ + { 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00 ; tvector1w v01 ; tvector1w v02 ; tvector1w v03 ; tvector1w v04 ; + tvector1w v10 ; tvector1w v11 ; tvector1w v12 ; tvector1w v13 ; tvector1w v14 ; + tvector1w v20 ; tvector1w v21 ; tvector1w v22 ; tvector1w v23 ; tvector1w v24 ; + tvector1w v30 ; tvector1w v31 ; tvector1w v32 ; tvector1w v33 ; tvector1w v34 ; + tvector1w v40 ; tvector1w v41 ; tvector1w v42 ; tvector1w v43 ; tvector1w v44 ; +} s_1w_5x5_matrix; + +#define S_1W_5X5_MATRIX_DEFAULT ((s_1w_5x5_matrix)\ + { 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0 }) +#ifndef ISP2401 + +#else + +#endif +typedef struct { + tvector1w v00; + tvector1w v01; + tvector1w v02; + tvector1w v03; + tvector1w v04; + tvector1w v05; + tvector1w v06; +} s_1w_1x7_matrix; + +#define S_1W_1X7_MATRIX_DEFAULT ((s_1w_1x7_matrix)\ + { 0, 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; + tvector1w v01; + tvector1w v02; + tvector1w v03; + tvector1w v04; + tvector1w v05; + tvector1w v06; + tvector1w v07; + tvector1w v08; +} s_1w_1x9_matrix; + +#define S_1W_1X9_MATRIX_DEFAULT ((s_1w_1x9_matrix)\ + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; + tvector1w v01; + tvector1w v02; + tvector1w v03; +} s_1w_1x4_matrix; + +#define S_1W_1X4_MATRIX ((s_1w_1x4_matrix)\ + { 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; tvector1w v01; tvector1w v02; tvector1w v03; + tvector1w v10; tvector1w v11; tvector1w v12; tvector1w v13; + tvector1w v20; tvector1w v21; tvector1w v22; tvector1w v23; + tvector1w v30; tvector1w v31; tvector1w v32; tvector1w v33; +} s_1w_4x4_matrix; + +#define S_1W_4X4_MATRIX_DEFAULT ((s_1w_4x4_matrix)\ + { 0, 0, 0, 0, \ + 0, 0, 0, 0, \ + 0, 0, 0, 0, \ + 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; + tvector1w v01; + tvector1w v02; + tvector1w v03; + tvector1w v04; + tvector1w v05; +} s_1w_1x6_matrix; + +#define S_1W_1X6_MATRIX_DEFAULT ((s_1w_1x6_matrix)\ + { 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; tvector1w v01; tvector1w v02; tvector1w v03; tvector1w v04; tvector1w v05; + tvector1w v10; tvector1w v11; tvector1w v12; tvector1w v13; tvector1w v14; tvector1w v15; + tvector1w v20; tvector1w v21; tvector1w v22; tvector1w v23; tvector1w v24; tvector1w v25; + tvector1w v30; tvector1w v31; tvector1w v32; tvector1w v33; tvector1w v34; tvector1w v35; + tvector1w v40; tvector1w v41; tvector1w v42; tvector1w v43; tvector1w v44; tvector1w v45; + tvector1w v50; tvector1w v51; tvector1w v52; tvector1w v53; tvector1w v54; tvector1w v55; +} s_1w_6x6_matrix; + +#define S_1W_6X6_MATRIX_DEFAULT ((s_1w_6x6_matrix)\ + { 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; tvector1w v01; tvector1w v02; tvector1w v03; tvector1w v04; + tvector1w v05; tvector1w v06; tvector1w v07; tvector1w v08; + tvector1w v10; tvector1w v11; tvector1w v12; tvector1w v13; tvector1w v14; + tvector1w v15; tvector1w v16; tvector1w v17; tvector1w v18; + tvector1w v20; tvector1w v21; tvector1w v22; tvector1w v23; tvector1w v24; + tvector1w v25; tvector1w v26; tvector1w v27; tvector1w v28; + tvector1w v30; tvector1w v31; tvector1w v32; tvector1w v33; tvector1w v34; + tvector1w v35; tvector1w v36; tvector1w v37; tvector1w v38; + tvector1w v40; tvector1w v41; tvector1w v42; tvector1w v43; tvector1w v44; + tvector1w v45; tvector1w v46; tvector1w v47; tvector1w v48; + tvector1w v50; tvector1w v51; tvector1w v52; tvector1w v53; tvector1w v54; + tvector1w v55; tvector1w v56; tvector1w v57; tvector1w v58; + tvector1w v60; tvector1w v61; tvector1w v62; tvector1w v63; tvector1w v64; + tvector1w v65; tvector1w v66; tvector1w v67; tvector1w v68; + tvector1w v70; tvector1w v71; tvector1w v72; tvector1w v73; tvector1w v74; + tvector1w v75; tvector1w v76; tvector1w v77; tvector1w v78; + tvector1w v80; tvector1w v81; tvector1w v82; tvector1w v83; tvector1w v84; + tvector1w v85; tvector1w v86; tvector1w v87; tvector1w v88; +} s_1w_9x9_matrix; + +#define S_1W_9X9_MATRIX_DEFAULT ((s_1w_9x9_matrix)\ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v00; tvector1w v01; tvector1w v02; tvector1w v03; tvector1w v04; + tvector1w v05; tvector1w v06; + tvector1w v10; tvector1w v11; tvector1w v12; tvector1w v13; tvector1w v14; + tvector1w v15; tvector1w v16; + tvector1w v20; tvector1w v21; tvector1w v22; tvector1w v23; tvector1w v24; + tvector1w v25; tvector1w v26; + tvector1w v30; tvector1w v31; tvector1w v32; tvector1w v33; tvector1w v34; + tvector1w v35; tvector1w v36; + tvector1w v40; tvector1w v41; tvector1w v42; tvector1w v43; tvector1w v44; + tvector1w v45; tvector1w v46; + tvector1w v50; tvector1w v51; tvector1w v52; tvector1w v53; tvector1w v54; + tvector1w v55; tvector1w v56; + tvector1w v60; tvector1w v61; tvector1w v62; tvector1w v63; tvector1w v64; + tvector1w v65; tvector1w v66; +} s_1w_7x7_matrix; + +#define S_1W_7X7_MATRIX_DEFAULT ((s_1w_7x7_matrix)\ + { 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w v0_0; + tvector1w v0_1; + tvector1w v0_2; + tvector1w v0_3; + tvector1w v0_4; + tvector1w v0_5; + tvector1w v0_6; + tvector1w v0_7; + tvector1w v0_8; + tvector1w v0_9; + tvector1w v0_10; +} s_1w_1x11_matrix; + +#define S_1W_1X11_MATRIX_DEFAULT ((s_1w_1x11_matrix)\ + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }) + +typedef struct { + tvector1w x_cord[MAX_CONFIG_POINTS]; + tvector1w slope[MAX_CONFIG_POINTS-1]; + tvector1w y_offset[MAX_CONFIG_POINTS-1]; +} ref_config_points; + +typedef struct { + tscalar1w_range1wbit slope_vec[CONFIG_UNIT_LUT_SIZE_32]; + tscalar1w_range1wbit offset_vec[CONFIG_UNIT_LUT_SIZE_32]; + tscalar1w_16bit x_cord_vec[CONFIG_UNIT_LUT_SIZE_32]; + tscalar1w_16bit x_cord_max; + tscalar1w_5bit exponent; + tscalar1w_5bit slope_resolution; +} xcu_ref_init_vectors; + +typedef struct { +#ifdef ISP2401 + tvector1w elem[IMAX32_ELEM_SIZE]; +} imax32_ref_in_vector; + +typedef struct { +#endif + tscalar1w search[BMA_SEARCH_BLOCK_SZ_16][BMA_SEARCH_BLOCK_SZ_16]; +} bma_16x16_search_window; + +typedef struct { + tscalar1w ref[BMA_REF_BLOCK_SZ_8][BMA_REF_BLOCK_SZ_8]; +} ref_block_8x8; + +typedef struct { + tscalar1w sads[SADS_16x16_1]; +} bma_output_16_1; + +typedef struct { + tscalar1w sads[SADS_16x16_2]; +} bma_output_16_2; + +typedef struct { + tscalar1w sads[SADS_14x14_2]; +} bma_output_14_2; + +typedef struct { + tscalar1w sads[SADS_14x14_1]; +} bma_output_14_1; + +typedef struct { + tvector1w spatial_weight_lut[BFA_MAX_KWAY]; /* spatial weight LUT */ + /* range weight LUT, (BFA_RW_LUT_SIZE + 1) numbers of LUT values are compressed in BFA_RW_LUT_SIZE buffer. + * range_weight_lut[k] = packed(drop[k], range_weight[k]) + * where, drop[k] = range_weight[k+1] - range_weight[k] + * pack(msb, lsb): two 8bits numbers packed in one 16bits number */ + tvector1w range_weight_lut[BFA_RW_LUT_SIZE]; +} bfa_weights; + +/* Return type for BFA BBBs */ +typedef struct { + tvector2w sop; /* weighted sum of pixels */ + tvector1w sow; /* sum of weights */ +} bfa_7x7_output; +#endif /* __REF_VECTOR_FUNC_TYPES_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/sp_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/sp_public.h new file mode 100644 index 0000000..974ce6a --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/sp_public.h @@ -0,0 +1,223 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __SP_PUBLIC_H_INCLUDED__ +#define __SP_PUBLIC_H_INCLUDED__ + +#include <type_support.h> +#include "system_types.h" + +typedef struct sp_state_s sp_state_t; +typedef struct sp_stall_s sp_stall_t; + +/*! Enable or disable the program complete irq signal of SP[ID] + + \param ID[in] SP identifier + \param cnd[in] predicate + + \return none, if(cnd) enable(SP[ID].irq) else disable(SP[ID].irq) + */ +extern void cnd_sp_irq_enable( + const sp_ID_t ID, + const bool cnd); + +/*! Read the state of cell SP[ID] + + \param ID[in] SP identifier + \param state[out] sp state structure + \param stall[out] isp stall conditions + + \return none, state = SP[ID].state, stall = SP[ID].stall + */ +extern void sp_get_state( + const sp_ID_t ID, + sp_state_t *state, + sp_stall_t *stall); + +/*! Write to the status and control register of SP[ID] + + \param ID[in] SP identifier + \param reg[in] register index + \param value[in] The data to be written + + \return none, SP[ID].sc[reg] = value + */ +STORAGE_CLASS_SP_H void sp_ctrl_store( + const sp_ID_t ID, + const hrt_address reg, + const hrt_data value); + +/*! Read from the status and control register of SP[ID] + + \param ID[in] SP identifier + \param reg[in] register index + \param value[in] The data to be written + + \return SP[ID].sc[reg] + */ +STORAGE_CLASS_SP_H hrt_data sp_ctrl_load( + const sp_ID_t ID, + const hrt_address reg); + +/*! Get the status of a bitfield in the control register of SP[ID] + + \param ID[in] SP identifier + \param reg[in] register index + \param bit[in] The bit index to be checked + + \return (SP[ID].sc[reg] & (1<<bit)) != 0 + */ +STORAGE_CLASS_SP_H bool sp_ctrl_getbit( + const sp_ID_t ID, + const hrt_address reg, + const unsigned int bit); + +/*! Set a bitfield in the control register of SP[ID] + + \param ID[in] SP identifier + \param reg[in] register index + \param bit[in] The bit index to be set + + \return none, SP[ID].sc[reg] |= (1<<bit) + */ +STORAGE_CLASS_SP_H void sp_ctrl_setbit( + const sp_ID_t ID, + const hrt_address reg, + const unsigned int bit); + +/*! Clear a bitfield in the control register of SP[ID] + + \param ID[in] SP identifier + \param reg[in] register index + \param bit[in] The bit index to be set + + \return none, SP[ID].sc[reg] &= ~(1<<bit) + */ +STORAGE_CLASS_SP_H void sp_ctrl_clearbit( + const sp_ID_t ID, + const hrt_address reg, + const unsigned int bit); + +/*! Write to the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, SP[ID].dmem[addr...addr+size-1] = data + */ +STORAGE_CLASS_SP_H void sp_dmem_store( + const sp_ID_t ID, + hrt_address addr, + const void *data, + const size_t size); + +/*! Read from the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = SP[ID].dmem[addr...addr+size-1] + */ +STORAGE_CLASS_SP_H void sp_dmem_load( + const sp_ID_t ID, + const hrt_address addr, + void *data, + const size_t size); + +/*! Write a 8-bit datum to the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, SP[ID].dmem[addr...addr+size-1] = data + */ +STORAGE_CLASS_SP_H void sp_dmem_store_uint8( + const sp_ID_t ID, + hrt_address addr, + const uint8_t data); + +/*! Write a 16-bit datum to the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, SP[ID].dmem[addr...addr+size-1] = data + */ +STORAGE_CLASS_SP_H void sp_dmem_store_uint16( + const sp_ID_t ID, + hrt_address addr, + const uint16_t data); + +/*! Write a 32-bit datum to the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be written + \param size[in] The size(in bytes) of the data to be written + + \return none, SP[ID].dmem[addr...addr+size-1] = data + */ +STORAGE_CLASS_SP_H void sp_dmem_store_uint32( + const sp_ID_t ID, + hrt_address addr, + const uint32_t data); + +/*! Load a 8-bit datum from the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = SP[ID].dmem[addr...addr+size-1] + */ +STORAGE_CLASS_SP_H uint8_t sp_dmem_load_uint8( + const sp_ID_t ID, + const hrt_address addr); + +/*! Load a 16-bit datum from the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = SP[ID].dmem[addr...addr+size-1] + */ +STORAGE_CLASS_SP_H uint16_t sp_dmem_load_uint16( + const sp_ID_t ID, + const hrt_address addr); + +/*! Load a 32-bit datum from the DMEM of SP[ID] + + \param ID[in] SP identifier + \param addr[in] the address in DMEM + \param data[in] The data to be read + \param size[in] The size(in bytes) of the data to be read + + \return none, data = SP[ID].dmem[addr...addr+size-1] + */ +STORAGE_CLASS_SP_H uint32_t sp_dmem_load_uint32( + const sp_ID_t ID, + const hrt_address addr); + +#endif /* __SP_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/tag_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/tag_public.h new file mode 100644 index 0000000..22ef747 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/tag_public.h @@ -0,0 +1,41 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TAG_PUBLIC_H_INCLUDED__ +#define __TAG_PUBLIC_H_INCLUDED__ + +/** + * @brief Creates the tag description from the given parameters. + * @param[in] num_captures + * @param[in] skip + * @param[in] offset + * @param[out] tag_descr + */ +void +sh_css_create_tag_descr(int num_captures, + unsigned int skip, + int offset, + unsigned int exp_id, + struct sh_css_tag_descr *tag_descr); + +/** + * @brief Encodes the members of tag description into a 32-bit value. + * @param[in] tag Pointer to the tag description + * @return (unsigned int) Encoded 32-bit tag-info + */ +unsigned int +sh_css_encode_tag_descr(struct sh_css_tag_descr *tag); + +#endif /* __TAG_PUBLIC_H_INCLUDED__ */ + diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/timed_ctrl_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/timed_ctrl_public.h new file mode 100644 index 0000000..b3becac --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/timed_ctrl_public.h @@ -0,0 +1,59 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TIMED_CTRL_PUBLIC_H_INCLUDED__ +#define __TIMED_CTRL_PUBLIC_H_INCLUDED__ + +#include "system_types.h" + +/*! Write to a control register of TIMED_CTRL[ID] + + \param ID[in] TIMED_CTRL identifier + \param reg_addr[in] register byte address + \param value[in] The data to be written + + \return none, TIMED_CTRL[ID].ctrl[reg] = value + */ +STORAGE_CLASS_TIMED_CTRL_H void timed_ctrl_reg_store( + const timed_ctrl_ID_t ID, + const unsigned int reg_addr, + const hrt_data value); + +extern void timed_ctrl_snd_commnd( + const timed_ctrl_ID_t ID, + hrt_data mask, + hrt_data condition, + hrt_data counter, + hrt_address addr, + hrt_data value); + +extern void timed_ctrl_snd_sp_commnd( + const timed_ctrl_ID_t ID, + hrt_data mask, + hrt_data condition, + hrt_data counter, + const sp_ID_t SP_ID, + hrt_address offset, + hrt_data value); + +extern void timed_ctrl_snd_gpio_commnd( + const timed_ctrl_ID_t ID, + hrt_data mask, + hrt_data condition, + hrt_data counter, + const gpio_ID_t GPIO_ID, + hrt_address offset, + hrt_data value); + +#endif /* __TIMED_CTRL_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vamem_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vamem_public.h new file mode 100644 index 0000000..cee15d0 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vamem_public.h @@ -0,0 +1,20 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VAMEM_PUBLIC_H_INCLUDED__ +#define __VAMEM_PUBLIC_H_INCLUDED__ + + + +#endif /* __VAMEM_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vmem_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vmem_public.h new file mode 100644 index 0000000..e9801c0 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/vmem_public.h @@ -0,0 +1,20 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VMEM_PUBLIC_H_INCLUDED__ +#define __VMEM_PUBLIC_H_INCLUDED__ + +#include "isp.h" /* tmemvectoru */ + +#endif /* __VMEM_PUBLIC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/ibuf_ctrl.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/ibuf_ctrl.h new file mode 100644 index 0000000..f5de0df --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/ibuf_ctrl.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __IBUF_CTRL_H_INCLUDED__ +#define __IBUF_CTRL_H_INCLUDED__ + + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & + * inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "ibuf_ctrl_local.h" + +#ifndef __INLINE_IBUF_CTRL__ +#define STORAGE_CLASS_IBUF_CTRL_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_IBUF_CTRL_C +#include "ibuf_ctrl_public.h" +#else /* __INLINE_IBUF_CTRL__ */ +#define STORAGE_CLASS_IBUF_CTRL_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_IBUF_CTRL_C STORAGE_CLASS_INLINE +#include "ibuf_ctrl_private.h" +#endif /* __INLINE_IBUF_CTRL__ */ + +#endif /* __IBUF_CTRL_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_formatter.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_formatter.h new file mode 100644 index 0000000..041c8b6 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_formatter.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __INPUT_FORMATTER_H_INCLUDED__ +#define __INPUT_FORMATTER_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "input_formatter_local.h" + +#ifndef __INLINE_INPUT_FORMATTER__ +#define STORAGE_CLASS_INPUT_FORMATTER_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_INPUT_FORMATTER_C +#include "input_formatter_public.h" +#else /* __INLINE_INPUT_FORMATTER__ */ +#define STORAGE_CLASS_INPUT_FORMATTER_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_INPUT_FORMATTER_C STORAGE_CLASS_INLINE +#include "input_formatter_private.h" +#endif /* __INLINE_INPUT_FORMATTER__ */ + +#endif /* __INPUT_FORMATTER_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_system.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_system.h new file mode 100644 index 0000000..1828673 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/input_system.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __INPUT_SYSTEM_H_INCLUDED__ +#define __INPUT_SYSTEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "input_system_local.h" + +#ifndef __INLINE_INPUT_SYSTEM__ +#define STORAGE_CLASS_INPUT_SYSTEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_INPUT_SYSTEM_C +#include "input_system_public.h" +#else /* __INLINE_INPUT_SYSTEM__ */ +#define STORAGE_CLASS_INPUT_SYSTEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_INPUT_SYSTEM_C STORAGE_CLASS_INLINE +#include "input_system_private.h" +#endif /* __INLINE_INPUT_SYSTEM__ */ + +#endif /* __INPUT_SYSTEM_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/irq.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/irq.h new file mode 100644 index 0000000..1dc4438 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/irq.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __IRQ_H_INCLUDED__ +#define __IRQ_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the IRQ device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "irq_local.h" + +#ifndef __INLINE_IRQ__ +#define STORAGE_CLASS_IRQ_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_IRQ_C +#include "irq_public.h" +#else /* __INLINE_IRQ__ */ +#define STORAGE_CLASS_IRQ_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_IRQ_C STORAGE_CLASS_INLINE +#include "irq_private.h" +#endif /* __INLINE_IRQ__ */ + +#endif /* __IRQ_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isp.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isp.h new file mode 100644 index 0000000..49190d0 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isp.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISP_H_INCLUDED__ +#define __ISP_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the ISP cell. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "isp_local.h" + +#ifndef __INLINE_ISP__ +#define STORAGE_CLASS_ISP_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_ISP_C +#include "isp_public.h" +#else /* __INLINE_iSP__ */ +#define STORAGE_CLASS_ISP_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_ISP_C STORAGE_CLASS_INLINE +#include "isp_private.h" +#endif /* __INLINE_ISP__ */ + +#endif /* __ISP_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_dma.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_dma.h new file mode 100644 index 0000000..9a608f0 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_dma.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_DMA_H_INCLUDED__ +#define __ISYS_DMA_H_INCLUDED__ + + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & + * inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "isys_dma_local.h" + +#ifndef __INLINE_ISYS2401_DMA__ +#define STORAGE_CLASS_ISYS2401_DMA_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_ISYS2401_DMA_C +#include "isys_dma_public.h" +#else /* __INLINE_ISYS2401_DMA__ */ +#define STORAGE_CLASS_ISYS2401_DMA_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_ISYS2401_DMA_C STORAGE_CLASS_INLINE +#include "isys_dma_private.h" +#endif /* __INLINE_ISYS2401_DMA__ */ + +#endif /* __ISYS_DMA_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_irq.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_irq.h new file mode 100644 index 0000000..cf858bc --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_irq.h @@ -0,0 +1,40 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __IA_CSS_ISYS_IRQ_H__ +#define __IA_CSS_ISYS_IRQ_H__ + +#include <type_support.h> +#include <storage_class.h> +#include <system_local.h> + +#if defined(USE_INPUT_SYSTEM_VERSION_2401) + +#ifndef __INLINE_ISYS2401_IRQ__ + +#define STORAGE_CLASS_ISYS2401_IRQ_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_ISYS2401_IRQ_C STORAGE_CLASS_EXTERN +#include "isys_irq_public.h" + +#else /* __INLINE_ISYS2401_IRQ__ */ + +#define STORAGE_CLASS_ISYS2401_IRQ_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_ISYS2401_IRQ_C STORAGE_CLASS_INLINE +#include "isys_irq_private.h" + +#endif /* __INLINE_ISYS2401_IRQ__ */ + +#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ + +#endif /* __IA_CSS_ISYS_IRQ_H__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_stream2mmio.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_stream2mmio.h new file mode 100644 index 0000000..3e8cfe5 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/isys_stream2mmio.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __ISYS_STREAM2MMIO_H_INCLUDED__ +#define __ISYS_STREAM2MMIO_H_INCLUDED__ + + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & + * inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "isys_stream2mmio_local.h" + +#ifndef __INLINE_STREAM2MMIO__ +#define STORAGE_CLASS_STREAM2MMIO_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_STREAM2MMIO_C +#include "isys_stream2mmio_public.h" +#else /* __INLINE_STREAM2MMIO__ */ +#define STORAGE_CLASS_STREAM2MMIO_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_STREAM2MMIO_C STORAGE_CLASS_INLINE +#include "isys_stream2mmio_private.h" +#endif /* __INLINE_STREAM2MMIO__ */ + +#endif /* __ISYS_STREAM2MMIO_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/math_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/math_support.h new file mode 100644 index 0000000..48d84bc --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/math_support.h @@ -0,0 +1,224 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MATH_SUPPORT_H +#define __MATH_SUPPORT_H + +#include "storage_class.h" /* for STORAGE_CLASS_INLINE */ +#if defined(__KERNEL__) +#include <linux/kernel.h> /* Override the definition of max/min from linux kernel*/ +#endif /*__KERNEL__*/ + +#if defined(_MSC_VER) +#include <stdlib.h> /* Override the definition of max/min from stdlib.h*/ +#endif /* _MSC_VER */ + +/* in case we have min/max/MIN/MAX macro's undefine them */ +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif +#ifdef MIN /* also defined in include/hrt/numeric.h from SDK */ +#undef MIN +#endif +#ifdef MAX +#undef MAX +#endif +#ifdef ABS +#undef ABS +#endif + +#define IS_ODD(a) ((a) & 0x1) +#define IS_EVEN(a) (!IS_ODD(a)) + +/* force a value to a lower even value */ +#define EVEN_FLOOR(x) ((x) & ~1) + +#ifdef ISP2401 +/* If the number is odd, find the next even number */ +#define EVEN_CEIL(x) ((IS_ODD(x)) ? ((x) + 1) : (x)) + +#endif +/* A => B */ +#define IMPLIES(a, b) (!(a) || (b)) + +#define ABS(a) ((a) >= 0 ? (a) : -(a)) + +/* for preprocessor and array sizing use MIN and MAX + otherwise use min and max */ +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#ifdef ISP2401 +#define ROUND_DIV(a, b) ((b) ? ((a) + ((b) >> 1)) / (b) : 0) +#endif +#define CEIL_DIV(a, b) ((b) ? ((a) + (b) - 1) / (b) : 0) +#define CEIL_MUL(a, b) (CEIL_DIV(a, b) * (b)) +#define CEIL_MUL2(a, b) (((a) + (b) - 1) & ~((b) - 1)) +#define CEIL_SHIFT(a, b) (((a) + (1 << (b)) - 1)>>(b)) +#define CEIL_SHIFT_MUL(a, b) (CEIL_SHIFT(a, b) << (b)) +#ifdef ISP2401 +#define ROUND_HALF_DOWN_DIV(a, b) ((b) ? ((a) + (b / 2) - 1) / (b) : 0) +#define ROUND_HALF_DOWN_MUL(a, b) (ROUND_HALF_DOWN_DIV(a, b) * (b)) +#endif + + +/*To Find next power of 2 number from x */ +#define bit2(x) ((x) | ((x) >> 1)) +#define bit4(x) (bit2(x) | (bit2(x) >> 2)) +#define bit8(x) (bit4(x) | (bit4(x) >> 4)) +#define bit16(x) (bit8(x) | (bit8(x) >> 8)) +#define bit32(x) (bit16(x) | (bit16(x) >> 16)) +#define NEXT_POWER_OF_2(x) (bit32(x-1) + 1) + + +/* min and max should not be macros as they will evaluate their arguments twice. + if you really need a macro (e.g. for CPP or for initializing an array) + use MIN() and MAX(), otherwise use min() and max(). + + +*/ + +#if !defined(PIPE_GENERATION) + +#ifndef INLINE_MATH_SUPPORT_UTILS +/* +This macro versions are added back as we are mixing types in usage of inline. +This causes corner cases of calculations to be incorrect due to conversions +between signed and unsigned variables or overflows. +Before the addition of the inline functions, max, min and ceil_div were macros +and therefore adding them back. + +Leaving out the other math utility functions as they are newly added +*/ + +#define max(a, b) (MAX(a, b)) +#define min(a, b) (MIN(a, b)) +#define ceil_div(a, b) (CEIL_DIV(a, b)) + +#else /* !defined(INLINE_MATH_SUPPORT_UTILS) */ + +STORAGE_CLASS_INLINE int max(int a, int b) +{ + return MAX(a, b); +} + +STORAGE_CLASS_INLINE int min(int a, int b) +{ + return MIN(a, b); +} + +STORAGE_CLASS_INLINE unsigned int ceil_div(unsigned int a, unsigned int b) +{ + return CEIL_DIV(a, b); +} +#endif /* !defined(INLINE_MATH_SUPPORT_UTILS) */ + +STORAGE_CLASS_INLINE unsigned int umax(unsigned int a, unsigned int b) +{ + return MAX(a, b); +} + +STORAGE_CLASS_INLINE unsigned int umin(unsigned int a, unsigned int b) +{ + return MIN(a, b); +} + + +STORAGE_CLASS_INLINE unsigned int ceil_mul(unsigned int a, unsigned int b) +{ + return CEIL_MUL(a, b); +} + +STORAGE_CLASS_INLINE unsigned int ceil_mul2(unsigned int a, unsigned int b) +{ + return CEIL_MUL2(a, b); +} + +STORAGE_CLASS_INLINE unsigned int ceil_shift(unsigned int a, unsigned int b) +{ + return CEIL_SHIFT(a, b); +} + +STORAGE_CLASS_INLINE unsigned int ceil_shift_mul(unsigned int a, unsigned int b) +{ + return CEIL_SHIFT_MUL(a, b); +} + +#ifdef ISP2401 +STORAGE_CLASS_INLINE unsigned int round_half_down_div(unsigned int a, unsigned int b) +{ + return ROUND_HALF_DOWN_DIV(a, b); +} + +STORAGE_CLASS_INLINE unsigned int round_half_down_mul(unsigned int a, unsigned int b) +{ + return ROUND_HALF_DOWN_MUL(a, b); +} +#endif + +/** @brief Next Power of Two + * + * @param[in] unsigned number + * + * @return next power of two + * + * This function rounds input to the nearest power of 2 (2^x) + * towards infinity + * + * Input Range: 0 .. 2^(8*sizeof(int)-1) + * + * IF input is a power of 2 + * out = in + * OTHERWISE + * out = 2^(ceil(log2(in)) + * + */ + +STORAGE_CLASS_INLINE unsigned int ceil_pow2(unsigned int a) +{ + if (a == 0) { + return 1; + } + /* IF input is already a power of two*/ + else if ((!((a)&((a)-1)))) { + return a; + } + else { + unsigned int v = a; + v |= v>>1; + v |= v>>2; + v |= v>>4; + v |= v>>8; + v |= v>>16; + return (v+1); + } +} + +#endif /* !defined(PIPE_GENERATION) */ + +#if !defined(__ISP) +/* + * For SP and ISP, SDK provides the definition of OP_std_modadd. + * We need it only for host + */ +#define OP_std_modadd(base, offset, size) ((base+offset)%(size)) +#endif /* !defined(__ISP) */ + +#if !defined(__KERNEL__) +#define clamp(a, min_val, max_val) MIN(MAX((a), (min_val)), (max_val)) +#endif /* !defined(__KERNEL__) */ + +#endif /* __MATH_SUPPORT_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h new file mode 100644 index 0000000..195c4a5 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h @@ -0,0 +1,174 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015-2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MEMORY_ACCESS_H_INCLUDED__ +#define __MEMORY_ACCESS_H_INCLUDED__ + +/*! + * \brief + * Define the public interface for virtual memory + * access functions. Access types are limited to + * those defined in <stdint.h> + * + * The address representation is private to the system + * and represented as "hrt_vaddress" rather than a + * pointer, as the memory allocation cannot be accessed + * by dereferencing but reaquires load and store access + * functions + * + * The page table selection or virtual memory context; + * The page table base index; Is implicit. This page + * table base index must be set by the implementation + * of the access function + * + * "store" is a transfer to the system + * "load" is a transfer from the system + * + * Allocation properties can be specified by setting + * attributes (see below) in case of multiple physical + * memories the memory ID is encoded on the attribute + * + * Allocations in the same physical memory, but in a + * different (set of) page tables can be shared through + * a page table information mapping function + */ + +#include <type_support.h> +#include "platform_support.h" /* for __func__ */ + +/* + * User provided file that defines the (sub)system address types: + * - hrt_vaddress a type that can hold the (sub)system virtual address range + */ +#include "system_types.h" + +/* + * The MMU base address is a physical address, thus the same type is used + * as for the device base address + */ +#include "device_access.h" + +#include "hmm/hmm.h" + +/*! + * \brief + * Bit masks for specialised allocation functions + * the default is "uncached", "not contiguous", + * "not page aligned" and "not cleared" + * + * Forcing alignment (usually) returns a pointer + * at an alignment boundary that is offset from + * the allocated pointer. Without storing this + * pointer/offset, we cannot free it. The memory + * manager is responsible for the bookkeeping, e.g. + * the allocation function creates a sentinel + * within the allocation referencable from the + * returned pointer/address. + */ +#define MMGR_ATTRIBUTE_MASK 0x000f +#define MMGR_ATTRIBUTE_CACHED 0x0001 +#define MMGR_ATTRIBUTE_CONTIGUOUS 0x0002 +#define MMGR_ATTRIBUTE_PAGEALIGN 0x0004 +#define MMGR_ATTRIBUTE_CLEARED 0x0008 +#define MMGR_ATTRIBUTE_UNUSED 0xfff0 + +/* #define MMGR_ATTRIBUTE_DEFAULT (MMGR_ATTRIBUTE_CACHED) */ +#define MMGR_ATTRIBUTE_DEFAULT 0 + +extern const hrt_vaddress mmgr_NULL; +extern const hrt_vaddress mmgr_EXCEPTION; + +/*! Return the address of an allocation in memory + + \param size[in] Size in bytes of the allocation + \param caller_func[in] Caller function name + \param caller_line[in] Caller function line number + + \return vaddress + */ +extern hrt_vaddress mmgr_malloc(const size_t size); + +/*! Return the address of a zero initialised allocation in memory + + \param N[in] Horizontal dimension of array + \param size[in] Vertical dimension of array Total size is N*size + + \return vaddress + */ +extern hrt_vaddress mmgr_calloc(const size_t N, const size_t size); + +/*! Return the address of an allocation in memory + + \param size[in] Size in bytes of the allocation + \param attribute[in] Bit vector specifying the properties + of the allocation including zero initialisation + + \return vaddress + */ + +extern hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attribute); + +/*! Return the address of a mapped existing allocation in memory + + \param ptr[in] Pointer to an allocation in a different + virtual memory page table, but the same + physical memory + \param size[in] Size of the memory of the pointer + \param attribute[in] Bit vector specifying the properties + of the allocation + \param context Pointer of a context provided by + client/driver for additonal parameters + needed by the implementation + \Note + This interface is tentative, limited to the desired function + the actual interface may require furhter parameters + + \return vaddress + */ +extern hrt_vaddress mmgr_mmap( + const void *ptr, + const size_t size, + uint16_t attribute, + void *context); + +/*! Zero initialise an allocation in memory + + \param vaddr[in] Address of an allocation + \param size[in] Size in bytes of the area to be cleared + + \return none + */ +extern void mmgr_clear(hrt_vaddress vaddr, const size_t size); + +/*! Read an array of bytes from a virtual memory address + + \param vaddr[in] Address of an allocation + \param data[out] pointer to the destination array + \param size[in] number of bytes to read + + \return none + */ +extern void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size); + +/*! Write an array of bytes to device registers or memory in the device + + \param vaddr[in] Address of an allocation + \param data[in] pointer to the source array + \param size[in] number of bytes to write + + \return none + */ +extern void mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size); + +#endif /* __MEMORY_ACCESS_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_realloc.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_realloc.h new file mode 100644 index 0000000..f3b7273 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_realloc.h @@ -0,0 +1,38 @@ +/** +Support for Intel Camera Imaging ISP subsystem. +Copyright (c) 2010 - 2015, Intel Corporation. + +This program is free software; you can redistribute it and/or modify it +under the terms and conditions of the GNU General Public License, +version 2, as published by the Free Software Foundation. + +This program is distributed in the hope it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. +*/ +#ifndef __MEMORY_REALLOC_H_INCLUDED__ +#define __MEMORY_REALLOC_H_INCLUDED__ + +/*! + * \brief + * Define the internal reallocation of private css memory + * + */ + +#include <type_support.h> +/* + * User provided file that defines the (sub)system address types: + * - hrt_vaddress a type that can hold the (sub)system virtual address range + */ +#include "system_types.h" +#include "ia_css_err.h" + +bool reallocate_buffer( + hrt_vaddress *curr_buf, + size_t *curr_size, + size_t needed_size, + bool force, + enum ia_css_err *err); + +#endif /*__MEMORY_REALLOC_H_INCLUDED__*/ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/misc_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/misc_support.h new file mode 100644 index 0000000..38db1ec --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/misc_support.h @@ -0,0 +1,26 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MISC_SUPPORT_H_INCLUDED__ +#define __MISC_SUPPORT_H_INCLUDED__ + +/* suppress compiler warnings on unused variables */ +#ifndef NOT_USED +#define NOT_USED(a) ((void)(a)) +#endif + +/* Calculate the total bytes for pow(2) byte alignment */ +#define tot_bytes_for_pow2_align(pow2, cur_bytes) ((cur_bytes + (pow2 - 1)) & ~(pow2 - 1)) + +#endif /* __MISC_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mmu_device.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mmu_device.h new file mode 100644 index 0000000..1b2017b --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mmu_device.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MMU_DEVICE_H_INCLUDED__ +#define __MMU_DEVICE_H_INCLUDED__ + +/* The file mmu.h already exists */ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the MMU device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "mmu_local.h" + +#ifndef __INLINE_MMU__ +#define STORAGE_CLASS_MMU_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_MMU_C +#include "mmu_public.h" +#else /* __INLINE_MMU__ */ +#define STORAGE_CLASS_MMU_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_MMU_C STORAGE_CLASS_INLINE +#include "mmu_private.h" +#endif /* __INLINE_MMU__ */ + +#endif /* __MMU_DEVICE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mpmath.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mpmath.h new file mode 100644 index 0000000..565983a --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/mpmath.h @@ -0,0 +1,330 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MPMATH_H_INCLUDED__ +#define __MPMATH_H_INCLUDED__ + +#include "storage_class.h" + +#ifdef INLINE_MPMATH +#define STORAGE_CLASS_MPMATH_FUNC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_MPMATH_DATA_H STORAGE_CLASS_INLINE_DATA +#else /* INLINE_MPMATH */ +#define STORAGE_CLASS_MPMATH_FUNC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_MPMATH_DATA_H STORAGE_CLASS_EXTERN_DATA +#endif /* INLINE_MPMATH */ + +#include <type_support.h> + +/* + * Implementation limits + */ +#define MIN_BITDEPTH 1 +#define MAX_BITDEPTH 64 + +#define ROUND_NEAREST_EVEN 0 +#define ROUND_NEAREST 1 + +/* + * The MP types + * + * "vector lane data" is scalar. With "scalar data" for limited range shift and address values + */ +typedef unsigned long long mpudata_t; /* Type of reference MP scalar / vector lane data; unsigned */ +typedef long long mpsdata_t; /* Type of reference MP scalar / vector lane data; signed */ +typedef unsigned short spudata_t; /* Type of reference SP scalar / vector lane data; unsigned */ +typedef short spsdata_t; /* Type of reference SP scalar / vector lane data; signed */ +typedef unsigned short bitdepth_t; + +typedef enum { + mp_zero_ID, + mp_one_ID, + mp_mone_ID, + mp_smin_ID, + mp_smax_ID, + mp_umin_ID, + mp_umax_ID, + N_mp_const_ID +} mp_const_ID_t; + +#ifdef ISP2401 +/* _isValidMpudata is for internal use by mpmath and bbb's. + * isValidMpudata is for external use by functions on top. + */ +#ifndef ENABLE_VALID_MP_DATA_CHECK +#define _isValidMpsdata(data,bitdepth) (1) +#define _isValidMpudata(data,bitdepth) (1) +#else +#define _isValidMpsdata(data,bitdepth) isValidMpsdata(data,bitdepth) +#define _isValidMpudata(data,bitdepth) isValidMpsdata(data,bitdepth) + +#endif +#endif +STORAGE_CLASS_MPMATH_FUNC_H bool isValidMpsdata( + const mpsdata_t data, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H bool isValidMpudata( + const mpudata_t data, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_castd ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_casth ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_scasth ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qcastd ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qcasth ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qrcasth ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_abs ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_limit ( + const mpsdata_t bnd_low, + const mpsdata_t in0, + const mpsdata_t bnd_high, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_max ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_min ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_mux ( + const spudata_t sel, + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_rmux ( + const spudata_t sel, + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_add ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_sadd ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_sub ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_ssub ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_addasr1 ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_subasr1 ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_lsr ( + const mpsdata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_asr ( + const mpsdata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_rasr ( + const mpsdata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +/* "mp_rasr_u()" is implemented by "mp_rasr()" */ +STORAGE_CLASS_MPMATH_FUNC_H mpudata_t mp_rasr_u ( + const mpudata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_lsl ( + const mpsdata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_asl ( + const mpsdata_t in0, + const spsdata_t shft, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_muld ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_mul ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qmul ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qrmul ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qdiv ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_qdivh ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_div ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_divh ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_and ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_compl ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_or ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_xor ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isEQ ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isNE ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isGT ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isGE ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isLT ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isLE ( + const mpsdata_t in0, + const mpsdata_t in1, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isEQZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isNEZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isGTZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isGEZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isLTZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H spudata_t mp_isLEZ ( + const mpsdata_t in0, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpsdata_t mp_const ( + const mp_const_ID_t ID, + const bitdepth_t bitdepth); + +STORAGE_CLASS_MPMATH_FUNC_H mpudata_t mp_sqrt_u( + const mpudata_t in0, + const bitdepth_t bitdepth); + +#ifndef INLINE_MPMATH +#define STORAGE_CLASS_MPMATH_FUNC_C +#define STORAGE_CLASS_MPMATH_DATA_C const +#else /* INLINE_MPMATH */ +#define STORAGE_CLASS_MPMATH_FUNC_C STORAGE_CLASS_MPMATH_FUNC_H +#define STORAGE_CLASS_MPMATH_DATA_C STORAGE_CLASS_MPMATH_DATA_H +#include "mpmath.c" +#define MPMATH_INLINED +#endif /* INLINE_MPMATH */ + +#endif /* __MPMATH_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/osys.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/osys.h new file mode 100644 index 0000000..6e48ea9 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/osys.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __OSYS_H_INCLUDED__ +#define __OSYS_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the OSYS device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "osys_local.h" + +#ifndef __INLINE_OSYS__ +#define STORAGE_CLASS_OSYS_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_OSYS_C +#include "osys_public.h" +#else /* __INLINE_OSYS__ */ +#define STORAGE_CLASS_OSYS_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_OSYS_C STORAGE_CLASS_INLINE +#include "osys_private.h" +#endif /* __INLINE_OSYS__ */ + +#endif /* __OSYS_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/pixelgen.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/pixelgen.h new file mode 100644 index 0000000..67f7f3a --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/pixelgen.h @@ -0,0 +1,49 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PIXELGEN_H_INCLUDED__ +#define __PIXELGEN_H_INCLUDED__ + + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & + * inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "pixelgen_local.h" + +#ifndef __INLINE_PIXELGEN__ +#define STORAGE_CLASS_PIXELGEN_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_PIXELGEN_C +#include "pixelgen_public.h" +#else /* __INLINE_PIXELGEN__ */ +#define STORAGE_CLASS_PIXELGEN_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_PIXELGEN_C STORAGE_CLASS_INLINE +#include "pixelgen_private.h" +#endif /* __INLINE_PIXELGEN__ */ + +#endif /* __PIXELGEN_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h new file mode 100644 index 0000000..02f9eee --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/platform_support.h @@ -0,0 +1,42 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PLATFORM_SUPPORT_H_INCLUDED__ +#define __PLATFORM_SUPPORT_H_INCLUDED__ + +/** +* @file +* Platform specific includes and functionality. +*/ + +#include "storage_class.h" +#include <linux/delay.h> +#include <linux/kernel.h> +#include <linux/string.h> + +/* For definition of hrt_sleep() */ +#include "hive_isp_css_custom_host_hrt.h" + +#define UINT16_MAX USHRT_MAX +#define UINT32_MAX UINT_MAX +#define UCHAR_MAX (255) + +#define CSS_ALIGN(d, a) d __attribute__((aligned(a))) + +/* + * Put here everything __KERNEL__ specific not covered in + * "assert_support.h", "math_support.h", etc + */ + +#endif /* __PLATFORM_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/print_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/print_support.h new file mode 100644 index 0000000..cfbc222 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/print_support.h @@ -0,0 +1,45 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PRINT_SUPPORT_H_INCLUDED__ +#define __PRINT_SUPPORT_H_INCLUDED__ + +#include "storage_class.h" + +#include <stdarg.h> +#if !defined(__KERNEL__) +#include <stdio.h> +#endif + +extern int (*sh_css_printf) (const char *fmt, va_list args); +/* depends on host supplied print function in ia_css_init() */ +STORAGE_CLASS_INLINE void ia_css_print(const char *fmt, ...) +{ + va_list ap; + if (sh_css_printf) { + va_start(ap, fmt); + sh_css_printf(fmt, ap); + va_end(ap); + } +} + +/* Start adding support for bxt tracing functions for poc. From + * bxt_sandbox/support/print_support.h. */ +/* TODO: support these macros in userspace. */ +#define PWARN(format, ...) ia_css_print("warning: ", ##__VA_ARGS__) +#define PRINT(format, ...) ia_css_print(format, ##__VA_ARGS__) +#define PERROR(format, ...) ia_css_print("error: " format, ##__VA_ARGS__) +#define PDEBUG(format, ...) ia_css_print("debug: " format, ##__VA_ARGS__) + +#endif /* __PRINT_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/queue.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/queue.h new file mode 100644 index 0000000..a3d874b --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/queue.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __QUEUE_H_INCLUDED__ +#define __QUEUE_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and is system agnostic + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - system and cell agnostic interfaces, constants and identifiers + * - public: cell specific interfaces + * - private: cell specific inline implementations + * - global: inter cell constants and identifiers + * - local: cell specific constants and identifiers + * + */ + +#include <storage_class.h> + +#include "queue_local.h" + +#ifndef __INLINE_QUEUE__ +#define STORAGE_CLASS_QUEUE_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_QUEUE_C +/* #include "queue_public.h" */ +#include "ia_css_queue.h" +#else /* __INLINE_QUEUE__ */ +#define STORAGE_CLASS_QUEUE_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_QUEUE_C STORAGE_CLASS_INLINE +#include "queue_private.h" +#endif /* __INLINE_QUEUE__ */ + +#endif /* __QUEUE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/resource.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/resource.h new file mode 100644 index 0000000..82c55ac --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/resource.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __RESOURCE_H_INCLUDED__ +#define __RESOURCE_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses a RESOURCE manager. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "resource_local.h" + +#ifndef __INLINE_RESOURCE__ +#define STORAGE_CLASS_RESOURCE_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_RESOURCE_C +#include "resource_public.h" +#else /* __INLINE_RESOURCE__ */ +#define STORAGE_CLASS_RESOURCE_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_RESOURCE_C STORAGE_CLASS_INLINE +#include "resource_private.h" +#endif /* __INLINE_RESOURCE__ */ + +#endif /* __RESOURCE_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/socket.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/socket.h new file mode 100644 index 0000000..c34c2e7 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/socket.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __SOCKET_H_INCLUDED__ +#define __SOCKET_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the DMA device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "socket_local.h" + +#ifndef __INLINE_SOCKET__ +#define STORAGE_CLASS_SOCKET_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_SOCKET_C +#include "socket_public.h" +#else /* __INLINE_SOCKET__ */ +#define STORAGE_CLASS_SOCKET_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_SOCKET_C STORAGE_CLASS_INLINE +#include "socket_private.h" +#endif /* __INLINE_SOCKET__ */ + +#endif /* __SOCKET_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/sp.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/sp.h new file mode 100644 index 0000000..150fc2f --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/sp.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __SP_H_INCLUDED__ +#define __SP_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the SP cell. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "sp_local.h" + +#ifndef __INLINE_SP__ +#define STORAGE_CLASS_SP_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_SP_C +#include "sp_public.h" +#else /* __INLINE_SP__ */ +#define STORAGE_CLASS_SP_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_SP_C STORAGE_CLASS_INLINE +#include "sp_private.h" +#endif /* __INLINE_SP__ */ + +#endif /* __SP_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/storage_class.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/storage_class.h new file mode 100644 index 0000000..3908e66 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/storage_class.h @@ -0,0 +1,34 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __STORAGE_CLASS_H_INCLUDED__ +#define __STORAGE_CLASS_H_INCLUDED__ + +/** +* @file +* Platform specific includes and functionality. +*/ + +#define STORAGE_CLASS_EXTERN extern + +#if defined(_MSC_VER) +#define STORAGE_CLASS_INLINE static __inline +#else +#define STORAGE_CLASS_INLINE static inline +#endif + +#define STORAGE_CLASS_EXTERN_DATA extern const +#define STORAGE_CLASS_INLINE_DATA static const + +#endif /* __STORAGE_CLASS_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/stream_buffer.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/stream_buffer.h new file mode 100644 index 0000000..8e41f60 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/stream_buffer.h @@ -0,0 +1,48 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __STREAM_BUFFER_H_INCLUDED__ +#define __STREAM_BUFFER_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the DMA device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "stream_buffer_local.h" + +#ifndef __INLINE_STREAM_BUFFER__ +#define STORAGE_CLASS_STREAM_BUFFER_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_STREAM_BUFFER_C +#include "stream_buffer_public.h" +#else /* __INLINE_STREAM_BUFFER__ */ +#define STORAGE_CLASS_STREAM_BUFFER_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_STREAM_BUFFER_C STORAGE_CLASS_INLINE +#include "stream_buffer_private.h" +#endif /* __INLINE_STREAM_BUFFER__ */ + +#endif /* __STREAM_BUFFER_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h new file mode 100644 index 0000000..5686316 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h @@ -0,0 +1,167 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __STRING_SUPPORT_H_INCLUDED__ +#define __STRING_SUPPORT_H_INCLUDED__ +#include <platform_support.h> +#include <type_support.h> +#include <storage_class.h> + +#if !defined(_MSC_VER) +/* + * For all non microsoft cases, we need the following functions + */ + + +/** @brief Copy from src_buf to dest_buf. + * + * @param[out] dest_buf. Destination buffer to copy to + * @param[in] dest_size. The size of the destination buffer in bytes + * @param[in] src_buf. The source buffer + * @param[in] src_size. The size of the source buffer in bytes + * @return 0 on success, error code on failure + * @return EINVAL on Invalid arguments + * @return ERANGE on Destination size too small + */ +STORAGE_CLASS_INLINE int memcpy_s( + void* dest_buf, + size_t dest_size, + const void* src_buf, + size_t src_size) +{ + if ((src_buf == NULL) || (dest_buf == NULL)) { + /* Invalid arguments*/ + return EINVAL; + } + + if ((dest_size < src_size) || (src_size == 0)) { + /* Destination too small*/ + return ERANGE; + } + + memcpy(dest_buf, src_buf, src_size); + return 0; +} + +/** @brief Get the length of the string, excluding the null terminator + * + * @param[in] src_str. The source string + * @param[in] max_len. Look only for max_len bytes in the string + * @return Return the string length excluding null character + * @return Return max_len if no null character in the first max_len bytes + * @return Returns 0 if src_str is NULL + */ +static size_t strnlen_s( + const char* src_str, + size_t max_len) +{ + size_t ix; + if (src_str == NULL) { + /* Invalid arguments*/ + return 0; + } + + for (ix=0; + ((src_str[ix] != '\0') && (ix< max_len)); + ++ix) /*Nothing else to do*/; + + /* On Error, it will return src_size == max_len*/ + return ix; +} + +/** @brief Copy string from src_str to dest_str + * + * @param[out] dest_str. Destination buffer to copy to + * @param[in] dest_size. The size of the destination buffer in bytes + * @param[in] src_str. The source buffer + * @param[in] src_size. The size of the source buffer in bytes + * @return Returns 0 on success + * @return Returns EINVAL on invalid arguments + * @return Returns ERANGE on destination size too small + */ +STORAGE_CLASS_INLINE int strncpy_s( + char* dest_str, + size_t dest_size, + const char* src_str, + size_t src_size) +{ + size_t len; + if (dest_str == NULL) { + /* Invalid arguments*/ + return EINVAL; + } + + if ((src_str == NULL) || (dest_size == 0)) { + /* Invalid arguments*/ + dest_str[0] = '\0'; + return EINVAL; + } + + len = strnlen_s(src_str, src_size); + + if (len >= dest_size) { + /* Destination too small*/ + dest_str[0] = '\0'; + return ERANGE; + } + + /* dest_str is big enough for the len */ + strncpy(dest_str, src_str, len); + dest_str[len+1] = '\0'; + return 0; +} + +/** @brief Copy string from src_str to dest_str + * + * @param[out] dest_str. Destination buffer to copy to + * @param[in] dest_size. The size of the destination buffer in bytes + * @param[in] src_str. The source buffer + * @return Returns 0 on success + * @return Returns EINVAL on invalid arguments + * @return Returns ERANGE on destination size too small + */ +STORAGE_CLASS_INLINE int strcpy_s( + char* dest_str, + size_t dest_size, + const char* src_str) +{ + size_t len; + if (dest_str == NULL) { + /* Invalid arguments*/ + return EINVAL; + } + + if ((src_str == NULL) || (dest_size == 0)) { + /* Invalid arguments*/ + dest_str[0] = '\0'; + return EINVAL; + } + + len = strnlen_s(src_str, dest_size); + + if (len >= dest_size) { + /* Destination too small*/ + dest_str[0] = '\0'; + return ERANGE; + } + + /* dest_str is big enough for the len */ + strncpy(dest_str, src_str, len); + dest_str[len+1] = '\0'; + return 0; +} + +#endif /*!defined(_MSC_VER)*/ + +#endif /* __STRING_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/system_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/system_types.h new file mode 100644 index 0000000..a8c19ce --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/system_types.h @@ -0,0 +1,25 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ +#ifndef __SYSTEM_TYPES_H_INCLUDED__ +#define __SYSTEM_TYPES_H_INCLUDED__ + +/** +* @file +* Platform specific types. +*/ + + +#include "system_local.h" + +#endif /* __SYSTEM_TYPES_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/tag.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/tag.h new file mode 100644 index 0000000..7385fd1 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/tag.h @@ -0,0 +1,46 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TAG_H_INCLUDED__ +#define __TAG_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and is system agnostic + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: cell specific interfaces + * - private: cell specific inline implementations + * - global: inter cell constants and identifiers + * - local: cell specific constants and identifiers + * + */ + +#include "storage_class.h" + +#include "tag_local.h" + +#ifndef __INLINE_TAG__ +#define STORAGE_CLASS_TAG_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_TAG_C +#include "tag_public.h" +#else /* __INLINE_TAG__ */ +#define STORAGE_CLASS_TAG_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_TAG_C STORAGE_CLASS_INLINE +#include "tag_private.h" +#endif /* __INLINE_TAG__ */ + +#endif /* __TAG_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/timed_ctrl.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/timed_ctrl.h new file mode 100644 index 0000000..ed13451 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/timed_ctrl.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TIMED_CTRL_H_INCLUDED__ +#define __TIMED_CTRL_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the input system device(s). It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "timed_ctrl_local.h" + +#ifndef __INLINE_TIMED_CTRL__ +#define STORAGE_CLASS_TIMED_CTRL_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_TIMED_CTRL_C +#include "timed_ctrl_public.h" +#else /* __INLINE_TIMED_CTRL__ */ +#define STORAGE_CLASS_TIMED_CTRL_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_TIMED_CTRL_C STORAGE_CLASS_INLINE +#include "timed_ctrl_private.h" +#endif /* __INLINE_TIMED_CTRL__ */ + +#endif /* __TIMED_CTRL_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/type_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/type_support.h new file mode 100644 index 0000000..b82fa3e --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/type_support.h @@ -0,0 +1,82 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TYPE_SUPPORT_H_INCLUDED__ +#define __TYPE_SUPPORT_H_INCLUDED__ + +/** +* @file +* Platform specific types. +* +* Per the DLI spec, types are in "type_support.h" and +* "platform_support.h" is for unclassified/to be refactored +* platform specific definitions. +*/ + +#define IA_CSS_UINT8_T_BITS 8 +#define IA_CSS_UINT16_T_BITS 16 +#define IA_CSS_UINT32_T_BITS 32 +#define IA_CSS_INT32_T_BITS 32 +#define IA_CSS_UINT64_T_BITS 64 + +#if defined(_MSC_VER) +#include <stdint.h> +/* For ATE compilation define the bool */ +#if defined(_ATE_) +#define bool int +#define true 1 +#define false 0 +#else +#include <stdbool.h> +#endif +#include <stddef.h> +#include <limits.h> +#include <errno.h> +#if defined(_M_X64) +#define HOST_ADDRESS(x) (unsigned long long)(x) +#else +#define HOST_ADDRESS(x) (unsigned long)(x) +#endif + +#elif defined(__KERNEL__) + +#define CHAR_BIT (8) + +#include <linux/types.h> +#include <linux/limits.h> +#include <linux/errno.h> +#define HOST_ADDRESS(x) (unsigned long)(x) + +#elif defined(__GNUC__) +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif +#include <stdint.h> +#include <stdbool.h> +#include <stddef.h> +#include <limits.h> +#include <errno.h> +#define HOST_ADDRESS(x) (unsigned long)(x) + +#else /* default is for the FIST environment */ +#include <stdint.h> +#include <stdbool.h> +#include <stddef.h> +#include <limits.h> +#include <errno.h> +#define HOST_ADDRESS(x) (unsigned long)(x) + +#endif + +#endif /* __TYPE_SUPPORT_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vamem.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vamem.h new file mode 100644 index 0000000..acf932e --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vamem.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VAMEM_H_INCLUDED__ +#define __VAMEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the VAMEM device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "vamem_local.h" + +#ifndef __INLINE_VAMEM__ +#define STORAGE_CLASS_VAMEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_VAMEM_C +#include "vamem_public.h" +#else /* __INLINE_VAMEM__ */ +#define STORAGE_CLASS_VAMEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_VAMEM_C STORAGE_CLASS_INLINE +#include "vamem_private.h" +#endif /* __INLINE_VAMEM__ */ + +#endif /* __VAMEM_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_func.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_func.h new file mode 100644 index 0000000..5d3be31 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_func.h @@ -0,0 +1,39 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VECTOR_FUNC_H_INCLUDED__ +#define __VECTOR_FUNC_H_INCLUDED__ + +#include "storage_class.h" + +/* TODO: Later filters will be moved to types directory, + * and we should only include matrix_MxN types */ +#include "filters/filters_1.0/filter_2x2.h" +#include "filters/filters_1.0/filter_3x3.h" +#include "filters/filters_1.0/filter_4x4.h" +#include "filters/filters_1.0/filter_5x5.h" + +#include "vector_func_local.h" + +#ifndef __INLINE_VECTOR_FUNC__ +#define STORAGE_CLASS_VECTOR_FUNC_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_VECTOR_FUNC_C +#include "vector_func_public.h" +#else /* __INLINE_VECTOR_FUNC__ */ +#define STORAGE_CLASS_VECTOR_FUNC_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_VECTOR_FUNC_C STORAGE_CLASS_INLINE +#include "vector_func_private.h" +#endif /* __INLINE_VECTOR_FUNC__ */ + +#endif /* __VECTOR_FUNC_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_ops.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_ops.h new file mode 100644 index 0000000..261f873 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vector_ops.h @@ -0,0 +1,32 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VECTOR_OPS_H_INCLUDED__ +#define __VECTOR_OPS_H_INCLUDED__ + +#include "storage_class.h" + +#include "vector_ops_local.h" + +#ifndef __INLINE_VECTOR_OPS__ +#define STORAGE_CLASS_VECTOR_OPS_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_VECTOR_OPS_C +#include "vector_ops_public.h" +#else /* __INLINE_VECTOR_OPS__ */ +#define STORAGE_CLASS_VECTOR_OPS_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_VECTOR_OPS_C STORAGE_CLASS_INLINE +#include "vector_ops_private.h" +#endif /* __INLINE_VECTOR_OPS__ */ + +#endif /* __VECTOR_OPS_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vmem.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vmem.h new file mode 100644 index 0000000..79a3675 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/vmem.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __VMEM_H_INCLUDED__ +#define __VMEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the VMEM device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "vmem_local.h" + +#ifndef __INLINE_VMEM__ +#define STORAGE_CLASS_VMEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_VMEM_C +#include "vmem_public.h" +#else /* __INLINE_VMEM__ */ +#define STORAGE_CLASS_VMEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_VMEM_C STORAGE_CLASS_INLINE +#include "vmem_private.h" +#endif /* __INLINE_VMEM__ */ + +#endif /* __VMEM_H_INCLUDED__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/xmem.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/xmem.h new file mode 100644 index 0000000..9169e04 --- /dev/null +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/xmem.h @@ -0,0 +1,47 @@ +/* + * Support for Intel Camera Imaging ISP subsystem. + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __XMEM_H_INCLUDED__ +#define __XMEM_H_INCLUDED__ + +/* + * This file is included on every cell {SP,ISP,host} and on every system + * that uses the XMEM device. It defines the API to DLI bridge + * + * System and cell specific interfaces and inline code are included + * conditionally through Makefile path settings. + * + * - . system and cell agnostic interfaces, constants and identifiers + * - public: system agnostic, cell specific interfaces + * - private: system dependent, cell specific interfaces & inline implementations + * - global: system specific constants and identifiers + * - local: system and cell specific constants and identifiers + */ + +#include "storage_class.h" + +#include "system_local.h" +#include "xmem_local.h" + +#ifndef __INLINE_XMEM__ +#define STORAGE_CLASS_XMEM_H STORAGE_CLASS_EXTERN +#define STORAGE_CLASS_XMEM_C +#include "xmem_public.h" +#else /* __INLINE_XMEM__ */ +#define STORAGE_CLASS_XMEM_H STORAGE_CLASS_INLINE +#define STORAGE_CLASS_XMEM_C STORAGE_CLASS_INLINE +#include "xmem_private.h" +#endif /* __INLINE_XMEM__ */ + +#endif /* __XMEM_H_INCLUDED__ */ |