Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306284
b: refs/heads/master
c: ae5df81
h: refs/heads/master
v: v3
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed May 14, 2012
1 parent c7113e8 commit 9ae002b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe6adc1991b6ce0f6d1c4ca74ec9f02d2d8cb3b4
refs/heads/master: ae5df813314a581225db9e9f5ca9c61f2b216775
61 changes: 32 additions & 29 deletions trunk/drivers/media/video/omap3isp/ispvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
}

/* Return a pointer to the ISP video instance at the far end of the pipeline. */
static struct isp_video *
isp_video_far_end(struct isp_video *video)
static int isp_video_get_graph_data(struct isp_video *video,
struct isp_pipeline *pipe)
{
struct media_entity_graph graph;
struct media_entity *entity = &video->video.entity;
Expand All @@ -267,21 +267,38 @@ isp_video_far_end(struct isp_video *video)
media_entity_graph_walk_start(&graph, entity);

while ((entity = media_entity_graph_walk_next(&graph))) {
struct isp_video *__video;

pipe->entities |= 1 << entity->id;

if (far_end != NULL)
continue;

if (entity == &video->video.entity)
continue;

if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
continue;

far_end = to_isp_video(media_entity_to_video_device(entity));
if (far_end->type != video->type)
break;

far_end = NULL;
__video = to_isp_video(media_entity_to_video_device(entity));
if (__video->type != video->type)
far_end = __video;
}

mutex_unlock(&mdev->graph_mutex);
return far_end;

if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
pipe->input = far_end;
pipe->output = video;
} else {
if (far_end == NULL)
return -EPIPE;

pipe->input = video;
pipe->output = far_end;
}

return 0;
}

/*
Expand All @@ -304,17 +321,13 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe)
struct v4l2_subdev *subdev;
int ret;

pipe->entities = 0;

subdev = isp_video_remote_subdev(pipe->output, NULL);
if (subdev == NULL)
return -EPIPE;

while (1) {
unsigned int shifter_link;

pipe->entities |= 1U << subdev->entity.id;

/* Retrieve the sink format */
pad = &subdev->entity.pads[0];
if (!(pad->flags & MEDIA_PAD_FL_SINK))
Expand Down Expand Up @@ -977,7 +990,6 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
struct isp_video *video = video_drvdata(file);
enum isp_pipeline_state state;
struct isp_pipeline *pipe;
struct isp_video *far_end;
unsigned long flags;
int ret;

Expand All @@ -997,6 +1009,8 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
pipe = video->video.entity.pipe
? to_isp_pipeline(&video->video.entity) : &video->pipe;

pipe->entities = 0;

if (video->isp->pdata->set_constraints)
video->isp->pdata->set_constraints(video->isp, true);
pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]);
Expand All @@ -1016,25 +1030,14 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
video->bpl_padding = ret;
video->bpl_value = vfh->format.fmt.pix.bytesperline;

/* Find the ISP video node connected at the far end of the pipeline and
* update the pipeline.
*/
far_end = isp_video_far_end(video);
ret = isp_video_get_graph_data(video, pipe);
if (ret < 0)
goto err_check_format;

if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
state = ISP_PIPELINE_STREAM_OUTPUT | ISP_PIPELINE_IDLE_OUTPUT;
pipe->input = far_end;
pipe->output = video;
} else {
if (far_end == NULL) {
ret = -EPIPE;
goto err_check_format;
}

else
state = ISP_PIPELINE_STREAM_INPUT | ISP_PIPELINE_IDLE_INPUT;
pipe->input = video;
pipe->output = far_end;
}

/* Validate the pipeline and update its state. */
ret = isp_video_validate_pipeline(pipe);
Expand Down

0 comments on commit 9ae002b

Please sign in to comment.