2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2010-2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef _hive_isp_css_ddr_hrt_modified_h_
16 #define _hive_isp_css_ddr_hrt_modified_h_
18 #include <hmm_64/hmm.h>
20 /* This function reads an image from DDR and stores it in the img_buf array
21 that has been allocated by the caller.
22 The specifics of how the pixels are stored into DDR by the DMA are taken
23 into account (bits padded to a width of 256, depending on the number of
24 elements per ddr word).
25 The DMA specific parameters give to this function (elems_per_xword and sign_extend)
26 should correspond to those given to the DMA engine.
27 The address is a virtual address which will be translated to a physical address before
28 data is loaded from or stored to that address.
30 The return value is 0 in case of success and 1 in case of failure.
33 hrt_isp_css_read_image_from_ddr(
34 unsigned short *img_buf,
37 unsigned int elems_per_xword,
38 unsigned int sign_extend,
41 /* This function writes an image to DDR, keeping the same aspects into account as the read_image function
44 hrt_isp_css_write_image_to_ddr(
45 const unsigned short *img_buf,
48 unsigned int elems_per_xword,
49 unsigned int sign_extend,
52 /* return the size in bytes of an image (frame or plane). */
54 hrt_isp_css_sizeof_image_in_ddr(
57 unsigned int bits_per_element);
60 hrt_isp_css_stride_of_image_in_ddr(
62 unsigned int bits_per_element);
65 hrt_isp_css_alloc_image_in_ddr(
68 unsigned int elems_per_xword);
71 hrt_isp_css_calloc_image_in_ddr(
74 unsigned int elems_per_xword);
76 #ifndef HIVE_ISP_NO_GDC
77 #include "gdc_v2_defs.h"
80 hrt_isp_css_alloc_gdc_lut_in_ddr(void);
83 hrt_isp_css_write_gdc_lut_to_ddr(
84 short values[4][HRT_GDC_N],
88 #ifdef _HIVE_ISP_CSS_FPGA_SYSTEM
90 hrt_isp_css_alloc_image_for_display(
93 unsigned int elems_per_xword);
96 hrt_isp_css_calloc_image_for_display(
99 unsigned int elems_per_xword);
102 /* New set of functions, these do not require the elems_per_xword, but use bits_per_element instead,
103 this way the user does not need to know about the width of a DDR word. */
105 hrt_isp_css_read_unsigned(
106 unsigned short *target,
109 unsigned int source_bits_per_element,
113 hrt_isp_css_read_signed(
117 unsigned int source_bits_per_element,
121 hrt_isp_css_write_unsigned(
122 const unsigned short *source,
125 unsigned int target_bits_per_element,
129 hrt_isp_css_write_signed(
133 unsigned int target_bits_per_element,
140 unsigned int bits_per_element);
146 unsigned int bits_per_element);
148 #endif /* _hive_isp_css_ddr_hrt_modified_h_ */