linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Shuah Khan <shuah.kh@samsung.com>, Ole Ernst <olebowle@gmx.com>,
	Akihiro Tsukada <tskd08@gmail.com>
Subject: Re: [PATCHv4 25/25] [media] dvb_frontend: start media pipeline while thread is running
Date: Mon, 16 Feb 2015 13:52:11 +0100	[thread overview]
Message-ID: <54E1E7FB.40703@xs4all.nl> (raw)
In-Reply-To: <08d239bd74bdc64596313f3c7edc21bff7a888c5.1423867976.git.mchehab@osg.samsung.com>

On 02/13/2015 11:58 PM, Mauro Carvalho Chehab wrote:
> While the DVB thread is running, the media pipeline should be
> streaming. This should prevent any attempt of using the analog
> TV while digital TV is working, and vice-versa.
> 
> 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 50bc6056e914..aa5306908193 100644
> --- a/drivers/media/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb-core/dvb_frontend.c
> @@ -131,6 +131,11 @@ struct dvb_frontend_private {
>  	int quality;
>  	unsigned int check_wrapped;
>  	enum dvbfe_search algo_status;
> +
> +#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
> +	struct media_pipeline pipe;
> +	struct media_entity *pipe_start_entity;
> +#endif
>  };
>  
>  static void dvb_frontend_wakeup(struct dvb_frontend *fe);
> @@ -608,9 +613,9 @@ static void dvb_frontend_wakeup(struct dvb_frontend *fe)
>   * or 0 if everything is OK, if no tuner is linked to the frontend or if the
>   * mdev is NULL.
>   */
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>  static int dvb_enable_media_tuner(struct dvb_frontend *fe)
>  {
> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>  	struct dvb_frontend_private *fepriv = fe->frontend_priv;
>  	struct dvb_adapter *adapter = fe->dvb;
>  	struct media_device *mdev = adapter->mdev;
> @@ -618,10 +623,14 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
>  	struct media_link *link, *found_link = NULL;
>  	int i, ret, n_links = 0, active_links = 0;
>  
> +	fepriv->pipe_start_entity = NULL;
> +
>  	if (!mdev)
>  		return 0;
>  
>  	entity = fepriv->dvbdev->entity;
> +	fepriv->pipe_start_entity = entity;
> +
>  	for (i = 0; i < entity->num_links; i++) {
>  		link = &entity->links[i];
>  		if (link->sink->entity == entity) {
> @@ -648,6 +657,7 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
>  	}
>  
>  	source = found_link->source->entity;
> +	fepriv->pipe_start_entity = source;
>  	for (i = 0; i < source->num_links; i++) {
>  		struct media_entity *sink;
>  		int flags = 0;
> @@ -672,9 +682,9 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe)
>  				source->name, sink->name,
>  				flags ? "ENABLED" : "disabled");
>  	}
> -#endif
>  	return 0;
>  }
> +#endif
>  
>  static int dvb_frontend_thread(void *data)
>  {
> @@ -696,12 +706,19 @@ static int dvb_frontend_thread(void *data)
>  	fepriv->wakeup = 0;
>  	fepriv->reinitialise = 0;
>  
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB

With this change I get 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;
      ^

So the 'ret' variable declaration should be under #ifdef CONFIG_MEDIA_CONTROLLER_DVB
as well.

Regards,

	Hans

>  	ret = dvb_enable_media_tuner(fe);
>  	if (ret) {
>  		/* FIXME: return an error if it fails */
>  		dev_info(fe->dvb->device,
>  			"proceeding with FE task\n");
> +	} else {
> +		ret = media_entity_pipeline_start(fepriv->pipe_start_entity,
> +						  &fepriv->pipe);
> +		if (ret)
> +			return ret;
>  	}
> +#endif
>  
>  	dvb_frontend_init(fe);
>  
> @@ -812,6 +829,11 @@ restart:
>  		}
>  	}
>  
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
> +	media_entity_pipeline_stop(fepriv->pipe_start_entity);
> +	fepriv->pipe_start_entity = NULL;
> +#endif
> +
>  	if (dvb_powerdown_on_sleep) {
>  		if (fe->ops.set_voltage)
>  			fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF);
> 


  reply	other threads:[~2015-02-16 12:52 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 22:57 [PATCHv4 00/25] dvb core: add basic support for the media controller Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 01/25] [media] ir-hix5hd2: remove writel/readl_relaxed define Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 02/25] [media] media: Fix DVB devnode representation at media controller Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 03/25] [media] Docbook: Fix documentation for media controller devnodes Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 04/25] [media] media: add new types for DVB devnodes Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 05/25] [media] DocBook: Document the DVB API devnodes at the media controller Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 06/25] [media] media: add a subdev type for tuner Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 07/25] [media] DocBook: Add tuner subdev at documentation Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 08/25] [media] dvbdev: add support for media controller Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 09/25] [media] cx231xx: add media controller support Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 10/25] [media] dvb_frontend: add media controller support for DVB frontend Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 11/25] [media] dmxdev: add support for demux/dvr nodes at media controller Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 12/25] [media] dvb_ca_en50221: add support for CA node at the " Mauro Carvalho Chehab
