All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] [media] dvb-frontend: remove a warning
@ 2015-02-18 15:29 Mauro Carvalho Chehab
  2015-02-18 15:29 ` [PATCH 2/7] [media] cx231xx: fix compilation if the media controller is not defined Mauro Carvalho Chehab
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:29 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Shuah Khan,
	Akihiro Tsukada, Ole Ernst

if CONFIG_MEDIA_CONTROLLER_DVB is not selected, it is now
producing this warning:

drivers/media/dvb-core/dvb_frontend.c: In function ‘dvb_frontend_thread’:
drivers/media/dvb-core/dvb_frontend.c:695:6: warning: unused variable ‘ret’ [-Wunused-variable]
  int ret;
      ^

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index aa5306908193..d7d390c5c7c3 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -692,7 +692,9 @@ static int dvb_frontend_thread(void *data)
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 	fe_status_t s;
 	enum dvbfe_algo algo;
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
 	int ret;
+#endif
 
 	bool re_tune = false;
 	bool semheld = false;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/7] [media] cx231xx: fix compilation if the media controller is not defined
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
@ 2015-02-18 15:29 ` Mauro Carvalho Chehab
  2015-02-18 15:29 ` [PATCH 3/7] [media] tuner-core: " Mauro Carvalho Chehab
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:29 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab,
	Matthias Schwarzott, Antti Palosaari, Hans Verkuil

drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:15: error: ‘struct v4l2_device’ has no member named ‘mdev’
  dev->v4l2_dev.mdev = dev->media_dev;
               ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:26: error: ‘struct cx231xx’ has no member named ‘media_dev’
  dev->v4l2_dev.mdev = dev->media_dev;
                          ^
scripts/Makefile.build:257: recipe for target 'drivers/media/usb/cx231xx/cx231xx-cards.o' failed

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index dfc7010cff7f..372b70eb042c 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1586,7 +1586,9 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
 	cx231xx_media_device_register(dev, udev);
 
 	/* Create v4l2 device */
+#ifdef CONFIG_MEDIA_CONTROLLER
 	dev->v4l2_dev.mdev = dev->media_dev;
+#endif
 	retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
 	if (retval) {
 		dev_err(d, "v4l2_device_register failed\n");
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index e8c054c4ac8c..44229a2c2d32 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -540,7 +540,9 @@ static int register_dvb(struct cx231xx_dvb *dvb,
 
 	/* register network adapter */
 	dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
 	dvb_create_media_graph(dev->media_dev);
+#endif
 	return 0;
 
 fail_fe_conn:
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/7] [media] tuner-core: fix compilation if the media controller is not defined
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
  2015-02-18 15:29 ` [PATCH 2/7] [media] cx231xx: fix compilation if the media controller is not defined Mauro Carvalho Chehab
@ 2015-02-18 15:29 ` Mauro Carvalho Chehab
  2015-02-18 22:36   ` Lad, Prabhakar
  2015-02-18 15:29 ` [PATCH 4/7] [media] dvb core: rename the media controller entities Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:29 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Hans Verkuil,
	Laurent Pinchart, Sakari Ailus, Prabhakar Lad

drivers/media/v4l2-core/tuner-core.c:440:7: error: 'struct v4l2_subdev' has no member named 'entity'
     t->sd.entity.name = t->name;

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index 9a83b27a7e8f..abdcffabcb59 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -437,7 +437,9 @@ static void set_type(struct i2c_client *c, unsigned int type,
 		t->name = analog_ops->info.name;
 	}
 
+#ifdef CONFIG_MEDIA_CONTROLLER
 	t->sd.entity.name = t->name;
+#endif
 
 	tuner_dbg("type set to %s\n", t->name);
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/7] [media] dvb core: rename the media controller entities
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
  2015-02-18 15:29 ` [PATCH 2/7] [media] cx231xx: fix compilation if the media controller is not defined Mauro Carvalho Chehab
  2015-02-18 15:29 ` [PATCH 3/7] [media] tuner-core: " Mauro Carvalho Chehab
@ 2015-02-18 15:29 ` Mauro Carvalho Chehab
  2015-02-18 15:37   ` Hans Verkuil
  2015-02-18 15:29 ` [PATCH 5/7] [media] cx25840: better document the media controller TODO Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:29 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Changbing Xiong,
	Joe Perches, David S. Miller, Dan Carpenter, David Herrmann,
	Tom Gundersen

