static inline u32 fimc_irq_out_none(struct fimc_control *ctrl) { u32 next = 0, wakeup = 1; int ret = -1; if (ctrl->status == FIMC_READY_OFF) { ctrl->out->idx.active = -1; ctrl->status = FIMC_STREAMOFF; return wakeup; } /* Attach done buffer to outgoing queue. */ ret = fimc_attach_out_queue(ctrl, ctrl->out->idx.active); if (ret < 0) fimc_err("Failed: fimc_attach_out_queue\n"); /* Detach buffer from incomming queue. */ ret = fimc_detach_in_queue(ctrl, &next); if (ret == 0) { /* There is a buffer in incomming queue. */ fimc_outdev_set_src_addr(ctrl, ctrl->out->src[next].base); ret = fimc_outdev_start_camif(ctrl); if (ret < 0) fimc_err("Fail: fimc_start_camif\n"); ctrl->out->idx.active = next; ctrl->status = FIMC_STREAMON; } else { /* There is no buffer in incomming queue. */ ctrl->out->idx.active = -1; ctrl->status = FIMC_STREAMON_IDLE; } return wakeup; }
static inline u32 fimc_irq_out_dma(struct fimc_control *ctrl) { u32 next = 0, wakeup = 1; int ret = -1; #ifdef VIEW_FUNCTION_CALL printk("[FIMC_DEV] %s(%d)\n", __func__, __LINE__); #endif /* Attach done buffer to outgoing queue. */ ret = fimc_attach_out_queue(ctrl, ctrl->out->idx.active); if (ret < 0) dev_err(ctrl->dev, "Failed: fimc_attach_out_queue\n"); if (ctrl->status == FIMC_READY_OFF) { ctrl->out->idx.active = -1; return wakeup; } /* Detach buffer from incomming queue. */ ret = fimc_detach_in_queue(ctrl, &next); if (ret == 0) { /* There is a buffer in incomming queue. */ fimc_outdev_set_src_addr(ctrl, ctrl->out->buf[next].base); ret = fimc_outdev_start_camif(ctrl); if (ret < 0) dev_err(ctrl->dev, "Fail: fimc_start_camif\n"); ctrl->out->idx.active = next; ctrl->status = FIMC_STREAMON; } else { /* There is no buffer in incomming queue. */ ctrl->out->idx.active = -1; ctrl->status = FIMC_STREAMON_IDLE; } return wakeup; }
static inline u32 fimc_irq_out_dma(struct fimc_control *ctrl) { struct fimc_buf_set buf_set; u32 next = 0, wakeup = 1; int idx = ctrl->out->idx.active; int ret = -1, i; if (ctrl->status == FIMC_READY_OFF) { ctrl->out->idx.active = -1; ctrl->status = FIMC_STREAMOFF; return wakeup; } /* Attach done buffer to outgoing queue. */ ret = fimc_attach_out_queue(ctrl, idx); if (ret < 0) fimc_err("Failed: fimc_attach_out_queue\n"); if(ctrl->out->overlay.mode == FIMC_OVERLAY_DMA_AUTO) { ret = s3cfb_direct_ioctl(ctrl->id, S3CFB_SET_WIN_ADDR, \ (unsigned long)ctrl->out->dst[idx].base[FIMC_ADDR_Y]); if (ret < 0) { fimc_err("direct_ioctl(S3CFB_SET_WIN_ADDR) fail\n"); return -EINVAL; } if(ctrl->fb.is_enable == 0) { ret = s3cfb_direct_ioctl(ctrl->id, S3CFB_SET_WIN_ON, \ (unsigned long)NULL); if (ret < 0) { fimc_err("direct_ioctl(S3CFB_SET_WIN_ON) fail\n"); return -EINVAL; } ctrl->fb.is_enable = 1; } } /* Detach buffer from incomming queue. */ ret = fimc_detach_in_queue(ctrl, &next); if (ret == 0) { /* There is a buffer in incomming queue. */ fimc_outdev_set_src_addr(ctrl, ctrl->out->src[next].base); memset(&buf_set, 0x00, sizeof(buf_set)); buf_set.base[FIMC_ADDR_Y] = ctrl->out->dst[next].base[FIMC_ADDR_Y]; for (i = 0; i < FIMC_PHYBUFS; i++) fimc_hwset_output_address(ctrl, &buf_set, i); ret = fimc_outdev_start_camif(ctrl); if (ret < 0) fimc_err("Fail: fimc_start_camif\n"); ctrl->out->idx.active = next; ctrl->status = FIMC_STREAMON; } else { /* There is no buffer in incomming queue. */ ctrl->out->idx.active = -1; ctrl->status = FIMC_STREAMON_IDLE; } return wakeup; }