static int gsc_m2m_streamon(struct file *file, void *fh,
			   enum v4l2_buf_type type)
{
	struct gsc_ctx *ctx = fh_to_ctx(fh);
	struct gsc_dev *gsc = ctx->gsc_dev;
	struct exynos_platform_gscaler *pdata = gsc->pdata;

	/* The source and target color format need to be set */
	if (V4L2_TYPE_IS_OUTPUT(type)) {
		if (!gsc_ctx_state_is_set(GSC_SRC_FMT, ctx))
			return -EINVAL;
	} else if (!gsc_ctx_state_is_set(GSC_DST_FMT, ctx)) {
		return -EINVAL;
	}

	gsc_pm_qos_ctrl(gsc, GSC_QOS_ON, pdata->mif_min, pdata->int_min);

	if (gsc->protected_content) {
		int id = gsc->id + 3;
		exynos_smc(SMC_PROTECTION_SET, 0, id, 1);
		gsc_dbg("DRM enable");
	}

	return v4l2_m2m_streamon(file, ctx->m2m_ctx, type);
}
Exemple #2
0
static int gsc_capture_streamoff(struct file *file, void *priv,
			    enum v4l2_buf_type type)
{
	struct gsc_dev *gsc = video_drvdata(file);
	struct v4l2_subdev *sd;
	struct gsc_pipeline *p = &gsc->pipeline;
	int ret;

	if (p->disp) {
		gsc_pm_qos_ctrl(gsc, GSC_QOS_OFF, 0, 0);
		sd = gsc->pipeline.disp;
	} else if (p->sensor) {
		sd = gsc->pipeline.sensor;
	} else {
		gsc_err("Error pipeline");
		return -EPIPE;
	}

	ret = vb2_streamoff(&gsc->cap.vbq, type);
	if (ret == 0) {
		if (p->disp)
			media_entity_pipeline_stop(&p->disp->entity);
		else if (p->sensor)
			media_entity_pipeline_stop(&p->sensor->entity);
	}

	return ret;
}
Exemple #3
0
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);
}
Exemple #4
0
static int gsc_m2m_streamoff(struct file *file, void *fh,
			    enum v4l2_buf_type type)
{
	struct gsc_ctx *ctx = fh_to_ctx(fh);
	struct gsc_dev *gsc = ctx->gsc_dev;

	gsc_pm_qos_ctrl(gsc, GSC_QOS_OFF, 0, 0);

	return v4l2_m2m_streamoff(file, ctx->m2m_ctx, type);
}
static int gsc_m2m_streamoff(struct file *file, void *fh,
			    enum v4l2_buf_type type)
{
	struct gsc_ctx *ctx = fh_to_ctx(fh);
	struct gsc_dev *gsc = ctx->gsc_dev;

	gsc_pm_qos_ctrl(gsc, GSC_QOS_OFF, 0, 0);

	if (gsc->protected_content) {
		int id = gsc->id + 3;
		exynos_smc(SMC_PROTECTION_SET, 0, id, 0);
		gsc_dbg("DRM disable");
	}

	return v4l2_m2m_streamoff(file, ctx->m2m_ctx, type);
}
Exemple #6
0
static int gsc_m2m_streamon(struct file *file, void *fh,
			   enum v4l2_buf_type type)
{
	struct gsc_ctx *ctx = fh_to_ctx(fh);
	struct gsc_dev *gsc = ctx->gsc_dev;

	/* The source and target color format need to be set */
	if (V4L2_TYPE_IS_OUTPUT(type)) {
		if (!gsc_ctx_state_is_set(GSC_SRC_FMT, ctx))
			return -EINVAL;
	} else if (!gsc_ctx_state_is_set(GSC_DST_FMT, ctx)) {
		return -EINVAL;
	}

	gsc_pm_qos_ctrl(gsc, GSC_QOS_ON, 160000, 160000);

	return v4l2_m2m_streamon(file, ctx->m2m_ctx, type);
}