Prefix all DVB media controller entities with "dvb-" and use dash
instead of underline at the names.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 2835924955a4..d0e3f9d85f34 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1141,7 +1141,7 @@ static const struct dvb_device dvbdev_demux = {
 	.users = 1,
 	.writers = 1,
 #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
-	.name = "demux",
+	.name = "dvb-demux",
 #endif
 	.fops = &dvb_demux_fops
 };
@@ -1217,7 +1217,7 @@ static const struct dvb_device dvbdev_dvr = {
 	.readers = 1,
 	.users = 1,
 #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
-	.name = "dvr",
+	.name = "dvb-dvr",
 #endif
 	.fops = &dvb_dvr_fops
 };
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 2bf28eb97a64..55a217f0ad0e 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1644,7 +1644,7 @@ static const struct dvb_device dvbdev_ca = {
 	.readers = 1,
 	.writers = 1,
 #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
-	.name = "ca_en50221",
+	.name = "dvb-ca-en50221",
 #endif
 	.fops = &dvb_ca_fops,
 };
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index 40990058b4bc..1508d918205d 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -1467,7 +1467,7 @@ static const struct dvb_device dvbdev_net = {
 	.users = 1,
 	.writers = 1,
 #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
-	.name = "dvb net",
+	.name = "dvb-net",
 #endif
 	.fops = &dvb_net_fops,
 };
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/7] [media] cx25840: better document the media controller TODO
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2015-02-18 15:29 ` [PATCH 4/7] [media] dvb core: rename the media controller entities Mauro Carvalho Chehab
@ 2015-02-18 15:29 ` Mauro Carvalho Chehab
  2015-02-18 15:38   ` Hans Verkuil
  2015-02-18 15:30 ` [PATCH 6/7] [media] cx231xx: Improve the media controller comment Mauro Carvalho Chehab
  2015-02-18 15:30 ` [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup Mauro Carvalho Chehab
  5 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:29 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Hans Verkuil,
	Prabhakar Lad, Sakari Ailus, Joe Perches, Boris BREZILLON,
	Laurent Pinchart

Analog video inputs are the tuner, plus composite, svideo, etc,
 e. g. the input pat should actually be like:

                ___________
TUNER --------> |         |
                |         |
SVIDEO .......> | cx25840 |
                |         |
COMPOSITE1 ...> |_________|

(in the above, dashes represent the enabled link, and periods
represent the disabled ones)

In other words, if we want to properly represent the pipeline,
it should be possible to see via the media controller if the tuner
is being used as an image source, or if the source is something else.

I didn't map those other inputs here yet, due to a few things:
- The extra inputs would require subdevs that won't be controlled
- I was in doubt about the best way for doing that
- That would likely require some extra setup for cx25840 caller
  drivers, in order to represent what of the possible internal
  inputs are actually used on each specific board

Actually, at least for now, I was unable to see much benefit
on adding such map now, so let's just document it, as this could
be added later on, as needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index bdb5bb6b58da..cb4e03de9b75 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -5182,7 +5182,20 @@ static int cx25840_probe(struct i2c_client *client,
 	sd = &state->sd;
 	v4l2_i2c_subdev_init(sd, client, &cx25840_ops);
 #if defined(CONFIG_MEDIA_CONTROLLER)
-	/* TODO: need to represent analog inputs too */
+	/*
+	 * TODO: add media controller support for analog video inputs like
+	 * composite, svideo, etc.
+	 * A real input pad for this analog demod would be like:
+	 *                 ___________
+	 * TUNER --------> |         |
+	 *		   |         |
+	 * SVIDEO .......> | cx25840 |
+	 *		   |         |
+	 * COMPOSITE1 ...> |_________|
+	 *
+	 * However, at least for now, there's no much gain on modelling
+	 * those extra inputs. So, let's add it only when needed.
+	 */
 	state->pads[0].flags = MEDIA_PAD_FL_SINK;	/* Tuner or input */
 	state->pads[1].flags = MEDIA_PAD_FL_SOURCE;	/* Video */
 	state->pads[2].flags = MEDIA_PAD_FL_SOURCE;	/* VBI */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/7] [media] cx231xx: Improve the media controller comment
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2015-02-18 15:29 ` [PATCH 5/7] [media] cx25840: better document the media controller TODO Mauro Carvalho Chehab
@ 2015-02-18 15:30 ` Mauro Carvalho Chehab
  2015-02-18 15:39   ` Hans Verkuil
  2015-02-18 15:30 ` [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup Mauro Carvalho Chehab
  5 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:30 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Hans Verkuil,
	Sakari Ailus, Laurent Pinchart, Boris BREZILLON,
	Ramakrishnan Muthukrishnan, Peter Senna Tschudin

There are two problems at the comment:
- it is badly idented;
- its comment doesn't mean anything.

Fix it.

Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 634763535d60..87c9e27505f4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -714,12 +714,13 @@ static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
 	if (!mdev)
 		return 0;
 
-/*
- * This will find the tuner that it is connected into the decoder.
- * Technically, this is not 100% correct, as the device may be using an
- * analog input instead of the tuner. However, we can't use the DVB for dvb
- * while the DMA engine is being used for V4L2.
- */
+	/*
+	 * This will find the tuner that it is connected into the decoder.
+	 * Technically, this is not 100% correct, as the device may be
+	 * using an analog input instead of the tuner. However, as we can't
+	 * do DVB streaming  while the DMA engine is being used for V4L2,
+	 * this should be enough for the actual needs.
+	 */
 	media_device_for_each_entity(entity, mdev) {
 		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
 			decoder = entity;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup
  2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
                   ` (4 preceding siblings ...)
  2015-02-18 15:30 ` [PATCH 6/7] [media] cx231xx: Improve the media controller comment Mauro Carvalho Chehab
@ 2015-02-18 15:30 ` Mauro Carvalho Chehab
  2015-02-18 15:42   ` Hans Verkuil
  5 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-18 15:30 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Hans Verkuil,
	Sakari Ailus, Laurent Pinchart, Peter Senna Tschudin,
	Ramakrishnan Muthukrishnan, Boris BREZILLON

buf_prepare callback is called for every queued buffer. This is
an overkill. Call it at buf_setup, as this should be enough.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 87c9e27505f4..f9e885fa153f 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -100,6 +100,75 @@ static struct cx231xx_fmt format[] = {
 };
 
 
+static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
+{
+#ifdef CONFIG_MEDIA_CONTROLLER
+	struct media_device *mdev = dev->media_dev;
+	struct media_entity  *entity, *decoder = NULL, *source;
+	struct media_link *link, *found_link = NULL;
+	int i, ret, active_links = 0;
+
+	if (!mdev)
+		return 0;
+
+	/*
+	 * This will find the tuner that it is connected into the decoder.
+	 * Technically, this is not 100% correct, as the device may be
+	 * using an analog input instead of the tuner. However, as we can't
+	 * do DVB streaming  while the DMA engine is being used for V4L2,
+	 * this should be enough for the actual needs.
+	 */
+	media_device_for_each_entity(entity, mdev) {
+		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
+			decoder = entity;
+			break;
+		}
+	}
+	if (!decoder)
+		return 0;
+
+	for (i = 0; i < decoder->num_links; i++) {
+		link = &decoder->links[i];
+		if (link->sink->entity == decoder) {
+			found_link = link;
+			if (link->flags & MEDIA_LNK_FL_ENABLED)
+				active_links++;
+			break;
+		}
+	}
+
+	if (active_links == 1 || !found_link)
+		return 0;
+
+	source = found_link->source->entity;
+	for (i = 0; i < source->num_links; i++) {
+		struct media_entity *sink;
+		int flags = 0;
+
+		link = &source->links[i];
+		sink = link->sink->entity;
+
+		if (sink == entity)
+			flags = MEDIA_LNK_FL_ENABLED;
+
+		ret = media_entity_setup_link(link, flags);
+		if (ret) {
+			dev_err(dev->dev,
+				"Couldn't change link %s->%s to %s. Error %d\n",
+				source->name, sink->name,
+				flags ? "enabled" : "disabled",
+				ret);
+			return ret;
+		} else
+			dev_dbg(dev->dev,
+				"link %s->%s was %s\n",
+				source->name, sink->name,
+				flags ? "ENABLED" : "disabled");
+	}
+#endif
+	return 0;
+}
+
 /* ------------------------------------------------------------------
 	Video buffer and parser functions
    ------------------------------------------------------------------*/
@@ -667,6 +736,9 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
 	if (*count < CX231XX_MIN_BUF)
 		*count = CX231XX_MIN_BUF;
 
+
+	cx231xx_enable_analog_tuner(dev);
+
 	return 0;
 }
 
@@ -703,75 +775,6 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
 	buf->vb.state = VIDEOBUF_NEEDS_INIT;
 }
 
-static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
-{
-#ifdef CONFIG_MEDIA_CONTROLLER
-	struct media_device *mdev = dev->media_dev;
-	struct media_entity  *entity, *decoder = NULL, *source;
-	struct media_link *link, *found_link = NULL;
-	int i, ret, active_links = 0;
-
-	if (!mdev)
-		return 0;
-
-	/*
-	 * This will find the tuner that it is connected into the decoder.
-	 * Technically, this is not 100% correct, as the device may be
-	 * using an analog input instead of the tuner. However, as we can't
-	 * do DVB streaming  while the DMA engine is being used for V4L2,
-	 * this should be enough for the actual needs.
-	 */
-	media_device_for_each_entity(entity, mdev) {
-		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
-			decoder = entity;
-			break;
-		}
-	}
-	if (!decoder)
-		return 0;
-
-	for (i = 0; i < decoder->num_links; i++) {
-		link = &decoder->links[i];
-		if (link->sink->entity == decoder) {
-			found_link = link;
-			if (link->flags & MEDIA_LNK_FL_ENABLED)
-				active_links++;
-			break;
-		}
-	}
-
-	if (active_links == 1 || !found_link)
-		return 0;
-
-	source = found_link->source->entity;
-	for (i = 0; i < source->num_links; i++) {
-		struct media_entity *sink;
-		int flags = 0;
-
-		link = &source->links[i];
-		sink = link->sink->entity;
-
-		if (sink == entity)
-			flags = MEDIA_LNK_FL_ENABLED;
-
-		ret = media_entity_setup_link(link, flags);
-		if (ret) {
-			dev_err(dev->dev,
-				"Couldn't change link %s->%s to %s. Error %d\n",
-				source->name, sink->name,
-				flags ? "enabled" : "disabled",
-				ret);
-			return ret;
-		} else
-			dev_dbg(dev->dev,
-				"link %s->%s was %s\n",
-				source->name, sink->name,
-				flags ? "ENABLED" : "disabled");
-	}
-#endif
-	return 0;
-}
-
 static int
 buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
 	       enum v4l2_field field)
@@ -826,8 +829,6 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
 
 	buf->vb.state = VIDEOBUF_PREPARED;
 
-	cx231xx_enable_analog_tuner(dev);
-
 	return 0;
 
 fail:
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/7] [media] dvb core: rename the media controller entities
  2015-02-18 15:29 ` [PATCH 4/7] [media] dvb core: rename the media controller entities Mauro Carvalho Chehab
