From: Sean Young <sean@mess.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
netdev@vger.kernel.org, Matthias Reichl <hias@horus.com>,
Devin Heitmueller <dheitmueller@kernellabs.com>
Subject: Re: [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER
Date: Tue, 15 May 2018 13:19:33 +0100 [thread overview]
Message-ID: <20180515121933.ogyvf4fi6sezzryy@gofer.mess.org> (raw)
In-Reply-To: <089862eb-8d37-6479-3c2a-ba6199ae7d3c@infradead.org>
On Mon, May 14, 2018 at 04:27:19PM -0700, Randy Dunlap wrote:
> On 05/14/2018 02:10 PM, Sean Young wrote:
> > Add support for BPF_PROG_IR_DECODER. This type of BPF program can call
>
> Kconfig file below uses IR_BPF_DECODER instead of the symbol name above.
>
> and then patch 3 says a third choice:
> The context provided to a BPF_PROG_RAWIR_DECODER is a struct ir_raw_event;
Yes, you're right. I guess the source/trigger is raw IR events; decoding
is something you're likely to do, but not necessarily. So:
bpf type: BPF_PROG_TYPE_RAWIR_EVENT, has context struct bpf_rawir_event.
Then we can call the Kconfig option CONFIG_BPF_RAW_IR_EVENT
Sean
>
> > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report
> > that the last key should be repeated.
> >
> > Signed-off-by: Sean Young <sean@mess.org>
> > ---
> > drivers/media/rc/Kconfig | 8 +++
> > drivers/media/rc/Makefile | 1 +
> > drivers/media/rc/ir-bpf-decoder.c | 93 +++++++++++++++++++++++++++++++
> > include/linux/bpf_types.h | 3 +
> > include/uapi/linux/bpf.h | 16 +++++-
> > 5 files changed, 120 insertions(+), 1 deletion(-)
> > create mode 100644 drivers/media/rc/ir-bpf-decoder.c
> >
> > diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
> > index eb2c3b6eca7f..10ad6167d87c 100644
> > --- a/drivers/media/rc/Kconfig
> > +++ b/drivers/media/rc/Kconfig
> > @@ -120,6 +120,14 @@ config IR_IMON_DECODER
> > remote control and you would like to use it with a raw IR
> > receiver, or if you wish to use an encoder to transmit this IR.
> >
> > +config IR_BPF_DECODER
> > + bool "Enable IR raw decoder using BPF"
> > + depends on BPF_SYSCALL
> > + depends on RC_CORE=y
> > + help
> > + Enable this option to make it possible to load custom IR
> > + decoders written in BPF.
> > +
> > endif #RC_DECODERS
> >
> > menuconfig RC_DEVICES
> > diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
> > index 2e1c87066f6c..12e1118430d0 100644
> > --- a/drivers/media/rc/Makefile
> > +++ b/drivers/media/rc/Makefile
> > @@ -5,6 +5,7 @@ obj-y += keymaps/
> > obj-$(CONFIG_RC_CORE) += rc-core.o
> > rc-core-y := rc-main.o rc-ir-raw.o
> > rc-core-$(CONFIG_LIRC) += lirc_dev.o
> > +rc-core-$(CONFIG_IR_BPF_DECODER) += ir-bpf-decoder.o
>
>
> --
> ~Randy
next prev parent reply other threads:[~2018-05-15 12:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 21:10 [PATCH v1 0/4] IR decoding using BPF Sean Young
2018-05-14 21:10 ` [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER Sean Young
2018-05-14 23:27 ` Randy Dunlap
2018-05-15 12:19 ` Sean Young [this message]
2018-05-15 4:48 ` Y Song
2018-05-15 10:30 ` Sean Young
2018-05-14 21:10 ` [PATCH v1 2/4] media: bpf: allow raw IR decoder bpf programs to be used Sean Young
2018-05-15 2:34 ` kbuild test robot
2018-05-15 5:22 ` Y Song
2018-05-14 21:11 ` [PATCH v1 3/4] media: rc bpf: move ir_raw_event to uapi Sean Young
2018-05-15 1:59 ` kbuild test robot
2018-05-15 5:26 ` Y Song
2018-05-14 21:11 ` [PATCH v1 4/4] samples/bpf: an example of a raw IR decoder Sean Young
2018-05-15 5:34 ` Y Song
2018-05-15 10:40 ` Sean Young
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=20180515121933.ogyvf4fi6sezzryy@gofer.mess.org \
--to=sean@mess.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=dheitmueller@kernellabs.com \
--cc=hias@horus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rdunlap@infradead.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
all inboxes | Powered by JetHome®