Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366984
b: refs/heads/master
c: 756e6e1
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Apr 14, 2013
1 parent e6a6b30 commit f8b6c43
Show file tree
Hide file tree
Showing 2 changed files with 29 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: 488f29d00e819b178f9060fa08028b73d5f8d916
refs/heads/master: 756e6e14484b3249dad9663ed1398711b62676a3
57 changes: 28 additions & 29 deletions trunk/drivers/media/platform/exynos4-is/fimc-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,43 @@ static const struct fimc_fmt *fimc_lite_find_format(const u32 *pixelformat,
return def_fmt;
}

/* Called with the media graph mutex held or @me stream_count > 0. */
static struct v4l2_subdev *__find_remote_sensor(struct media_entity *me)
{
struct media_pad *pad = &me->pads[0];
struct v4l2_subdev *sd;

while (pad->flags & MEDIA_PAD_FL_SINK) {
/* source pad */
pad = media_entity_remote_source(pad);
if (pad == NULL ||
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break;

sd = media_entity_to_v4l2_subdev(pad->entity);

if (sd->grp_id == GRP_ID_FIMC_IS_SENSOR ||
sd->grp_id == GRP_ID_SENSOR)
return sd;
/* sink pad */
pad = &sd->entity.pads[0];
}
return NULL;
}

static int fimc_lite_hw_init(struct fimc_lite *fimc, bool isp_output)
{
struct fimc_pipeline *pipeline = &fimc->pipeline;
struct v4l2_subdev *sensor;
struct fimc_sensor_info *si;
unsigned long flags;

sensor = isp_output ? fimc->sensor : pipeline->subdevs[IDX_SENSOR];

if (sensor == NULL)
if (fimc->sensor == NULL)
return -ENXIO;

if (fimc->inp_frame.fmt == NULL || fimc->out_frame.fmt == NULL)
return -EINVAL;

/* Get sensor configuration data from the sensor subdev */
si = v4l2_get_subdev_hostdata(sensor);
si = v4l2_get_subdev_hostdata(fimc->sensor);
spin_lock_irqsave(&fimc->slock, flags);

flite_hw_set_camera_bus(fimc, &si->pdata);
Expand Down Expand Up @@ -801,6 +821,8 @@ static int fimc_lite_streamon(struct file *file, void *priv,
if (ret < 0)
goto err_p_stop;

fimc->sensor = __find_remote_sensor(&fimc->subdev.entity);

ret = vb2_ioctl_streamon(file, priv, type);
if (!ret) {
fimc->streaming = true;
Expand Down Expand Up @@ -929,29 +951,6 @@ static const struct v4l2_ioctl_ops fimc_lite_ioctl_ops = {
.vidioc_streamoff = fimc_lite_streamoff,
};

/* Called with the media graph mutex held */
static struct v4l2_subdev *__find_remote_sensor(struct media_entity *me)
{
struct media_pad *pad = &me->pads[0];
struct v4l2_subdev *sd;

while (pad->flags & MEDIA_PAD_FL_SINK) {
/* source pad */
pad = media_entity_remote_source(pad);
if (pad == NULL ||
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break;

sd = media_entity_to_v4l2_subdev(pad->entity);

if (sd->grp_id == GRP_ID_FIMC_IS_SENSOR)
return sd;
/* sink pad */
pad = &sd->entity.pads[0];
}
return NULL;
}

/* Capture subdev media entity operations */
static int fimc_lite_link_setup(struct media_entity *entity,
const struct media_pad *local,
Expand Down

0 comments on commit f8b6c43

Please sign in to comment.