@ 2015-02-18 15:37   ` Hans Verkuil
  2015-02-19 19:33     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2015-02-18 15:37 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Changbing Xiong, Joe Perches,
	David S. Miller, Dan Carpenter, David Herrmann, Tom Gundersen

Hi Mauro,

On 02/18/2015 04:29 PM, Mauro Carvalho Chehab wrote:
> Prefix all DVB media controller entities with "dvb-" and use dash
> instead of underline at the names.
> 
> Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
			      ^^^^^^^^^^^^^^^^^^

For these foo-by lines please keep my hans.verkuil@cisco.com email.
It's my way of thanking Cisco for allowing me to do this work. Not a
big deal, but if you can change that before committing?

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> 
> diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
> index 2835924955a4..d0e3f9d85f34 100644
> --- a/drivers/media/dvb-core/dmxdev.c
> +++ b/drivers/media/dvb-core/dmxdev.c
> @@ -1141,7 +1141,7 @@ static const struct dvb_device dvbdev_demux = {
>  	.users = 1,
>  	.writers = 1,
>  #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
> -	.name = "demux",
> +	.name = "dvb-demux",
>  #endif
>  	.fops = &dvb_demux_fops
>  };
> @@ -1217,7 +1217,7 @@ static const struct dvb_device dvbdev_dvr = {
>  	.readers = 1,
>  	.users = 1,
>  #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
> -	.name = "dvr",
> +	.name = "dvb-dvr",
>  #endif
>  	.fops = &dvb_dvr_fops
>  };
> diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
> index 2bf28eb97a64..55a217f0ad0e 100644
> --- a/drivers/media/dvb-core/dvb_ca_en50221.c
> +++ b/drivers/media/dvb-core/dvb_ca_en50221.c
> @@ -1644,7 +1644,7 @@ static const struct dvb_device dvbdev_ca = {
>  	.readers = 1,
>  	.writers = 1,
>  #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
> -	.name = "ca_en50221",
> +	.name = "dvb-ca-en50221",
>  #endif
>  	.fops = &dvb_ca_fops,
>  };
> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index 40990058b4bc..1508d918205d 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
> @@ -1467,7 +1467,7 @@ static const struct dvb_device dvbdev_net = {
>  	.users = 1,
>  	.writers = 1,
>  #if defined(CONFIG_MEDIA_CONTROLLER_DVB)
> -	.name = "dvb net",
> +	.name = "dvb-net",
>  #endif
>  	.fops = &dvb_net_fops,
>  };
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/7] [media] cx25840: better document the media controller TODO
  2015-02-18 15:29 ` [PATCH 5/7] [media] cx25840: better document the media controller TODO Mauro Carvalho Chehab
