3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 * \file exynos_gscaler.h
20 * \brief header file for Gscaler HAL
21 * \author ShinWon Lee (shinwon.lee@samsung.com)
24 * <b>Revision History: </b>
25 * - 2012/01/09 : ShinWon Lee(shinwon.lee@samsung.com) \n
28 * - 2012/02/07 : ShinWon Lee(shinwon.lee@samsung.com) \n
29 * Change file name to exynos_gscaler.h
31 * - 2012/02/09 : Sangwoo, Parkk(sw5771.park@samsung.com) \n
32 * Use Multiple Gscaler by Multiple Process
34 * - 2012/02/20 : Sangwoo, Park(sw5771.park@samsung.com) \n
35 * Add exynos_gsc_set_rotation() API
37 * - 2012/02/20 : ShinWon Lee(shinwon.lee@samsung.com) \n
43 * \defgroup exynos_gscaler
44 * \brief API for gscaler
47 #include "Exynos_log.h"
49 #ifndef EXYNOS_GSCALER_H_
50 #define EXYNOS_GSCALER_H_
56 //#define EXYNOS_GSC_TRACE 0
57 #ifdef EXYNOS_GSC_TRACE
58 #define EXYNOS_GSC_LOG_TAG "Exynos_gscaler"
59 #define Exynos_gsc_In() Exynos_Log(EXYNOS_DEV_LOG_DEBUG, EXYNOS_GSC_LOG_TAG, "%s In , Line: %d", __FUNCTION__, __LINE__)
60 #define Exynos_gsc_Out() Exynos_Log(EXYNOS_DEV_LOG_DEBUG, EXYNOS_GSC_LOG_TAG, "%s Out , Line: %d", __FUNCTION__, __LINE__)
62 #define Exynos_gsc_In() ((void *)0)
63 #define Exynos_gsc_Out() ((void *)0)
86 * Create libgscaler handle.
87 * Gscaler dev_num is dynamically changed.
89 * \ingroup exynos_gscaler
94 void *exynos_gsc_create(
98 * Create exclusive libgscaler handle.
99 * Other module can't use dev_num of Gscaler.
101 * \ingroup exynos_gscaler
104 * gscaler dev_num[in]
106 *It should be set to GSC_M2M_MODE or GSC_OUTPUT_MODE.
109 *It should be set to GSC_OUT_FIMD or GSC_OUT_TV.
114 void *exynos_gsc_create_exclusive(
121 * Destroy libgscaler handle
123 * \ingroup exynos_gscaler
126 * libgscaler handle[in]
128 void exynos_gsc_destroy(
134 * \ingroup exynos_gscaler
137 * libgscaler handle[in]
146 * image left crop size[in]
149 * image top crop size[in]
152 * cropped image width[in]
155 * cropped image height[in]
157 * \param v4l2_colorformat
169 int exynos_gsc_set_src_format(
173 unsigned int crop_left
,
174 unsigned int crop_top
,
175 unsigned int crop_width
,
176 unsigned int crop_height
,
177 unsigned int v4l2_colorformat
,
178 unsigned int cacheable
,
179 unsigned int mode_drm
);
182 * Set destination format.
184 * \ingroup exynos_gscaler
187 * libgscaler handle[in]
196 * image left crop size[in]
199 * image top crop size[in]
202 * cropped image width[in]
205 * cropped image height[in]
207 * \param v4l2_colorformat
217 * narrow RGB range[in]
222 int exynos_gsc_set_dst_format(
226 unsigned int crop_left
,
227 unsigned int crop_top
,
228 unsigned int crop_width
,
229 unsigned int crop_height
,
230 unsigned int v4l2_colorformat
,
231 unsigned int cacheable
,
232 unsigned int mode_drm
,
233 unsigned int narrowRgb
);
238 * \ingroup exynos_gscaler
241 * libgscaler handle[in]
244 * image rotation. It should be multiple of 90[in]
246 * \param flip_horizontal
247 * image flip_horizontal[in]
249 * \param flip_vertical
250 * image flip_vertical[in]
255 int exynos_gsc_set_rotation(
264 * \ingroup exynos_gscaler
267 * libgscaler handle[in]
270 * buffer pointer array[in]
272 * \param acquireFenceFd
273 * acquire fence fd for the buffer or -1[in]
278 int exynos_gsc_set_src_addr(
284 * Set destination buffer
287 * libgscaler handle[in]
290 * buffer pointer array[in]
292 * \param acquireFenceFd
293 * acquire fence fd for the buffer or -1[in]
298 int exynos_gsc_set_dst_addr(
304 * Convert color space with presetup color format
306 * \ingroup exynos_gscaler
309 * libgscaler handle[in]
314 int exynos_gsc_convert(
318 * api for local path gscaler. Not yet support.
320 * \ingroup exynos_gscaler
322 int exynos_gsc_connect(
327 * api for local path gscaler. Not yet support.
329 * \ingroup exynos_gscaler
331 int exynos_gsc_disconnect(
336 * api for reserving a specific gscaler.
337 * This API could be used from any module that
338 *wants to control the gscalar privately. By calling this function any
339 *module can let the libgscaler know that GSC is used privately.
341 * \ingroup exynos_gsc_reserve
343 void *exynos_gsc_reserve
348 * api for releasing the gscaler that was reserved with
350 * \ingroup exynos_gsc_reserve
352 void exynos_gsc_release
357 *api for setting the GSC config.
358 It configures the GSC for given config
360 int exynos_gsc_config_exclusive(
362 exynos_gsc_img
*src_img
,
363 exynos_gsc_img
*dst_img
);
366 *api for GSC-OUT run.
367 It queues the srcBuf to GSC and deques a buf from driver.
368 It should be called after configuring the GSC.
370 int exynos_gsc_run_exclusive(
372 exynos_gsc_img
*src_img
,
373 exynos_gsc_img
*dst_img
);
376 * Blocks until the current frame is done processing.
378 int exynos_gsc_wait_frame_done_exclusive
383 It stops the GSC OUT streaming.
385 int exynos_gsc_stop_exclusive
404 GSC_DONE_CNG_CFG
= 0,
412 #endif /*EXYNOS_GSCALER_H_*/