You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

127 lines
3.4 KiB

/*
* vp_config.h
*
* History:
* 2017/12/27 - [Hao Qian] created file
*
* Copyright (c) 2017 Ambarella, Inc.
*
* This file and its contents ("Software") are protected by intellectual
* property rights including, without limitation, U.S. and/or foreign
* copyrights. This Software is also the confidential and proprietary
* information of Ambarella, Inc. and its licensors. You may not use, reproduce,
* disclose, distribute, modify, or otherwise prepare derivative works of this
* Software or any portion thereof except pursuant to a signed license agreement
* or nondisclosure agreement with Ambarella, Inc. or its authorized affiliates.
* In the absence of such an agreement, you agree to promptly notify and return
* this Software to Ambarella, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
* MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL AMBARELLA, INC. OR ITS AFFILIATES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; COMPUTER FAILURE OR MALFUNCTION; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __VP_CONFIG_H__
#define __VP_CONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
#define SERVER_NAME "/tmp/vp_cfg.server"
enum IPC_MSG_TYPE {
IPC_MSG_TYPE_SESSION = 0,
IPC_MSG_TYPE_NOTICE = 1,
IPC_MSG_TYPE_REQUEST = 2,
IPC_MSG_TYPE_REPORT = 3,
};
enum IPC_SESSION_CMD {
IPC_SESS_CMD_CONNECT = 0,
IPC_SESS_CMD_DISCONNECT = 1,
IPC_SESS_CMD_NUM,
IPC_SESS_CMD_FIRST = IPC_SESS_CMD_CONNECT,
NIPC_SESS_CMD_LAST = IPC_SESS_CMD_NUM,
};
enum IPC_NOTICE_SYS {
IPC_NOTICE_SYS_VP_START = 0,
IPC_NOTICE_SYS_VP_STOP = 1,
IPC_NOTICE_SYS_NUM,
IPC_NOTICE_SYS_FIRST = IPC_NOTICE_SYS_VP_START,
IPC_NOTICE_SYS_LAST = IPC_NOTICE_SYS_NUM,
};
enum NL_REQUEST_VP_INFO {
IPC_REQ_VP_START_WITH_ALGO = 0,
IPC_REQ_VP_STATUS = 1,
IPC_REQ_VP_RESULT = 2,
IPC_REQ_IMG_NUM,
IPC_REQ_IMG_FIRST = IPC_REQ_VP_START_WITH_ALGO,
IPC_REQ_IMG_LAST = IPC_REQ_IMG_NUM,
};
enum IPC_REPORT_VP_INFO {
IPC_RPT_IAV_VP_ALGO_REQUIREMENT = 1,
IPC_RPT_IAV_NUM,
IPC_RPT_IAV_FIRST = IPC_RPT_IAV_VP_ALGO_REQUIREMENT,
IPC_RPT_IAV_LAST = IPC_RPT_IAV_NUM,
};
enum IPC_CMD_STATUS {
IPC_CMD_STATUS_SUCCESS = 0,
IPC_CMD_STATUS_FAIL = 1,
};
enum IPC_MSG_DIR {
IPC_MSG_DIR_CMD = 0,
IPC_MSG_DIR_STATUS = 1,
};
enum VP_ALGO_ID {
VP_ALGO_MTCNN = 0,
VP_ALGO_YOLO = 1,
VP_ALGO_NUM,
VP_ALGO_FIRST = VP_ALGO_MTCNN,
VP_ALGO_LAST = VP_ALGO_NUM,
};
typedef struct vp_algo_env_s {
u32 algo_id;
u32 pyrmd1_width;
u32 pyrmd1_height;
u32 pyrmd2_width;
u32 pyrmd2_height;
/* TODO: Remove following lines if they are fixed address */
u32 vp_cmd_addr;
u32 vp_cmd_size;
u32 vp_msg_addr;
} vp_algo_env_t;
#define IPC_MSG_SIZE (128)
#define IPC_MSG_HEADER_SIZE (16)
#define IPC_MSG_PAYLOAD_SIZE (IPC_MSG_SIZE - IPC_MSG_HEADER_SIZE)
typedef struct ipc_msg_s {
u32 type;
u32 dir;
u32 cmd;
u32 status;
u8 payload[IPC_MSG_PAYLOAD_SIZE];
} ipc_msg_t;
#ifdef __cplusplus
}
#endif
#endif