@ 2015-02-18 15:38   ` Hans Verkuil
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Verkuil @ 2015-02-18 15:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Hans Verkuil, Prabhakar Lad, Sakari Ailus,
	Joe Perches, Boris BREZILLON, Laurent Pinchart

On 02/18/2015 04:29 PM, Mauro Carvalho Chehab wrote:
> Analog video inputs are the tuner, plus composite, svideo, etc,
>  e. g. the input pat should actually be like:
> 
>                 ___________
> TUNER --------> |         |
>                 |         |
> SVIDEO .......> | cx25840 |
>                 |         |
> COMPOSITE1 ...> |_________|
> 
> (in the above, dashes represent the enabled link, and periods
> represent the disabled ones)
> 
> In other words, if we want to properly represent the pipeline,
> it should be possible to see via the media controller if the tuner
> is being used as an image source, or if the source is something else.
> 
> I didn't map those other inputs here yet, due to a few things:
> - The extra inputs would require subdevs that won't be controlled
> - I was in doubt about the best way for doing that
> - That would likely require some extra setup for cx25840 caller
>   drivers, in order to represent what of the possible internal
>   inputs are actually used on each specific board
> 
> Actually, at least for now, I was unable to see much benefit
> on adding such map now, so let's just document it, as this could
> be added later on, as needed.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

> 
> diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
> index bdb5bb6b58da..cb4e03de9b75 100644
> --- a/drivers/media/i2c/cx25840/cx25840-core.c
> +++ b/drivers/media/i2c/cx25840/cx25840-core.c
> @@ -5182,7 +5182,20 @@ static int cx25840_probe(struct i2c_client *client,
>  	sd = &state->sd;
>  	v4l2_i2c_subdev_init(sd, client, &cx25840_ops);
>  #if defined(CONFIG_MEDIA_CONTROLLER)
> -	/* TODO: need to represent analog inputs too */
> +	/*
> +	 * TODO: add media controller support for analog video inputs like
> +	 * composite, svideo, etc.
> +	 * A real input pad for this analog demod would be like:
> +	 *                 ___________
> +	 * TUNER --------> |         |
> +	 *		   |         |
> +	 * SVIDEO .......> | cx25840 |
> +	 *		   |         |
> +	 * COMPOSITE1 ...> |_________|
> +	 *
> +	 * However, at least for now, there's no much gain on modelling
> +	 * those extra inputs. So, let's add it only when needed.
> +	 */
>  	state->pads[0].flags = MEDIA_PAD_FL_SINK;	/* Tuner or input */
>  	state->pads[1].flags = MEDIA_PAD_FL_SOURCE;	/* Video */
>  	state->pads[2].flags = MEDIA_PAD_FL_SOURCE;	/* VBI */
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 6/7] [media] cx231xx: Improve the media controller comment
  2015-02-18 15:30 ` [PATCH 6/7] [media] cx231xx: Improve the media controller comment Mauro Carvalho Chehab
