From: Antti Palosaari <crope@iki.fi>
To: Michael Krufky <mkrufky@kernellabs.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
linux-media@vger.kernel.org,
Jose Alberto Reguero <jareguero@telefonica.net>
Subject: Re: [PATCH 2/3] dvb-usb: multi-frontend support (MFE)
Date: Wed, 07 Sep 2011 21:20:18 +0300 [thread overview]
Message-ID: <4E67B5E2.4040006@iki.fi> (raw)
In-Reply-To: <CAOcJUbzDNXw8j6seVuM1ZkYzV5WRV0nv6Np620hKq5sHe0Bk=g@mail.gmail.com>
On 09/07/2011 08:45 PM, Michael Krufky wrote:
> On Wed, Sep 7, 2011 at 1:41 PM, Michael Krufky<mkrufky@kernellabs.com> wrote:
>> On Wed, Sep 7, 2011 at 12:51 PM, Antti Palosaari<crope@iki.fi> wrote:
>>> On 08/01/2011 05:24 AM, Mauro Carvalho Chehab wrote:
>>>>
>>>> Em 31-07-2011 22:22, Antti Palosaari escreveu:
>>>>>
>>>>> On 08/01/2011 03:46 AM, Mauro Carvalho Chehab wrote:
>>>>>>
>>>>>> One bad thing I noticed with the API is that it calls
>>>>>> adap->props.frontend_attach(adap)
>>>>>> several times, instead of just one, without even passing an argument for
>>>>>> the driver to
>>>>>> know that it was called twice.
>>>>>>
>>>>>> IMO, there are two ways of doing the attach:
>>>>>>
>>>>>> 1) call it only once, and, inside the driver, it will loop to add the
>>>>>> other FE's;
>>>>>> 2) add a parameter, at the call, to say what FE needs to be initialized.
>>>>>>
>>>>>> I think (1) is preferred, as it is more flexible, allowing the driver to
>>>>>> test for
>>>>>> several types of frontends.
>>>
>>> I am planning to change DVB USB MFE call .frontend_attach() only once. Is
>>> there any comments about that?
>>>
>>> Currently there is anysee, ttusb2 and cx88 drivers which uses MFE and change
>>> is needed ASAP before more MFE devices are coming.
>>>
>>> Also .num_frontends can be removed after that, since DVB USB will just loop
>>> through 0 to MAX FEs and register all FEs found (fe pointer !NULL).
>>>
>>> CURRENTLY:
>>> ==========
>>> .frontend_attach()
>>> if (adap->fe_adap[0].fe == NULL)
>>> adap->fe_adap[0].fe = dvb_attach(DVB-T)
>>> else if (adap->fe_adap[1].fe == NULL)
>>> adap->fe_adap[1].fe = dvb_attach(DVB-C)
>>> else if (adap->fe_adap[2].fe == NULL)
>>> adap->fe_adap[2].fe = dvb_attach(DVB-S)
>>>
>>> PLANNED:
>>> ========
>>> .frontend_attach()
>>> adap->fe_adap[0].fe = dvb_attach(DVB-T)
>>> adap->fe_adap[1].fe = dvb_attach(DVB-C)
>>> adap->fe_adap[2].fe = dvb_attach(DVB-S)
>>
>> Antti,
>>
>> I don't understand exactly what you are proposing -- Is this a change
>> for the anysee driver? ...or is it a change for the dvb-usb
>> framework? ...or is it a change to dvb-core, and every driver in the
>> subsystem?
>>
>> In the anysee driver, I see that you are using this:
>>
>> .frontend_attach()
>> if (adap->fe_adap[0].fe == NULL)
>> adap->fe_adap[0].fe = dvb_attach(DVB-T)
>> else if (adap->fe_adap[1].fe == NULL)
>> adap->fe_adap[1].fe = dvb_attach(DVB-C)
>> else if (adap->fe_adap[2].fe == NULL)
>> adap->fe_adap[2].fe = dvb_attach(DVB-S)
>>
>> I have no problem if you want to change the anysee driver to remove
>> the second dvb_usb_adap_fe_props context, and replace with the
>> following:
>>
>>
>> .frontend_attach()
>> adap->fe_adap[0].fe = dvb_attach(DVB-T)
>> adap->fe_adap[1].fe = dvb_attach(DVB-C)
>> adap->fe_adap[2].fe = dvb_attach(DVB-S)
>>
>> I believe this will work in the anysee driver for you, even with my
>> changes that got merged yesterday... However, I do *not* believe that
>> such change should propogate to the dvb-usb framework or dvb-core
>> itself, because it can have a large negative impact on the drivers
>> using it.
>>
>> For example, my mxl111sf driver was merged yesterday. Since it is the
>> initial driver merge, it currently only supports one frontend (ATSC).
>> The device also supports two other delivery systems, and has two
>> additional dtv demodulators, each attached via a separate input bus to
>> the USB device, each streaming on a separate USB endpoint.
>>
>> Many demod drivers do an ID test or some other kind of initialization
>> during the _attach() function. A device like the mxl111sf would have
>> to manipulate the USB device state and alter the bus operations before
>> and after each frontend attachment in order for the _attach() calls to
>> succeed, not to mention the separate calls needed for bus negotiation
>> to power on the correct demodulator and initialize its streaming data
>> path.
>>
>> I repeat, if this is a change that is specific to your anysee driver,
>> then it seems like a good idea to me. However, if your plan is to
>> change dvb-usb itself, and / or dvb-core, then I'd really like to have
>> a better idea of the implications that this change will bring forth.
>>
>> So, to help reduce the confusion, can you clarify exactly what code
>> you plan to change, and what impact it will have on the drivers that
>> exist today?
>>
>> Best Regards,
>>
>> Michael Krufky
>>
>
> ADDENDUM:
>
> For the anysee driver, for your single .frontend_attach()
> adap->fe_adap[0].fe = dvb_attach(DVB-T)
> adap->fe_adap[1].fe = dvb_attach(DVB-C)
> adap->fe_adap[2].fe = dvb_attach(DVB-S)
>
> ...for this to work in today's dvb-usb code without modification to
> the dvb-usb framework, i believe that you should do a test for
> (adap->fe_adap[0].fe&& adap->fe_adap[1].fe&& adap->fe_adap[2].fe )
> ... if null, then attach, if not null, then exit -- this will prevent
> the second context's initialization from occurring twice.
Yes, I now saw when looked latest anysee driver that you moved
.streaming_ctrl(), .frontend_attach() and .tuner_attach() to frontend
property. OK, it is not then relevant anymore to change register all as
once.
What is size_of_priv used?
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2011-09-07 18:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 0:17 [PATCH 2/3] dvb-usb: multi-frontend support (MFE) Antti Palosaari
2011-07-27 19:06 ` Mauro Carvalho Chehab
2011-07-27 19:49 ` Antti Palosaari
2011-07-27 20:06 ` Mauro Carvalho Chehab
2011-07-27 20:19 ` Antti Palosaari
2011-08-01 0:46 ` Mauro Carvalho Chehab
2011-08-01 1:22 ` Antti Palosaari
2011-08-01 2:24 ` Mauro Carvalho Chehab
2011-09-07 16:51 ` Antti Palosaari
2011-09-07 17:41 ` Michael Krufky
2011-09-07 17:45 ` Michael Krufky
2011-09-07 18:04 ` Michael Krufky
2011-09-07 18:20 ` Antti Palosaari [this message]
2011-09-07 18:36 ` Michael Krufky
2011-09-07 21:10 ` Antti Palosaari
2011-09-07 21:32 ` Michael Krufky
2011-07-27 22:07 ` Malcolm Priestley
2011-07-27 22:23 ` Antti Palosaari
2011-07-31 18:28 ` Patrick Boettcher
2011-08-01 1:28 ` Antti Palosaari
-- strict thread matches above, loose matches on Subject: below --
2011-07-28 21:35 Antti Palosaari
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=4E67B5E2.4040006@iki.fi \
--to=crope@iki.fi \
--cc=jareguero@telefonica.net \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=mkrufky@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