#define VS4L_TARGET_SC_SHIFT 16
#define VS4L_TARGET_PU 0xFFFF
#define VS4L_TARGET_PU_SHIFT 0
-#define _MAX_NUM_OF_USER_PARAMS 80
+#define _MAX_NUM_OF_USER_PARAMS 180
enum vs4l_graph_flag {
#else
MAX_NUM_OF_INPUTS = 24,
#endif
-#if 0
+#if 0
MAX_NUM_OF_OUTPUTS = 12,
#else
MAX_NUM_OF_OUTPUTS = 8,
#if 0
MAX_NUM_OF_USER_PARAMS = 8,
#else
- MAX_NUM_OF_USER_PARAMS = 80,
+ MAX_NUM_OF_USER_PARAMS = 180,
#endif
};
SCENARIO_DE = 1,
SCENARIO_SDOF_FULL,
SCENARIO_DE_SDOF,
-// temp for previous host ver
-// SCENARIO_ENF,
SCENARIO_DE_CAPTURE,
SCENARIO_SDOF_CAPTURE,
SCENARIO_DE_SDOF_CAPTURE,
SCENARIO_GDC,
SCENARIO_ENF,
SCENARIO_ENF_UV,
+ SCENARIO_ENF_YUV,
SCENARIO_BLEND,
SCENARIO_AP_MAX,
};
/* #define DBG_PRINT_TASK */
/* #define DBG_VERBOSE_IO */
+#if 0
//#define DUMP_DEBUG_LOG_REGION
#define DEBUG_LOG_MEMORY
//#define PRINT_DBG
-
+#endif
#define DISABLE_VIPX_LOG 0
#if DISABLE_VIPX_LOG
#define VIPX_IOVA_DRAM_FIRMWARE 0xB8000000
#define VIPX_IOVA_DRAM_MBOX 0xA9000000
+#define ION_FLAG_NON_CACHED 0
+
+
struct vipx_vb2_buf;
struct vipx_vb2_buf_ops {
ulong (*plane_kvaddr)(struct vipx_vb2_buf *vbuf, u32 plane);
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && itaskmgr->req_cnt) {
vipx_warn("waiting %d request completion...(%d)\n", itaskmgr->req_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && itaskmgr->pro_cnt) {
vipx_warn("waiting %d process completion...(%d)\n", itaskmgr->pro_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && itaskmgr->com_cnt) {
vipx_warn("waiting %d complete completion...(%d)\n", itaskmgr->com_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
int vipx_hw_wait_bootup(struct vipx_interface *interface)
{
int ret = 0;
- int try_cnt = 10;
struct vipx_system *system = container_of(interface, struct vipx_system, interface);
- struct vipx_binary *binary = &system->binary;
BUG_ON(!interface);
+#ifdef DUMP_DEBUG_LOG_REGION
+ int try_cnt = 10;
+ struct vipx_binary *binary = &system->binary;
while (try_cnt && !test_bit(VIPX_ITF_STATE_BOOTUP, &interface->state)) {
- msleep(5);
+ msleep(1);
try_cnt--;
vipx_info("%s(): wait CM7 bootup\n",__func__);
}
+#endif
vipx_info("debug kva(0x%p), dva(0x%x), size(%ld)\n", system->memory.info.kvaddr_debug, (u32)system->memory.info.dvaddr_debug, system->memory.info.pb_debug->size);
+#ifdef DUMP_DEBUG_LOG_REGION
if (try_cnt == 0)
{
if (!IS_ERR_OR_NULL(system->memory.info.kvaddr_debug)) {
}
ret = -EINVAL;
}
-
+#endif
vipx_info("%s():%d\n", __func__, ret);
return ret;
}
if (payload.msg_u.destroy_graph_req.graph_id < SCENARIO_DE_CAPTURE)
heap_size = VIPX_CM7_HEAP_SIZE_PREVIEW;
- else if (payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF)
+ else if ((payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF) ||
+ (payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF_YUV))
heap_size = VIPX_CM7_HEAP_SIZE_ENF;
else
heap_size = VIPX_CM7_HEAP_SIZE_CAPTURE;
// Allocate and assign heap
if (payload.msg_u.set_graph_req.graph_id < SCENARIO_DE_CAPTURE)
heap_size = VIPX_CM7_HEAP_SIZE_PREVIEW;
- else if (payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF_UV ||
- payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF)
+ else if ((payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF_UV) ||
+ (payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF) ||
+ (payload.msg_u.destroy_graph_req.graph_id == SCENARIO_ENF_YUV))
heap_size = VIPX_CM7_HEAP_SIZE_ENF;
else
heap_size = VIPX_CM7_HEAP_SIZE_CAPTURE;
try_count = 1000;
while (--try_count && (mbox->wmsg_idx == mbox->rmsg_idx)) {
vipx_warn("waiting vipx reply(%d, %d)...(%d)\n", mbox->wmsg_idx, mbox->rmsg_idx, try_count);
- msleep(10);
+ msleep(1);
}
if (try_count <= 0) {
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && taskmgr->req_cnt) {
vipx_iwarn("waiting %d request cancel...(%d)\n", graph, taskmgr->req_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && taskmgr->pre_cnt) {
vipx_iwarn("waiting %d prepare cancel...(%d)\n", graph, taskmgr->pre_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
retry = VIPX_STOP_WAIT_COUNT;
while (--retry && taskmgr->pro_cnt) {
vipx_iwarn("waiting %d process done...(%d)\n", graph, taskmgr->pro_cnt, retry);
- msleep(10);
+ msleep(1);
}
if (!retry) {
size = PAGE_ALIGN(size);
- buf->dma_buf = ion_alloc_dmabuf(heapname, size, alloc_ctx->flags);
+ buf->dma_buf = ion_alloc_dmabuf(heapname, size, ION_FLAG_NON_CACHED);
+ //buf->dma_buf = ion_alloc_dmabuf(heapname, size, alloc_ctx->flags);
if (IS_ERR(buf->dma_buf)) {
ret = -ENOMEM;
goto err_alloc;
vipx_err("failed to allocate buffer for VIPX_CM7_HEAP_SIZE");
ret = -ENOMEM;
}
+#ifdef DUMP_DEBUG_LOG_REGION
minfo->kvaddr_heap = vipx_ion_kvaddr(minfo->pb_heap);
+#endif
minfo->dvaddr_heap = vipx_ion_dvaddr(minfo->pb_heap);
vipx_info("heap kva(0x%p), dva(0x%x), size(%ld)\n",
minfo->kvaddr_heap, (u32)minfo->dvaddr_heap, minfo->pb_heap->size);
vipx_err("CTL_OP(ctl_start) is fail(%d)\n", ret);
goto p_err;
}
-
+#if 0 // change code position to vipx_vertex_streamon in vipx-vertex.c before streamon execution
ret = vipx_hw_wait_bootup(&system->interface);
if (ret) {
vipx_err("vipx_hw_wait_bootup is fail(%d)\n", ret);
goto p_err;
}
+#endif
p_err:
vipx_info("%s():%d\n", __func__, ret);
struct vipx_vertex *vertex = vctx->vertex;
struct vipx_queue *queue = &vctx->queue;
struct mutex *lock = &vctx->lock;
+ struct vipx_device *device = container_of(vertex, struct vipx_device, vertex);
+ struct vipx_system *system = &device->system;
if (mutex_lock_interruptible(lock)) {
vipx_ierr("mutex_lock_interruptible is fail\n", vctx);
return -ERESTARTSYS;
}
+ ret = vipx_hw_wait_bootup(&system->interface);
+ if (ret) {
+ vision_err("CM7 bootup is fail(%d)\n", ret);
+ goto p_err;
+ }
+
if (!(vctx->state & (BIT(VIPX_VERTEX_FORMAT) | BIT(VIPX_VERTEX_STOP)))) {
vipx_ierr("invalid state(%X)\n", vctx, vctx->state);
ret = -EINVAL;