@ 2015-02-18 15:39   ` Hans Verkuil
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Verkuil @ 2015-02-18 15:39 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Hans Verkuil, Sakari Ailus,
	Laurent Pinchart, Boris BREZILLON, Ramakrishnan Muthukrishnan,
	Peter Senna Tschudin

On 02/18/2015 04:30 PM, Mauro Carvalho Chehab wrote:
> There are two problems at the comment:
> - it is badly idented;
> - its comment doesn't mean anything.
> 
> Fix it.
> 
> Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> 
> diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
> index 634763535d60..87c9e27505f4 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-video.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-video.c
> @@ -714,12 +714,13 @@ static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
>  	if (!mdev)
>  		return 0;
>  
> -/*
> - * This will find the tuner that it is connected into the decoder.
> - * Technically, this is not 100% correct, as the device may be using an
> - * analog input instead of the tuner. However, we can't use the DVB for dvb
> - * while the DMA engine is being used for V4L2.
> - */
> +	/*
> +	 * This will find the tuner that it is connected into the decoder.

s/that it is/that is/

> +	 * Technically, this is not 100% correct, as the device may be
> +	 * using an analog input instead of the tuner. However, as we can't
> +	 * do DVB streaming  while the DMA engine is being used for V4L2,

Two spaces between 'streaming' and 'while'. I know, a nitpick :-)

With those changes:

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> +	 * this should be enough for the actual needs.
> +	 */
>  	media_device_for_each_entity(entity, mdev) {
>  		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
>  			decoder = entity;
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup
  2015-02-18 15:30 ` [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup Mauro Carvalho Chehab
@ 2015-02-18 15:42   ` Hans Verkuil
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Verkuil @ 2015-02-18 15:42 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Hans Verkuil, Sakari Ailus,
	Laurent Pinchart, Peter Senna Tschudin,
	Ramakrishnan Muthukrishnan, Boris BREZILLON

On 02/18/2015 04:30 PM, Mauro Carvalho Chehab wrote:
> buf_prepare callback is called for every queued buffer. This is
> an overkill. Call it at buf_setup, as this should be enough.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> 
> diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
> index 87c9e27505f4..f9e885fa153f 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-video.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-video.c
> @@ -100,6 +100,75 @@ static struct cx231xx_fmt format[] = {
>  };
>  
>  
> +static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
> +{
> +#ifdef CONFIG_MEDIA_CONTROLLER
> +	struct media_device *mdev = dev->media_dev;
> +	struct media_entity  *entity, *decoder = NULL, *source;
> +	struct media_link *link, *found_link = NULL;
> +	int i, ret, active_links = 0;
> +
> +	if (!mdev)
> +		return 0;
> +
> +	/*
> +	 * This will find the tuner that it is connected into the decoder.

s/that it is/that is/

> +	 * Technically, this is not 100% correct, as the device may be
> +	 * using an analog input instead of the tuner. However, as we can't
> +	 * do DVB streaming  while the DMA engine is being used for V4L2,

s/streaming  while/streaming while/

With those changes:

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> +	 * this should be enough for the actual needs.
> +	 */
> +	media_device_for_each_entity(entity, mdev) {
> +		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
> +			decoder = entity;
> +			break;
> +		}
> +	}
> +	if (!decoder)
> +		return 0;
> +
> +	for (i = 0; i < decoder->num_links; i++) {
> +		link = &decoder->links[i];
> +		if (link->sink->entity == decoder) {
> +			found_link = link;
> +			if (link->flags & MEDIA_LNK_FL_ENABLED)
> +				active_links++;
> +			break;
> +		}
> +	}
> +
> +	if (active_links == 1 || !found_link)
> +		return 0;
> +
> +	source = found_link->source->entity;
> +	for (i = 0; i < source->num_links; i++) {
> +		struct media_entity *sink;
> +		int flags = 0;
> +
> +		link = &source->links[i];
> +		sink = link->sink->entity;
> +
> +		if (sink == entity)
> +			flags = MEDIA_LNK_FL_ENABLED;
> +
> +		ret = media_entity_setup_link(link, flags);
> +		if (ret) {
> +			dev_err(dev->dev,
> +				"Couldn't change link %s->%s to %s. Error %d\n",
> +				source->name, sink->name,
> +				flags ? "enabled" : "disabled",
> +				ret);
> +			return ret;
> +		} else
> +			dev_dbg(dev->dev,
> +				"link %s->%s was %s\n",
> +				source->name, sink->name,
> +				flags ? "ENABLED" : "disabled");
> +	}
> +#endif
> +	return 0;
> +}
> +
>  /* ------------------------------------------------------------------
>  	Video buffer and parser functions
>     ------------------------------------------------------------------*/
> @@ -667,6 +736,9 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
>  	if (*count < CX231XX_MIN_BUF)
>  		*count = CX231XX_MIN_BUF;
>  
> +
> +	cx231xx_enable_analog_tuner(dev);
> +
>  	return 0;
>  }
>  
> @@ -703,75 +775,6 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
>  	buf->vb.state = VIDEOBUF_NEEDS_INIT;
>  }
>  
> -static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
> -{
> -#ifdef CONFIG_MEDIA_CONTROLLER
> -	struct media_device *mdev = dev->media_dev;
> -	struct media_entity  *entity, *decoder = NULL, *source;
> -	struct media_link *link, *found_link = NULL;
> -	int i, ret, active_links = 0;
> -
> -	if (!mdev)
> -		return 0;
> -
> -	/*
> -	 * This will find the tuner that it is connected into the decoder.
> -	 * Technically, this is not 100% correct, as the device may be
> -	 * using an analog input instead of the tuner. However, as we can't
> -	 * do DVB streaming  while the DMA engine is being used for V4L2,
> -	 * this should be enough for the actual needs.
> -	 */
> -	media_device_for_each_entity(entity, mdev) {
> -		if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
> -			decoder = entity;
> -			break;
> -		}
> -	}
> -	if (!decoder)
> -		return 0;
> -
> -	for (i = 0; i < decoder->num_links; i++) {
> -		link = &decoder->links[i];
> -		if (link->sink->entity == decoder) {
> -			found_link = link;
> -			if (link->flags & MEDIA_LNK_FL_ENABLED)
> -				active_links++;
> -			break;
> -		}
> -	}
> -
> -	if (active_links == 1 || !found_link)
> -		return 0;
> -
> -	source = found_link->source->entity;
> -	for (i = 0; i < source->num_links; i++) {
> -		struct media_entity *sink;
> -		int flags = 0;
> -
> -		link = &source->links[i];
> -		sink = link->sink->entity;
> -
> -		if (sink == entity)
> -			flags = MEDIA_LNK_FL_ENABLED;
> -
> -		ret = media_entity_setup_link(link, flags);
> -		if (ret) {
> -			dev_err(dev->dev,
> -				"Couldn't change link %s->%s to %s. Error %d\n",
> -				source->name, sink->name,
> -				flags ? "enabled" : "disabled",
> -				ret);
> -			return ret;
> -		} else
> -			dev_dbg(dev->dev,
> -				"link %s->%s was %s\n",
> -				source->name, sink->name,
> -				flags ? "ENABLED" : "disabled");
> -	}
> -#endif
> -	return 0;
> -}
> -
>  static int
>  buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
>  	       enum v4l2_field field)
> @@ -826,8 +829,6 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
>  
>  	buf->vb.state = VIDEOBUF_PREPARED;
>  
> -	cx231xx_enable_analog_tuner(dev);
> -
>  	return 0;
>  
>  fail:
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/7] [media] tuner-core: fix compilation if the media controller is not defined
  2015-02-18 15:29 ` [PATCH 3/7] [media] tuner-core: " Mauro Carvalho Chehab
@ 2015-02-18 22:36   ` Lad, Prabhakar
  0 siblings, 0 replies; 14+ messages in thread
From: Lad, Prabhakar @ 2015-02-18 22:36 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Media Mailing List, Mauro Carvalho Chehab, Hans Verkuil,
	Laurent Pinchart, Sakari Ailus

On Wed, Feb 18, 2015 at 3:29 PM, Mauro Carvalho Chehab
<mchehab@osg.samsung.com> wrote:
> drivers/media/v4l2-core/tuner-core.c:440:7: error: 'struct v4l2_subdev' has no member named 'entity'
>      t->sd.entity.name = t->name;
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Regards,
--Prabhakar Lad

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/7] [media] dvb core: rename the media controller entities
  2015-02-18 15:37   ` Hans Verkuil
@ 2015-02-19 19:33     ` Mauro Carvalho Chehab
  2015-02-20  9:59       ` Hans Verkuil
  0 siblings, 1 reply; 14+ messages in thread
From: Mauro Carvalho Chehab @ 2015-02-19 19:33 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Linux Media Mailing List, Mauro Carvalho Chehab, Changbing Xiong,
	Joe Perches, David S. Miller, Dan Carpenter, David Herrmann,
	Tom Gundersen

Em Wed, 18 Feb 2015 16:37:38 +0100
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> Hi Mauro,
> 
> On 02/18/2015 04:29 PM, Mauro Carvalho Chehab wrote:
> > Prefix all DVB media controller entities with "dvb-" and use dash
> > instead of underline at the names.
> > 
> > Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
> 			      ^^^^^^^^^^^^^^^^^^
> 
> For these foo-by lines please keep my hans.verkuil@cisco.com email.
> It's my way of thanking Cisco for allowing me to do this work. Not a
> big deal, but if you can change that before committing?
> 
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>


Sure, I'll run a
git filter-branch -f --msg-filter 'cat |sed s,hverkuil@xs4all.nl,hans.verkuil@cisco.com,' origin..

To replace the e-mail on this series.

Next time, it would be better if you could reply using your @cisco
email on your From: if you want me to use it, as I generally just
cut-and-paste whatever e-mail used at the replies ;)

