Petr Havlena | c928814 | 2012-11-15 14:07:10 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _FIMC_LIB_ |
| 18 | #define _FIMC_LIB_ |
| 19 | |
| 20 | #include "s5p_fimc.h" |
| 21 | #include "sec_utils.h" |
| 22 | |
| 23 | #define MAX_RESIZING_RATIO_LIMIT (63) |
| 24 | |
| 25 | enum { |
| 26 | FIMC_MEM_TYPE_UNKNOWN = 0, |
| 27 | FIMC_MEM_TYPE_PHYS, |
| 28 | FIMC_MEM_TYPE_VIRT, |
| 29 | }; |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
| 35 | struct sec_rect { |
| 36 | uint32_t x; |
| 37 | uint32_t y; |
| 38 | uint32_t w; |
| 39 | uint32_t h; |
| 40 | }; |
| 41 | |
| 42 | struct sec_img { |
| 43 | uint32_t w; |
| 44 | uint32_t h; |
| 45 | uint32_t format; |
| 46 | uint32_t base; |
| 47 | uint32_t offset; |
| 48 | int mem_id; |
| 49 | int mem_type; |
| 50 | }; |
| 51 | |
| 52 | inline int SEC_MIN(int x, int y) { |
| 53 | return ((x < y) ? x : y); |
| 54 | } |
| 55 | |
| 56 | inline int SEC_MAX(int x, int y) { |
| 57 | return ((x > y) ? x : y); |
| 58 | } |
| 59 | |
| 60 | int fimc_open(s5p_fimc_t *fimc, const char* dev); |
| 61 | |
| 62 | void fimc_close(s5p_fimc_t *fimc); |
| 63 | |
| 64 | int fimc_flush(s5p_fimc_t *fimc, |
| 65 | struct sec_img *src_img, |
| 66 | struct sec_rect *src_rect, |
| 67 | struct sec_img *dst_img, |
| 68 | struct sec_rect *dst_rect, |
| 69 | unsigned int *phyAddr, |
| 70 | uint32_t transform); |
| 71 | |
| 72 | #ifdef __cplusplus |
| 73 | } |
| 74 | #endif |
| 75 | |
| 76 | #endif // end of _FIMC_LIB_ |