1 /*
2 * Copyright (c) 2019-2022 Rockchip Eletronics Co., Ltd.
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 #include "aie/rk_aiq_uapi_aie_int.h"
18 #include "algo_handlers/RkAiqAieHandle.h"
19
20 RKAIQ_BEGIN_DECLARE
21
22 #ifdef RK_SIMULATOR_HW
23 #define CHECK_USER_API_ENABLE
24 #endif
25
26 #if RKAIQ_HAVE_AIE_V10
rk_aiq_user_api_aie_SetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,const aie_attrib_t * attr)27 XCamReturn rk_aiq_user_api_aie_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
28 const aie_attrib_t* attr)
29 {
30 XCamReturn ret = XCAM_RETURN_NO_ERROR;
31 CHECK_USER_API_ENABLE2(sys_ctx);
32 CHECK_USER_API_ENABLE(RK_AIQ_ALGO_TYPE_AIE);
33 RKAIQ_API_SMART_LOCK(sys_ctx);
34
35 RkAiqAieHandleInt* algo_handle =
36 algoHandle<RkAiqAieHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_AIE);
37
38 if (algo_handle) {
39 return algo_handle->setAttrib(attr);
40 }
41
42 return (ret);
43 }
44
rk_aiq_user_api_aie_GetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,aie_attrib_t * attr)45 XCamReturn rk_aiq_user_api_aie_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
46 aie_attrib_t *attr)
47 {
48 RKAIQ_API_SMART_LOCK(sys_ctx);
49 XCamReturn ret = XCAM_RETURN_NO_ERROR;
50
51 RkAiqAieHandleInt* algo_handle =
52 algoHandle<RkAiqAieHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_AIE);
53
54 if (algo_handle) {
55 return algo_handle->getAttrib(attr);
56 }
57
58 return (ret);
59
60 }
61 #else
62 XCamReturn rk_aiq_user_api_aie_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
63 const aie_attrib_t* attr)
64 {
65
66 return XCAM_RETURN_ERROR_UNKNOWN;
67 }
68
69 XCamReturn rk_aiq_user_api_aie_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
70 aie_attrib_t *attr)
71 {
72
73 return XCAM_RETURN_ERROR_UNKNOWN;
74
75 }
76 #endif
77
78 RKAIQ_END_DECLARE
79
80
81
82