Regards,
Mauro

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/7] [media] dvb core: rename the media controller entities
  2015-02-19 19:33     ` Mauro Carvalho Chehab
@ 2015-02-20  9:59       ` Hans Verkuil
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Verkuil @ 2015-02-20  9:59 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Media Mailing List, Mauro Carvalho Chehab, Changbing Xiong,
	Joe Perches, David S. Miller, Dan Carpenter, David Herrmann,
	Tom Gundersen

On 02/19/2015 08:33 PM, Mauro Carvalho Chehab wrote:
> Em Wed, 18 Feb 2015 16:37:38 +0100
> Hans Verkuil <hverkuil@xs4all.nl> escreveu:
> 
>> Hi Mauro,
>>
>> On 02/18/2015 04:29 PM, Mauro Carvalho Chehab wrote:
>>> Prefix all DVB media controller entities with "dvb-" and use dash
>>> instead of underline at the names.
>>>
>>> Requested-by: Hans Verkuil <hverkuil@xs4all.nl>
>> 			      ^^^^^^^^^^^^^^^^^^
>>
>> For these foo-by lines please keep my hans.verkuil@cisco.com email.
>> It's my way of thanking Cisco for allowing me to do this work. Not a
>> big deal, but if you can change that before committing?
>>
>> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
> 
> 
> Sure, I'll run a
> git filter-branch -f --msg-filter 'cat |sed s,hverkuil@xs4all.nl,hans.verkuil@cisco.com,' origin..
> 
> To replace the e-mail on this series.
> 
> Next time, it would be better if you could reply using your @cisco
> email on your From: if you want me to use it, as I generally just
> cut-and-paste whatever e-mail used at the replies ;)