2015-02-16  9:04   ` Hans Verkuil
2015-02-16 10:54     ` Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 13/25] [media] dvb_net: add support for DVB net " Mauro Carvalho Chehab
2015-02-16  9:03   ` Hans Verkuil
2015-02-16 10:53     ` Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 14/25] [media] dvbdev: add pad for the DVB devnodes Mauro Carvalho Chehab
2015-02-13 22:57 ` [PATCHv4 15/25] [media] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
2015-02-16  9:10   ` Hans Verkuil
2015-02-16 10:59     ` Mauro Carvalho Chehab
2015-02-16 14:39       ` Devin Heitmueller
2015-02-16 14:46         ` Hans Verkuil
2015-02-16 15:24           ` Devin Heitmueller
2015-02-13 22:57 ` [PATCHv4 16/25] [media] cx25840: fill the media controller entity Mauro Carvalho Chehab
2015-02-16  9:11   ` Hans Verkuil
2015-02-16 11:11     ` Mauro Carvalho Chehab
2015-02-16 11:16       ` Hans Verkuil
2015-02-16 11:42         ` Mauro Carvalho Chehab
2015-02-18 22:48   ` Lad, Prabhakar
2015-02-19 19:50     ` Mauro Carvalho Chehab
2015-02-19 21:50       ` Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 17/25] [media] cx231xx: initialize video/vbi pads Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 18/25] [media] cx231xx: create media links for analog mode Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 19/25] [media] dvbdev: represent frontend with two pads Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 20/25] [media] dvbdev: add a function to create DVB media graph Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 21/25] [media] cx231xx: create DVB graph Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 22/25] [media] dvbdev: enable DVB-specific links Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 23/25] [media] dvb-frontend: enable tuner link when the FE thread starts Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 24/25] [media] cx231xx: enable tuner->decoder link at videobuf start Mauro Carvalho Chehab
2015-02-16  9:27   ` Hans Verkuil
2015-02-16 11:19     ` Mauro Carvalho Chehab
2015-02-13 22:58 ` [PATCHv4 25/25] [media] dvb_frontend: start media pipeline while thread is running Mauro Carvalho Chehab
2015-02-16 12:52   ` Hans Verkuil [this message]
2015-02-14  9:32 ` [PATCHv4 00/25] dvb core: add basic support for the media controller Hans Verkuil
2015-02-14 11:00   ` Mauro Carvalho Chehab
2015-02-14 11:43     ` Hans Verkuil
2015-02-15 10:27       ` Mauro Carvalho Chehab
2015-02-16  9:55         ` Hans Verkuil
2015-02-16 10:50           ` Mauro Carvalho Chehab
2015-02-16 11:08             ` Hans Verkuil
2015-02-16  9:57 ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E1E7FB.40703@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@osg.samsung.com \
    --cc=olebowle@gmx.com \
    --cc=shuah.kh@samsung.com \
    --cc=tskd08@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).