From: Takashi Iwai <tiwai@suse.de>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: alsa-devel@alsa-project.org,
Linux and Kernel Video <video4linux-list@redhat.com>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH] Improved support for different bt87x board configurations
Date: Wed, 05 Sep 2007 12:07:52 +0200 [thread overview]
Message-ID: <s5h3axtv30n.wl%tiwai@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.58.0709050120490.31808@shell4.speakeasy.net>
At Wed, 5 Sep 2007 02:09:45 -0700 (PDT),
Trent Piepho wrote:
>
> On Wed, 5 Sep 2007, Mauro Carvalho Chehab wrote:
> > Em Ter, 2007-09-04 às 14:04 -0700, Trent Piepho escreveu:
> > > There are few drawbacks.
> > >
> > > First, there are like 20x more cards supported by the bttv driver than by
> > > the bt87x driver. It's going to produce a very sparse card database in the
> > > ALSA driver. Note that for the most part, __initdata doesn't work, so you
> > > can't say "it'll just be dropped after the driver loads."
> >
> > You should notice that even the way you've mapped is a a little sparse,
> > since just two boards use digital_fmt.
> >
> > Maybe one solution for that is to use a different code or data
> > structure.
> >
> > For example, instead of using a data struct, you could use some sort of
> > code like (*) (**):
> >
> > static void fill_board (struct snd_bt87x_board &board, int board_id)
> > {
> > board->dig_rate = 32000;
> > switch (board_id) {
> > case BTTV_BOARD_AVPHONE98:
> > board.dig_rate = 48000,
> > break;
>
> I don't think gcc will be smart enough to a bunch of cases with random numbers
> into a O(1) lookup, instead it will use an O(log n) branch chain. With all
> the explicit assignments, I doubt it will be much smaller, if any, since there
> are just a couple board configurations. Several board configurations are
> currently duplicates and I think I'll just merge them.
>
> But code wise I think using a switch with manual assignments is ugly. It's a
> lot more code to write and just doesn't have the regularity and elegance of a
> table.
I second for Trent. The switch is uglier than the array for such a
purpose.
> > > And if both linuxtv and alsa use the same header, what happens if they
> > > don't push the changes to GIT at the exact same time? You'll have patches
> > > in one subsystem that are dependant on the other subsystem. How will they
> > > make the same merge window?
> >
> > This should be coordinated between me and Takashi. I have no objections
> > if he pull such patch, if he is willing to send the pull request before
> > myself.
> >
> > I don't see this as a big trouble. There are other cases like this
> > already (pci_ids.h, i2c_id.h). Also, currently, there are not much bttv
> > board additions anymore.
>
> And pci_ids and i2d_id are pain to deal with. Both v4l-dvb and ALSA have out
> of kernel tree build system that try to be backward compatible with older
> kernels. When the IDs come from somewhere outside the repository, you need to
> have compat patches to deal with old id files that are missing ids. Look at
> all the kernel-sync patches for those id files, all the compat code in the
> various drivers for non-defined PCI ids. There's even something I had to add
> to compat.h for an i2c ID that went away in newer kernels.
>
> It's a lot of extra work, and I just don't see the point. To reuse a couple
> defines from a bttv header file? They are just arbitrary numbers, it's not
> like there is any benefit from using the same value in both drivers.
Well, at first I misunderstood that we would share the PCI SSIDs
together with enum items. Sharing only the enum items doesn't give
much improvements. Sharing the card database may do, though.
So, I see Trent's point. The merge work wouldn't pay for the benifit
by sharing only the enum id, not the card database.
thanks,
Takashi
next prev parent reply other threads:[~2007-09-05 10:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-30 10:21 [PATCH] Improved support for different bt87x board configurations Trent Piepho
2007-08-30 11:03 ` Takashi Iwai
2007-09-02 23:21 ` Trent Piepho
2007-09-03 6:36 ` Clemens Ladisch
2007-09-04 11:49 ` Trent Piepho
2007-09-04 13:54 ` Mauro Carvalho Chehab
2007-09-04 20:29 ` Takashi Iwai
2007-09-04 21:04 ` Trent Piepho
2007-09-05 6:54 ` Mauro Carvalho Chehab
2007-09-05 9:09 ` [alsa-devel] " Trent Piepho
2007-09-05 10:07 ` Takashi Iwai [this message]
2007-09-05 10:32 ` Mauro Carvalho Chehab
2007-09-05 22:34 ` Trent Piepho
2007-09-06 20:17 ` [alsa-devel] " Mauro Carvalho Chehab
2007-09-07 23:50 ` Takashi Iwai
2007-09-08 0:33 ` [alsa-devel] " Mauro Carvalho Chehab
2007-09-05 10:16 ` Takashi Iwai
2007-09-05 22:23 ` Trent Piepho
2007-09-06 13:13 ` Takashi Iwai
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=s5h3axtv30n.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=mchehab@infradead.org \
--cc=video4linux-list@redhat.com \
--cc=xyzzy@speakeasy.org \
/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 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.