public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Oberritter <obi@linuxtv.org>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Manu Abraham <abraham.manu@gmail.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Steven Toth <stoth@kernellabs.com>
Subject: Re: PATCH: Query DVB frontend capabilities
Date: Fri, 11 Nov 2011 21:09:19 +0100	[thread overview]
Message-ID: <4EBD80EF.2010002@linuxtv.org> (raw)
In-Reply-To: <4EBD57E8.1010501@redhat.com>

On 11.11.2011 18:14, Mauro Carvalho Chehab wrote:
> Em 11-11-2011 13:06, Andreas Oberritter escreveu:
>> On 11.11.2011 15:43, Mauro Carvalho Chehab wrote:
>>> IMHO, the better is to set all parameters via stb0899_get_property(). We should
>>> work on deprecate the old way, as, by having all frontends implementing the
>>> get/set property ops, we can remove part of the legacy code inside the DVB core.
>>
>> I'm not sure what "legacy code" you're referring to. If you're referring
>> to the big switch in dtv_property_process_get(), which presets output
>> values based on previously set tuning parameters, then no, please don't
>> deprecate it. It doesn't improve driver code if you move this switch
>> down into every driver.
> 
> What I mean is that drivers should get rid of implementing get_frontend() and 
> set_frontend(), restricting the usage of struct dvb_frontend_parameters for DVBv3
> calls from userspace.

This would generate quite some work without much benefit.

> In other words, it should be part of the core logic to get all the parameters
> passed from userspace and passing them via one single call to something similar
> to set_property.

That's exactly what we have now with the set_frontend, tune, search and
track callbacks.

> In other words, ideally, the implementation for DTV set should be
> like:
> 
> static int dtv_property_process_set(struct dvb_frontend *fe,
> 				    struct dtv_property *tvp,
> 				    struct file *file)
> {
> 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> 
> 	switch(tvp->cmd) {
> 	case DTV_CLEAR:
> 		dvb_frontend_clear_cache(fe);
> 		break;
> 	case DTV_FREQUENCY:
> 		c->frequency = tvp->u.data;
> 		break;
> 	case DTV_MODULATION:
> 		c->modulation = tvp->u.data;
> 		break;
> 	case DTV_BANDWIDTH_HZ:
> 		c->bandwidth_hz = tvp->u.data;
> 		break;
> ...
> 	case DTV_TUNE:
> 		/* interpret the cache of data */
> 		if (fe->ops.new_set_frontend) {
> 			r = fe->ops.new_set_frontend(fe);
> 			if (r < 0)
> 				return r;
> 		}

set_frontend is called by the frontend thread, multiple times with
alternating parameters if necessary. Depending on the tuning algorithm,
drivers may implement tune or search and track instead. You cannot just
call a "new_set_frontend" driver function from here and expect it to
work as before.

> 		break;
> 
> E. g. instead of using the struct dvb_frontend_parameters, the drivers would
> use struct dtv_frontend_properties (already stored at the frontend
> struct as fe->dtv_property_cache).

Drivers are already free to ignore dvb_frontend_parameters and use the
properties stored in dtv_property_cache today.

> Btw, with such change, it would actually make sense the original proposal
> from Manu of having a separate callback for supported delivery systems.

Why? How does setting parameters relate to querying capabilies?

Regards,
Andreas

  reply	other threads:[~2011-11-11 20:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 14:18 PATCH: Query DVB frontend capabilities Manu Abraham
2011-11-10 14:44 ` Andreas Oberritter
2011-11-10 15:30   ` Manu Abraham
2011-11-10 21:20     ` Mauro Carvalho Chehab
2011-11-11  6:26       ` Manu Abraham
2011-11-11 10:12         ` Mauro Carvalho Chehab
2011-11-11 22:07           ` Manu Abraham
2011-11-11 22:38             ` Mauro Carvalho Chehab
2011-11-12  3:36               ` Andreas Oberritter
2011-11-13 11:39                 ` Mauro Carvalho Chehab
2011-11-11 14:30         ` Andreas Oberritter
2011-11-11 14:43           ` Mauro Carvalho Chehab
2011-11-11 15:06             ` Andreas Oberritter
2011-11-11 17:14               ` Mauro Carvalho Chehab
2011-11-11 20:09                 ` Andreas Oberritter [this message]
2011-11-11 22:02                   ` Mauro Carvalho Chehab
2011-11-12  4:02                     ` Andreas Oberritter
2011-11-11 22:12           ` Manu Abraham
2011-11-11  9:55       ` FE_CAN-bits (was: Re: PATCH: Query DVB frontend capabilities) Patrick Boettcher
2011-11-11 10:21         ` FE_CAN-bits Mauro Carvalho Chehab
2011-11-11 11:36         ` FE_CAN-bits Antti Palosaari
2011-11-11 12:44           ` FE_CAN-bits Mauro Carvalho Chehab
2011-11-11 17:43       ` PATCH: Query DVB frontend capabilities BOUWSMA Barry
2011-11-11 18:37         ` Mauro Carvalho Chehab
2011-11-11 22:34           ` Manu Abraham
2011-11-13 13:32             ` Mauro Carvalho Chehab
2011-11-13 15:27               ` Manu Abraham
2011-11-14 11:47                 ` Mauro Carvalho Chehab
2011-11-14 15:02                   ` Manu Abraham
2011-11-14 16:39                     ` Mauro Carvalho Chehab
2011-11-14 17:09                       ` Manu Abraham
2011-11-14 18:08                         ` Mauro Carvalho Chehab
2011-11-14 18:30                           ` Manu Abraham
2011-11-14 18:42                             ` Mauro Carvalho Chehab
2011-11-14 18:59                               ` Manu Abraham
2011-11-14 20:31                                 ` Mauro Carvalho Chehab

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=4EBD80EF.2010002@linuxtv.org \
    --to=obi@linuxtv.org \
    --cc=abraham.manu@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=stoth@kernellabs.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