summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/exynos4-is
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-05-31 10:37:26 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-12 22:16:27 -0300
commit813f5c0ac5ccf7dd9c216a8f7fbe827ca36cb83f (patch)
treef4d4ebfcea1fa7fa25d4d3b447301bef13628e6e /drivers/media/platform/exynos4-is
parent4434adff80bf24c1c558a1605599665301185bdb (diff)
[media] media: Change media device link_notify behaviour
Currently the media device link_notify callback is invoked before the actual change of state of a link when the link is being enabled, and after the actual change of state when the link is being disabled. This doesn't allow a media device driver to perform any operations on a full graph before a link is disabled, as well as performing any tasks on a modified graph right after a link's state is changed. This patch modifies signature of the link_notify callback. This callback is now called always before and after a link's state change. To distinguish the notifications a 'notification' argument is added to the link_notify callback: MEDIA_DEV_NOTIFY_PRE_LINK_CH indicates notification before link's state change and MEDIA_DEV_NOTIFY_POST_LINK_CH corresponds to a notification after link flags change. [mchehab@redhat.com: whitespace cleanups] Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/exynos4-is')
-rw-r--r--drivers/media/platform/exynos4-is/media-dev.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
index b5624931d16..5298dd6680a 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -1287,34 +1287,36 @@ int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on)
return __fimc_md_set_camclk(fmd, si, on);
}
-static int fimc_md_link_notify(struct media_pad *source,
- struct media_pad *sink, u32 flags)
+static int fimc_md_link_notify(struct media_link *link, u32 flags,
+ unsigned int notification)
{
+ struct media_entity *sink = link->sink->entity;
struct exynos_video_entity *ve;
struct video_device *vdev;
struct fimc_pipeline *pipeline;
int i, ret = 0;
- if (media_entity_type(sink->entity) != MEDIA_ENT_T_DEVNODE_V4L)
+ if (media_entity_type(sink) != MEDIA_ENT_T_DEVNODE_V4L ||
+ notification == MEDIA_DEV_NOTIFY_PRE_LINK_CH)
return 0;
- vdev = media_entity_to_video_device(sink->entity);
+ vdev = media_entity_to_video_device(sink);
ve = vdev_to_exynos_video_entity(vdev);
pipeline = to_fimc_pipeline(ve->pipe);
- if (!(flags & MEDIA_LNK_FL_ENABLED) && pipeline->subdevs[IDX_SENSOR]) {
- if (sink->entity->use_count > 0)
+ if (!(link->flags & MEDIA_LNK_FL_ENABLED) && pipeline->subdevs[IDX_SENSOR]) {
+ if (sink->use_count > 0)
ret = __fimc_pipeline_close(ve->pipe);
for (i = 0; i < IDX_MAX; i++)
pipeline->subdevs[i] = NULL;
- } else if (sink->entity->use_count > 0) {
+ } else if (sink->use_count > 0) {
/*
* Link activation. Enable power of pipeline elements only if
* the pipeline is already in use, i.e. its video node is open.
* Recreate the controls destroyed during the link deactivation.
*/
- ret = __fimc_pipeline_open(ve->pipe, sink->entity, true);
+ ret = __fimc_pipeline_open(ve->pipe, sink, true);
}
return ret ? -EPIPE : ret;