public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 08/26] V4L/DVB: Break Remote Controller keymaps into modules
Date: Sat, 10 Apr 2010 13:06:06 -0300	[thread overview]
Message-ID: <4BC0A1EE.1000504@redhat.com> (raw)
In-Reply-To: <1270902458.3034.49.camel@palomino.walls.org>

Andy Walls wrote:
> On Tue, 2010-04-06 at 15:18 -0300, Mauro Carvalho Chehab wrote:
>> The original Remote Controller approach were very messy: a big file,
>> that were part of ir-common kernel module, containing 64 different
>> RC keymap tables, used by the V4L/DVB drivers.
>>
>> Better to break each RC keymap table into a separate module,
>> registering them into rc core on a process similar to the fs/nls tables.
>>
>> As an userspace program is now in charge of loading those tables,
>> adds an option to allow the complete removal of those tables from
>> kernelspace.
>>
>> Yet, on embedded devices like Set Top Boxes and TV sets, maybe the
>> only available input device is the IR. So, we should keep allowing
>> the usage of in-kernel tables, but a latter patch should change
>> the default to 'n', after giving some time for distros to add
>> the v4l-utils with the ir-keytable program, to allow the table
>> load via userspace.
> 
> I know I'm probably late on commenting on this.
> 
> Although this is interesting, it seems like overkill.
> 
> 
> 1. How will this help move us to the "just works" case, if now userspace
> has to help the kernel.  Every distro is likely just going to bundle a
> script which loads them all into the kernel and forgets about them.

No. They will either use userspace or kernelspace keymaps. For in-kernel
keymaps, there's nothing needed on userspace.

> 2. How is a driver, which knows the bundled remote, supposed to convey
> to userspace "load this map by default for my IR receiver"?  Is that
> covered in another portion of the patch?

It is on a separate patch. Basically, by the name. The table name is stored
on each IR map entry on kernel. If the table is in kernel, the table will
be dynamically loaded, when needed.

Userspace can always replace it by another one.

For example, this is my current test setup:

$ ./ir-keytable 
Found /sys/class/rc/rc0/ (/dev/input/event8) with:
        Driver "saa7134", raw software decoder, table "rc-avermedia-m135a-rm-jx"
        Supported protocols: NEC RC-5 RC-6 
Found /sys/class/rc/rc1/ (/dev/input/event9) with:
        Driver "cx88xx", hardware decoder, table "rc-pixelview-mk12"
        Supported protocols: other 
        Current protocols: NEC 
Found /sys/class/rc/rc2/ (/dev/input/event10) with:
        Driver "em28xx", hardware decoder, table "rc-rc5-hauppauge-new"
        Supported protocols: NEC RC-5 
        Current protocols: RC-5 

When ready, ir-keytable udev option will get driver and table info and
seek on some files for the proper keymap, if the user wants to replace it
by a customized one, or if the kernel keymap is disabled.

> 
> 3. If you're going to be so remote specific, why not add protocol
> information in these regarding the remotes?  You can tell the core
> everything to expect from this remote: raw vs. hardware decoder and the
> RC-5/NEC/RC-6/JVC/whatever raw protocol decoder to use.  That gets us
> closer to "just works" and avoids false input events from two of the raw
> deoders both thinking they got a valid code.

The table contains the info.

> 4. /sbin/lsmod is now going to give a very long listing with lots of
> noise.  When these things are registered with the core, is the module's
> use count incremented when the core knows a driver is using one of them?

No. It will just show the used modules, as they're dynamically loaded.
For example, with my 3 test device driver loaded, it shows:

rc_rc5_hauppauge_new     1100  0 
rc_pixelview_mk12        953  0 
rc_avermedia_m135a_rm_jx     1016  0 


> 
> 5. Each module is going to consume a page of vmalloc address space and
> ram, and an addtional page of vmalloc address as a gap behind it.  These
> maps are rather small in comparison.  Is it really worth all the page
> table entries to load all these as individual modules?  Memory is cheap,
> and small allocations can fill in fragmentation gaps in the vmalloc
> address space, but page table entries are spent on better things.

My plan is to merge several keymaps. I'm currently trying to obtain some
RC's to write the correct keymaps and try to merge them.

> I guess I'm not aware of what the return is here for the costs.

-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-10 16:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1270577768.git.mchehab@redhat.com>
2010-04-06 18:18 ` [PATCH 23/26] V4L/DVB: ir-core: move rc map code to rc-map.h Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 22/26] V4L-DVB: ir-core: remove the ancillary buffer Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 24/26] V4L/DVB: ir-core: Add support for badly-implemented hardware decoders Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 25/26] V4L/DVB: re-add enable/disable check to the IR decoders Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 26/26] V4L/DVB: ir-rc5-decoder: fix state machine Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 18/26] V4L/DVB: ir-nec-decoder: Reimplement the entire decoder Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 13/26] V4L/DVB: saa7134: Add support for both positive and negative edge IRQ Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 20/26] V4L-DVB: ir-rc5-decoder: Add a decoder for RC-5 IR protocol Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 15/26] V4L/DVB: ir-core: re-add some debug functions for keytable changes Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 19/26] ir-nec-decoder: Cleanups Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 21/26] V4L/DVB: cx88: don't handle IR on Pixelview too fast Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 14/26] V4L/DVB: drivers/media/IR - improve keytable code Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 12/26] V4L/DVB: saa7134: Fix IRQ2 bit names for the register map Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 17/26] V4L/DVB: Convert drivers/media/dvb/ttpci/budget-ci.c to use ir-core Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 11/26] V4L/DVB: ir-common: remove keymap tables from the module Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 10/26] V4L/DVB: ir-core: Make use of the new IR keymap modules Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 08/26] V4L/DVB: Break Remote Controller keymaps into modules Mauro Carvalho Chehab
2010-04-10 12:27   ` Andy Walls
2010-04-10 16:06     ` Mauro Carvalho Chehab [this message]
2010-04-10 17:26       ` Andy Walls
2010-04-06 18:18 ` [PATCH 04/26] V4L/DVB: rename all *_rc_keys to ir_codes_*_nec_table Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 09/26] V4L/DVB: ir: prepare IR code for a parameter change at register function Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 06/26] V4L/DVB: ir-common: move IR tables from ir-keymaps.c to a separate file Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 07/26] V4L/DVB: ir-core: Add support for RC map code register Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 05/26] V4L/DVB: ir-common: Use macros to define the keytables Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 03/26] V4L/DVB: IR: use IR_KEYTABLE where an IR table is needed Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 02/26] V4L/DVB: ir-common: re-order keytables by name and remove duplicates Mauro Carvalho Chehab
2010-04-06 18:18 ` [PATCH 01/26] V4L/DVB: ir-common: Use a function to declare an IR table Mauro Carvalho Chehab
2010-04-06 19:13 ` [PATCH 16/26] V4L/DVB: ir-core: improve keyup/keydown logic 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=4BC0A1EE.1000504@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=linux-media@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox