media: camss: vfe: Reserve VFE lines on stream start and link to CSID
For multiple virtual channels support, each VFE line can be in either ON, RESERVED or OFF states. This allows the starting and stopping of a VFE line independently of other active VFE lines (e.g. already- running lines stay in ON state, and newly-added lines are RESERVED) Also, link the CSID entity's source ports to corresponding VFE lines. Signed-off-by: Milen Mitkov <quic_mmitkov@quicinc.com> Reviewed-by: Robert Foss <robert.foss@linaro.org> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Acked-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
3c4ed72a16
commit
8ce158c1be
@ -409,7 +409,7 @@ static int vfe_get_output(struct vfe_line *line)
|
||||
spin_lock_irqsave(&vfe->output_lock, flags);
|
||||
|
||||
output = &line->output;
|
||||
if (output->state != VFE_OUTPUT_OFF) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is running\n");
|
||||
goto error;
|
||||
}
|
||||
@ -462,7 +462,7 @@ static int vfe_enable_output(struct vfe_line *line)
|
||||
|
||||
ops->reg_update_clear(vfe, line->id);
|
||||
|
||||
if (output->state != VFE_OUTPUT_OFF) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n",
|
||||
output->state);
|
||||
spin_unlock_irqrestore(&vfe->output_lock, flags);
|
||||
|
@ -239,7 +239,7 @@ static int vfe_get_output(struct vfe_line *line)
|
||||
spin_lock_irqsave(&vfe->output_lock, flags);
|
||||
|
||||
output = &line->output;
|
||||
if (output->state != VFE_OUTPUT_OFF) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is running\n");
|
||||
goto error;
|
||||
}
|
||||
@ -279,7 +279,7 @@ static int vfe_enable_output(struct vfe_line *line)
|
||||
|
||||
vfe_reg_update_clear(vfe, line->id);
|
||||
|
||||
if (output->state != VFE_OUTPUT_OFF) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n",
|
||||
output->state);
|
||||
spin_unlock_irqrestore(&vfe->output_lock, flags);
|
||||
|
@ -194,7 +194,7 @@ static int vfe_enable_output(struct vfe_line *line)
|
||||
|
||||
ops->reg_update_clear(vfe, line->id);
|
||||
|
||||
if (output->state != VFE_OUTPUT_RESERVED) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n", output->state);
|
||||
spin_unlock_irqrestore(&vfe->output_lock, flags);
|
||||
return -EINVAL;
|
||||
@ -289,7 +289,7 @@ static int vfe_get_output(struct vfe_line *line)
|
||||
spin_lock_irqsave(&vfe->output_lock, flags);
|
||||
|
||||
output = &line->output;
|
||||
if (output->state != VFE_OUTPUT_OFF) {
|
||||
if (output->state > VFE_OUTPUT_RESERVED) {
|
||||
dev_err(vfe->camss->dev, "Output is running\n");
|
||||
goto error;
|
||||
}
|
||||
|
@ -740,6 +740,7 @@ static int vfe_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
int ret;
|
||||
|
||||
if (enable) {
|
||||
line->output.state = VFE_OUTPUT_RESERVED;
|
||||
ret = vfe->ops->vfe_enable(line);
|
||||
if (ret < 0)
|
||||
dev_err(vfe->camss->dev,
|
||||
|
@ -1320,7 +1320,7 @@ static int camss_register_entities(struct camss *camss)
|
||||
struct v4l2_subdev *vfe = &camss->vfe[k].line[j].subdev;
|
||||
|
||||
ret = media_create_pad_link(&csid->entity,
|
||||
MSM_CSID_PAD_SRC,
|
||||
MSM_CSID_PAD_FIRST_SRC + j,
|
||||
&vfe->entity,
|
||||
MSM_VFE_PAD_SINK,
|
||||
0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user