My Signed-offs, acks, etc. are (almost) always with the cisco email (occasionally I
forget as well :-) ), but all my email correspondence uses my private email. Mainly
because to read my work email I need a vpn, which is a pain and which I cannot use
everywhere.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-02-20  9:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 15:29 [PATCH 1/7] [media] dvb-frontend: remove a warning Mauro Carvalho Chehab
2015-02-18 15:29 ` [PATCH 2/7] [media] cx231xx: fix compilation if the media controller is not defined Mauro Carvalho Chehab
2015-02-18 15:29 ` [PATCH 3/7] [media] tuner-core: " Mauro Carvalho Chehab
2015-02-18 22:36   ` Lad, Prabhakar
2015-02-18 15:29 ` [PATCH 4/7] [media] dvb core: rename the media controller entities Mauro Carvalho Chehab
2015-02-18 15:37   ` Hans Verkuil
2015-02-19 19:33     ` Mauro Carvalho Chehab
2015-02-20  9:59       ` Hans Verkuil
2015-02-18 15:29 ` [PATCH 5/7] [media] cx25840: better document the media controller TODO Mauro Carvalho Chehab
2015-02-18 15:38   ` Hans Verkuil
2015-02-18 15:30 ` [PATCH 6/7] [media] cx231xx: Improve the media controller comment Mauro Carvalho Chehab
2015-02-18 15:39   ` Hans Verkuil
2015-02-18 15:30 ` [PATCH 7/7] [media] cx231xx: enable the analog tuner at buffer setup Mauro Carvalho Chehab
2015-02-18 15:42   ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.