From: Kamil Debski <k.debski@samsung.com>
To: 'Hans Verkuil' <hverkuil@xs4all.nl>,
dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org, sean@mess.org,
mchehab@osg.samsung.com, dmitry.torokhov@gmail.com,
'Hans Verkuil' <hansverk@cisco.com>,
kyungmin.park@samsung.com, thomas@tommie-lie.de,
linux-input@vger.kernel.org, m.szyprowski@samsung.com
Subject: RE: [PATCH v4 06/10] cec: add HDMI CEC framework
Date: Mon, 27 Apr 2015 14:18:27 +0200 [thread overview]
Message-ID: <"08ee01d080e4$44c4c770$ce4e5650$@debski"@samsung.com> (raw)
In-Reply-To: <553E1D1A.9020503@xs4all.nl>
Hi Hans,
Thank you so much for all today's comments. I will consider them when
preparing the next version.
From: linux-media-owner@vger.kernel.org [mailto:linux-media-
owner@vger.kernel.org] On Behalf Of Hans Verkuil
Sent: Monday, April 27, 2015 1:27 PM
>
> On 04/27/2015 12:25 PM, Hans Verkuil wrote:
> > On 04/23/2015 03:03 PM, Kamil Debski wrote:
> >> From: Hans Verkuil <hansverk@cisco.com>
> >>
> >> The added HDMI CEC framework provides a generic kernel interface for
> >> HDMI CEC devices.
> >>
> >> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
> >> [k.debski@samsung.com: Merged CEC Updates commit by Hans Verkuil]
> >> [k.debski@samsung.com: Merged Update author commit by Hans Verkuil]
> >> [k.debski@samsung.com: change kthread handling when setting logical
> >> address]
> >> [k.debski@samsung.com: code cleanup and fixes]
> >> [k.debski@samsung.com: add missing CEC commands to match spec]
> >> [k.debski@samsung.com: add RC framework support]
> >> [k.debski@samsung.com: move and edit documentation]
> >> [k.debski@samsung.com: add vendor id reporting]
> >> [k.debski@samsung.com: add possibility to clear assigned logical
> >> addresses]
> >> [k.debski@samsung.com: documentation fixes, clenaup and expansion]
> >> [k.debski@samsung.com: reorder of API structs and add reserved
> >> fields]
> >> [k.debski@samsung.com: fix handling of events and fix 32/64bit
> >> timespec problem]
> >> [k.debski@samsung.com: add cec.h to include/uapi/linux/Kbuild]
> >> Signed-off-by: Kamil Debski <k.debski@samsung.com>
> >> ---
> >> Documentation/cec.txt | 396 ++++++++++++++++
> >> drivers/media/Kconfig | 6 +
> >> drivers/media/Makefile | 2 +
> >> drivers/media/cec.c | 1161
> +++++++++++++++++++++++++++++++++++++++++++++
> >> include/media/cec.h | 140 ++++++
> >> include/uapi/linux/Kbuild | 1 +
> >> include/uapi/linux/cec.h | 303 ++++++++++++
> >> 7 files changed, 2009 insertions(+)
> >> create mode 100644 Documentation/cec.txt create mode 100644
> >> drivers/media/cec.c create mode 100644 include/media/cec.h create
> >> mode 100644 include/uapi/linux/cec.h
> >>
> >
> >> + case CEC_S_ADAP_LOG_ADDRS: {
> >> + struct cec_log_addrs log_addrs;
> >> +
> >> + if (!(adap->capabilities & CEC_CAP_LOG_ADDRS))
> >> + return -ENOTTY;
> >> + if (copy_from_user(&log_addrs, parg, sizeof(log_addrs)))
> >> + return -EFAULT;
> >> + err = cec_claim_log_addrs(adap, &log_addrs, true);
> >
> > Currently CEC_S_ADAP_LOG_ADDRS is always blocking, but since we have
> > CEC_EVENT_READY I think it makes sense to just return in non-blocking
> > mode and have cec_claim_log_addrs generate CEC_EVENT_READY when done.
> > Userspace can then call G_ADAP_LOG_ADDRS to discover the result.
> >
> > What do you think?
> >
I am looking into this now. If I see this correctly this involves:
- adding cec_post_event(cla_int->adap, CEC_EVENT_READY); to
cec_config_thread_func
- adding O_NONBLOCK check in CEC_S_ADAP_LOG_ADDRS
Right?
> On a related topic: non-blocking behavior for CEC_RECEIVE is well
> defined, but for CEC_TRA NSMIT it isn't. If reply == 0, then we need a
> way to inform userspace that the transmit finished (with a possible
> non-zero status code). An event would be suitable for that, but we
> would need a way to associate a transmit message with the event.
>
> One possibility might be to have the CEC framework assign a sequence
> number to a transmit message which is returned by CEC_TRANSMIT and used
> in the event.
>
> If reply != 0, then I think the received message should be queued up in
> the receive queue, but with a non-zero reply field and with the
> sequence number of the transmit message it is a reply of.
A sequence number is a good solution, I believe. To recap:
- a sequence number should be set by the framework and returned in the
CEC_TRANSMIT ioctl
- a new event should be added CEC_EVENT_TX_DONE and it should be posted on
each transmission
finish
- event struct has to include a sequence field as well
Is this ok?
>
> Regards,
>
> Hans
Best wishes,
--
Kamil Debski
Samsung R&D Institute Poland
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Kamil Debski <k.debski@samsung.com>
To: 'Hans Verkuil' <hverkuil@xs4all.nl>,
dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org
Cc: m.szyprowski@samsung.com, mchehab@osg.samsung.com,
kyungmin.park@samsung.com, thomas@tommie-lie.de, sean@mess.org,
dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
'Hans Verkuil' <hansverk@cisco.com>
Subject: RE: [PATCH v4 06/10] cec: add HDMI CEC framework
Date: Mon, 27 Apr 2015 14:18:27 +0200 [thread overview]
Message-ID: <"08ee01d080e4$44c4c770$ce4e5650$@debski"@samsung.com> (raw)
In-Reply-To: <553E1D1A.9020503@xs4all.nl>
Hi Hans,
Thank you so much for all today's comments. I will consider them when
preparing the next version.
From: linux-media-owner@vger.kernel.org [mailto:linux-media-
owner@vger.kernel.org] On Behalf Of Hans Verkuil
Sent: Monday, April 27, 2015 1:27 PM
>
> On 04/27/2015 12:25 PM, Hans Verkuil wrote:
> > On 04/23/2015 03:03 PM, Kamil Debski wrote:
> >> From: Hans Verkuil <hansverk@cisco.com>
> >>
> >> The added HDMI CEC framework provides a generic kernel interface for
> >> HDMI CEC devices.
> >>
> >> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
> >> [k.debski@samsung.com: Merged CEC Updates commit by Hans Verkuil]
> >> [k.debski@samsung.com: Merged Update author commit by Hans Verkuil]
> >> [k.debski@samsung.com: change kthread handling when setting logical
> >> address]
> >> [k.debski@samsung.com: code cleanup and fixes]
> >> [k.debski@samsung.com: add missing CEC commands to match spec]
> >> [k.debski@samsung.com: add RC framework support]
> >> [k.debski@samsung.com: move and edit documentation]
> >> [k.debski@samsung.com: add vendor id reporting]
> >> [k.debski@samsung.com: add possibility to clear assigned logical
> >> addresses]
> >> [k.debski@samsung.com: documentation fixes, clenaup and expansion]
> >> [k.debski@samsung.com: reorder of API structs and add reserved
> >> fields]
> >> [k.debski@samsung.com: fix handling of events and fix 32/64bit
> >> timespec problem]
> >> [k.debski@samsung.com: add cec.h to include/uapi/linux/Kbuild]
> >> Signed-off-by: Kamil Debski <k.debski@samsung.com>
> >> ---
> >> Documentation/cec.txt | 396 ++++++++++++++++
> >> drivers/media/Kconfig | 6 +
> >> drivers/media/Makefile | 2 +
> >> drivers/media/cec.c | 1161
> +++++++++++++++++++++++++++++++++++++++++++++
> >> include/media/cec.h | 140 ++++++
> >> include/uapi/linux/Kbuild | 1 +
> >> include/uapi/linux/cec.h | 303 ++++++++++++
> >> 7 files changed, 2009 insertions(+)
> >> create mode 100644 Documentation/cec.txt create mode 100644
> >> drivers/media/cec.c create mode 100644 include/media/cec.h create
> >> mode 100644 include/uapi/linux/cec.h
> >>
> >
> >> + case CEC_S_ADAP_LOG_ADDRS: {
> >> + struct cec_log_addrs log_addrs;
> >> +
> >> + if (!(adap->capabilities & CEC_CAP_LOG_ADDRS))
> >> + return -ENOTTY;
> >> + if (copy_from_user(&log_addrs, parg, sizeof(log_addrs)))
> >> + return -EFAULT;
> >> + err = cec_claim_log_addrs(adap, &log_addrs, true);
> >
> > Currently CEC_S_ADAP_LOG_ADDRS is always blocking, but since we have
> > CEC_EVENT_READY I think it makes sense to just return in non-blocking
> > mode and have cec_claim_log_addrs generate CEC_EVENT_READY when done.
> > Userspace can then call G_ADAP_LOG_ADDRS to discover the result.
> >
> > What do you think?
> >
I am looking into this now. If I see this correctly this involves:
- adding cec_post_event(cla_int->adap, CEC_EVENT_READY); to
cec_config_thread_func
- adding O_NONBLOCK check in CEC_S_ADAP_LOG_ADDRS
Right?
> On a related topic: non-blocking behavior for CEC_RECEIVE is well
> defined, but for CEC_TRA NSMIT it isn't. If reply == 0, then we need a
> way to inform userspace that the transmit finished (with a possible
> non-zero status code). An event would be suitable for that, but we
> would need a way to associate a transmit message with the event.
>
> One possibility might be to have the CEC framework assign a sequence
> number to a transmit message which is returned by CEC_TRANSMIT and used
> in the event.
>
> If reply != 0, then I think the received message should be queued up in
> the receive queue, but with a non-zero reply field and with the
> sequence number of the transmit message it is a reply of.
A sequence number is a good solution, I believe. To recap:
- a sequence number should be set by the framework and returned in the
CEC_TRANSMIT ioctl
- a new event should be added CEC_EVENT_TX_DONE and it should be posted on
each transmission
finish
- event struct has to include a sequence field as well
Is this ok?
>
> Regards,
>
> Hans
Best wishes,
--
Kamil Debski
Samsung R&D Institute Poland
next prev parent reply other threads:[~2015-04-27 12:18 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 13:03 [PATCH v4 00/10] HDMI CEC framework Kamil Debski
2015-04-23 13:03 ` [PATCH v4 01/10] dts: exynos4*: add HDMI CEC pin definition to pinctrl Kamil Debski
2015-04-23 13:03 ` [PATCH v4 02/10] dts: exynos4: add node for the HDMI CEC device Kamil Debski
2015-04-23 13:03 ` Kamil Debski
2015-04-23 13:03 ` [PATCH v4 03/10] dts: exynos4412-odroid*: enable " Kamil Debski
2015-04-23 13:03 ` [PATCH v4 04/10] HID: add HDMI CEC specific keycodes Kamil Debski
2015-04-23 13:03 ` Kamil Debski
2015-04-23 13:03 ` [PATCH v4 05/10] rc: Add HDMI CEC protoctol handling Kamil Debski
2015-04-23 13:03 ` Kamil Debski
2015-04-23 13:03 ` [PATCH v4 06/10] cec: add HDMI CEC framework Kamil Debski
2015-04-23 14:18 ` Hans Verkuil
2015-04-24 10:03 ` Lars Op den Kamp
2015-04-27 8:09 ` Kamil Debski
2015-04-27 8:09 ` Kamil Debski
2015-04-27 8:19 ` Hans Verkuil
2015-04-27 7:40 ` [PATCH v4 06/10] cec: add HDMI CEC framework: y2038 question Hans Verkuil
2015-05-04 7:42 ` [Y2038] " Hans Verkuil
2015-05-04 10:14 ` Arnd Bergmann
2015-05-06 15:58 ` Hans Verkuil
2015-05-06 16:17 ` Arnd Bergmann
2015-04-27 9:13 ` [PATCH v4 06/10] cec: add HDMI CEC framework Hans Verkuil
2015-04-27 9:22 ` Hans Verkuil
2015-04-27 9:22 ` Hans Verkuil
2015-04-27 9:30 ` Hans Verkuil
2015-04-27 9:30 ` Hans Verkuil
2015-04-27 11:45 ` Hans Verkuil
2015-04-27 10:04 ` Hans Verkuil
2015-04-27 10:25 ` Hans Verkuil
2015-04-27 10:25 ` Hans Verkuil
2015-04-27 11:27 ` Hans Verkuil
2015-04-27 12:18 ` Kamil Debski [this message]
2015-04-27 12:18 ` Kamil Debski
2015-04-23 13:03 ` [PATCH v4 07/10] v4l2-subdev: add HDMI CEC ops Kamil Debski
2015-04-23 13:03 ` [PATCH v4 08/10] cec: adv7604: add cec support Kamil Debski
2015-04-23 13:03 ` Kamil Debski
2015-04-23 13:03 ` [PATCH v4 09/10] cec: adv7511: " Kamil Debski
2015-04-23 13:03 ` Kamil Debski
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='"08ee01d080e4$44c4c770$ce4e5650$@debski"@samsung.com' \
--to=k.debski@samsung.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hansverk@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@osg.samsung.com \
--cc=sean@mess.org \
--cc=thomas@tommie-lie.de \
/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.