static int gsc_capture_streamon(struct file *file, void *priv, enum v4l2_buf_type type) { struct gsc_dev *gsc = video_drvdata(file); struct gsc_pipeline *p = &gsc->pipeline; int ret; if (gsc_cap_active(gsc)) return -EBUSY; if (p->disp) { gsc_pm_qos_ctrl(gsc, GSC_QOS_ON, 267000, 200000); media_entity_pipeline_start(&p->disp->entity, p->pipe); } else if (p->sensor) { media_entity_pipeline_start(&p->sensor->entity, p->pipe); } else { gsc_err("Error pipeline"); return -EPIPE; } ret = gsc_cap_link_validate(gsc); if (ret) return ret; gsc_hw_set_sw_reset(gsc); ret= gsc_wait_reset(gsc); if (ret < 0) { gsc_err("gscaler s/w reset timeout"); return ret; } gsc_hw_set_output_buf_mask_all(gsc); return vb2_streamon(&gsc->cap.vbq, type); }
static int gsc_capture_start_streaming(struct vb2_queue *q, unsigned int count) { struct gsc_ctx *ctx = q->drv_priv; struct gsc_dev *gsc = ctx->gsc_dev; struct gsc_capture_device *cap = &gsc->cap; int min_bufs; gsc_hw_set_sw_reset(gsc); gsc_wait_reset(gsc); gsc_hw_set_output_buf_mask_all(gsc); min_bufs = cap->reqbufs_cnt > 1 ? 2 : 1; if ((gsc_hw_get_nr_unmask_bits(gsc) >= min_bufs) && !test_bit(ST_CAPT_STREAM, &gsc->state)) { if (!test_and_set_bit(ST_CAPT_PIPE_STREAM, &gsc->state)) { gsc_info(""); gsc_cap_pipeline_s_stream(gsc, 1); } } return 0; }