cron job: media_tree daily build: WARNINGS

2016-08-19 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Sat Aug 20 04:00:26 CEST 2016
git branch: test
git hash:   b6aa39228966e0d3f0bc3306be1892f87792903a
gcc version:i686-linux-gcc (GCC) 5.4.0
sparse version: v0.5.0-56-g7647c77
smatch version: v0.5.0-3428-gdfe27cf
host hardware:  x86_64
host os:4.6.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: WARNINGS
linux-3.12.23-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
linux-3.19-i686: WARNINGS
linux-4.0-i686: WARNINGS
linux-4.1.1-i686: WARNINGS
linux-4.2-i686: WARNINGS
linux-4.3-i686: WARNINGS
linux-4.4-i686: WARNINGS
linux-4.5-i686: WARNINGS
linux-4.6-i686: WARNINGS
linux-4.7-i686: WARNINGS
linux-4.8-rc1-i686: WARNINGS
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12.23-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0-x86_64: WARNINGS
linux-4.1.1-x86_64: WARNINGS
linux-4.2-x86_64: WARNINGS
linux-4.3-x86_64: WARNINGS
linux-4.4-x86_64: WARNINGS
linux-4.5-x86_64: WARNINGS
linux-4.6-x86_64: WARNINGS
linux-4.7-x86_64: WARNINGS
linux-4.8-rc1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: WARNINGS
smatch: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] [media] subdev-formats.rst: adjust tables size for LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
There are two big tables here that are very hard to adjust its
size.

The first one would fit into one page, but the latex.py logic
at Sphinx auto-switches to longtable when there are more than 30
rows. There's no way to override without coding.

The second one is really big, and won't fit on a single page.
So, it has to use tiny font to fit.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/subdev-formats.rst | 36 -
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst 
b/Documentation/media/uapi/v4l/subdev-formats.rst
index a347fcc206db..0b31943bb300 100644
--- a/Documentation/media/uapi/v4l/subdev-formats.rst
+++ b/Documentation/media/uapi/v4l/subdev-formats.rst
@@ -154,18 +154,26 @@ half of the green value) transferred first will be named
 
 The following tables list existing packed RGB formats.
 
-.. FIXME: I was unable to find a way to use adjustbox or landscape for this 
table!
+.. HACK: ideally, we would be using adjustbox here. However, Sphinx
+.. is a very bad behaviored guy: if the table has more than 30 cols,
+.. it switches to long table, and there's no way to override it.
 
-.. tabularcolumns:: 
|p{7.6cm}|p{1.6cm}|p{0.7cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{-1.0cm}|
+
+.. tabularcolumns:: 
|p{4.0cm}|p{0.7cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22}|
 
 .. _v4l2-mbus-pixelcode-rgb:
 
+.. raw:: latex
+
+\begingroup
+\tiny
+\setlength{\tabcolsep}{2pt}
+
 .. flat-table:: RGB formats
 :header-rows:  2
 :stub-columns: 0
 :widths: 36 7 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 
2 2 2
 
-
 -  .. row 1
 
-  Identifier
@@ -2355,6 +2363,10 @@ The following tables list existing packed RGB formats.
 
-  b\ :sub:`0`
 
+.. raw:: latex
+
+\endgroup
+
 On LVDS buses, usually each sample is transferred serialized in seven
 time slots per pixel clock, on three (18-bit) or four (24-bit)
 differential data pairs at the same time. The remaining bits are used
@@ -3751,13 +3763,22 @@ the following codes.
 
 -  d for dummy bits
 
-.. FIXME: I was unable to find a way to use adjustbox or landscape for this 
table!
 
-.. tabularcolumns:: 
|p{7.6cm}|p{1.6cm}|p{0.7cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{-1.0cm}|
+.. tabularcolumns:: 
|p{4.0cm}|p{0.7cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22}|
 
 .. _v4l2-mbus-pixelcode-yuv8:
 
-.. cssclass:: longtable
+
+.. HACK: ideally, we would be using adjustbox here. However, this
+.. will never work for this table, as, even with tiny font, it is
+.. to big for a single page. So, we need to manually adjust the
+.. size.
+
+.. raw:: latex
+
+\begingroup
+\tiny
+\setlength{\tabcolsep}{2pt}
 
 .. flat-table:: YUV Formats
 :header-rows:  2
@@ -11439,6 +11460,9 @@ the following codes.
-  v\ :sub:`0`
 
 
+.. raw:: latex
+
+   \endgroup
 
 HSV/HSL Formats
 ^^^
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] cec-ioc-receive.rst: one table here should be longtable.

2016-08-19 Thread Mauro Carvalho Chehab
The table is too big to fit into a single page on LaTeX format.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-receive.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst 
b/Documentation/media/uapi/cec/cec-ioc-receive.rst
index 7214b1ede34b..025a3851ab76 100644
--- a/Documentation/media/uapi/cec/cec-ioc-receive.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -78,6 +78,8 @@ result.
 
 .. _cec-msg:
 
+.. cssclass:: longtable
+
 .. flat-table:: struct cec_msg
 :header-rows:  0
 :stub-columns: 0
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] [media] extended-controls.rst: avoid going past page with LaTeX

2016-08-19 Thread Mauro Carvalho Chehab
It is painful to put code/verbatim code in bold. It seems that
the only way is to arrange it like:
``foo``
bar

At least on LaTeX output, when this happens, the "foo" string
is not hidentable/breakable. The entire string should fit into
a single line.

Add a workaround for this ReST limitation by splitting the
foo string into two strings, on separate lines. The output
is not the best, but it works.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/extended-controls.rst | 267 -
 1 file changed, 213 insertions(+), 54 deletions(-)

diff --git a/Documentation/media/uapi/v4l/extended-controls.rst 
b/Documentation/media/uapi/v4l/extended-controls.rst
index 3f0f94a5eeed..9c6aff3e97c1 100644
--- a/Documentation/media/uapi/v4l/extended-controls.rst
+++ b/Documentation/media/uapi/v4l/extended-controls.rst
@@ -209,7 +209,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-stream-type:
 
-``V4L2_CID_MPEG_STREAM_TYPE (enum v4l2_mpeg_stream_type)``
+``V4L2_CID_MPEG_STREAM_TYPE``
+(enum)
+
+enum v4l2_mpeg_stream_type -
 The MPEG-1, -2 or -4 output stream type. One cannot assume anything
 here. Each hardware MPEG encoder tends to support different subsets
 of the available MPEG stream types. This control is specific to
@@ -282,7 +285,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-stream-vbi-fmt:
 
-``V4L2_CID_MPEG_STREAM_VBI_FMT (enum v4l2_mpeg_stream_vbi_fmt)``
+``V4L2_CID_MPEG_STREAM_VBI_FMT``
+(enum)
+
+enum v4l2_mpeg_stream_vbi_fmt -
 Some cards can embed VBI data (e. g. Closed Caption, Teletext) into
 the MPEG stream. This control selects whether VBI data should be
 embedded, and if so, what embedding method should be used. The list
@@ -316,7 +322,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-sampling-freq:
 
-``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (enum v4l2_mpeg_audio_sampling_freq)``
+``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ``
+(enum)
+
+enum v4l2_mpeg_audio_sampling_freq -
 MPEG Audio sampling frequency. Possible values are:
 
 
@@ -348,7 +357,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-encoding:
 
-``V4L2_CID_MPEG_AUDIO_ENCODING (enum v4l2_mpeg_audio_encoding)``
+``V4L2_CID_MPEG_AUDIO_ENCODING``
+(enum)
+
+enum v4l2_mpeg_audio_encoding -
 MPEG Audio encoding. This control is specific to multiplexed MPEG
 streams. Possible values are:
 
@@ -393,7 +405,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-l1-bitrate:
 
-``V4L2_CID_MPEG_AUDIO_L1_BITRATE (enum v4l2_mpeg_audio_l1_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L1_BITRATE``
+(enum)
+
+enum v4l2_mpeg_audio_l1_bitrate -
 MPEG-1/2 Layer I bitrate. Possible values are:
 
 
@@ -491,7 +506,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-l2-bitrate:
 
-``V4L2_CID_MPEG_AUDIO_L2_BITRATE (enum v4l2_mpeg_audio_l2_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L2_BITRATE``
+(enum)
+
+enum v4l2_mpeg_audio_l2_bitrate -
 MPEG-1/2 Layer II bitrate. Possible values are:
 
 
@@ -589,7 +607,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-l3-bitrate:
 
-``V4L2_CID_MPEG_AUDIO_L3_BITRATE (enum v4l2_mpeg_audio_l3_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L3_BITRATE``
+(enum)
+
+enum v4l2_mpeg_audio_l3_bitrate -
 MPEG-1/2 Layer III bitrate. Possible values are:
 
 
@@ -690,7 +711,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-ac3-bitrate:
 
-``V4L2_CID_MPEG_AUDIO_AC3_BITRATE (enum v4l2_mpeg_audio_ac3_bitrate)``
+``V4L2_CID_MPEG_AUDIO_AC3_BITRATE``
+(enum)
+
+enum v4l2_mpeg_audio_ac3_bitrate -
 AC-3 bitrate. Possible values are:
 
 
@@ -818,7 +842,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-mode:
 
-``V4L2_CID_MPEG_AUDIO_MODE (enum v4l2_mpeg_audio_mode)``
+``V4L2_CID_MPEG_AUDIO_MODE``
+(enum)
+
+enum v4l2_mpeg_audio_mode -
 MPEG Audio mode. Possible values are:
 
 
@@ -856,7 +883,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-mode-extension:
 
-``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (enum v4l2_mpeg_audio_mode_extension)``
+``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION``
+(enum)
+
+enum v4l2_mpeg_audio_mode_extension -
 Joint Stereo audio mode extension. In Layer I and II they indicate
 which subbands are in intensity stereo. All other subbands are coded
 in stereo. Layer III is not (yet) supported. Possible values are:
@@ -896,7 +926,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-emphasis:
 
-``V4L2_CID_MPEG_AUDIO_EMPHASIS (enum v4l2_mpeg_audio_emphasis)``
+``V4L2_CID_MPEG_AUDIO_EMPHASIS``
+(enum)
+
+enum v4l2_mpeg_audio_emphasis -
 Audio Emphasis. Possible values are:
 
 
@@ -928,7 +961,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-crc:
 
-``V4L2_CID_MPEG_AUDIO_CRC (enum v4l2_mpeg_audio_crc)``
+``V4L2_CID_MPEG_AUDIO_CRC``
+(enum)
+
+enum v4l2_mpeg_audio_crc -
 CRC method. Possible values are:
 
 
@@ -960,7 +996,10 @@ Codec Control IDs
 
 .. _v4l2-mpeg-audio-dec-playback:
 
-``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (enum v4l2_mpeg_audio_dec_playback)``
+``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK``
+(enum)
+
+enum v4l2_mpeg_audio_dec_playback -
   

Re: [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder

2016-08-19 Thread Kevin Hilman
Martin Blumenstingl  writes:

> From: Neil Armstrong 
>
> Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
> REG1 to configure the decoder mode. This makes it necessary to
> introduce new bindings so the driver knows which register has to be
> used.
>
> Signed-off-by: Neil Armstrong 
> Signed-off-by: Martin Blumenstingl 

Acked-by: Kevin Hilman 

Mauro, are you the one to pick up new media/rc drivers?  Or if you
prefer, with your ack, I'll take this along with the DT and submit via
arm-soc.

Thanks,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin

2016-08-19 Thread Kevin Hilman
Martin Blumenstingl  writes:

> This adds the IR remote receiver to the AO domain devices.

nit Re: Subject: should specify IR remote *input* pin.

> Signed-off-by: Martin Blumenstingl 
> ---
>  drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c 
> b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> index cb4d6ad..8fffb31 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> @@ -225,6 +225,8 @@ static const unsigned int i2c_sda_ao_pins[] = 
> {PIN(GPIOAO_5, 0) };
>  static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) };
>  static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
>  
> +static const unsigned int ir_in_ao_pins[] = {PIN(GPIOAO_7, 0) };
> +

I'm trying to keep the names here so they match the datasheet, which
calls this remote_input_ao.  Please update throughout the patch.

Otherwise looks good to me.  Feel free to add

Reviewed-by: Kevin Hilman 

and Linus W can queue it up.

Thanks,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/6] Add Meson 8b / GXBB support to the IR driver

2016-08-19 Thread Martin Blumenstingl
Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
register layout for their Infrared Remoete Controller. The decoder mode
is now configured in another register. Without the changes to the
meson-ir driver we are simply getting incorrect "durations" reported
from the hardware (because the hardware is not in time measurement aka
software decode mode).

This problem was also noticed by some people trying to use this on an
ODROID-C1 and ODROID-C2 - the workaround there (probably because the
datasheets were not publicy available yet at that time) was to switch
to ir_raw_event_store_edge (which leaves it up to the kernel to measure
the duration of a pulse). See [0] and [1] for the corresponding
patches.

Changes in v4:
- added support for pinctrl configuration which makes it possible to
  use the IR decoder when doing a cold-boot. Without these pinctrl
  changes the IR decoder was only working when booting into stock
  Android, then rebooting and booting the mainline kernel (with the
  other patches from this series). Thanks to Kevin Hilman for spotting
  this issue.
- rebased dts changes to Kevin's v4.8/integ branch

As discussed on IRC (thanks Neil):

Tested-by: Neil Armstrong 


[0] 
https://github.com/erdoukki/linux-amlogic-1/commit/969b2e2242fb14a13cb651f9a1cf771b599c958b
[1] http://forum.odroid.com/viewtopic.php?f=135=20504


Martin Blumenstingl (3):
  pinctrl: amlogic: gxbb: add the IR remote pin
  ARM64: dts: amlogic: add the pin for the IR remote
  ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards

Neil Armstrong (3):
  dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
  media: rc: meson-ir: Add support for newer versions of the IR decoder
  ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder

 .../devicetree/bindings/media/meson-ir.txt |  5 +++-
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts |  6 +
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi   |  6 +
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi  |  6 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi| 14 +++
 drivers/media/rc/meson-ir.c| 29 ++
 drivers/pinctrl/meson/pinctrl-meson-gxbb.c |  8 ++
 7 files changed, 68 insertions(+), 6 deletions(-)

-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin

2016-08-19 Thread Martin Blumenstingl
This adds the IR remote receiver to the AO domain devices.

Signed-off-by: Martin Blumenstingl 
---
 drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c 
b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
index cb4d6ad..8fffb31 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
@@ -225,6 +225,8 @@ static const unsigned int i2c_sda_ao_pins[] = 
{PIN(GPIOAO_5, 0) };
 static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) };
 static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
 
+static const unsigned int ir_in_ao_pins[] = {PIN(GPIOAO_7, 0) };
+
 static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
GPIO_GROUP(GPIOZ_0, EE_OFF),
GPIO_GROUP(GPIOZ_1, EE_OFF),
@@ -432,6 +434,7 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = {
GROUP(i2c_sda_ao,   0,  5),
GROUP(i2c_slave_sck_ao, 0,  2),
GROUP(i2c_slave_sda_ao, 0,  1),
+   GROUP(ir_in_ao, 0,  0),
 };
 
 static const char * const gpio_periphs_groups[] = {
@@ -521,6 +524,10 @@ static const char * const i2c_slave_ao_groups[] = {
"i2c_slave_sdk_ao", "i2c_slave_sda_ao",
 };
 
+static const char * const ir_in_ao_groups[] = {
+   "ir_in_ao",
+};
+
 static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
FUNCTION(gpio_periphs),
FUNCTION(emmc),
@@ -537,6 +544,7 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = 
{
FUNCTION(uart_ao_b),
FUNCTION(i2c_ao),
FUNCTION(i2c_slave_ao),
+   FUNCTION(ir_in_ao),
 };
 
 static struct meson_bank meson_gxbb_periphs_banks[] = {
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] vsp1: add R8A7792 VSP1V support

2016-08-19 Thread Sergei Shtylyov
Add  support for the R8A7792 VSP1V cores which are different from the other
gen2 VSP1 cores...

Signed-off-by: Sergei Shtylyov 

---
This patch is against the 'media_tree.git' repo's 'master' branch.

 drivers/media/platform/vsp1/vsp1_drv.c  |   20 
 drivers/media/platform/vsp1/vsp1_regs.h |2 ++
 2 files changed, 22 insertions(+)

Index: media_tree/drivers/media/platform/vsp1/vsp1_drv.c
===
--- media_tree.orig/drivers/media/platform/vsp1/vsp1_drv.c
+++ media_tree/drivers/media/platform/vsp1/vsp1_drv.c
@@ -596,6 +596,26 @@ static const struct vsp1_device_info vsp
.num_bru_inputs = 4,
.uapi = true,
}, {
+   .version = VI6_IP_VERSION_MODEL_VSPS_V2H,
+   .gen = 2,
+   .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT |
+   VSP1_HAS_SRU | VSP1_HAS_WPF_VFLIP,
+   .rpf_count = 4,
+   .uds_count = 1,
+   .wpf_count = 4,
+   .num_bru_inputs = 4,
+   .uapi = true,
+   }, {
+   .version = VI6_IP_VERSION_MODEL_VSPD_V2H,
+   .gen = 2,
+   .features = VSP1_HAS_BRU | VSP1_HAS_CLU | VSP1_HAS_LUT |
+   VSP1_HAS_LIF,
+   .rpf_count = 4,
+   .uds_count = 1,
+   .wpf_count = 1,
+   .num_bru_inputs = 4,
+   .uapi = true,
+   }, {
.version = VI6_IP_VERSION_MODEL_VSPI_GEN3,
.gen = 3,
.features = VSP1_HAS_CLU | VSP1_HAS_LUT | VSP1_HAS_SRU
Index: media_tree/drivers/media/platform/vsp1/vsp1_regs.h
===
--- media_tree.orig/drivers/media/platform/vsp1/vsp1_regs.h
+++ media_tree/drivers/media/platform/vsp1/vsp1_regs.h
@@ -660,6 +660,8 @@
 #define VI6_IP_VERSION_MODEL_VSPR_H2   (0x0a << 8)
 #define VI6_IP_VERSION_MODEL_VSPD_GEN2 (0x0b << 8)
 #define VI6_IP_VERSION_MODEL_VSPS_M2   (0x0c << 8)
+#define VI6_IP_VERSION_MODEL_VSPS_V2H  (0x12 << 8)
+#define VI6_IP_VERSION_MODEL_VSPD_V2H  (0x13 << 8)
 #define VI6_IP_VERSION_MODEL_VSPI_GEN3 (0x14 << 8)
 #define VI6_IP_VERSION_MODEL_VSPBD_GEN3(0x15 << 8)
 #define VI6_IP_VERSION_MODEL_VSPBC_GEN3(0x16 << 8)

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder

2016-08-19 Thread Martin Blumenstingl
From: Neil Armstrong 

Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
REG1 to configure the decoder mode. This makes it necessary to
introduce new bindings so the driver knows which register has to be
used.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
---
 drivers/media/rc/meson-ir.c | 29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index fcc3b82..003fff0 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -24,6 +24,7 @@
 
 #define DRIVER_NAME"meson-ir"
 
+/* valid on all Meson platforms */
 #define IR_DEC_LDR_ACTIVE  0x00
 #define IR_DEC_LDR_IDLE0x04
 #define IR_DEC_LDR_REPEAT  0x08
@@ -32,12 +33,21 @@
 #define IR_DEC_FRAME   0x14
 #define IR_DEC_STATUS  0x18
 #define IR_DEC_REG10x1c
+/* only available on Meson 8b and newer */
+#define IR_DEC_REG20x20
 
 #define REG0_RATE_MASK (BIT(11) - 1)
 
-#define REG1_MODE_MASK (BIT(7) | BIT(8))
-#define REG1_MODE_NEC  (0 << 7)
-#define REG1_MODE_GENERAL  (2 << 7)
+#define DECODE_MODE_NEC0x0
+#define DECODE_MODE_RAW0x2
+
+/* Meson 6b uses REG1 to configure the mode */
+#define REG1_MODE_MASK GENMASK(8, 7)
+#define REG1_MODE_SHIFT7
+
+/* Meson 8b / GXBB use REG2 to configure the mode */
+#define REG2_MODE_MASK GENMASK(3, 0)
+#define REG2_MODE_SHIFT0
 
 #define REG1_TIME_IV_SHIFT 16
 #define REG1_TIME_IV_MASK  ((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
@@ -158,8 +168,15 @@ static int meson_ir_probe(struct platform_device *pdev)
/* Reset the decoder */
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
-   /* Set general operation mode */
-   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+
+   /* Set general operation mode (= raw/software decoding) */
+   if (of_device_is_compatible(node, "amlogic,meson6-ir"))
+   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK,
+ DECODE_MODE_RAW << REG1_MODE_SHIFT);
+   else
+   meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK,
+ DECODE_MODE_RAW << REG2_MODE_SHIFT);
+
/* Set rate */
meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
/* IRQ on rising and falling edges */
@@ -197,6 +214,8 @@ static int meson_ir_remove(struct platform_device *pdev)
 
 static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson6-ir" },
+   { .compatible = "amlogic,meson8b-ir" },
+   { .compatible = "amlogic,meson-gxbb-ir" },
{ },
 };
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder

2016-08-19 Thread Martin Blumenstingl
From: Neil Armstrong 

This adds the Infrared Remote Controller node so boards with an IR
remote can simply enable it.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 72df302..7070719 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -226,6 +226,13 @@
clocks = <>;
status = "disabled";
};
+
+   ir: ir@580 {
+   compatible = "amlogic,meson-gxbb-ir";
+   reg = <0x0 0x00580 0x0 0x40>;
+   interrupts = ;
+   status = "disabled";
+   };
};
 
periphs: periphs@c8834000 {
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings

2016-08-19 Thread Martin Blumenstingl
From: Neil Armstrong 

New bindings are needed as the register layout on the newer platforms
is slightly different compared to Meson6b.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/media/meson-ir.txt | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt 
b/Documentation/devicetree/bindings/media/meson-ir.txt
index 407848e..e7e3f3c 100644
--- a/Documentation/devicetree/bindings/media/meson-ir.txt
+++ b/Documentation/devicetree/bindings/media/meson-ir.txt
@@ -1,7 +1,10 @@
 * Amlogic Meson IR remote control receiver
 
 Required properties:
- - compatible  : should be "amlogic,meson6-ir"
+ - compatible  : depending on the platform this should be one of:
+ - "amlogic,meson6-ir"
+ - "amlogic,meson8b-ir"
+ - "amlogic,meson-gxbb-ir"
  - reg : physical base address and length of the device registers
  - interrupts  : a single specifier for the interrupt from the device
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 2/6] ARM64: dts: amlogic: add the pin for the IR remote

2016-08-19 Thread Martin Blumenstingl
Signed-off-by: Martin Blumenstingl 
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 4f42316..72df302 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -210,6 +210,13 @@
function = "uart_ao";
};
};
+
+   ir_in_ao_pins: ir_in_ao {
+   mux {
+   groups = "ir_in_ao";
+   function = "ir_in_ao";
+   };
+   };
};
 
uart_AO: serial@4c0 {
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards

2016-08-19 Thread Martin Blumenstingl
Enable the Infrared Remote Controller on boards which have an Infrared
receiver.

Signed-off-by: Martin Blumenstingl 
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts  | 6 ++
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 ++
 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 ++
 3 files changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index cba3ea1..9900b87 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -161,3 +161,9 @@
vmmc-supply = <>;
vmmcq-sumpply = <>;
 };
+
+ {
+   status = "okay";
+   pinctrl-0 = <_in_ao_pins>;
+   pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index e118754..dc007fe 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -143,3 +143,9 @@
vmmc-supply = <_3v3>;
vmmcq-sumpply = <_boot>;
 };
+
+ {
+   status = "okay";
+   pinctrl-0 = <_in_ao_pins>;
+   pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 54bb7c7..45cd3ae 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -60,3 +60,9 @@
pinctrl-names = "default";
 
 };
+
+ {
+   status = "okay";
+   pinctrl-0 = <_in_ao_pins>;
+   pinctrl-names = "default";
+};
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Mauro Carvalho Chehab
Em Fri, 19 Aug 2016 17:40:38 -0300
Mauro Carvalho Chehab  escreveu:

> Em Fri, 19 Aug 2016 17:52:07 +0200
> Markus Heiser  escreveu:
> 

> > After said this, what is your suggestion? For me its all equal, these 
> > are only my 2cent to this discussion :-)

Forgot to mention, but I noticed that, sometimes, the building system
doesn't get the cross-references right, and produces a PDF file
(or an HTML file) with no TOC tables. The output files are still
generated.

I didn't try to track the root case.

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Mauro Carvalho Chehab
Em Fri, 19 Aug 2016 17:52:07 +0200
Markus Heiser  escreveu:

> Am 19.08.2016 um 14:49 schrieb Jani Nikula :
> 
> > On Fri, 19 Aug 2016, Markus Heiser  wrote:  
> >> Am 19.08.2016 um 00:35 schrieb Jonathan Corbet :
> >> * the pdf goes to the "latex" folder .. since this is WIP
> >>  and there are different solutions conceivable ... I left
> >>  it open for the first.  
> > 
> > Mea culpa. As I said, I intended my patches as RFC only.  
> 
> I think this is OK for the first. I thought that we first
> let finish Mauro's task on making the media PDF and after
> this we decide how move from the latex folder to a pdf folder
> (one solution see below).

Most of the work is done: the uAPI book. The other books don't use much
tables. So, I guess it should be easier to fix them. I'll look on
the other media books next week.

> 
> >>> I'm not sure that we actually need the format-specific subfolders, but we
> >>> should be consistent across all the formats and in the documentation and,
> >>> as of this patch, we're not.  
> >> 
> >> IMHO a structure where only non-HTML formats are placed in subfolders
> >> (described above) is the better choice.
> >> 
> >> In the long run I like to get rid of all the intermediate formats
> >> (latex, .doctrees) and build a clear output-folder (with all formats
> >> in) which could be copied 1:1 to a static HTTP-server.  
> > 
> > When I added the Documentation/output subfolder, my main intention was
> > to separate the source documents from everything that is generated,
> > intermediate or final. I suggest you keep the generated files somewhere
> > under output. This'll be handly also when ensuring O= works.  
> 
> Yes, everything is under output / tested O=..
> 
> > I set up the format specific subfolders, because I thought people would
> > want to keep them separated and independent. For me, all the formats
> > were equal and at the same level in that regard. You're suggesting to
> > make html the root of everything?  
> 
> Yes this was my intention. With some additional work, we can build a 
> root index.html where the other formats are linked. Since other
> formats *below* index.html, everything is *reachable* from the root
> index.html.
> 
> Am 19.08.2016 um 15:32 schrieb Mauro Carvalho Chehab :
> > 
> > Agreed. it should either use subfolders or not.
> > 
> > IMHO, the best would be to just output everything at 
> > Documentation/output, if this is possible. That "fixes" the issue
> > of generating PDF files at the latex dir, with sounds weird, IMHO.  
> 
> Changing the latex/pdf issue should be  just a two-liner (not yet tested).
> 
> @@ -71,8 +71,8 @@ ifeq ($(HAVE_PDFLATEX),0)
>   $(warning The 'xelatex' command was not found. Make sure you have it 
> installed and in PATH to produce PDF output.)
>   @echo "  SKIPSphinx $@ target."
>  else # HAVE_PDFLATEX
> - @$(call loop_cmd,sphinx,latex,.,latex,.)
> - $(Q)$(MAKE) PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C 
> $(BUILDDIR)/latex
> + @$(call loop_cmd,sphinx,latex,.,pdf,.)
> + $(Q)$(MAKE) PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C 
> $(BUILDDIR)/pdf
>  endif # HAVE_PDFLATEX

True, but I would still prefer to place everything at $(BUILDDIR), but this
is just my personal preference. Not really against per-format subdir.

> 
> 
> > I guess I mention on a previous e-mail, but SPHINXDIRS= is not working
> > for PDF files generation.  
> 
> Not yet, there is a concurrency question to answer, should sub-folder's 
> PDFs defined in the main conf.py-file or in the sub-folder conf.py?
> 
> I suggest the last one, or in other words: the PDF content of a target
> should have the same content as the HTML target even if it is a subfolder
> or the whole documentation. But this is only possible if we know, that
> all media content can be integrated in the big PDF file.

It can. However, in practice, experienced developers use only the
uAPI book most of the time. So, splitting the media documentation
on 4 books IMHO makes sense.

Yet, the all-in-one media book has only ~3MB. Not big.
https://mchehab.fedorapeople.org/media.pdf
>
> After said this, what is your suggestion? For me its all equal, these 
> are only my 2cent to this discussion :-)
>  
> -- Markus --
> 
> > 
> > Thanks,
> > Mauro  



Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] [media] docs-rst: Convert LIRC uAPI to use C function references

2016-08-19 Thread Mauro Carvalho Chehab
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

While here, improve the documentation to make them to look more
like the rest of the document.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/rc/lirc-get-features.rst |  6 ++
 Documentation/media/uapi/rc/lirc-get-length.rst   |  6 ++
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst | 11 ++-
 Documentation/media/uapi/rc/lirc-get-rec-resolution.rst   |  6 ++
 Documentation/media/uapi/rc/lirc-get-send-mode.rst|  9 +
 Documentation/media/uapi/rc/lirc-get-timeout.rst  |  9 +
 Documentation/media/uapi/rc/lirc-read.rst |  5 -
 Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst |  6 ++
 Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst|  6 ++
 Documentation/media/uapi/rc/lirc-set-rec-carrier.rst  |  6 ++
 Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst  |  6 ++
 Documentation/media/uapi/rc/lirc-set-rec-timeout.rst  |  6 ++
 Documentation/media/uapi/rc/lirc-set-send-carrier.rst |  6 ++
 Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst  |  6 ++
 Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst |  6 ++
 Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst|  6 ++
 Documentation/media/uapi/rc/lirc-write.rst|  6 --
 17 files changed, 48 insertions(+), 64 deletions(-)

diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst 
b/Documentation/media/uapi/rc/lirc-get-features.rst
index d0c8a426aa16..79e07b4d44d6 100644
--- a/Documentation/media/uapi/rc/lirc-get-features.rst
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -14,7 +14,8 @@ LIRC_GET_FEATURES - Get the underlying hardware device's 
features
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, __u32 *features)
+.. c:function:: int ioctl( int fd, LIRC_GET_FEATURES, __u32 *features)
+:name: LIRC_GET_FEATURES
 
 Arguments
 =
@@ -22,9 +23,6 @@ Arguments
 ``fd``
 File descriptor returned by open().
 
-``request``
-LIRC_GET_FEATURES
-
 ``features``
 Bitmask with the LIRC features.
 
diff --git a/Documentation/media/uapi/rc/lirc-get-length.rst 
b/Documentation/media/uapi/rc/lirc-get-length.rst
index 44c6e8923b40..8c2747c8d2c9 100644
--- a/Documentation/media/uapi/rc/lirc-get-length.rst
+++ b/Documentation/media/uapi/rc/lirc-get-length.rst
@@ -14,7 +14,8 @@ LIRC_GET_LENGTH - Retrieves the code length in bits.
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, __u32 *length )
+.. c:function:: int ioctl( int fd, LIRC_GET_LENGTH, __u32 *length )
+:name: LIRC_GET_LENGTH
 
 Arguments
 =
@@ -22,9 +23,6 @@ Arguments
 ``fd``
 File descriptor returned by open().
 
-``request``
-LIRC_GET_LENGTH
-
 ``length``
 length, in bits
 
diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst 
b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
index 445c618771f4..a5023e0194c1 100644
--- a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
+++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
@@ -10,12 +10,16 @@ ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
 Name
 
 
-LIRC_GET_REC_MODE/LIRC_GET_REC_MODE - Get/set supported receive modes.
+LIRC_GET_REC_MODE/LIRC_SET_REC_MODE - Get/set supported receive modes.
 
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, __u32 rx_modes)
+.. c:function:: int ioctl( int fd, LIRC_GET_REC_MODE, __u32 rx_modes)
+   :name: LIRC_GET_REC_MODE
+
+.. c:function:: int ioctl( int fd, LIRC_SET_REC_MODE, __u32 rx_modes)
+   :name: LIRC_SET_REC_MODE
 
 Arguments
 =
@@ -23,9 +27,6 @@ Arguments
 ``fd``
 File descriptor returned by open().
 
-``request``
-LIRC_GET_REC_MODE or LIRC_GET_REC_MODE
-
 ``rx_modes``
 Bitmask with the supported transmit modes.
 
diff --git a/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst 
b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
index 3ac3a8199c29..6e016edc2bc4 100644
--- a/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
+++ b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
@@ -14,7 +14,8 @@ LIRC_GET_REC_RESOLUTION - Obtain the value of receive 
resolution, in microsecond
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, __u32 *microseconds)
+.. c:function:: int ioctl( int fd, LIRC_GET_REC_RESOLUTION, __u32 
*microseconds)
+:name: LIRC_GET_REC_RESOLUTION
 
 Arguments
 =
@@ -22,9 +23,6 @@ Arguments
 ``fd``
 File descriptor returned by open().
 
-``request``
-LIRC_GET_REC_RESOLUTION
-
 ``microseconds``
 Resolution, in microseconds.
 
diff --git a/Documentation/media/uapi/rc/lirc-get-send-mode.rst 

[PATCH 2/6] [media] docs-rst: Convert V4L2 uAPI to use C function references

2016-08-19 Thread Mauro Carvalho Chehab
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/func-close.rst |  2 +-
 Documentation/media/uapi/v4l/func-ioctl.rst |  2 +-
 Documentation/media/uapi/v4l/func-mmap.rst  |  2 +-
 Documentation/media/uapi/v4l/func-munmap.rst|  2 +-
 Documentation/media/uapi/v4l/func-open.rst  |  2 +-
 Documentation/media/uapi/v4l/func-poll.rst  |  2 +-
 Documentation/media/uapi/v4l/func-read.rst  |  6 --
 Documentation/media/uapi/v4l/func-select.rst| 16 +++-
 Documentation/media/uapi/v4l/func-write.rst |  6 --
 Documentation/media/uapi/v4l/vidioc-create-bufs.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-cropcap.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 +++
 Documentation/media/uapi/v4l/vidioc-dqevent.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst  |  9 +
 Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst |  9 +
 Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst |  9 +
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst|  6 ++
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst   |  6 ++
 Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-enumaudio.rst   |  6 ++
 Documentation/media/uapi/v4l/vidioc-enumaudioout.rst|  6 ++
 Documentation/media/uapi/v4l/vidioc-enuminput.rst   |  6 ++
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst  |  6 ++
 Documentation/media/uapi/v4l/vidioc-enumstd.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-expbuf.rst  |  6 ++
 Documentation/media/uapi/v4l/vidioc-g-audio.rst |  9 -
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-g-crop.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst  |  9 +
 Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst| 16 +++-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst  | 17 -
 Documentation/media/uapi/v4l/vidioc-g-enc-index.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst | 15 ++-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst   | 11 +++
 Documentation/media/uapi/v4l/vidioc-g-frequency.rst |  9 -
 Documentation/media/uapi/v4l/vidioc-g-input.rst |  9 +
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-g-modulator.rst |  9 -
 Documentation/media/uapi/v4l/vidioc-g-output.rst|  9 +
 Documentation/media/uapi/v4l/vidioc-g-parm.rst  |  9 +
 Documentation/media/uapi/v4l/vidioc-g-priority.rst  |  9 -
 Documentation/media/uapi/v4l/vidioc-g-selection.rst |  7 ++-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst  |  6 ++
 Documentation/media/uapi/v4l/vidioc-g-std.rst   |  9 -
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst |  9 -
 Documentation/media/uapi/v4l/vidioc-log-status.rst  |  5 -
 Documentation/media/uapi/v4l/vidioc-overlay.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-prepare-buf.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-qbuf.rst|  9 +
 .../media/uapi/v4l/vidioc-query-dv-timings.rst  |  9 +
 Documentation/media/uapi/v4l/vidioc-querybuf.rst|  6 ++
 Documentation/media/uapi/v4l/vidioc-querycap.rst|  6 ++
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst   | 12 ++--
 Documentation/media/uapi/v4l/vidioc-querystd.rst|  6 ++
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst  |  6 ++
 Documentation/media/uapi/v4l/vidioc-streamon.rst|  9 +
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst  |  6 ++
 .../media/uapi/v4l/vidioc-subdev-enum-frame-size.rst|  6 ++
 .../media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst |  6 ++
 Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst   |  9 -
 Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst|  9 +
 .../media/uapi/v4l/vidioc-subdev-g-frame-interval.rst   | 10 +-
 

[PATCH 1/6] [media] docs-next: stop abusing on the cpp domain

2016-08-19 Thread Mauro Carvalho Chehab
Now that we have an override for the c domain that will do
the right thing for the Kernel, stop abusing on the cpp
domain.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py| 33 +++---
 Documentation/media/kapi/dtv-core.rst  |  2 +-
 Documentation/media/kapi/v4l2-dev.rst  |  4 +--
 Documentation/media/kapi/v4l2-fh.rst   |  4 +--
 Documentation/media/kapi/v4l2-subdev.rst   |  2 +-
 Documentation/media/uapi/cec/cec-func-close.rst|  2 +-
 Documentation/media/uapi/cec/cec-func-ioctl.rst|  2 +-
 Documentation/media/uapi/cec/cec-func-open.rst |  2 +-
 Documentation/media/uapi/cec/cec-func-poll.rst |  2 +-
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |  2 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|  2 +-
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst|  2 +-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst|  2 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |  2 +-
 .../uapi/dvb/audio-bilingual-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-clear-buffer.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-continue.rst|  2 +-
 Documentation/media/uapi/dvb/audio-fclose.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-fopen.rst   |  2 +-
 Documentation/media/uapi/dvb/audio-fwrite.rst  |  2 +-
 .../media/uapi/dvb/audio-get-capabilities.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-get-pts.rst |  2 +-
 Documentation/media/uapi/dvb/audio-get-status.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-pause.rst   |  2 +-
 Documentation/media/uapi/dvb/audio-play.rst|  2 +-
 .../media/uapi/dvb/audio-select-source.rst |  2 +-
 .../media/uapi/dvb/audio-set-attributes.rst|  2 +-
 Documentation/media/uapi/dvb/audio-set-av-sync.rst |  2 +-
 .../media/uapi/dvb/audio-set-bypass-mode.rst   |  2 +-
 Documentation/media/uapi/dvb/audio-set-ext-id.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-set-id.rst  |  2 +-
 Documentation/media/uapi/dvb/audio-set-karaoke.rst |  2 +-
 Documentation/media/uapi/dvb/audio-set-mixer.rst   |  2 +-
 Documentation/media/uapi/dvb/audio-set-mute.rst|  2 +-
 .../media/uapi/dvb/audio-set-streamtype.rst|  2 +-
 Documentation/media/uapi/dvb/audio-stop.rst|  2 +-
 Documentation/media/uapi/dvb/ca-fclose.rst |  2 +-
 Documentation/media/uapi/dvb/ca-fopen.rst  |  2 +-
 Documentation/media/uapi/dvb/ca-get-cap.rst|  2 +-
 Documentation/media/uapi/dvb/ca-get-descr-info.rst |  2 +-
 Documentation/media/uapi/dvb/ca-get-msg.rst|  2 +-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  |  2 +-
 Documentation/media/uapi/dvb/ca-reset.rst  |  2 +-
 Documentation/media/uapi/dvb/ca-send-msg.rst   |  2 +-
 Documentation/media/uapi/dvb/ca-set-descr.rst  |  2 +-
 Documentation/media/uapi/dvb/ca-set-pid.rst|  2 +-
 Documentation/media/uapi/dvb/dmx-add-pid.rst   |  2 +-
 Documentation/media/uapi/dvb/dmx-fclose.rst|  2 +-
 Documentation/media/uapi/dvb/dmx-fopen.rst |  2 +-
 Documentation/media/uapi/dvb/dmx-fread.rst |  2 +-
 Documentation/media/uapi/dvb/dmx-fwrite.rst|  2 +-
 Documentation/media/uapi/dvb/dmx-get-caps.rst  |  2 +-
 Documentation/media/uapi/dvb/dmx-get-event.rst |  2 +-
 Documentation/media/uapi/dvb/dmx-get-pes-pids.rst  |  2 +-
 Documentation/media/uapi/dvb/dmx-get-stc.rst   |  2 +-
 Documentation/media/uapi/dvb/dmx-remove-pid.rst|  2 +-
 .../media/uapi/dvb/dmx-set-buffer-size.rst |  2 +-
 Documentation/media/uapi/dvb/dmx-set-filter.rst|  2 +-
 .../media/uapi/dvb/dmx-set-pes-filter.rst  |  2 +-
 Documentation/media/uapi/dvb/dmx-set-source.rst|  2 +-
 Documentation/media/uapi/dvb/dmx-start.rst |  2 +-
 Documentation/media/uapi/dvb/dmx-stop.rst  |  2 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  2 +-
 .../media/uapi/dvb/fe-diseqc-reset-overload.rst|  2 +-
 .../media/uapi/dvb/fe-diseqc-send-burst.rst|  2 +-
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |  2 +-
 .../uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst|  2 +-
 .../media/uapi/dvb/fe-enable-high-lnb-voltage.rst  |  2 +-
 Documentation/media/uapi/dvb/fe-get-event.rst  |  2 +-
 Documentation/media/uapi/dvb/fe-get-frontend.rst   |  2 +-
 Documentation/media/uapi/dvb/fe-get-info.rst   |  2 +-
 Documentation/media/uapi/dvb/fe-get-property.rst   |  2 +-
 Documentation/media/uapi/dvb/fe-read-ber.rst   |  2 +-
 .../media/uapi/dvb/fe-read-signal-strength.rst |  2 +-
 Documentation/media/uapi/dvb/fe-read-snr.rst   |  2 +-
 Documentation/media/uapi/dvb/fe-read-status.rst|  2 +-
 .../media/uapi/dvb/fe-read-uncorrected-blocks.rst  |  2 +-
 .../media/uapi/dvb/fe-set-frontend-tune-mode.rst   |  2 +-
 

[PATCH 4/6] [media] docs-rst: Convert CEC uAPI to use C function references

2016-08-19 Thread Mauro Carvalho Chehab
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

While here, improve the documentation to make them to look more
like the rest of the document.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-close.rst   |  3 ++-
 Documentation/media/uapi/cec/cec-func-ioctl.rst   |  5 +++--
 Documentation/media/uapi/cec/cec-func-open.rst|  1 +
 Documentation/media/uapi/cec/cec-func-poll.rst| 10 ++
 Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst  |  6 ++
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 12 ++--
 Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst | 13 +++--
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst  |  7 ++-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst   | 13 +++--
 Documentation/media/uapi/cec/cec-ioc-receive.rst  | 13 +++--
 10 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-close.rst 
b/Documentation/media/uapi/cec/cec-func-close.rst
index c763496b243f..8267c31b317d 100644
--- a/Documentation/media/uapi/cec/cec-func-close.rst
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -21,12 +21,13 @@ Synopsis
 
 
 .. c:function:: int close( int fd )
+:name: cec-close
 
 Arguments
 =
 
 ``fd``
-File descriptor returned by :ref:`open() `.
+File descriptor returned by :c:func:`open() `.
 
 
 Description
diff --git a/Documentation/media/uapi/cec/cec-func-ioctl.rst 
b/Documentation/media/uapi/cec/cec-func-ioctl.rst
index 116132b19515..9e8dbb118d6a 100644
--- a/Documentation/media/uapi/cec/cec-func-ioctl.rst
+++ b/Documentation/media/uapi/cec/cec-func-ioctl.rst
@@ -20,16 +20,17 @@ Synopsis
 
 
 .. c:function:: int ioctl( int fd, int request, void *argp )
+   :name: cec-ioctl
 
 Arguments
 =
 
 ``fd``
-File descriptor returned by :ref:`open() `.
+File descriptor returned by :c:func:`open() `.
 
 ``request``
 CEC ioctl request code as defined in the cec.h header file, for
-example :ref:`CEC_ADAP_G_CAPS`.
+example :c:func:`CEC_ADAP_G_CAPS`.
 
 ``argp``
 Pointer to a request-specific structure.
diff --git a/Documentation/media/uapi/cec/cec-func-open.rst 
b/Documentation/media/uapi/cec/cec-func-open.rst
index 33e5b5379fa3..af3f5b5c24c6 100644
--- a/Documentation/media/uapi/cec/cec-func-open.rst
+++ b/Documentation/media/uapi/cec/cec-func-open.rst
@@ -20,6 +20,7 @@ Synopsis
 
 
 .. c:function:: int open( const char *device_name, int flags )
+   :name: cec-open
 
 
 Arguments
diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst 
b/Documentation/media/uapi/cec/cec-func-poll.rst
index a5225185f98c..5bacb7c6f33b 100644
--- a/Documentation/media/uapi/cec/cec-func-poll.rst
+++ b/Documentation/media/uapi/cec/cec-func-poll.rst
@@ -21,10 +21,20 @@ Synopsis
 
 
 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
+   :name: cec-poll
 
 Arguments
 =
 
+``ufds``
+   List of FD events to be watched
+
+``nfds``
+   Number of FD efents at the \*ufds array
+
+``timeout``
+   Timeout to wait for events
+
 
 Description
 ===
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
index cc68e0dcea7e..14d7f6a19455 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
@@ -14,7 +14,8 @@ CEC_ADAP_G_CAPS - Query device capabilities
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, struct cec_caps *argp )
+.. c:function:: int ioctl( int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp )
+:name: CEC_ADAP_G_CAPS
 
 Arguments
 =
@@ -22,9 +23,6 @@ Arguments
 ``fd``
 File descriptor returned by :ref:`open() `.
 
-``request``
-CEC_ADAP_G_CAPS
-
 ``argp``
 
 
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index 9de2a005f6fb..1a920109072c 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -17,20 +17,20 @@ CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS - Get or set the 
logical addresses
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, struct cec_log_addrs *argp )
+.. c:function:: int ioctl( int fd, CEC_ADAP_G_LOG_ADDRS, struct cec_log_addrs 
*argp )
+   :name: CEC_ADAP_G_LOG_ADDRS
 
+.. c:function:: int ioctl( int fd, CEC_ADAP_S_LOG_ADDRS, struct cec_log_addrs 
*argp )
+   :name: CEC_ADAP_S_LOG_ADDRS
 
 Arguments
 =
 
 ``fd``
-File descriptor returned by :ref:`open() `.
-
-``request``
-CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS
+File descriptor returned by :c:func:`open() `.
 
 ``argp``
-
+

[PATCH 3/6] [media] docs-rst: Convert DVB uAPI to use C function references

2016-08-19 Thread Mauro Carvalho Chehab
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

While here, improve the documentation, marking the deprecated
ioctls, and making the non-deprecated ones more like the rest
of the media book.

Also, add a notice for ioctls that still require documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../uapi/dvb/audio-bilingual-channel-select.rst| 15 ++
 .../media/uapi/dvb/audio-channel-select.rst| 14 ++
 .../media/uapi/dvb/audio-clear-buffer.rst  | 12 ++---
 Documentation/media/uapi/dvb/audio-continue.rst| 11 ++---
 Documentation/media/uapi/dvb/audio-fclose.rst  |  4 +-
 Documentation/media/uapi/dvb/audio-fopen.rst   |  4 +-
 Documentation/media/uapi/dvb/audio-fwrite.rst  |  2 +
 .../media/uapi/dvb/audio-get-capabilities.rst  | 14 ++
 Documentation/media/uapi/dvb/audio-get-pts.rst | 14 ++
 Documentation/media/uapi/dvb/audio-get-status.rst  | 14 ++
 Documentation/media/uapi/dvb/audio-pause.rst   | 11 ++---
 Documentation/media/uapi/dvb/audio-play.rst| 11 ++---
 .../media/uapi/dvb/audio-select-source.rst | 14 ++
 .../media/uapi/dvb/audio-set-attributes.rst| 16 +++
 Documentation/media/uapi/dvb/audio-set-av-sync.rst | 24 +++---
 .../media/uapi/dvb/audio-set-bypass-mode.rst   | 25 +++---
 Documentation/media/uapi/dvb/audio-set-ext-id.rst  | 15 ++
 Documentation/media/uapi/dvb/audio-set-id.rst  | 15 ++
 Documentation/media/uapi/dvb/audio-set-karaoke.rst | 14 ++
 Documentation/media/uapi/dvb/audio-set-mixer.rst   | 15 ++
 Documentation/media/uapi/dvb/audio-set-mute.rst| 24 +++---
 .../media/uapi/dvb/audio-set-streamtype.rst| 14 ++
 Documentation/media/uapi/dvb/audio-stop.rst| 11 ++---
 Documentation/media/uapi/dvb/ca-fclose.rst | 18 ++--
 Documentation/media/uapi/dvb/ca-fopen.rst  | 53 --
 Documentation/media/uapi/dvb/ca-get-cap.rst| 30 +++-
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 31 +++--
 Documentation/media/uapi/dvb/ca-get-msg.rst| 30 +++-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  | 30 +++-
 Documentation/media/uapi/dvb/ca-reset.rst  | 24 ++
 Documentation/media/uapi/dvb/ca-send-msg.rst   | 30 +++-
 Documentation/media/uapi/dvb/ca-set-descr.rst  | 30 +++-
 Documentation/media/uapi/dvb/ca-set-pid.rst| 30 +++-
 Documentation/media/uapi/dvb/dmx-add-pid.rst   | 28 +++-
 Documentation/media/uapi/dvb/dmx-fclose.rst| 14 ++
 Documentation/media/uapi/dvb/dmx-fopen.rst | 47 ---
 Documentation/media/uapi/dvb/dmx-fread.rst | 29 +++-
 Documentation/media/uapi/dvb/dmx-fwrite.rst| 30 +++-
 Documentation/media/uapi/dvb/dmx-get-caps.rst  | 31 +++--
 Documentation/media/uapi/dvb/dmx-get-event.rst | 28 +++-
 Documentation/media/uapi/dvb/dmx-get-pes-pids.rst  | 31 +++--
 Documentation/media/uapi/dvb/dmx-get-stc.rst   | 31 +++--
 Documentation/media/uapi/dvb/dmx-remove-pid.rst| 28 +++-
 .../media/uapi/dvb/dmx-set-buffer-size.rst | 29 +++-
 Documentation/media/uapi/dvb/dmx-set-filter.rst| 28 +++-
 .../media/uapi/dvb/dmx-set-pes-filter.rst  | 27 +++
 Documentation/media/uapi/dvb/dmx-set-source.rst| 29 +++-
 Documentation/media/uapi/dvb/dmx-start.rst | 22 ++---
 Documentation/media/uapi/dvb/dmx-stop.rst  | 22 ++---
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  6 +--
 .../media/uapi/dvb/fe-diseqc-reset-overload.rst|  7 +--
 .../media/uapi/dvb/fe-diseqc-send-burst.rst|  6 +--
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |  6 +--
 .../uapi/dvb/fe-dishnetwork-send-legacy-cmd.rst| 16 +++
 .../media/uapi/dvb/fe-enable-high-lnb-voltage.rst  |  6 +--
 Documentation/media/uapi/dvb/fe-get-event.rst  | 35 --
 Documentation/media/uapi/dvb/fe-get-frontend.rst   | 30 
 Documentation/media/uapi/dvb/fe-get-info.rst   |  6 +--
 Documentation/media/uapi/dvb/fe-get-property.rst   |  9 ++--
 Documentation/media/uapi/dvb/fe-read-ber.rst   | 30 
 .../media/uapi/dvb/fe-read-signal-strength.rst | 31 +++--
 Documentation/media/uapi/dvb/fe-read-snr.rst   | 29 +++-
 Documentation/media/uapi/dvb/fe-read-status.rst|  6 +--
 .../media/uapi/dvb/fe-read-uncorrected-blocks.rst  | 31 +++--
 .../media/uapi/dvb/fe-set-frontend-tune-mode.rst   |  6 +--
 Documentation/media/uapi/dvb/fe-set-frontend.rst   | 31 -
 Documentation/media/uapi/dvb/fe-set-tone.rst   |  6 +--
 Documentation/media/uapi/dvb/fe-set-voltage.rst|  6 +--
 

[PATCH 0/6] Convert media uAPI to c domain

2016-08-19 Thread Mauro Carvalho Chehab
Those patches make usage of the new c-domain override extension
written by Markus. They allow stopping abusing of the cpp domain to
allow "overriding" the ioctl function, and converts all syscall documentation
at the media uAPI book to c domain.

Mauro Carvalho Chehab (6):
  [media] docs-next: stop abusing on the cpp domain
  [media] docs-rst: Convert V4L2 uAPI to use C function references
  [media] docs-rst: Convert DVB uAPI to use C function references
  [media] docs-rst: Convert CEC uAPI to use C function references
  [media] docs-rst: Convert LIRC uAPI to use C function references
  [media] docs-rst: Convert MC uAPI to use C function references

 Documentation/media/conf_nitpick.py| 33 +++---
 Documentation/media/kapi/dtv-core.rst  |  2 +-
 Documentation/media/kapi/v4l2-dev.rst  |  4 +-
 Documentation/media/kapi/v4l2-fh.rst   |  4 +-
 Documentation/media/kapi/v4l2-subdev.rst   |  2 +-
 Documentation/media/uapi/cec/cec-func-close.rst|  5 +-
 Documentation/media/uapi/cec/cec-func-ioctl.rst|  7 +--
 Documentation/media/uapi/cec/cec-func-open.rst |  3 +-
 Documentation/media/uapi/cec/cec-func-poll.rst | 12 -
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |  6 +--
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst| 12 ++---
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst| 13 +++---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |  7 +--
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst| 13 +++---
 Documentation/media/uapi/cec/cec-ioc-receive.rst   | 13 +++---
 .../uapi/dvb/audio-bilingual-channel-select.rst| 15 ++
 .../media/uapi/dvb/audio-channel-select.rst| 14 ++
 .../media/uapi/dvb/audio-clear-buffer.rst  | 12 ++---
 Documentation/media/uapi/dvb/audio-continue.rst| 11 ++---
 Documentation/media/uapi/dvb/audio-fclose.rst  |  4 +-
 Documentation/media/uapi/dvb/audio-fopen.rst   |  4 +-
 Documentation/media/uapi/dvb/audio-fwrite.rst  |  4 +-
 .../media/uapi/dvb/audio-get-capabilities.rst  | 14 ++
 Documentation/media/uapi/dvb/audio-get-pts.rst | 14 ++
 Documentation/media/uapi/dvb/audio-get-status.rst  | 14 ++
 Documentation/media/uapi/dvb/audio-pause.rst   | 11 ++---
 Documentation/media/uapi/dvb/audio-play.rst| 11 ++---
 .../media/uapi/dvb/audio-select-source.rst | 14 ++
 .../media/uapi/dvb/audio-set-attributes.rst| 16 +++
 Documentation/media/uapi/dvb/audio-set-av-sync.rst | 24 +++---
 .../media/uapi/dvb/audio-set-bypass-mode.rst   | 25 +++---
 Documentation/media/uapi/dvb/audio-set-ext-id.rst  | 15 ++
 Documentation/media/uapi/dvb/audio-set-id.rst  | 15 ++
 Documentation/media/uapi/dvb/audio-set-karaoke.rst | 14 ++
 Documentation/media/uapi/dvb/audio-set-mixer.rst   | 15 ++
 Documentation/media/uapi/dvb/audio-set-mute.rst| 24 +++---
 .../media/uapi/dvb/audio-set-streamtype.rst| 14 ++
 Documentation/media/uapi/dvb/audio-stop.rst| 11 ++---
 Documentation/media/uapi/dvb/ca-fclose.rst | 18 ++--
 Documentation/media/uapi/dvb/ca-fopen.rst  | 53 --
 Documentation/media/uapi/dvb/ca-get-cap.rst| 30 +++-
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 31 +++--
 Documentation/media/uapi/dvb/ca-get-msg.rst| 30 +++-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  | 30 +++-
 Documentation/media/uapi/dvb/ca-reset.rst  | 24 ++
 Documentation/media/uapi/dvb/ca-send-msg.rst   | 30 +++-
 Documentation/media/uapi/dvb/ca-set-descr.rst  | 30 +++-
 Documentation/media/uapi/dvb/ca-set-pid.rst| 30 +++-
 Documentation/media/uapi/dvb/dmx-add-pid.rst   | 28 +++-
 Documentation/media/uapi/dvb/dmx-fclose.rst| 16 ++-
 Documentation/media/uapi/dvb/dmx-fopen.rst | 49 
 Documentation/media/uapi/dvb/dmx-fread.rst | 31 -
 Documentation/media/uapi/dvb/dmx-fwrite.rst| 32 -
 Documentation/media/uapi/dvb/dmx-get-caps.rst  | 31 +++--
 Documentation/media/uapi/dvb/dmx-get-event.rst | 28 +++-
 Documentation/media/uapi/dvb/dmx-get-pes-pids.rst  | 31 +++--
 Documentation/media/uapi/dvb/dmx-get-stc.rst   | 31 +++--
 Documentation/media/uapi/dvb/dmx-remove-pid.rst| 28 +++-
 .../media/uapi/dvb/dmx-set-buffer-size.rst | 29 +++-
 Documentation/media/uapi/dvb/dmx-set-filter.rst| 28 +++-
 .../media/uapi/dvb/dmx-set-pes-filter.rst  | 27 +++
 Documentation/media/uapi/dvb/dmx-set-source.rst| 29 +++-
 Documentation/media/uapi/dvb/dmx-start.rst | 22 ++---
 Documentation/media/uapi/dvb/dmx-stop.rst  | 22 ++---
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  6 +--
 .../media/uapi/dvb/fe-diseqc-reset-overload.rst

[PATCH 6/6] [media] docs-rst: Convert MC uAPI to use C function references

2016-08-19 Thread Mauro Carvalho Chehab
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

While here, improve the documentation to make them to look more
like the rest of the document.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/mediactl/media-func-close.rst| 4 ++--
 Documentation/media/uapi/mediactl/media-func-ioctl.rst| 4 ++--
 Documentation/media/uapi/mediactl/media-func-open.rst | 2 +-
 Documentation/media/uapi/mediactl/media-ioc-device-info.rst   | 6 ++
 Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst | 6 ++
 Documentation/media/uapi/mediactl/media-ioc-enum-links.rst| 6 ++
 Documentation/media/uapi/mediactl/media-ioc-g-topology.rst| 6 ++
 Documentation/media/uapi/mediactl/media-ioc-setup-link.rst| 6 ++
 8 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/Documentation/media/uapi/mediactl/media-func-close.rst 
b/Documentation/media/uapi/mediactl/media-func-close.rst
index c13220c2696e..a8f5203afe4b 100644
--- a/Documentation/media/uapi/mediactl/media-func-close.rst
+++ b/Documentation/media/uapi/mediactl/media-func-close.rst
@@ -21,13 +21,13 @@ Synopsis
 
 
 .. c:function:: int close( int fd )
-
+:name: mc-close
 
 Arguments
 =
 
 ``fd``
-File descriptor returned by :ref:`open() `.
+File descriptor returned by :c:func:`open() `.
 
 
 Description
diff --git a/Documentation/media/uapi/mediactl/media-func-ioctl.rst 
b/Documentation/media/uapi/mediactl/media-func-ioctl.rst
index 6fa0a8e65af5..fe072b7c8765 100644
--- a/Documentation/media/uapi/mediactl/media-func-ioctl.rst
+++ b/Documentation/media/uapi/mediactl/media-func-ioctl.rst
@@ -21,13 +21,13 @@ Synopsis
 
 
 .. c:function:: int ioctl( int fd, int request, void *argp )
-
+:name: mc-ioctl
 
 Arguments
 =
 
 ``fd``
-File descriptor returned by :ref:`open() `.
+File descriptor returned by :c:func:`open() `.
 
 ``request``
 Media ioctl request code as defined in the media.h header file, for
diff --git a/Documentation/media/uapi/mediactl/media-func-open.rst 
b/Documentation/media/uapi/mediactl/media-func-open.rst
index aa77ba32db21..32f53016a9e5 100644
--- a/Documentation/media/uapi/mediactl/media-func-open.rst
+++ b/Documentation/media/uapi/mediactl/media-func-open.rst
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: int open( const char *device_name, int flags )
-
+:name: mc-open
 
 Arguments
 =
diff --git a/Documentation/media/uapi/mediactl/media-ioc-device-info.rst 
b/Documentation/media/uapi/mediactl/media-ioc-device-info.rst
index e8c97abed394..412014110570 100644
--- a/Documentation/media/uapi/mediactl/media-ioc-device-info.rst
+++ b/Documentation/media/uapi/mediactl/media-ioc-device-info.rst
@@ -15,7 +15,8 @@ MEDIA_IOC_DEVICE_INFO - Query device information
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, struct media_device_info *argp 
)
+.. c:function:: int ioctl( int fd, MEDIA_IOC_DEVICE_INFO, struct 
media_device_info *argp )
+:name: MEDIA_IOC_DEVICE_INFO
 
 
 Arguments
@@ -24,9 +25,6 @@ Arguments
 ``fd``
 File descriptor returned by :ref:`open() `.
 
-``request``
-MEDIA_IOC_DEVICE_INFO
-
 ``argp``
 
 
diff --git a/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst 
b/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst
index a621b08187ea..628e91aeda97 100644
--- a/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst
+++ b/Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst
@@ -15,7 +15,8 @@ MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their 
properties
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, struct media_entity_desc *argp 
)
+.. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_ENTITIES, struct 
media_entity_desc *argp )
+:name: MEDIA_IOC_ENUM_ENTITIES
 
 
 Arguments
@@ -24,9 +25,6 @@ Arguments
 ``fd``
 File descriptor returned by :ref:`open() `.
 
-``request``
-MEDIA_IOC_ENUM_ENTITIES
-
 ``argp``
 
 
diff --git a/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst 
b/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst
index d07629ba44db..c81765f14b9f 100644
--- a/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst
+++ b/Documentation/media/uapi/mediactl/media-ioc-enum-links.rst
@@ -15,7 +15,8 @@ MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a 
given entity
 Synopsis
 
 
-.. c:function:: int ioctl( int fd, int request, struct media_links_enum *argp )
+.. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_LINKS, struct 
media_links_enum *argp )
+:name: MEDIA_IOC_ENUM_LINKS
 
 
 Arguments
@@ -24,9 +25,6 @@ Arguments
 ``fd``
 File descriptor returned by :ref:`open() `.
 
-``request``
-MEDIA_IOC_ENUM_LINKS
-
 ``argp``
 
 
diff --git a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst 

Re: Linux support for current StarTech analog video capture device (SAA711xx)

2016-08-19 Thread Alexandre-Xavier Labonté-Lamoureux
Hi,

If this is the SVID2USB23 with the id 0xeb1a, 0x5051, then I hope
someone will get it to work, because it will fix my Ion Video 2 PC
which has the same hardware. I wrote a wiki page about it:
https://www.linuxtv.org/wiki/index.php/Ion_Video_2_PC

Best regards to every of you,
Alexandre-Xavier

On Fri, Aug 19, 2016 at 10:01 AM, Devin Heitmueller
 wrote:
> Hi Steve,
>
>> We have two models of the StarTech in use: SVID2USB2 and SVID2USB23.  The 
>> "23" version is the only version currently listed on StarTech's website.  It 
>> is available via Amazon in the USA but I'm not sure about other countries.
>
> Have you actually opened these units up and confirmed what chips are
> inside of them?  Or did you determine it's em28xx/saa711x via a Google
> search.  The reason I ask is many of these devices will quietly change
> their internal design over time, without changing the plastics and/or
> model number.  Hence you cannot simply rely on what somebody else may
> have said in terms of what chips are inside the device you're holding
> in your hand.
>
> First step would probably be to confirm the chips in question.  If
> they really are based on the em2882/saa7115, then it should be pretty
> easy to get working with a minor code change to the driver.
>
> If you're in the US and you're willing to throw it in a USPS flat rate
> box and ship it to me, I can probably have it working in about an
> hour.
>
> Devin
>
> --
> Devin J. Heitmueller - Kernel Labs
> http://www.kernellabs.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] pulse8-cec: serialize communication with adapter

2016-08-19 Thread Johan Fjeldtvedt
Make sending messages to the adapter serialized within the driver.

send_and_wait is split into send_and_wait_once, which only sends once
and checks for the result, and the higher level send_and_wait, which
performs locking and retries.

Signed-off-by: Johan Fjeldtvedt 
---
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 50 ---
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c 
b/drivers/staging/media/pulse8-cec/pulse8-cec.c
index ed8bd95..fdb2407 100644
--- a/drivers/staging/media/pulse8-cec/pulse8-cec.c
+++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c
@@ -99,6 +99,7 @@ struct pulse8 {
unsigned int idx;
bool escape;
bool started;
+   struct mutex write_lock;
 };
 
 static void pulse8_irq_work_handler(struct work_struct *work)
@@ -233,8 +234,8 @@ static int pulse8_send(struct serio *serio, const u8 
*command, u8 cmd_len)
return err;
 }
 
-static int pulse8_send_and_wait(struct pulse8 *pulse8,
-   const u8 *cmd, u8 cmd_len, u8 response, u8 size)
+static int pulse8_send_and_wait_once(struct pulse8 *pulse8,
+const u8 *cmd, u8 cmd_len, u8 response, u8 
size)
 {
int err;
 
@@ -250,24 +251,8 @@ static int pulse8_send_and_wait(struct pulse8 *pulse8,
if ((pulse8->data[0] & 0x3f) == MSGCODE_COMMAND_REJECTED &&
cmd[0] != MSGCODE_SET_CONTROLLED &&
cmd[0] != MSGCODE_SET_AUTO_ENABLED &&
-   cmd[0] != MSGCODE_GET_BUILDDATE) {
-   u8 cmd_sc[2];
-
-   cmd_sc[0] = MSGCODE_SET_CONTROLLED;
-   cmd_sc[1] = 1;
-   err = pulse8_send_and_wait(pulse8, cmd_sc, 2,
-  MSGCODE_COMMAND_ACCEPTED, 1);
-   if (err)
-   return err;
-   init_completion(>cmd_done);
-
-   err = pulse8_send(pulse8->serio, cmd, cmd_len);
-   if (err)
-   return err;
-
-   if (!wait_for_completion_timeout(>cmd_done, HZ))
-   return -ETIMEDOUT;
-   }
+   cmd[0] != MSGCODE_GET_BUILDDATE)
+   return -ENOTTY;
if (response &&
((pulse8->data[0] & 0x3f) != response || pulse8->len < size + 1)) {
dev_info(pulse8->dev, "transmit: failed %02x\n",
@@ -277,6 +262,30 @@ static int pulse8_send_and_wait(struct pulse8 *pulse8,
return 0;
 }
 
+static int pulse8_send_and_wait(struct pulse8 *pulse8,
+   const u8 *cmd, u8 cmd_len, u8 response, u8 size)
+{
+   u8 cmd_sc[2];
+   int err;
+
+   mutex_lock(>write_lock);
+   err = pulse8_send_and_wait_once(pulse8, cmd, cmd_len, response, size);
+
+   if (err == -ENOTTY) {
+   cmd_sc[0] = MSGCODE_SET_CONTROLLED;
+   cmd_sc[1] = 1;
+   err = pulse8_send_and_wait_once(pulse8, cmd_sc, 2,
+   MSGCODE_COMMAND_ACCEPTED, 1);
+   if (err)
+   goto unlock;
+   err = pulse8_send_and_wait_once(pulse8, cmd, cmd_len, response, 
size);
+   }
+
+  unlock:
+   mutex_unlock(>write_lock);
+   return err;
+}
+
 static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio)
 {
u8 *data = pulse8->data + 1;
@@ -453,6 +462,7 @@ static int pulse8_connect(struct serio *serio, struct 
serio_driver *drv)
pulse8->dev = >dev;
serio_set_drvdata(serio, pulse8);
INIT_WORK(>work, pulse8_irq_work_handler);
+   mutex_init(>write_lock);
 
err = serio_open(serio, drv);
if (err)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] pulse8-cec: sync configuration with adapter

2016-08-19 Thread Johan Fjeldtvedt
When the configuration is changed, they are also written to the adapter.
This allows the adapter to continue operating in autonomous mode with
the same settings when it is disconnected from the driver (typically by
going into suspend). For adapters with firmware version 2 or greater, the
settings are also persisted in EEPROM.

A new module parameter is added to optionally also use the configuration
already present in the adapter when it is connected. This option is
enabled by default.

When a new configuration is written, the autonomous mode is
automatically enabled. When the device is unconfigured, autonomous mode
is disabled.

Signed-off-by: Johan Fjeldtvedt 
---
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 259 ++
 1 file changed, 221 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c 
b/drivers/staging/media/pulse8-cec/pulse8-cec.c
index 4d20e72..531377a 100644
--- a/drivers/staging/media/pulse8-cec/pulse8-cec.c
+++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c
@@ -51,8 +51,11 @@ MODULE_DESCRIPTION("Pulse Eight HDMI CEC driver");
 MODULE_LICENSE("GPL");
 
 static int debug;
+static int persistent_config = 1;
 module_param(debug, int, 0644);
+module_param(persistent_config, int, 0644);
 MODULE_PARM_DESC(debug, "debug level (0-1)");
+MODULE_PARM_DESC(persitent_config, "read config from persitent memory (0-1)");
 
 enum pulse8_msgcodes {
MSGCODE_NOTHING = 0,
@@ -109,12 +112,16 @@ enum pulse8_msgcodes {
 
 #define DATA_SIZE 256
 
+#define PING_PERIOD15 * HZ
+
 struct pulse8 {
struct device *dev;
struct serio *serio;
struct cec_adapter *adap;
+   unsigned int vers;
struct completion cmd_done;
struct work_struct work;
+   struct delayed_work ping_eeprom_work;
struct cec_msg rx_msg;
u8 data[DATA_SIZE];
unsigned int len;
@@ -122,9 +129,15 @@ struct pulse8 {
unsigned int idx;
bool escape;
bool started;
+   struct mutex config_lock;
struct mutex write_lock;
+   bool config_pending;
+   bool restoring_config;
+   bool autonomous;
 };
 
+static void pulse8_ping_eeprom_work_handler(struct work_struct *work);
+
 static void pulse8_irq_work_handler(struct work_struct *work)
 {
struct pulse8 *pulse8 =
@@ -229,6 +242,7 @@ static void pulse8_disconnect(struct serio *serio)
struct pulse8 *pulse8 = serio_get_drvdata(serio);
 
cec_unregister_adapter(pulse8->adap);
+   cancel_delayed_work_sync(>ping_eeprom_work);
dev_info(>dev, "disconnected\n");
serio_close(serio);
serio_set_drvdata(serio, NULL);
@@ -309,14 +323,14 @@ static int pulse8_send_and_wait(struct pulse8 *pulse8,
return err;
 }
 
-static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio)
+static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, struct 
cec_log_addrs *log_addrs, u16 *pa)
 {
u8 *data = pulse8->data + 1;
-   unsigned int count = 0;
-   unsigned int vers = 0;
u8 cmd[2];
int err;
 
+   pulse8->vers = 0;
+
cmd[0] = MSGCODE_PING;
err = pulse8_send_and_wait(pulse8, cmd, 1,
   MSGCODE_COMMAND_ACCEPTED, 0);
@@ -326,10 +340,10 @@ static int pulse8_setup(struct pulse8 *pulse8, struct 
serio *serio)
if (err)
return err;
 
-   vers = (data[0] << 8) | data[1];
+   pulse8->vers = (data[0] << 8) | data[1];
 
-   dev_info(pulse8->dev, "Firmware version %04x\n", vers);
-   if (vers < 2)
+   dev_info(pulse8->dev, "Firmware version %04x\n", pulse8->vers);
+   if (pulse8->vers < 2)
return 0;
 
cmd[0] = MSGCODE_GET_BUILDDATE;
@@ -346,37 +360,98 @@ static int pulse8_setup(struct pulse8 *pulse8, struct 
serio *serio)
 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
 tm.tm_hour, tm.tm_min, tm.tm_sec);
}
+   if (err)
+   return err;
 
-   do {
-   if (count)
-   msleep(500);
-   cmd[0] = MSGCODE_SET_AUTO_ENABLED;
-   cmd[1] = 0;
-   err = pulse8_send_and_wait(pulse8, cmd, 2,
-  MSGCODE_COMMAND_ACCEPTED, 1);
-   if (err && count == 0) {
-   dev_info(pulse8->dev, "No Auto Enabled supported\n");
-   return 0;
-   }
+   dev_dbg(pulse8->dev, "Persistent config:\n");
+   cmd[0] = MSGCODE_GET_AUTO_ENABLED;
+   err = pulse8_send_and_wait(pulse8, cmd, 1, cmd[0], 1);
+   if (err)
+   return err;
+   pulse8->autonomous = data[0];
+   dev_dbg(pulse8->dev, "Autonomous mode: %s",
+   data[0] ? "on" : "off");
 
-   cmd[0] = MSGCODE_GET_AUTO_ENABLED;
-   if (!err)
-   err = pulse8_send_and_wait(pulse8, cmd, 1, 

[PATCH 1/4] cec: allow configuration both from within driver and from user space

2016-08-19 Thread Johan Fjeldtvedt
It makes sense for adapters such as the Pulse-Eight to be configurable
both from within the driver and from user space, so remove the
requirement that drivers only can call cec_s_log_addrs or
cec_s_phys_addr if they don't expose those capabilities to user space.

Signed-off-by: Johan Fjeldtvedt 
---
 drivers/staging/media/cec/cec-adap.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index b2393bb..608e3e7 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -1153,8 +1153,6 @@ void cec_s_phys_addr(struct cec_adapter *adap, u16 
phys_addr, bool block)
if (IS_ERR_OR_NULL(adap))
return;
 
-   if (WARN_ON(adap->capabilities & CEC_CAP_PHYS_ADDR))
-   return;
mutex_lock(>lock);
__cec_s_phys_addr(adap, phys_addr, block);
mutex_unlock(>lock);
@@ -1295,8 +1293,6 @@ int cec_s_log_addrs(struct cec_adapter *adap,
 {
int err;
 
-   if (WARN_ON(adap->capabilities & CEC_CAP_LOG_ADDRS))
-   return -EINVAL;
mutex_lock(>lock);
err = __cec_s_log_addrs(adap, log_addrs, block);
mutex_unlock(>lock);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] pulse8-cec: add notes about behavior in autonomous mode

2016-08-19 Thread Johan Fjeldtvedt
The pulse8 dongle has some quirky behaviors when in autonomous mode.
Document these.

Signed-off-by: Johan Fjeldtvedt 
---
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c 
b/drivers/staging/media/pulse8-cec/pulse8-cec.c
index fdb2407..4d20e72 100644
--- a/drivers/staging/media/pulse8-cec/pulse8-cec.c
+++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c
@@ -10,6 +10,29 @@
  * this archive for more details.
  */
 
+/*
+ * Notes:
+ *
+ * - Devices with firmware version < 2 do not store their configuration in
+ *   EEPROM.
+ *
+ * - In autonomous mode, only messages from a TV will be acknowledged, even
+ *   polling messages. Upon receiving a message from a TV, the dongle will
+ *   respond to messages from any logical address.
+ *
+ * - In autonomous mode, the dongle will by default reply Feature Abort
+ *   [Unrecognized Opcode] when it receives Give Device Vendor ID. It will
+ *   however observe vendor ID's reported by other devices and possibly
+ *   alter this behavior. When TV's (and TV's only) report that their vendor ID
+ *   is LG (0x00e091), the dongle will itself reply that it has the same vendor
+ *   ID, and it will respond to at least one vendor specific command.
+ *
+ * - In autonomous mode, the dongle is known to attempt wakeup if it receives
+ *["Power On"], ["Power] or ["Power Toggle"], or if 
it
+ *   receives  with its own physical address. It also does 
this
+ *   if it receives  [0x03 0x00] from an LG TV.
+ */
+
 #include 
 #include 
 #include 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Markus Heiser

Am 19.08.2016 um 14:49 schrieb Jani Nikula :

> On Fri, 19 Aug 2016, Markus Heiser  wrote:
>> Am 19.08.2016 um 00:35 schrieb Jonathan Corbet :
>> * the pdf goes to the "latex" folder .. since this is WIP
>>  and there are different solutions conceivable ... I left
>>  it open for the first.
> 
> Mea culpa. As I said, I intended my patches as RFC only.

I think this is OK for the first. I thought that we first
let finish Mauro's task on making the media PDF and after
this we decide how move from the latex folder to a pdf folder
(one solution see below).

>>> I'm not sure that we actually need the format-specific subfolders, but we
>>> should be consistent across all the formats and in the documentation and,
>>> as of this patch, we're not.
>> 
>> IMHO a structure where only non-HTML formats are placed in subfolders
>> (described above) is the better choice.
>> 
>> In the long run I like to get rid of all the intermediate formats
>> (latex, .doctrees) and build a clear output-folder (with all formats
>> in) which could be copied 1:1 to a static HTTP-server.
> 
> When I added the Documentation/output subfolder, my main intention was
> to separate the source documents from everything that is generated,
> intermediate or final. I suggest you keep the generated files somewhere
> under output. This'll be handly also when ensuring O= works.

Yes, everything is under output / tested O=..

> I set up the format specific subfolders, because I thought people would
> want to keep them separated and independent. For me, all the formats
> were equal and at the same level in that regard. You're suggesting to
> make html the root of everything?

Yes this was my intention. With some additional work, we can build a 
root index.html where the other formats are linked. Since other
formats *below* index.html, everything is *reachable* from the root
index.html.

Am 19.08.2016 um 15:32 schrieb Mauro Carvalho Chehab :
> 
> Agreed. it should either use subfolders or not.
> 
> IMHO, the best would be to just output everything at 
> Documentation/output, if this is possible. That "fixes" the issue
> of generating PDF files at the latex dir, with sounds weird, IMHO.

Changing the latex/pdf issue should be  just a two-liner (not yet tested).

@@ -71,8 +71,8 @@ ifeq ($(HAVE_PDFLATEX),0)
$(warning The 'xelatex' command was not found. Make sure you have it 
installed and in PATH to produce PDF output.)
@echo "  SKIPSphinx $@ target."
 else # HAVE_PDFLATEX
-   @$(call loop_cmd,sphinx,latex,.,latex,.)
-   $(Q)$(MAKE) PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C 
$(BUILDDIR)/latex
+   @$(call loop_cmd,sphinx,latex,.,pdf,.)
+   $(Q)$(MAKE) PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C 
$(BUILDDIR)/pdf
 endif # HAVE_PDFLATEX


> I guess I mention on a previous e-mail, but SPHINXDIRS= is not working
> for PDF files generation.

Not yet, there is a concurrency question to answer, should sub-folder's 
PDFs defined in the main conf.py-file or in the sub-folder conf.py?

I suggest the last one, or in other words: the PDF content of a target
should have the same content as the HTML target even if it is a subfolder
or the whole documentation. But this is only possible if we know, that
all media content can be integrated in the big PDF file.

After said this, what is your suggestion? For me its all equal, these 
are only my 2cent to this discussion :-)
 
-- Markus --

> 
> Thanks,
> Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Sony tuner chip driver questions

2016-08-19 Thread Takiguchi, Yasunari
Dear Mauro

We discuss about
> At the DVB frontend, the tuner and demodulators should be implemented
> on different drivers, even when both are encapsulated on the same silicon.
with our HW developers and SW designers.

Our codes for tuner and demodulator driver of user-space driver are 
encapsulated 
in order to optimize tuner control sequence.
(Our tuner driver often have to set rf tuner registers and demodulator 
alternately. )
And there are some registers which simultaneously set parameter for tuner and 
demodulator block.
Additionally, we think about current TV tuner IC trend and linux tuner driver.

I summarized our study results and proposals as follows.

・In our case the tuner and demodulator are single chip architecture, so the 
tuner control cannot be distinguished from demodulator functionality. It is 
therefore difficult to separate tuner code and demodulator code.
・We understand that single chip solutions may become more popular for 
smartphone and low power tuner device (USB, etc) so mixed driver will be main 
stream.
・We intend to add the driver incorporating tuner and demodulator code to 
/media/dvb-frontend/ ( is our tuner name folder)
・We will create our driver to have same API structure as the current tuner and 
demodulator driver code.
  (drivers/media/dvb-frontends/m88rs2000.c and tda10071.c also seem to have 
tuner and demodulator code.
  We would like to refer to their codes for our creating.)

Could you give us your advice and comments?

Best Regards & Thanks
Takiguchi

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] [media] Fix a few additional tables at uAPI for LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
There are still a few tables with wrong columns at the uAPI
docs. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/fe-get-info.rst| 2 +-
 Documentation/media/uapi/dvb/fe_property_parameters.rst | 5 ++---
 Documentation/media/uapi/v4l/buffer.rst | 2 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst | 2 +-
 Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst | 2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Documentation/media/uapi/dvb/fe-get-info.rst 
b/Documentation/media/uapi/dvb/fe-get-info.rst
index 85973be62b0c..87ff3f62050d 100644
--- a/Documentation/media/uapi/dvb/fe-get-info.rst
+++ b/Documentation/media/uapi/dvb/fe-get-info.rst
@@ -160,7 +160,7 @@ frontend capabilities
 Capabilities describe what a frontend can do. Some capabilities are
 supported only on some specific frontend types.
 
-.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
 
 .. _fe-caps:
 
diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst 
b/Documentation/media/uapi/dvb/fe_property_parameters.rst
index d7acc72ebbdf..304ac1a3c2ff 100644
--- a/Documentation/media/uapi/dvb/fe_property_parameters.rst
+++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst
@@ -1005,10 +1005,9 @@ Possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
12, 13, -1 (AUTO)
 Note: Truth table for ``DTV_ISDBT_SOUND_BROADCASTING`` and
 ``DTV_ISDBT_PARTIAL_RECEPTION`` and ``LAYER[A-C]_SEGMENT_COUNT``
 
-
 .. _isdbt-layer_seg-cnt-table:
 
-.. flat-table::
+.. flat-table:: Truth table for ISDB-T Sound Broadcasting
 :header-rows:  0
 :stub-columns: 0
 
@@ -1101,7 +1100,7 @@ TMCC-structure, as shown in the table below.
 
 .. _isdbt-layer-interleaving-table:
 
-.. flat-table::
+.. flat-table:: ISDB-T time interleaving modes
 :header-rows:  0
 :stub-columns: 0
 
diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 4d315b01c2a4..7bab30b59eae 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -39,7 +39,7 @@ buffer.
 struct v4l2_buffer
 ==
 
-.. tabularcolumns:: |p{1.3cm}|p{2.5cm}|p{1.3cm}|p{12.0cm}|
+.. tabularcolumns:: |p{2.8cm}|p{2.5cm}|p{1.3cm}|p{10.5cm}|
 
 .. cssclass:: longtable
 
diff --git a/Documentation/media/uapi/v4l/pixfmt-003.rst 
b/Documentation/media/uapi/v4l/pixfmt-003.rst
index 4a2dbe1095b1..6ec8ce639764 100644
--- a/Documentation/media/uapi/v4l/pixfmt-003.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-003.rst
@@ -49,7 +49,7 @@ describing all planes of that format.
  applications.
 
 
-.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+.. tabularcolumns:: |p{4.4cm}|p{5.6cm}|p{7.5cm}|
 
 .. _v4l2-pix-format-mplane:
 
diff --git a/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst 
b/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst
index 5b80481d8734..f0d33298f329 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst
@@ -229,7 +229,7 @@ still cause this situation.
  ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set for this control.
 
 
-.. tabularcolumns:: |p{4.0cm}|p{3.0cm}|p{2.0cm}|p{8.5cm}|
+.. tabularcolumns:: |p{4.0cm}|p{2.0cm}|p{2.0cm}|p{8.5cm}|
 
 .. _v4l2-ext-controls:
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] [media] docs-rst: fix warnings introduced by LaTeX patchset

2016-08-19 Thread Mauro Carvalho Chehab
Sphinx is really pedantic with respect to the order where
table tags and references are created. Putting things at
the wrong order causes troubles.

The order that seems to work is:

.. raw:: latex

.. tabularcolumns::

.. _foo_name:

.. cssclass: longtable

.. flat-table::

Reorder the tags to the above order, to avoid troubles, and
fix remaining warnings introduced by media recent patches.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst | 10 +++---
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst| 19 +---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   | 25 ++-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst| 15 -
 Documentation/media/uapi/cec/cec-ioc-receive.rst   | 10 +++---
 .../media/uapi/mediactl/media-ioc-g-topology.rst   | 18 ---
 Documentation/media/uapi/v4l/dev-raw-vbi.rst   | 10 +++---
 Documentation/media/uapi/v4l/dev-subdev.rst|  4 +--
 Documentation/media/uapi/v4l/pixfmt-002.rst|  5 ++-
 Documentation/media/uapi/v4l/pixfmt-003.rst|  7 ++---
 Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst |  8 ++---
 Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst |  2 +-
 Documentation/media/uapi/v4l/pixfmt-reserved.rst   |  8 ++---
 Documentation/media/uapi/v4l/subdev-formats.rst|  7 ++---
 .../media/uapi/v4l/vidioc-dbg-g-chip-info.rst  | 12 
 .../media/uapi/v4l/vidioc-dbg-g-register.rst   |  8 ++---
 .../media/uapi/v4l/vidioc-decoder-cmd.rst  |  8 ++---
 Documentation/media/uapi/v4l/vidioc-dqevent.rst| 36 +++---
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst   |  9 +++---
 .../media/uapi/v4l/vidioc-encoder-cmd.rst  | 11 +++
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |  9 +++---
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |  8 ++---
 Documentation/media/uapi/v4l/vidioc-enuminput.rst  | 16 +-
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst | 12 
 Documentation/media/uapi/v4l/vidioc-enumstd.rst|  3 +-
 Documentation/media/uapi/v4l/vidioc-g-audio.rst| 12 
 .../media/uapi/v4l/vidioc-g-dv-timings.rst | 12 +++-
 .../media/uapi/v4l/vidioc-g-enc-index.rst  | 13 
 .../media/uapi/v4l/vidioc-g-ext-ctrls.rst  | 14 -
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst | 10 +++---
 .../media/uapi/v4l/vidioc-g-frequency.rst  |  4 +--
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst |  9 +++---
 .../media/uapi/v4l/vidioc-g-modulator.rst  |  8 ++---
 Documentation/media/uapi/v4l/vidioc-g-parm.rst | 20 ++--
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst| 16 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |  8 ++---
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  | 20 ++--
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst   |  4 +--
 .../media/uapi/v4l/vidioc-subdev-g-fmt.rst |  8 ++---
 .../media/uapi/v4l/vidioc-subscribe-event.rst  |  8 ++---
 40 files changed, 205 insertions(+), 241 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
index e0eaadaf2305..89ba813e577c 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
@@ -41,11 +41,10 @@ device information, applications call the ioctl with a 
pointer to a
 struct :ref:`cec_caps `. The driver fills the structure and
 returns the information to the application. The ioctl never fails.
 
-
-.. _cec-caps:
-
 .. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
 
+.. _cec-caps:
+
 .. flat-table:: struct cec_caps
 :header-rows:  0
 :stub-columns: 0
@@ -88,11 +87,10 @@ returns the information to the application. The ioctl never 
fails.
  macro.
 
 
-
-.. _cec-capabilities:
-
 .. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|
 
+.. _cec-capabilities:
+
 .. flat-table:: CEC Capabilities Flags
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index 959e920eb7c3..42f8e856ec55 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -66,11 +66,10 @@ logical addresses are claimed or cleared.
 Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS ` 
when
 logical address types are already defined will return with error ``EBUSY``.
 
-
-.. _cec-log-addrs:
-
 .. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
 
+.. _cec-log-addrs:
+
 .. cssclass:: longtable
 
 .. flat-table:: struct cec_log_addrs
@@ -207,10 +206,10 @@ logical address types are already defined will return 
with error ``EBUSY``.
   give the CEC framework more information about the device type, even
   though the 

Re: [PATCH v4 1/8] media: adv7180: fix field type

2016-08-19 Thread Lars-Peter Clausen
On 08/03/2016 08:03 PM, Steve Longerbeam wrote:
> From: Steve Longerbeam 
> 
> The ADV7180 and ADV7182 transmit whole fields, bottom field followed
> by top (or vice-versa, depending on detected video standard). So
> for chips that do not have support for explicitly setting the field
> mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE.
> 
> Signed-off-by: Steve Longerbeam 
> Signed-off-by: Niklas Söderlund 

Acked-by: Lars-Peter Clausen 

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 2/4] dt-bindings: Add a binding for Mediatek MDP

2016-08-19 Thread Rob Herring
On Fri, Aug 19, 2016 at 07:39:25PM +0800, Minghsiu Tsai wrote:
> Add a DT binding documentation of MDP for the MT8173 SoC
> from Mediatek
> 
> Signed-off-by: Minghsiu Tsai 
> ---
>  .../devicetree/bindings/media/mediatek-mdp.txt |  109 
> 
>  1 file changed, 109 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt

Please add acks when posting new versions.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Linux support for current StarTech analog video capture device (SAA711xx)

2016-08-19 Thread Andrey Utkin
On Fri, Aug 19, 2016 at 01:52:23PM +, Steve Preston wrote:
> Hello everyone,
> 
> Sorry for the slow response.  Several people have offered to help and this is 
> greatly appreciated. I'm not the occultation person actually doing the dev 
> work on our Linux project.

You should CC your Linux people in this thread so that you don't need to
relay messages back and forth manually.

> I have forwarded the suggestions from this thread on the list and we let you 
> know as we make progress.
> 
> We have two models of the StarTech in use: SVID2USB2 and SVID2USB23.  The 
> "23" version is the only version currently listed on StarTech's website.  It 
> is available via Amazon in the USA but I'm not sure about other countries.

OK, make sure to try what Hans has suggested, and to describe in details
what you have tried so far and what is your state - i.e. what happens,
what is logged to dmesg, etc.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Linux support for current StarTech analog video capture device (SAA711xx)

2016-08-19 Thread Devin Heitmueller
Hi Steve,

> We have two models of the StarTech in use: SVID2USB2 and SVID2USB23.  The 
> "23" version is the only version currently listed on StarTech's website.  It 
> is available via Amazon in the USA but I'm not sure about other countries.

Have you actually opened these units up and confirmed what chips are
inside of them?  Or did you determine it's em28xx/saa711x via a Google
search.  The reason I ask is many of these devices will quietly change
their internal design over time, without changing the plastics and/or
model number.  Hence you cannot simply rely on what somebody else may
have said in terms of what chips are inside the device you're holding
in your hand.

First step would probably be to confirm the chips in question.  If
they really are based on the em2882/saa7115, then it should be pretty
easy to get working with a minor code change to the driver.

If you're in the US and you're willing to throw it in a USPS flat rate
box and ship it to me, I can probably have it working in about an
hour.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v4.9] Add atmel-isc driver

2016-08-19 Thread Hans Verkuil
New Atmel ISC driver.

Regards,

Hans

The following changes since commit b6aa39228966e0d3f0bc3306be1892f87792903a:

  Merge tag 'v4.8-rc1' into patchwork (2016-08-08 07:30:25 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git atmel-isc

for you to fetch changes up to 25e7f8102f1c6a7ea4461124ea65709ba8423773:

  MAINTAINERS: atmel-isc: add entry for Atmel ISC (2016-08-19 15:52:42 +0200)


Songjun Wu (3):
  atmel-isc: add the Image Sensor Controller code
  atmel-isc: DT binding for Image Sensor Controller driver
  MAINTAINERS: atmel-isc: add entry for Atmel ISC

 Documentation/devicetree/bindings/media/atmel-isc.txt |   65 ++
 MAINTAINERS   |8 +
 drivers/media/platform/Kconfig|1 +
 drivers/media/platform/Makefile   |2 +
 drivers/media/platform/atmel/Kconfig  |9 +
 drivers/media/platform/atmel/Makefile |1 +
 drivers/media/platform/atmel/atmel-isc-regs.h |  165 +
 drivers/media/platform/atmel/atmel-isc.c  | 1514 
+
 8 files changed, 1765 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt
 create mode 100644 drivers/media/platform/atmel/Kconfig
 create mode 100644 drivers/media/platform/atmel/Makefile
 create mode 100644 drivers/media/platform/atmel/atmel-isc-regs.h
 create mode 100644 drivers/media/platform/atmel/atmel-isc.c
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Linux support for current StarTech analog video capture device (SAA711xx)

2016-08-19 Thread Steve Preston
Hello everyone,

Sorry for the slow response.  Several people have offered to help and this is 
greatly appreciated. I'm not the occultation person actually doing the dev work 
on our Linux project.  I have forwarded the suggestions from this thread on the 
list and we let you know as we make progress.

We have two models of the StarTech in use: SVID2USB2 and SVID2USB23.  The "23" 
version is the only version currently listed on StarTech's website.  It is 
available via Amazon in the USA but I'm not sure about other countries.

Thanks again,
Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v4.8] Fixes and updates (mostly cec-related) (v3)

2016-08-19 Thread Hans Verkuil
Hi Mauro,

These are (regression) fixes for 4.8, mostly related to the cec framework.

It fixes some dubious locking code, two typos in cec-funcs.h, a missing reply
for the Record On/Off messages, improves the documentation, adds a TODO line,
adds a flag to explicitly allow fallback to Unregistered, ensures unclaimed
LAs are set to INVALID, prevents broadcast messages from being processed
when they should be ignored and add a IEEE ID check when locating in physical
address location in the EDID.

The CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK patch changes the default behavior,
so I would like to get that in for 4.8 rather than waiting for 4.9.

The cec-compliance test we've been working on is done and merged in v4l-utils.
This means we have 99% coverage (only some CDC HEC tests are missing since
that's rarely used). These patches fix some remaining problems that we've found
while working on this test.

I hope to fix the remaining items from the TODO list for 4.9 so that the
framework can be mainlined soon.

There are three other patches: the mediatek patch adds a missing HAS_DMA
dependency to shut the kbuild robot up, and there are two fixes for the 
pulse8-cec
driver. Many thanks to Pulse-Eight for providing me with the information
necessary for these two patches.

Regards,

Hans

v3: add cec-edid: check for IEEE identifier
v2: fixing a bug in the "cec: add CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK flag"
patch and adding "cec: set unclaimed addresses to CEC_LOG_ADDR_INVALID".

The following changes since commit b6aa39228966e0d3f0bc3306be1892f87792903a:

  Merge tag 'v4.8-rc1' into patchwork (2016-08-08 07:30:25 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v4.8a

for you to fetch changes up to d9fb56631ec40780de628ce5dc9f519f5e336e1c:

  cec-edid: check for IEEE identifier (2016-08-19 15:30:23 +0200)


Hans Verkuil (13):
  cec: rename cec_devnode fhs_lock to just lock
  cec: improve locking
  cec-funcs.h: fix typo: && should be &
  cec-funcs.h: add reply argument for Record On/Off
  cec: improve dqevent documentation
  cec: add CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK flag
  cec: set unclaimed addresses to CEC_LOG_ADDR_INVALID
  cec: add item to TODO
  cec: ignore messages when log_addr_mask == 0
  mtk-vcodec: add HAS_DMA dependency
  pulse8-cec: set correct Signal Free Time
  pulse8-cec: fix error handling
  cec-edid: check for IEEE identifier

 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 21 
-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst  |  8 ++--
 drivers/media/cec-edid.c  |  5 -
 drivers/media/platform/Kconfig|  2 +-
 drivers/staging/media/cec/TODO|  1 +
 drivers/staging/media/cec/cec-adap.c  | 23 
+--
 drivers/staging/media/cec/cec-api.c   | 10 +-
 drivers/staging/media/cec/cec-core.c  | 27 
+++
 drivers/staging/media/pulse8-cec/pulse8-cec.c | 10 +-
 include/linux/cec-funcs.h |  9 ++---
 include/linux/cec.h   |  5 -
 include/media/cec.h   |  2 +-
 12 files changed, 85 insertions(+), 38 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format

2016-08-19 Thread Mauro Carvalho Chehab
Em Fri, 19 Aug 2016 10:37:50 -0300
Mauro Carvalho Chehab  escreveu:

> Em Fri, 19 Aug 2016 15:24:16 +0200
> Hans Verkuil  escreveu:
> 
> > On 08/19/2016 03:05 PM, Mauro Carvalho Chehab wrote:  
> > > There are some things there that aren't ok for ReST format.
> > >
> > > Fix them.
> > >
> > > Signed-off-by: Mauro Carvalho Chehab 
> > 
> > OK, so I posted a similar patch for this:
> > 
> > https://patchwork.linuxtv.org/patch/36376/
> > 
> > It's part of one of my pull requests, but I guess you can skip that patch.  
> 
> Sorry, I didn't notice. I'm actually waiting for Jon to merge the
> remaining patches for the Sphinx rst core before starting handling
> and merging our patches. I want to avoid having a separate branch for
> documentation this time.
> 
> IMHO, my approach is better than you for functions, as it declares
> functions and struct using the proper macros that are also used
> by kernel-doc script.
> 
> Yet, I didn't touch at MAINTAINERS nor I used ``constant`` or
> :c:type:/:c:func: for references of the functions/struct. 
> Would you care to rebase your patch on the top of mine doing such
> changes?

Hmm... actually we should do something else...

As those functions are declared (or should be declared) using the
kernel documentation macros, we should have references for them
already. So, we need to actually change the text there to point
to the references created by kernel-doc script.

like:


https://linuxtv.org/downloads/v4l-dvb-apis-new/_sources/media/kapi/v4l2-dev.txt

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format

2016-08-19 Thread Mauro Carvalho Chehab
Em Fri, 19 Aug 2016 15:24:16 +0200
Hans Verkuil  escreveu:

> On 08/19/2016 03:05 PM, Mauro Carvalho Chehab wrote:
> > There are some things there that aren't ok for ReST format.
> >
> > Fix them.
> >
> > Signed-off-by: Mauro Carvalho Chehab   
> 
> OK, so I posted a similar patch for this:
> 
> https://patchwork.linuxtv.org/patch/36376/
> 
> It's part of one of my pull requests, but I guess you can skip that patch.

Sorry, I didn't notice. I'm actually waiting for Jon to merge the
remaining patches for the Sphinx rst core before starting handling
and merging our patches. I want to avoid having a separate branch for
documentation this time.

IMHO, my approach is better than you for functions, as it declares
functions and struct using the proper macros that are also used
by kernel-doc script.

Yet, I didn't touch at MAINTAINERS nor I used ``constant`` or
:c:type:/:c:func: for references of the functions/struct. 
Would you care to rebase your patch on the top of mine doing such
changes?

Thanks!
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Mauro Carvalho Chehab
Em Thu, 18 Aug 2016 16:35:14 -0600
Jonathan Corbet  escreveu:

> On Sat, 13 Aug 2016 16:12:42 +0200
> Markus Heiser  wrote:
> 
> > Add a generic way to build only a reST sub-folder with or
> > without a individual *build-theme*.
> > 
> > * control *sub-folders* by environment SPHINXDIRS
> > * control *build-theme* by environment SPHINX_CONF
> > 
> > Folders with a conf.py file, matching $(srctree)/Documentation/*/conf.py
> > can be build and distributed *stand-alone*. E.g. to compile only the
> > html of 'media' and 'gpu' folder use::
> > 
> >   make SPHINXDIRS="media gpu" htmldocs
> > 
> > To use an additional sphinx-build configuration (*build-theme*) set the
> > name of the configuration file to SPHINX_CONF. E.g. to compile only the
> > html of 'media' with the *nit-picking* build use::
> > 
> >   make SPHINXDIRS=media SPHINX_CONF=conf_nitpick.py htmldocs
> > 
> > With this, the Documentation/conf.py is read first and updated with the
> > configuration values from the Documentation/media/conf_nitpick.py.  
> 
> So this patch appears to have had the undocumented effect of moving HTML
> output from Documentation/output/html to Documentation/output.  I am
> assuming that was not the intended result?
> 
> I'm not sure that we actually need the format-specific subfolders, but we
> should be consistent across all the formats and in the documentation and,
> as of this patch, we're not.

Agreed. it should either use subfolders or not.

IMHO, the best would be to just output everything at 
Documentation/output, if this is possible. That "fixes" the issue
of generating PDF files at the latex dir, with sounds weird, IMHO.

I guess I mention on a previous e-mail, but SPHINXDIRS= is not working
for PDF files generation.

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9] Prepare Sphinx to build media PDF books

2016-08-19 Thread Mauro Carvalho Chehab
Em Thu, 18 Aug 2016 17:21:27 -0600
Jonathan Corbet  escreveu:

> On Tue, 16 Aug 2016 13:25:34 -0300
> Mauro Carvalho Chehab  wrote:
> 
> > I think this patch series belong to docs-next. Feel free to merge them 
> > there, if
> > you agree. There's one extra patch that touches Documentation/conf.py,
> > re-adding the media book to the PDF build, but IMHO this one would be better
> > to be merged via the media tree, after the fixes inside the media 
> > documentation
> > to fix the build.
> 
> It's now in docs-next.  I was able to build some nice-looking docs with it
> without too much (additional) pain...

Good!

> The conf.py patch makes me a bit nervous, in that I feel like I spent a
> fair amount of time explaining docs merge conflicts to Linus during the
> merge window, and would rather not do that again.  Can we keep it aside,
> with the idea that one of us will put it in toward the end of the 4.9
> merge window?

Yeah, sure. I'm actually planning to pull from your docs-next branch
at the media master tree before starting picking other patches on it,
and wait for your pull request before sending mine on the next merge
tree.

> Meanwhile, let's see how this xelatex thing works out.  Thanks for making
> all this work!

Anytime!

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format

2016-08-19 Thread Hans Verkuil

On 08/19/2016 03:05 PM, Mauro Carvalho Chehab wrote:

There are some things there that aren't ok for ReST format.

Fix them.

Signed-off-by: Mauro Carvalho Chehab 


OK, so I posted a similar patch for this:

https://patchwork.linuxtv.org/patch/36376/

It's part of one of my pull requests, but I guess you can skip that patch.

Hans


---
 Documentation/media/kapi/cec-core.rst | 145 ++
 1 file changed, 93 insertions(+), 52 deletions(-)

diff --git a/Documentation/media/kapi/cec-core.rst 
b/Documentation/media/kapi/cec-core.rst
index 75155fe37153..88c33b53ec13 100644
--- a/Documentation/media/kapi/cec-core.rst
+++ b/Documentation/media/kapi/cec-core.rst
@@ -36,39 +36,50 @@ CEC Adapter
 The struct cec_adapter represents the CEC adapter hardware. It is created by
 calling cec_allocate_adapter() and deleted by calling cec_delete_adapter():

-struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
+.. c:function::
+   struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
   void *priv, const char *name, u32 caps, u8 available_las,
   struct device *parent);
-void cec_delete_adapter(struct cec_adapter *adap);
+
+.. c:function::
+   void cec_delete_adapter(struct cec_adapter *adap);

 To create an adapter you need to pass the following information:

-ops: adapter operations which are called by the CEC framework and that you
-have to implement.
+ops:
+   adapter operations which are called by the CEC framework and that you
+   have to implement.

-priv: will be stored in adap->priv and can be used by the adapter ops.
+priv:
+   will be stored in adap->priv and can be used by the adapter ops.

-name: the name of the CEC adapter. Note: this name will be copied.
+name:
+   the name of the CEC adapter. Note: this name will be copied.

-caps: capabilities of the CEC adapter. These capabilities determine the
+caps:
+   capabilities of the CEC adapter. These capabilities determine the
capabilities of the hardware and which parts are to be handled
by userspace and which parts are handled by kernelspace. The
capabilities are returned by CEC_ADAP_G_CAPS.

-available_las: the number of simultaneous logical addresses that this
+available_las:
+   the number of simultaneous logical addresses that this
adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.

-parent: the parent device.
+parent:
+   the parent device.


 To register the /dev/cecX device node and the remote control device (if
 CEC_CAP_RC is set) you call:

-int cec_register_adapter(struct cec_adapter *adap);
+.. c:function::
+   int cec_register_adapter(struct cec_adapter \*adap);

 To unregister the devices call:

-void cec_unregister_adapter(struct cec_adapter *adap);
+.. c:function::
+   void cec_unregister_adapter(struct cec_adapter \*adap);

 Note: if cec_register_adapter() fails, then call cec_delete_adapter() to
 clean up. But if cec_register_adapter() succeeded, then only call
@@ -83,18 +94,23 @@ Implementing the Low-Level CEC Adapter
 The following low-level adapter operations have to be implemented in
 your driver:

-struct cec_adap_ops {
-   /* Low-level callbacks */
-   int (*adap_enable)(struct cec_adapter *adap, bool enable);
-   int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
-   int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
-   int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
-u32 signal_free_time, struct cec_msg *msg);
-   void (*adap_log_status)(struct cec_adapter *adap);
+.. c:type:: struct cec_adap_ops

-   /* High-level callbacks */
-   ...
-};
+.. code-block:: none
+
+   struct cec_adap_ops
+   {
+   /* Low-level callbacks */
+   int (*adap_enable)(struct cec_adapter *adap, bool enable);
+   int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool 
enable);
+   int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
+   int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
+ u32 signal_free_time, struct cec_msg 
*msg);
+   void (\*adap_log_status)(struct cec_adapter *adap);
+
+   /* High-level callbacks */
+   ...
+   };

 The three low-level ops deal with various aspects of controlling the CEC 
adapter
 hardware:
@@ -102,6 +118,7 @@ hardware:

 To enable/disable the hardware:

+.. c:function::
int (*adap_enable)(struct cec_adapter *adap, bool enable);

 This callback enables or disables the CEC hardware. Enabling the CEC hardware
@@ -115,6 +132,7 @@ Note that adap_enable must return 0 if enable is false.

 To enable/disable the 'monitor all' mode:

+.. c:function::
int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);

 If enabled, 

Re: [PATCH v5 10/12] [media] videodev2.h Add HSV encoding

2016-08-19 Thread Hans Verkuil
On 08/18/2016 04:33 PM, Ricardo Ribalda Delgado wrote:
> Some hardware maps the Hue between 0 and 255 instead of 0-179. Support
> this format with a new field hsv_enc.
> 
> Signed-off-by: Ricardo Ribalda Delgado 
> ---
>  include/uapi/linux/videodev2.h | 32 +++-
>  1 file changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 58ed8aedc196..71a4c3c13ee0 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -335,6 +335,19 @@ enum v4l2_ycbcr_encoding {
>  };
>  
>  /*
> + * enum v4l2_hsv_encoding values should not collide with the ones from
> + * enum v4l2_ycbcr_encoding.
> + */
> +enum v4l2_hsv_encoding {
> +
> + /* Hue mapped to 0 - 179 */
> + V4L2_HSV_ENC_180= 128,
> +
> + /* Hue mapped to 0-255 */
> + V4L2_HSV_ENC_256= 129,
> +};
> +
> +/*
>   * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding.
>   * This depends on the colorspace.
>   */
> @@ -362,9 +375,10 @@ enum v4l2_quantization {
>   * This depends on whether the image is RGB or not, the colorspace and the
>   * Y'CbCr encoding.
>   */
> -#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
> - (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? 
> V4L2_QUANTIZATION_LIM_RANGE : \
> -  (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
> +#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_yuv, colsp, ycbcr_enc) \

That should be is_rgb_or_hsv.

All other patches look OK.

It would be useful though if you could rebase on top of 
https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=sycc.
I have a pull request outstanding for that tree, and it will conflict with this 
patch.

There might be other doc conflicts as well.

Regards,

Hans

> + (((is_rgb_or_yuv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \
> +  V4L2_QUANTIZATION_LIM_RANGE : \
> +  (((is_rgb_or_yuv) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
> (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == 
> V4L2_COLORSPACE_JPEG) || \
> (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == 
> V4L2_COLORSPACE_SRGB ? \
>V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
> @@ -460,7 +474,12 @@ struct v4l2_pix_format {
>   __u32   colorspace; /* enum v4l2_colorspace */
>   __u32   priv;   /* private data, depends on 
> pixelformat */
>   __u32   flags;  /* format flags 
> (V4L2_PIX_FMT_FLAG_*) */
> - __u32   ycbcr_enc;  /* enum v4l2_ycbcr_encoding */
> + union {
> + /* enum v4l2_ycbcr_encoding */
> + __u32   ycbcr_enc;
> + /* enum v4l2_hsv_encoding */
> + __u32   hsv_enc;
> + };
>   __u32   quantization;   /* enum v4l2_quantization */
>   __u32   xfer_func;  /* enum v4l2_xfer_func */
>  };
> @@ -1993,7 +2012,10 @@ struct v4l2_pix_format_mplane {
>   struct v4l2_plane_pix_formatplane_fmt[VIDEO_MAX_PLANES];
>   __u8num_planes;
>   __u8flags;
> - __u8ycbcr_enc;
> +  union {
> + __u8ycbcr_enc;
> + __u8hsv_enc;
> + };
>   __u8quantization;
>   __u8xfer_func;
>   __u8reserved[7];
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/15] [media] adjust remaining tables at DVB uAPI documentation

2016-08-19 Thread Mauro Carvalho Chehab
There are a few broken tables on LaTeX output at the DVB
uAPI documentation. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/audio-fopen.rst| 2 ++
 Documentation/media/uapi/dvb/ca-fopen.rst   | 2 ++
 Documentation/media/uapi/dvb/dmx-fread.rst  | 3 ++-
 Documentation/media/uapi/dvb/dmx-fwrite.rst | 2 ++
 Documentation/media/uapi/dvb/dmx-set-pes-filter.rst | 2 +-
 Documentation/media/uapi/dvb/dmx-start.rst  | 2 +-
 Documentation/media/uapi/dvb/dmx_types.rst  | 1 +
 Documentation/media/uapi/dvb/fe-get-info.rst| 1 +
 Documentation/media/uapi/dvb/fe-read-status.rst | 1 +
 Documentation/media/uapi/dvb/video-fopen.rst| 2 ++
 10 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/media/uapi/dvb/audio-fopen.rst 
b/Documentation/media/uapi/dvb/audio-fopen.rst
index ec3b23aa79b3..3ef4fd62ffb6 100644
--- a/Documentation/media/uapi/dvb/audio-fopen.rst
+++ b/Documentation/media/uapi/dvb/audio-fopen.rst
@@ -80,6 +80,8 @@ AUDIO_GET_STATUS. All other call will return with an error 
code.
 Return Value
 
 
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/dvb/ca-fopen.rst 
b/Documentation/media/uapi/dvb/ca-fopen.rst
index f284461cce20..9960fc76189c 100644
--- a/Documentation/media/uapi/dvb/ca-fopen.rst
+++ b/Documentation/media/uapi/dvb/ca-fopen.rst
@@ -79,6 +79,8 @@ the device in this mode will fail, and an error code will be 
returned.
 Return Value
 
 
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/dvb/dmx-fread.rst 
b/Documentation/media/uapi/dvb/dmx-fread.rst
index d25b19e4f696..266c9ca259c9 100644
--- a/Documentation/media/uapi/dvb/dmx-fread.rst
+++ b/Documentation/media/uapi/dvb/dmx-fread.rst
@@ -53,10 +53,11 @@ data. The filtered data is transferred from the driver???s 
internal
 circular buffer to buf. The maximum amount of data to be transferred is
 implied by count.
 
-
 Return Value
 
 
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/dvb/dmx-fwrite.rst 
b/Documentation/media/uapi/dvb/dmx-fwrite.rst
index 9efd81a1b5c8..3d76470bef60 100644
--- a/Documentation/media/uapi/dvb/dmx-fwrite.rst
+++ b/Documentation/media/uapi/dvb/dmx-fwrite.rst
@@ -59,6 +59,8 @@ The amount of data to be transferred is implied by count.
 Return Value
 
 
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
 .. flat-table::
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst 
b/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst
index addc321011ce..d71db779b6fd 100644
--- a/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst
+++ b/Documentation/media/uapi/dvb/dmx-set-pes-filter.rst
@@ -61,7 +61,7 @@ On success 0 is returned, on error -1 and the ``errno`` 
variable is set
 appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes ` chapter.
 
-
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
 
 .. flat-table::
 :header-rows:  0
diff --git a/Documentation/media/uapi/dvb/dmx-start.rst 
b/Documentation/media/uapi/dvb/dmx-start.rst
index 9835d1e78400..959b5eee2647 100644
--- a/Documentation/media/uapi/dvb/dmx-start.rst
+++ b/Documentation/media/uapi/dvb/dmx-start.rst
@@ -53,7 +53,7 @@ On success 0 is returned, on error -1 and the ``errno`` 
variable is set
 appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes ` chapter.
 
-
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
 
 .. flat-table::
 :header-rows:  0
diff --git a/Documentation/media/uapi/dvb/dmx_types.rst 
b/Documentation/media/uapi/dvb/dmx_types.rst
index 7a8900af2680..efd564035958 100644
--- a/Documentation/media/uapi/dvb/dmx_types.rst
+++ b/Documentation/media/uapi/dvb/dmx_types.rst
@@ -12,6 +12,7 @@ Demux Data Types
 Output for the demux
 
 
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
 
 .. _dmx-output:
 
diff --git a/Documentation/media/uapi/dvb/fe-get-info.rst 
b/Documentation/media/uapi/dvb/fe-get-info.rst
index 80644072087f..85973be62b0c 100644
--- a/Documentation/media/uapi/dvb/fe-get-info.rst
+++ b/Documentation/media/uapi/dvb/fe-get-info.rst
@@ -160,6 +160,7 @@ frontend capabilities
 Capabilities describe what a frontend can do. Some capabilities are
 supported only on some specific frontend types.
 
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
 
 .. _fe-caps:
 
diff --git a/Documentation/media/uapi/dvb/fe-read-status.rst 
b/Documentation/media/uapi/dvb/fe-read-status.rst
index defe30d036ec..def8160d6807 100644
--- a/Documentation/media/uapi/dvb/fe-read-status.rst
+++ b/Documentation/media/uapi/dvb/fe-read-status.rst
@@ -56,6 +56,7 @@ The fe_status parameter is used to indicate 

[PATCH 06/15] [media] vidioc-g-tuner.rst: improve documentation for tuner type

2016-08-19 Thread Mauro Carvalho Chehab
The tuner type table misses descriptions for each type. While
most of stuff are obvious, the two SDR definitions aren't.

So, add descriptions to all of them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-g-tuner.rst 
b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
index 762918a1e58a..740a4dd0db00 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
@@ -260,7 +260,7 @@ To change the radio frequency the
 .. flat-table:: enum v4l2_tuner_type
 :header-rows:  0
 :stub-columns: 0
-:widths:   3 1 4
+:widths:   3 1 6
 
 
 -  .. row 1
@@ -269,7 +269,7 @@ To change the radio frequency the
 
-  1
 
-   -
+   - Tuner supports radio
 
 -  .. row 2
 
@@ -277,7 +277,7 @@ To change the radio frequency the
 
-  2
 
-   -
+   - Tuner supports analog TV
 
 -  .. row 3
 
@@ -285,7 +285,8 @@ To change the radio frequency the
 
-  4
 
-   -
+   - Tuner controls the A/D and/or D/A block of a
+Sofware Digital Radio (SDR)
 
 -  .. row 4
 
@@ -293,8 +294,7 @@ To change the radio frequency the
 
-  5
 
-   -
-
+   - Tuner controls the RF part of a Sofware Digital Radio (SDR)
 
 
 .. _tuner-capability:
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/15] [media] adjust some vidioc-*rst tables with wrong columns

2016-08-19 Thread Mauro Carvalho Chehab
Adjust simple cases where the columns on some vidioc files
are overriding their neighbours.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-dqevent.rst |  2 ++
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst|  4 +++-
 Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst |  5 +++--
 Documentation/media/uapi/v4l/vidioc-enuminput.rst   |  2 ++
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst| 11 +--
 Documentation/media/uapi/v4l/vidioc-g-enc-index.rst |  6 +++---
 Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst | 14 ++
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst  |  4 
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst   |  2 ++
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-modulator.rst | 10 ++
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst   | 16 
 13 files changed, 50 insertions(+), 30 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index 6cd5d7068065..ad4b826a2966 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -183,6 +183,8 @@ call.
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
+.. cssclass:: longtable
+
 .. flat-table:: Event Types
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
index 6bb30ade6aad..2d1444b0d017 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -108,7 +108,9 @@ one until ``EINVAL`` is returned.
-  :cspan:`2`
 
  .. _v4l2-fourcc:
- ``#define v4l2_fourcc(a,b,c,d) 
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))``
+ ``#define v4l2_fourcc(a,b,c,d)``
+
+ 
``(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))``
 
  Several image formats are already defined by this specification in
  :ref:`pixfmt`.
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
index ea1ccfb43e6d..c6ae6f14c9f6 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
@@ -146,8 +146,9 @@ of the corresponding tuner/modulator is set.
 
-  ``reserved``\ [9]
 
-   -  Reserved for future extensions. Applications and drivers must set
- the array to zero.
+   -  Reserved for future extensions.
+
+ Applications and drivers must set the array to zero.
 
 
 
diff --git a/Documentation/media/uapi/v4l/vidioc-enuminput.rst 
b/Documentation/media/uapi/v4l/vidioc-enuminput.rst
index 6b90a1a3506d..8f0b821bd921 100644
--- a/Documentation/media/uapi/v4l/vidioc-enuminput.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enuminput.rst
@@ -181,6 +181,8 @@ at index zero, incrementing by one until the driver returns 
``EINVAL``.
 
 .. _input-status:
 
+.. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
+
 .. flat-table:: Input Status Flags
 :header-rows:  0
 :stub-columns: 0
diff --git a/Documentation/media/uapi/v4l/vidioc-enumoutput.rst 
b/Documentation/media/uapi/v4l/vidioc-enumoutput.rst
index 13939d8d4358..456013fb50a2 100644
--- a/Documentation/media/uapi/v4l/vidioc-enumoutput.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enumoutput.rst
@@ -142,7 +142,7 @@ EINVAL.
 
 .. _output-type:
 
-.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+.. tabularcolumns:: |p{7.0cm}|p{1.8cm}|p{8.7cm}|
 
 .. flat-table:: Output Type
 :header-rows:  0
diff --git a/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst 
b/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst
index d2ea3bf01fce..58dec578f54d 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst
@@ -316,11 +316,6 @@ EBUSY
 
-  Description
 
--  .. row 2
-
-   -
-   -
-
 -  .. row 3
 
-  ``V4L2_DV_BT_STD_CEA861``
@@ -346,6 +341,7 @@ EBUSY
-  The timings follow the VESA Generalized Timings Formula standard
 
 
+.. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
 
 .. _dv-bt-flags:
 
@@ -360,11 +356,6 @@ EBUSY
 
-  Description
 
--  .. row 2
-
-   -
-   -
-
 -  .. row 3
 
-  ``V4L2_DV_FL_REDUCED_BLANKING``
diff --git a/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst 
b/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst
index cb094b589f0e..9cb98a8eaf2d 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-enc-index.rst
@@ -59,12 +59,12 @@ video elementary streams.
 
 .. _v4l2-enc-idx:
 
-.. tabularcolumns:: 

[PATCH 12/15] [media] docs-rst: move cec kAPI documentation to the media book

2016-08-19 Thread Mauro Carvalho Chehab
The CEC kAPI documentation should also be part of the media book.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/{cec.txt => media/kapi/cec-core.rst} | 0
 Documentation/media/media_kapi.rst | 1 +
 2 files changed, 1 insertion(+)
 rename Documentation/{cec.txt => media/kapi/cec-core.rst} (100%)

diff --git a/Documentation/cec.txt b/Documentation/media/kapi/cec-core.rst
similarity index 100%
rename from Documentation/cec.txt
rename to Documentation/media/kapi/cec-core.rst
diff --git a/Documentation/media/media_kapi.rst 
b/Documentation/media/media_kapi.rst
index b71e8e8048ca..f282ca270369 100644
--- a/Documentation/media/media_kapi.rst
+++ b/Documentation/media/media_kapi.rst
@@ -32,3 +32,4 @@ For more details see the file COPYING in the source 
distribution of Linux.
 kapi/dtv-core
 kapi/rc-core
 kapi/mc-core
+kapi/cec-core
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/15] [media] vidioc-g-sliced-vbi-cap.rst: make tables fit on LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
The tables don't fit at the page on this file. As noticed
before, Sphinx (or LaTeX?) does a crap job on tables with
cell span, and some work has to be done to make it fit.

Move the see also reference to a footnote, break one paragraph
into two and adjust the table columns to make it visible.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst | 30 +-
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst 
b/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
index 0d4b6b0044a0..740324e6e5db 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
@@ -48,7 +48,7 @@ the sliced VBI API is unsupported or ``type`` is invalid.
 
 .. _v4l2-sliced-vbi-cap:
 
-.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|
+.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|
 
 .. flat-table:: struct v4l2_sliced_vbi_cap
 :header-rows:  0
@@ -63,6 +63,7 @@ the sliced VBI API is unsupported or ``type`` is invalid.
-  ``service_set``
 
-  :cspan:`2` A set of all data services supported by the driver.
+
  Equal to the union of all elements of the ``service_lines`` array.
 
 -  .. row 2
@@ -74,8 +75,7 @@ the sliced VBI API is unsupported or ``type`` is invalid.
-  :cspan:`2` Each element of this array contains a set of data
  services the hardware can look for or insert into a particular
  scan line. Data services are defined in :ref:`vbi-services`.
- Array indices map to ITU-R line numbers (see also :ref:`vbi-525`
- and :ref:`vbi-625`) as follows:
+ Array indices map to ITU-R line numbers\ [#f1]_ as follows:
 
 -  .. row 3
 
@@ -171,14 +171,22 @@ the sliced VBI API is unsupported or ``type`` is invalid.
-  ``reserved``\ [3]
 
-  :cspan:`2` This array is reserved for future extensions.
+
  Applications and drivers must set it to zero.
 
+.. [#f1]
 
+   See also :ref:`vbi-525` and :ref:`vbi-625`.
+
+
+.. raw:: latex
+
+\newline\newline\begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}|
 
 .. _vbi-services:
 
-.. tabularcolumns:: |p{4.4cm}|p{2.2cm}|p{2.2cm}|p{4.4cm}|p{4.3cm}|
-
 .. flat-table:: Sliced VBI services
 :header-rows:  1
 :stub-columns: 0
@@ -203,7 +211,9 @@ the sliced VBI API is unsupported or ``type`` is invalid.
 
-  0x0001
 
-   -  :ref:`ets300706`, :ref:`itu653`
+   -  :ref:`ets300706`,
+
+ :ref:`itu653`
 
-  PAL/SECAM line 7-22, 320-335 (second field 7-22)
 
@@ -242,7 +252,9 @@ the sliced VBI API is unsupported or ``type`` is invalid.
 
-  0x4000
 
-   -  :ref:`en300294`, :ref:`itu1119`
+   -  :ref:`en300294`,
+
+ :ref:`itu1119`
 
-  PAL/SECAM line 23
 
@@ -270,6 +282,10 @@ the sliced VBI API is unsupported or ``type`` is invalid.
 
-  :cspan:`2` Set of services applicable to 625 line systems.
 
+.. raw:: latex
+
+\end{adjustbox}\newline\newline
+
 
 Return Value
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/15] [media] vidioc-dv-timings-cap.rst: Adjust LaTeX columns

2016-08-19 Thread Mauro Carvalho Chehab
Some tables are not properly displayed on LaTeX. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst 
b/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst
index e14e780eb0d1..b2bf4f3a3c25 100644
--- a/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst
@@ -56,7 +56,7 @@ that doesn't support them will return an ``EINVAL`` error 
code.
 
 .. _v4l2-bt-timings-cap:
 
-.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
 
 .. flat-table:: struct v4l2_bt_timings_cap
 :header-rows:  0
@@ -136,14 +136,14 @@ that doesn't support them will return an ``EINVAL`` error 
code.
 
-  ``reserved``\ [16]
 
-   -  Reserved for future extensions. Drivers must set the array to
- zero.
+   -  Reserved for future extensions.
+ Drivers must set the array to zero.
 
 
 
 .. _v4l2-dv-timings-cap:
 
-.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}|
+.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{3.5cm}|p{9.5cm}|
 
 .. flat-table:: struct v4l2_dv_timings_cap
 :header-rows:  0
@@ -175,8 +175,9 @@ that doesn't support them will return an ``EINVAL`` error 
code.
 
-  ``reserved``\ [2]
 
-   -  Reserved for future extensions. Drivers and applications must set
- the array to zero.
+   -  Reserved for future extensions.
+
+ Drivers and applications must set the array to zero.
 
 -  .. row 4
 
@@ -203,6 +204,7 @@ that doesn't support them will return an ``EINVAL`` error 
code.
 
-
 
+.. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
 
 
 .. _dv-bt-cap-capabilities:
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/15] Fix (most of) the remaining issues with uAPI book and LaTeX

2016-08-19 Thread Mauro Carvalho Chehab
This patch series addresses (almost all) remaining issues of texts going
out of the page width.

There are just two places that need fixes:
- Two big tables at Documentation/media/uapi/v4l/subdev-formats.rst;
- some texts at Documentation/media/uapi/v4l/extended-controls.rst
  with very long constants (like
  V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE)
  that are linked to very long enum types.

Yet, as mentioned on the previous patch series, some tables don't look
nice. Basically, the flat-tables with cspan columns on it are not
formatted well in LaTeX output. The tables go out of the left margin on
several such cases. Yet, all text are at the visible area. So, the
document is readable on screen. Also, on such tables, texts with more
than one line on span cells are not left-margin justified, and their
size is not well calculated. So, usually, it uses more lines than what
would be needed.

Yet, the document output is OK for usage, IMHO.


Mauro Carvalho Chehab (15):
  [media] vidioc-dqevent.rst: adjust two table columns for LaTeX output
  [media] vidioc-dv-timings-cap.rst: Adjust LaTeX columns
  [media] vidioc-enumstd.rst: adjust video standards table
  [media] vidioc-g-sliced-vbi-cap.rst: make tables fit on LaTeX output
  [media] adjust some vidioc-*rst tables with wrong columns
  [media] vidioc-g-tuner.rst: improve documentation for tuner type
  [media] vidioc-g-tuner.rst: Fix tables to fit at LaTeX output
  [media] fix v4l2-selection-*.rst tables for LaTeX output
  [media] fe_property_parameters.rst: Adjust column sizes
  [media] adjust remaining tables at DVB uAPI documentation
  [media] media-types.rst: adjust tables to fit on LaTeX output
  [media] docs-rst: move cec kAPI documentation to the media book
  [media] cec-core: Convert it to ReST format
  [media] uapi/cec: adjust tables on LaTeX output
  [media] gen-errors.rst fix error table column limits

 Documentation/{cec.txt => media/kapi/cec-core.rst} | 145 +
 Documentation/media/media_kapi.rst |   1 +
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|   6 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |  23 ++--
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst|   6 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |   6 +-
 Documentation/media/uapi/dvb/audio-fopen.rst   |   2 +
 Documentation/media/uapi/dvb/ca-fopen.rst  |   2 +
 Documentation/media/uapi/dvb/dmx-fread.rst |   3 +-
 Documentation/media/uapi/dvb/dmx-fwrite.rst|   2 +
 .../media/uapi/dvb/dmx-set-pes-filter.rst  |   2 +-
 Documentation/media/uapi/dvb/dmx-start.rst |   2 +-
 Documentation/media/uapi/dvb/dmx_types.rst |   1 +
 Documentation/media/uapi/dvb/fe-get-info.rst   |   1 +
 Documentation/media/uapi/dvb/fe-read-status.rst|   1 +
 .../media/uapi/dvb/fe_property_parameters.rst  |   3 +
 Documentation/media/uapi/dvb/video-fopen.rst   |   2 +
 Documentation/media/uapi/gen-errors.rst|   2 +-
 Documentation/media/uapi/mediactl/media-types.rst  |  14 +-
 .../media/uapi/v4l/v4l2-selection-flags.rst|   1 +
 .../media/uapi/v4l/v4l2-selection-targets.rst  |   2 +
 Documentation/media/uapi/v4l/vidioc-dqevent.rst|   8 +-
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst   |  14 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   4 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |   5 +-
 Documentation/media/uapi/v4l/vidioc-enuminput.rst  |   2 +
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst|  23 +++-
 .../media/uapi/v4l/vidioc-g-dv-timings.rst |  11 +-
 .../media/uapi/v4l/vidioc-g-enc-index.rst  |   6 +-
 .../media/uapi/v4l/vidioc-g-ext-ctrls.rst  |  14 +-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst |   4 +
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst  |   2 +
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst  |  10 +-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst |  30 -
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|  44 +--
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |  16 ++-
 39 files changed, 283 insertions(+), 145 deletions(-)
 rename Documentation/{cec.txt => media/kapi/cec-core.rst} (72%)

-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/15] [media] fix v4l2-selection-*.rst tables for LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
Adjust the tables there to fit inside the page margins.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/v4l2-selection-flags.rst   | 1 +
 Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/Documentation/media/uapi/v4l/v4l2-selection-flags.rst 
b/Documentation/media/uapi/v4l/v4l2-selection-flags.rst
index 3ce3731faf5f..9ef139f8e21d 100644
--- a/Documentation/media/uapi/v4l/v4l2-selection-flags.rst
+++ b/Documentation/media/uapi/v4l/v4l2-selection-flags.rst
@@ -6,6 +6,7 @@
 Selection flags
 ***
 
+.. tabularcolumns:: |p{5.2cm}|p{2.0cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}|
 
 .. _v4l2-selection-flags-table:
 
diff --git a/Documentation/media/uapi/v4l/v4l2-selection-targets.rst 
b/Documentation/media/uapi/v4l/v4l2-selection-targets.rst
index 7519099a50cd..a82b58f5ebcf 100644
--- a/Documentation/media/uapi/v4l/v4l2-selection-targets.rst
+++ b/Documentation/media/uapi/v4l/v4l2-selection-targets.rst
@@ -12,6 +12,8 @@ of the two interfaces they are used.
 
 .. _v4l2-selection-targets-table:
 
+.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}|
+
 .. flat-table:: Selection target definitions
 :header-rows:  1
 :stub-columns: 0
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/15] [media] vidioc-g-tuner.rst: Fix tables to fit at LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
Several tables are missing column definitions and/or are too big
to fit into the page. Adjust them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst | 32 ++---
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-g-tuner.rst 
b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
index 740a4dd0db00..a52efdf94795 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-tuner.rst
@@ -60,8 +60,12 @@ To change the radio frequency the
 :ref:`VIDIOC_S_FREQUENCY ` ioctl is available.
 
 
+ .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{6.6cm}|p{6.6cm}|
+
 .. _v4l2-tuner:
 
+.. cssclass:: longtable
+
 .. flat-table:: struct v4l2_tuner
 :header-rows:  0
 :stub-columns: 0
@@ -83,8 +87,9 @@ To change the radio frequency the
 
-  :cspan:`1`
 
- Name of the tuner, a NUL-terminated ASCII string. This information
- is intended for the user.
+ Name of the tuner, a NUL-terminated ASCII string.
+
+ This information is intended for the user.
 
 -  .. row 3
 
@@ -230,8 +235,9 @@ To change the radio frequency the
 
-  ``signal``
 
-   -  :cspan:`1` The signal strength if known, ranging from 0 to
- 65535. Higher values indicate a better signal.
+   -  :cspan:`1` The signal strength if known.
+
+ Ranging from 0 to 65535. Higher values indicate a better signal.
 
 -  .. row 16
 
@@ -239,8 +245,10 @@ To change the radio frequency the
 
-  ``afc``
 
-   -  :cspan:`1` Automatic frequency control: When the ``afc`` value
- is negative, the frequency is too low, when positive too high.
+   -  :cspan:`1` Automatic frequency control.
+
+ When the ``afc`` value is negative, the frequency is too
+ low, when positive too high.
 
 -  .. row 17
 
@@ -248,8 +256,9 @@ To change the radio frequency the
 
-  ``reserved``\ [4]
 
-   -  :cspan:`1` Reserved for future extensions. Drivers and
- applications must set the array to zero.
+   -  :cspan:`1` Reserved for future extensions.
+
+  Drivers and applications must set the array to zero.
 
 
 
@@ -301,6 +310,8 @@ To change the radio frequency the
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
+.. cssclass:: longtable
+
 .. flat-table:: Tuner and Modulator Capability Flags
 :header-rows:  0
 :stub-columns: 0
@@ -608,7 +619,9 @@ To change the radio frequency the
  ``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this
  mode.
 
+.. raw:: latex
 
+\newline\newline\begin{adjustbox}{width=\columnwidth}
 
 .. _tuner-matrix:
 
@@ -706,6 +719,9 @@ To change the radio frequency the
 
-  Lang1/Lang2 (preferred) or Lang1/Lang1
 
+.. raw:: latex
+
+\end{adjustbox}\newline\newline
 
 Return Value
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/15] [media] vidioc-dqevent.rst: adjust two table columns for LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
There are two tables with mangled columns. Fix it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-dqevent.rst | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index 0a84f3a6ed92..6cd5d7068065 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -42,7 +42,9 @@ call.
 
 .. _v4l2-event:
 
-.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}|
+.. tabularcolumns:: |p{3.0cm}|p{4.3cm}|p{2.5cm}|p{7.7cm}|
+
+.. cssclass: longtable
 
 .. flat-table:: struct v4l2_event
 :header-rows:  0
@@ -328,7 +330,7 @@ call.
 
 .. _v4l2-event-ctrl:
 
-.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}|
+.. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}|
 
 .. flat-table:: struct v4l2_event_ctrl
 :header-rows:  0
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/15] [media] fe_property_parameters.rst: Adjust column sizes

2016-08-19 Thread Mauro Carvalho Chehab
Add position hints for some tables, in order for them to be
shown properly on LaTeX output.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/fe_property_parameters.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst 
b/Documentation/media/uapi/dvb/fe_property_parameters.rst
index f776d62523da..d7acc72ebbdf 100644
--- a/Documentation/media/uapi/dvb/fe_property_parameters.rst
+++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst
@@ -1234,6 +1234,7 @@ Reed Solomon (RS) frame mode.
 
 Possible values are:
 
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
 
 .. _atscmh-rs-frame-mode:
 
@@ -1395,6 +1396,7 @@ Series Concatenated Convolutional Code Block Mode.
 
 Possible values are:
 
+.. tabularcolumns:: |p{4.5cm}|p{13.0cm}|
 
 .. _atscmh-sccc-block-mode:
 
@@ -1687,6 +1689,7 @@ on OFTM-based standards, e. g. DVB-T/T2, ISDB-T, DTMB
 enum fe_transmit_mode: Number of carriers per channel
 -
 
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
 
 .. _fe-transmit-mode:
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/15] [media] uapi/cec: adjust tables on LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
Fix tables to avoid text to overflow the cell limits.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |  4 ++--
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|  6 --
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   | 23 +-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst|  6 +++---
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |  6 +++---
 5 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
index 4e70eae7e6ab..e0eaadaf2305 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst
@@ -44,7 +44,7 @@ returns the information to the application. The ioctl never 
fails.
 
 .. _cec-caps:
 
-.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}|
+.. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
 
 .. flat-table:: struct cec_caps
 :header-rows:  0
@@ -91,7 +91,7 @@ returns the information to the application. The ioctl never 
fails.
 
 .. _cec-capabilities:
 
-.. tabularcolumns:: |p{4.4cm}|p{1.5cm}|p{11.6cm}|
+.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|
 
 .. flat-table:: CEC Capabilities Flags
 :header-rows:  0
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index 11fac7e24554..959e920eb7c3 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -69,7 +69,9 @@ logical address types are already defined will return with 
error ``EBUSY``.
 
 .. _cec-log-addrs:
 
-.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}|
+.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
+
+.. cssclass:: longtable
 
 .. flat-table:: struct cec_log_addrs
 :header-rows:  0
@@ -311,7 +313,7 @@ logical address types are already defined will return with 
error ``EBUSY``.
 
 .. _cec-log-addr-types:
 
-.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}|
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
 .. flat-table:: CEC Logical Address Types
 :header-rows:  0
diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index b4c73ed50509..c27b56881a4a 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -54,7 +54,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. _cec-event-state-change_s:
 
-.. tabularcolumns:: |p{1.8cm}|p{1.8cm}|p{13.9cm}|
+.. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}|
 
 .. flat-table:: struct cec_event_state_change
 :header-rows:  0
@@ -82,7 +82,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. _cec-event-lost-msgs_s:
 
-.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}|
+.. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}|
 
 .. flat-table:: struct cec_event_lost_msgs
 :header-rows:  0
@@ -110,7 +110,7 @@ it is guaranteed that the state did change in between the 
two events.
 
 .. _cec-event:
 
-.. tabularcolumns:: |p{1.6cm}|p{1.6cm}|p{1.6cm}|p{12.7cm}|
+.. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{2.5cm}|p{8.8cm}|
 
 .. flat-table:: struct cec_event
 :header-rows:  0
@@ -124,21 +124,18 @@ it is guaranteed that the state did change in between the 
two events.
 
-  ``ts``
 
-   -  Timestamp of the event in ns.
+   -  :cspan:`1` Timestamp of the event in ns.
+
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
  the same clock from userspace use :c:func:`clock_gettime(2)`.
 
-   -
-
 -  .. row 2
 
-  __u32
 
-  ``event``
 
-   -  The CEC event type, see :ref:`cec-events`.
-
-   -
+   -  :cspan:`1` The CEC event type, see :ref:`cec-events`.
 
 -  .. row 3
 
@@ -146,9 +143,7 @@ it is guaranteed that the state did change in between the 
two events.
 
-  ``flags``
 
-   -  Event flags, see :ref:`cec-event-flags`.
-
-   -
+   -  :cspan:`1` Event flags, see :ref:`cec-event-flags`.
 
 -  .. row 4
 
@@ -183,7 +178,7 @@ it is guaranteed that the state did change in between the 
two events.
 
 .. _cec-events:
 
-.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}|
+.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
 
 .. flat-table:: CEC Events Types
 :header-rows:  0
@@ -214,7 +209,7 @@ it is guaranteed that the state did change in between the 
two events.
 
 .. _cec-event-flags:
 
-.. tabularcolumns:: |p{4.4cm}|p{1.5cm}|p{11.6cm}|
+.. tabularcolumns:: |p{6.0cm}|p{0.6cm}|p{10.9cm}|
 
 .. flat-table:: CEC Event Flags
 :header-rows:  0
diff --git a/Documentation/media/uapi/cec/cec-ioc-g-mode.rst 
b/Documentation/media/uapi/cec/cec-ioc-g-mode.rst
index d213432eedd7..32261e0510ca 100644
--- a/Documentation/media/uapi/cec/cec-ioc-g-mode.rst
+++ 

[PATCH 11/15] [media] media-types.rst: adjust tables to fit on LaTeX output

2016-08-19 Thread Mauro Carvalho Chehab
A few tables at the media uAPI documentation have columns
not well dimentioned. Adjust them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/mediactl/media-types.rst | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/mediactl/media-types.rst 
b/Documentation/media/uapi/mediactl/media-types.rst
index c77717b236ce..20f99301bfdb 100644
--- a/Documentation/media/uapi/mediactl/media-types.rst
+++ b/Documentation/media/uapi/mediactl/media-types.rst
@@ -5,9 +5,12 @@
 Types and flags used to represent the media graph elements
 ==
 
+..  tabularcolumns:: |p{8.0cm}|p{10.5cm}|
 
 .. _media-entity-type:
 
+.. cssclass:: longtable
+
 .. flat-table:: Media entity types
 :header-rows:  0
 :stub-columns: 0
@@ -15,10 +18,12 @@ Types and flags used to represent the media graph elements
 
 -  .. row 1
 
-   ..  _MEDIA-ENT-F-UNKNOWN:
+   .. _MEDIA-ENT-F-UNKNOWN:
.. _MEDIA-ENT-F-V4L2-SUBDEV-UNKNOWN:
 
-   -  ``MEDIA_ENT_F_UNKNOWN`` and ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``
+   -  ``MEDIA_ENT_F_UNKNOWN`` and
+
+ ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``
 
-  Unknown entity. That generally indicates that a driver didn't
  initialize properly the entity, with is a Kernel bug
@@ -294,6 +299,8 @@ Types and flags used to represent the media graph elements
  its source pad.
 
 
+..  tabularcolumns:: |p{5.5cm}|p{12.0cm}|
+
 .. _media-entity-flag:
 
 .. flat-table:: Media entity flags
@@ -319,6 +326,7 @@ Types and flags used to represent the media graph elements
-  The entity represents a data conector
 
 
+..  tabularcolumns:: |p{6.5cm}|p{6.0cm}|p{5.0cm}|
 
 .. _media-intf-type:
 
@@ -508,6 +516,7 @@ Types and flags used to represent the media graph elements
-  typically, /dev/snd/timer
 
 
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
 
 .. _media-pad-flag:
 
@@ -551,6 +560,7 @@ Types and flags used to represent the media graph elements
 One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``
 must be set for every pad.
 
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
 
 .. _media-link-flag:
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/15] [media] vidioc-enumstd.rst: adjust video standards table

2016-08-19 Thread Mauro Carvalho Chehab
This table is too big for LaTeX output, and lacks columns
specs for LaTeX format.

Also, it has a hidden column, as there are some cell spans
with the wrong values.

Fix it, so it can be displayed properly on LaTeX/PDF.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-enumstd.rst | 23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-enumstd.rst 
b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
index 9d7d77af0161..28f00a027cc7 100644
--- a/Documentation/media/uapi/v4l/vidioc-enumstd.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
@@ -272,6 +272,12 @@ support digital TV. See also the Linux DVB API at
 #define V4L2_STD_ALL(V4L2_STD_525_60|
 V4L2_STD_625_50)
 
+.. raw:: latex
+
+\newline\newline\begin{adjustbox}{width=\columnwidth}
+
+..NTSC/M   PAL/M/N   /B   /D   /H  
 /ISECAM/B/D   /K1 /L
+.. tabularcolumns:: 
|p{2.7cm}|p{2.6cm}|p{3.0cm}|p{3.2cm}|p{3.2cm}|p{2.2cm}|p{1.2cm}|p{3.2cm}|p{3.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|
 
 .. _video-standards:
 
@@ -312,7 +318,7 @@ support digital TV. See also the Linux DVB API at
 
-  :cspan:`1` 525
 
-   -  :cspan:`9` 625
+   -  :cspan:`8` 625
 
 -  .. row 3
 
@@ -320,7 +326,7 @@ support digital TV. See also the Linux DVB API at
 
-  :cspan:`1` 1001/3
 
-   -  :cspan:`9` 1/25
+   -  :cspan:`8` 1/25
 
 -  .. row 4
 
@@ -330,13 +336,17 @@ support digital TV. See also the Linux DVB API at
 
-  3579611.49 ?? 10
 
-   -  4433618.75 ?? 5 (3582056.25 ?? 5)
+   -  4433618.75 ?? 5
+
+  (3582056.25 ?? 5)
 
-  :cspan:`3` 4433618.75 ?? 5
 
-  4433618.75 ?? 1
 
-   -  :cspan:`3` f\ :sub:`OR` = 4406250 ?? 2000, f\ :sub:`OB` = 425 ?? 
2000
+   -  :cspan:`2` f\ :sub:`OR` = 4406250 ?? 2000,
+
+ f\ :sub:`OB` = 425 ?? 2000
 
 -  .. row 5
 
@@ -390,6 +400,11 @@ support digital TV. See also the Linux DVB API at
 
-  6.5 [#f8]_
 
+.. raw:: latex
+
+\end{adjustbox}\newline\newline
+
+
 
 Return Value
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/15] [media] cec-core: Convert it to ReST format

2016-08-19 Thread Mauro Carvalho Chehab
There are some things there that aren't ok for ReST format.

Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/cec-core.rst | 145 ++
 1 file changed, 93 insertions(+), 52 deletions(-)

diff --git a/Documentation/media/kapi/cec-core.rst 
b/Documentation/media/kapi/cec-core.rst
index 75155fe37153..88c33b53ec13 100644
--- a/Documentation/media/kapi/cec-core.rst
+++ b/Documentation/media/kapi/cec-core.rst
@@ -36,39 +36,50 @@ CEC Adapter
 The struct cec_adapter represents the CEC adapter hardware. It is created by
 calling cec_allocate_adapter() and deleted by calling cec_delete_adapter():
 
-struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
+.. c:function::
+   struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
   void *priv, const char *name, u32 caps, u8 available_las,
   struct device *parent);
-void cec_delete_adapter(struct cec_adapter *adap);
+
+.. c:function::
+   void cec_delete_adapter(struct cec_adapter *adap);
 
 To create an adapter you need to pass the following information:
 
-ops: adapter operations which are called by the CEC framework and that you
-have to implement.
+ops:
+   adapter operations which are called by the CEC framework and that you
+   have to implement.
 
-priv: will be stored in adap->priv and can be used by the adapter ops.
+priv:
+   will be stored in adap->priv and can be used by the adapter ops.
 
-name: the name of the CEC adapter. Note: this name will be copied.
+name:
+   the name of the CEC adapter. Note: this name will be copied.
 
-caps: capabilities of the CEC adapter. These capabilities determine the
+caps:
+   capabilities of the CEC adapter. These capabilities determine the
capabilities of the hardware and which parts are to be handled
by userspace and which parts are handled by kernelspace. The
capabilities are returned by CEC_ADAP_G_CAPS.
 
-available_las: the number of simultaneous logical addresses that this
+available_las:
+   the number of simultaneous logical addresses that this
adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
 
-parent: the parent device.
+parent:
+   the parent device.
 
 
 To register the /dev/cecX device node and the remote control device (if
 CEC_CAP_RC is set) you call:
 
-int cec_register_adapter(struct cec_adapter *adap);
+.. c:function::
+   int cec_register_adapter(struct cec_adapter \*adap);
 
 To unregister the devices call:
 
-void cec_unregister_adapter(struct cec_adapter *adap);
+.. c:function::
+   void cec_unregister_adapter(struct cec_adapter \*adap);
 
 Note: if cec_register_adapter() fails, then call cec_delete_adapter() to
 clean up. But if cec_register_adapter() succeeded, then only call
@@ -83,18 +94,23 @@ Implementing the Low-Level CEC Adapter
 The following low-level adapter operations have to be implemented in
 your driver:
 
-struct cec_adap_ops {
-   /* Low-level callbacks */
-   int (*adap_enable)(struct cec_adapter *adap, bool enable);
-   int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
-   int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
-   int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
-u32 signal_free_time, struct cec_msg *msg);
-   void (*adap_log_status)(struct cec_adapter *adap);
+.. c:type:: struct cec_adap_ops
 
-   /* High-level callbacks */
-   ...
-};
+.. code-block:: none
+
+   struct cec_adap_ops
+   {
+   /* Low-level callbacks */
+   int (*adap_enable)(struct cec_adapter *adap, bool enable);
+   int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool 
enable);
+   int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
+   int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
+ u32 signal_free_time, struct cec_msg 
*msg);
+   void (\*adap_log_status)(struct cec_adapter *adap);
+
+   /* High-level callbacks */
+   ...
+   };
 
 The three low-level ops deal with various aspects of controlling the CEC 
adapter
 hardware:
@@ -102,6 +118,7 @@ hardware:
 
 To enable/disable the hardware:
 
+.. c:function::
int (*adap_enable)(struct cec_adapter *adap, bool enable);
 
 This callback enables or disables the CEC hardware. Enabling the CEC hardware
@@ -115,6 +132,7 @@ Note that adap_enable must return 0 if enable is false.
 
 To enable/disable the 'monitor all' mode:
 
+.. c:function::
int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
 
 If enabled, then the adapter should be put in a mode to also monitor messages
@@ -127,6 +145,7 @@ Note that adap_monitor_all_enable must return 0 if enable 
is false.
 
 To program a new logical address:
 
+.. c:function::
  

[PATCH 15/15] [media] gen-errors.rst fix error table column limits

2016-08-19 Thread Mauro Carvalho Chehab
Fix the generic errors table to avoid column overflows on
LaTeX output.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/gen-errors.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/gen-errors.rst 
b/Documentation/media/uapi/gen-errors.rst
index d37284d50e56..6e983b9880fc 100644
--- a/Documentation/media/uapi/gen-errors.rst
+++ b/Documentation/media/uapi/gen-errors.rst
@@ -9,7 +9,7 @@ Generic Error Codes
 
 .. _gen-errors:
 
-.. tabularcolumns:: |p{1.0cm}|p{16.5cm}|
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
 
 .. flat-table:: Generic error codes
 :header-rows:  0
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] docs-rst: conf.py: adjust the size of .. note:: tag

2016-08-19 Thread Mauro Carvalho Chehab
While the current implementation works well when using as a
paragraph, it doesn't work properly if inside a table. As we
have quite a few such cases, fix the logic to take the column
size into account.

PS.: I took the logic there from the latest version of Sphinx.sty

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/conf.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 8058eb2b8340..5094a3b98ffa 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -282,7 +282,13 @@ latex_elements = {
 \\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
 
 \\makeatletter\\newenvironment{graybox}{%
-   
\\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}%
+  \\newlength{\\py@noticelength}
+  \\setlength{\\fboxrule}{1pt}
+  \\setlength{\\fboxsep}{7pt}
+  \\setlength{\\py@noticelength}{\\linewidth}
+  \\addtolength{\\py@noticelength}{-2\\fboxsep}
+  \\addtolength{\\py@noticelength}{-2\\fboxrule}
+   
\\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\py@noticelength}}{\\end{minipage}\\end{lrbox}%
\\colorbox{MyGray}{\\usebox{\\@tempboxa}}
 }\\makeatother
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Jani Nikula
On Fri, 19 Aug 2016, Markus Heiser  wrote:
> Am 19.08.2016 um 00:35 schrieb Jonathan Corbet :
> * the pdf goes to the "latex" folder .. since this is WIP
>   and there are different solutions conceivable ... I left
>   it open for the first.

Mea culpa. As I said, I intended my patches as RFC only.

>
> * in the index.html we miss some links to pdf-/man- etc files
>   
> The last point needs some discussion. Hopefully, this discussion
> starts right here.
>
>
>> I'm not sure that we actually need the format-specific subfolders, but we
>> should be consistent across all the formats and in the documentation and,
>> as of this patch, we're not.
>
> IMHO a structure where only non-HTML formats are placed in subfolders
> (described above) is the better choice.
>
> In the long run I like to get rid of all the intermediate formats
> (latex, .doctrees) and build a clear output-folder (with all formats
> in) which could be copied 1:1 to a static HTTP-server.

When I added the Documentation/output subfolder, my main intention was
to separate the source documents from everything that is generated,
intermediate or final. I suggest you keep the generated files somewhere
under output. This'll be handly also when ensuring O= works.

I set up the format specific subfolders, because I thought people would
want to keep them separated and independent. For me, all the formats
were equal and at the same level in that regard. You're suggesting to
make html the root of everything?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/4] VPU: mediatek: Add mdp support

2016-08-19 Thread Minghsiu Tsai
VPU driver add mdp support

Signed-off-by: Minghsiu Tsai 
---
 drivers/media/platform/mtk-vpu/mtk_vpu.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.h 
b/drivers/media/platform/mtk-vpu/mtk_vpu.h
index f457479..291ae46 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.h
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.h
@@ -53,6 +53,8 @@ typedef void (*ipi_handler_t) (void *data,
 handle H264 video encoder job, and vice versa.
  * @IPI_VENC_VP8:   The interrupt fro vpu is to notify kernel to
 handle VP8 video encoder job,, and vice versa.
+ * @IPI_MDP:The interrupt from vpu is to notify kernel to
+handle MDP (Media Data Path) job, and vice versa.
  * @IPI_MAX:The maximum IPI number
  */
 
@@ -63,6 +65,7 @@ enum ipi_id {
IPI_VDEC_VP9,
IPI_VENC_H264,
IPI_VENC_VP8,
+   IPI_MDP,
IPI_MAX,
 };
 
@@ -71,11 +74,13 @@ enum ipi_id {
  *
  * @VPU_RST_ENC: encoder reset id
  * @VPU_RST_DEC: decoder reset id
+ * @VPU_RST_MDP: MDP (Media Data Path) reset id
  * @VPU_RST_MAX: maximum reset id
  */
 enum rst_id {
VPU_RST_ENC,
VPU_RST_DEC,
+   VPU_RST_MDP,
VPU_RST_MAX,
 };
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 3/4] media: Add Mediatek MDP Driver

2016-08-19 Thread Minghsiu Tsai
Add MDP driver for MT8173

Signed-off-by: Minghsiu Tsai 
---
 drivers/media/platform/Kconfig|   17 +
 drivers/media/platform/Makefile   |2 +
 drivers/media/platform/mtk-mdp/Makefile   |9 +
 drivers/media/platform/mtk-mdp/mtk_mdp_comp.c |  159 
 drivers/media/platform/mtk-mdp/mtk_mdp_comp.h |   72 ++
 drivers/media/platform/mtk-mdp/mtk_mdp_core.c |  294 ++
 drivers/media/platform/mtk-mdp/mtk_mdp_core.h |  260 +
 drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h  |  126 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c  | 1269 +
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h  |   22 +
 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c |  156 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_regs.h |   31 +
 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c  |  145 +++
 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h  |   41 +
 14 files changed, 2603 insertions(+)
 create mode 100644 drivers/media/platform/mtk-mdp/Makefile
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_comp.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_core.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_regs.h
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.c
 create mode 100644 drivers/media/platform/mtk-mdp/mtk_mdp_vpu.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index f25344b..0c88532 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -166,6 +166,23 @@ config VIDEO_MEDIATEK_VPU
To compile this driver as a module, choose M here: the
module will be called mtk-vpu.
 
+config VIDEO_MEDIATEK_MDP
+   tristate "Mediatek MDP driver"
+   depends on MTK_IOMMU || COMPILE_TEST
+   depends on VIDEO_DEV && VIDEO_V4L2
+   depends on ARCH_MEDIATEK || COMPILE_TEST
+   depends on HAS_DMA
+   select VIDEOBUF2_DMA_CONTIG
+   select V4L2_MEM2MEM_DEV
+   select VIDEO_MEDIATEK_VPU
+   default n
+   ---help---
+   It is a v4l2 driver and present in Mediatek MT8173 SoCs.
+   The driver supports for scaling and color space conversion.
+
+   To compile this driver as a module, choose M here: the
+   module will be called mtk-mdp.
+
 config VIDEO_MEDIATEK_VCODEC
tristate "Mediatek Video Codec driver"
depends on MTK_IOMMU || COMPILE_TEST
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 21771c1..221aace 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -63,3 +63,5 @@ ccflags-y += -I$(srctree)/drivers/media/i2c
 obj-$(CONFIG_VIDEO_MEDIATEK_VPU)   += mtk-vpu/
 
 obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC)+= mtk-vcodec/
+
+obj-$(CONFIG_VIDEO_MEDIATEK_MDP)   += mtk-mdp/
diff --git a/drivers/media/platform/mtk-mdp/Makefile 
b/drivers/media/platform/mtk-mdp/Makefile
new file mode 100644
index 000..f802569
--- /dev/null
+++ b/drivers/media/platform/mtk-mdp/Makefile
@@ -0,0 +1,9 @@
+mtk-mdp-y += mtk_mdp_core.o
+mtk-mdp-y += mtk_mdp_comp.o
+mtk-mdp-y += mtk_mdp_m2m.o
+mtk-mdp-y += mtk_mdp_regs.o
+mtk-mdp-y += mtk_mdp_vpu.o
+
+obj-$(CONFIG_VIDEO_MEDIATEK_MDP) += mtk-mdp.o
+
+ccflags-y += -I$(srctree)/drivers/media/platform/mtk-vpu
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
new file mode 100644
index 000..aa8f9fd
--- /dev/null
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2016 MediaTek Inc.
+ * Author: Ming Hsiu Tsai 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "mtk_mdp_comp.h"
+
+
+static const char * const mtk_mdp_comp_stem[MTK_MDP_COMP_TYPE_MAX] = {
+   "mdp_rdma",
+   "mdp_rsz",
+   "mdp_wdma",
+   "mdp_wrot",
+};
+
+struct mtk_mdp_comp_match {
+   enum mtk_mdp_comp_type type;
+   int alias_id;
+};
+
+static const struct mtk_mdp_comp_match mtk_mdp_matches[MTK_MDP_COMP_ID_MAX] = {
+   { MTK_MDP_RDMA, 0 },
+   { MTK_MDP_RDMA, 1 },
+   { 

[PATCH v4 0/4] Add MT8173 MDP Driver

2016-08-19 Thread Minghsiu Tsai
Changes in v4:
- Add "depends on HAS_DMA" in Kconfig.
- Fix s/g_selection()
- Replace struct v4l2_crop with u32 and struct v4l2_rect 
- Remove VB2_USERPTR
- Move mutex lock after ctx allocation in mtk_mdp_m2m_open()
- Add new format V4L2_PIX_FMT_YVU420 to support software on Android platform.
- Only width/height of image in format V4L2_PIX_FMT_MT21 is aligned to 16/16, 
  other ones are aligned to 2/2 by default

Changes in v3:
- Modify device ndoe as structured one.
- Fix conflict in dts on Linux 4.8-rc1

Changes in v2:
- Add section to describe blocks function in dts-bindings
- Remove the assignment of device_caps in querycap()
- Remove format's name assignment
- Copy colorspace-related parameters from OUTPUT to CAPTURE
- Use m2m helper functions
- Fix DMA allocation failure
- Initialize lazily vpu instance in streamon()

==
 Introduction
==

The purpose of this series is to add the driver for Media Data Path HW embedded 
in the Mediatek's MT8173 SoC.
MDP is used for scaling and color space conversion.

It could convert V4L2_PIX_FMT_MT21 to V4L2_PIX_FMT_NV12M or 
V4L2_PIX_FMT_YUV420M.

NV12M/YUV420M/MT21 -> MDP -> NV12M/YUV420M

This patch series rely on MTK VPU driver in patch series "Add MT8173 Video 
Encoder Driver and VPU Driver"[1] and "Add MT8173 Video Decoder Driver"[2].
MDP driver rely on VPU driver to load, communicate with VPU.

Internally the driver uses videobuf2 framework and MTK IOMMU and MTK SMI both 
have been merged in v4.6-rc1.

[1]https://patchwork.kernel.org/patch/9002171/
[2]https://patchwork.kernel.org/patch/9141245/

==
 Device interface
==

In principle the driver bases on v4l2 memory-to-memory framework:
it provides a single video node and each opened file handle gets its own 
private context with separate buffer queues. Each context consist of 2 buffer 
queues: OUTPUT (for source buffers) and CAPTURE (for destination buffers).
OUTPUT and CAPTURE buffer could be MMAP or DMABUF memory type.

v4l2-compliance test output:
# v4l2-compliance -d /dev/image-proc0
v4l2-compliance SHA   : ee1ab491019f80052834d14c76bdd1c1b46f2158

Driver Info:
Driver name   : mtk-mdp
Card type : soc:mdp
Bus info  : platform:mt8173
Driver version: 4.8.0
Capabilities  : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format

Compliance test for device /dev/image-proc0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 5 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK
test Composing: OK
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
   

[PATCH v4 2/4] dt-bindings: Add a binding for Mediatek MDP

2016-08-19 Thread Minghsiu Tsai
Add a DT binding documentation of MDP for the MT8173 SoC
from Mediatek

Signed-off-by: Minghsiu Tsai 
---
 .../devicetree/bindings/media/mediatek-mdp.txt |  109 
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt

diff --git a/Documentation/devicetree/bindings/media/mediatek-mdp.txt 
b/Documentation/devicetree/bindings/media/mediatek-mdp.txt
new file mode 100644
index 000..4182063
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/mediatek-mdp.txt
@@ -0,0 +1,109 @@
+* Mediatek Media Data Path
+
+Media Data Path is used for scaling and color space conversion.
+
+Required properties (controller (parent) node):
+- compatible: "mediatek,mt8173-mdp"
+- mediatek,vpu: the node of video processor unit, see
+  Documentation/devicetree/bindings/media/mediatek-vpu.txt for details.
+
+Required properties (all function blocks, child node):
+- compatible: Should be one of
+"mediatek,mt8173-mdp-rdma"  - read DMA
+"mediatek,mt8173-mdp-rsz"   - resizer
+"mediatek,mt8173-mdp-wdma"  - write DMA
+"mediatek,mt8173-mdp-wrot"  - write DMA with rotation
+- reg: Physical base address and length of the function block register space
+- clocks: device clocks, see
+  Documentation/devicetree/bindings/clock/clock-bindings.txt for details.
+- power-domains: a phandle to the power domain, see
+  Documentation/devicetree/bindings/power/power_domain.txt for details.
+
+Required properties (DMA function blocks, child node):
+- compatible: Should be one of
+"mediatek,mt8173-mdp-rdma"
+"mediatek,mt8173-mdp-wdma"
+"mediatek,mt8173-mdp-wrot"
+- iommus: should point to the respective IOMMU block with master port as
+  argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
+  for details.
+- mediatek,larb: must contain the local arbiters in the current Socs, see
+  Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
+  for details.
+
+Example:
+mdp {
+   compatible = "mediatek,mt8173-mdp";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+   mediatek,vpu = <>;
+
+   mdp_rdma0: rdma@14001000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14001000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA0>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rdma1: rdma@14002000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14002000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA1>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA1>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rsz0: rsz@14003000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14003000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ0>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz1: rsz@14004000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14004000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ1>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz2: rsz@14005000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14005000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ2>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_wdma0: wdma@14006000 {
+   compatible = "mediatek,mt8173-mdp-wdma";
+   reg = <0 0x14006000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WDMA>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WDMA>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot0: wrot@14007000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14007000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT0>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot1: wrot@14008000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14008000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT1>;
+   power-domains = < MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT1>;
+   mediatek,larb = <>;
+   };
+};
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 4/4] arm64: dts: mediatek: Add MDP for MT8173

2016-08-19 Thread Minghsiu Tsai
Add MDP node for MT8173

Signed-off-by: Minghsiu Tsai 
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi |   84 ++
 1 file changed, 84 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi 
b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 10f638f..cd93228 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -41,6 +41,14 @@
dpi0 = 
dsi0 = 
dsi1 = 
+   mdp_rdma0 = _rdma0;
+   mdp_rdma1 = _rdma1;
+   mdp_rsz0 = _rsz0;
+   mdp_rsz1 = _rsz1;
+   mdp_rsz2 = _rsz2;
+   mdp_wdma0 = _wdma0;
+   mdp_wrot0 = _wrot0;
+   mdp_wrot1 = _wrot1;
};
 
cpus {
@@ -716,6 +724,82 @@
#clock-cells = <1>;
};
 
+   mdp {
+   compatible = "mediatek,mt8173-mdp";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+   mediatek,vpu = <>;
+
+   mdp_rdma0: rdma@14001000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14001000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA0>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rdma1: rdma@14002000 {
+   compatible = "mediatek,mt8173-mdp-rdma";
+   reg = <0 0x14002000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RDMA1>,
+< CLK_MM_MUTEX_32K>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_RDMA1>;
+   mediatek,larb = <>;
+   };
+
+   mdp_rsz0: rsz@14003000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14003000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ0>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz1: rsz@14004000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14004000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ1>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_rsz2: rsz@14005000 {
+   compatible = "mediatek,mt8173-mdp-rsz";
+   reg = <0 0x14005000 0 0x1000>;
+   clocks = < CLK_MM_MDP_RSZ2>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   };
+
+   mdp_wdma0: wdma@14006000 {
+   compatible = "mediatek,mt8173-mdp-wdma";
+   reg = <0 0x14006000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WDMA>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WDMA>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot0: wrot@14007000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14007000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT0>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT0>;
+   mediatek,larb = <>;
+   };
+
+   mdp_wrot1: wrot@14008000 {
+   compatible = "mediatek,mt8173-mdp-wrot";
+   reg = <0 0x14008000 0 0x1000>;
+   clocks = < CLK_MM_MDP_WROT1>;
+   power-domains = < 
MT8173_POWER_DOMAIN_MM>;
+   iommus = < M4U_PORT_MDP_WROT1>;
+   mediatek,larb = <>;
+   };
+   };
+
ovl0: ovl@1400c000 {
compatible = "mediatek,mt8173-disp-ovl";
reg = <0 0x1400c000 0 0x1000>;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org

Re: [PATCH 1/7] doc-rst: generic way to build only sphinx sub-folders

2016-08-19 Thread Markus Heiser

Am 19.08.2016 um 00:35 schrieb Jonathan Corbet :

> On Sat, 13 Aug 2016 16:12:42 +0200
> Markus Heiser  wrote:
> 
>> Add a generic way to build only a reST sub-folder with or
>> without a individual *build-theme*.
>> 
>> * control *sub-folders* by environment SPHINXDIRS
>> * control *build-theme* by environment SPHINX_CONF
>> 
>> Folders with a conf.py file, matching $(srctree)/Documentation/*/conf.py
>> can be build and distributed *stand-alone*. E.g. to compile only the
>> html of 'media' and 'gpu' folder use::
>> 
>>  make SPHINXDIRS="media gpu" htmldocs
>> 
>> To use an additional sphinx-build configuration (*build-theme*) set the
>> name of the configuration file to SPHINX_CONF. E.g. to compile only the
>> html of 'media' with the *nit-picking* build use::
>> 
>>  make SPHINXDIRS=media SPHINX_CONF=conf_nitpick.py htmldocs
>> 
>> With this, the Documentation/conf.py is read first and updated with the
>> configuration values from the Documentation/media/conf_nitpick.py.
> 
> So this patch appears to have had the undocumented effect of moving HTML
> output from Documentation/output/html to Documentation/output.  I am
> assuming that was not the intended result?

Sorry for being unclear. My intention was to produce a structured output
which could copied 1:1 to a static HTML server.

Since the documentation says: 

  "The generated documentation is placed in ``Documentation/output``."

I thought I'am free to give it a structure. But I haven't clarified
this point / sorry.

The main structure is, that a HTML output is produced without any
folder prefix, so a simple htmldoc target goes to::

  Documentation/output/index.html

Other formats like epub are placed into a format-specific subfolder e.g. 
the epub from target "epubdocs" are placed in::

  Documentation/output/epub/*

If you only compile a subfolder e.g. "SPHINXDIRS=media" you get a
the analogous structure in the Documentation/output/media folder::

  Documentation/output/{subfolder}/{non-html-format}/

With you can place the Documentation/output/{subfolder} on 
your HTTP server including all formats.

Unfortunately at the this time, 

* the pdf goes to the "latex" folder .. since this is WIP
  and there are different solutions conceivable ... I left
  it open for the first.

* in the index.html we miss some links to pdf-/man- etc files
  
The last point needs some discussion. Hopefully, this discussion
starts right here.


> I'm not sure that we actually need the format-specific subfolders, but we
> should be consistent across all the formats and in the documentation and,
> as of this patch, we're not.

IMHO a structure where only non-HTML formats are placed in subfolders
(described above) is the better choice.

In the long run I like to get rid of all the intermediate formats
(latex, .doctrees) and build a clear output-folder (with all formats
in) which could be copied 1:1 to a static HTTP-server.

-- Markus --

> jon

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 15/17] omap3isp: Allocate the media device dynamically

2016-08-19 Thread Sakari Ailus
Signed-off-by: Sakari Ailus 
---
 drivers/media/platform/omap3isp/isp.c  | 25 +
 drivers/media/platform/omap3isp/isp.h  |  2 +-
 drivers/media/platform/omap3isp/ispvideo.c |  2 +-
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index aa32537..1e42d37 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1597,8 +1597,7 @@ static void isp_unregister_entities(struct isp_device 
*isp)
omap3isp_stat_unregister_entities(>isp_hist);
 
v4l2_device_unregister(>v4l2_dev);
-   media_device_unregister(>media_dev);
-   media_device_cleanup(>media_dev);
+   media_device_unregister(isp->media_dev);
 }
 
 static int isp_link_entity(
@@ -1676,14 +1675,16 @@ static int isp_register_entities(struct isp_device *isp)
 {
int ret;
 
-   isp->media_dev.dev = isp->dev;
-   strlcpy(isp->media_dev.model, "TI OMAP3 ISP",
-   sizeof(isp->media_dev.model));
-   isp->media_dev.hw_revision = isp->revision;
-   isp->media_dev.link_notify = v4l2_pipeline_link_notify;
-   media_device_init(>media_dev);
+   isp->media_dev = media_device_alloc(isp->dev, isp, 0);
+   if (!isp->media_dev)
+   return -ENOMEM;
+
+   strlcpy(isp->media_dev->model, "TI OMAP3 ISP",
+   sizeof(isp->media_dev->model));
+   isp->media_dev->hw_revision = isp->revision;
+   isp->media_dev->link_notify = v4l2_pipeline_link_notify;
 
-   isp->v4l2_dev.mdev = >media_dev;
+   isp->v4l2_dev.mdev = isp->media_dev;
ret = v4l2_device_register(isp->dev, >v4l2_dev);
if (ret < 0) {
dev_err(isp->dev, "%s: V4L2 device registration failed (%d)\n",
@@ -1728,7 +1729,7 @@ static int isp_register_entities(struct isp_device *isp)
 done:
if (ret < 0) {
isp_unregister_entities(isp);
-   media_device_put(>media_dev);
+   media_device_put(isp->media_dev);
}
 
return ret;
@@ -2163,7 +2164,7 @@ static int isp_subdev_notifier_complete(struct 
v4l2_async_notifier *async)
struct isp_bus_cfg *bus;
int ret;
 
-   ret = media_entity_enum_init(>crashed, >media_dev);
+   ret = media_entity_enum_init(>crashed, isp->media_dev);
if (ret)
return ret;
 
@@ -2181,7 +2182,7 @@ static int isp_subdev_notifier_complete(struct 
v4l2_async_notifier *async)
if (ret < 0)
return ret;
 
-   return media_device_register(>media_dev);
+   return media_device_register(isp->media_dev);
 }
 
 /*
diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index 7e6f663..7378279 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -176,7 +176,7 @@ struct isp_xclk {
 struct isp_device {
struct v4l2_device v4l2_dev;
struct v4l2_async_notifier notifier;
-   struct media_device media_dev;
+   struct media_device *media_dev;
struct device *dev;
u32 revision;
 
diff --git a/drivers/media/platform/omap3isp/ispvideo.c 
b/drivers/media/platform/omap3isp/ispvideo.c
index 7d9f359..45ef38c 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -1077,7 +1077,7 @@ isp_video_streamon(struct file *file, void *fh, enum 
v4l2_buf_type type)
pipe = video->video.entity.pipe
 ? to_isp_pipeline(>video.entity) : >pipe;
 
-   ret = media_entity_enum_init(>ent_enum, >isp->media_dev);
+   ret = media_entity_enum_init(>ent_enum, video->isp->media_dev);
if (ret)
goto err_enum_init;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 14/17] media-device: Postpone graph object removal until free

2016-08-19 Thread Sakari Ailus
The media device itself will be unregistered based on it being unbound and
driver's remove callback being called. The graph objects themselves may
still be in use; rely on the media device release callback to release
them.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 44 
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 0656daf..cbbc397 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -756,6 +756,26 @@ EXPORT_SYMBOL_GPL(media_device_cleanup);
 static void media_device_release(struct media_devnode *devnode)
 {
struct media_device *mdev = to_media_device(devnode);
+   struct media_entity *entity;
+   struct media_entity *next;
+   struct media_interface *intf, *tmp_intf;
+   struct media_entity_notify *notify, *nextp;
+
+   /* Remove all entities from the media device */
+   list_for_each_entry_safe(entity, next, >entities, graph_obj.list)
+   __media_device_unregister_entity(entity);
+
+   /* Remove all entity_notify callbacks from the media device */
+   list_for_each_entry_safe(notify, nextp, >entity_notify, list)
+   __media_device_unregister_entity_notify(mdev, notify);
+
+   /* Remove all interfaces from the media device */
+   list_for_each_entry_safe(intf, tmp_intf, >interfaces,
+graph_obj.list) {
+   __media_remove_intf_links(intf);
+   media_gobj_destroy(>graph_obj);
+   kfree(intf);
+   }
 
ida_destroy(>entity_internal_idx);
mdev->entity_internal_idx_max = 0;
@@ -800,38 +820,14 @@ EXPORT_SYMBOL_GPL(__media_device_register);
 
 void media_device_unregister(struct media_device *mdev)
 {
-   struct media_entity *entity;
-   struct media_entity *next;
-   struct media_interface *intf, *tmp_intf;
-   struct media_entity_notify *notify, *nextp;
-
if (mdev == NULL)
return;
 
mutex_lock(>graph_mutex);
-
-   /* Check if mdev was ever registered at all */
if (!media_devnode_is_registered(>devnode)) {
mutex_unlock(>graph_mutex);
return;
}
-
-   /* Remove all entities from the media device */
-   list_for_each_entry_safe(entity, next, >entities, graph_obj.list)
-   __media_device_unregister_entity(entity);
-
-   /* Remove all entity_notify callbacks from the media device */
-   list_for_each_entry_safe(notify, nextp, >entity_notify, list)
-   __media_device_unregister_entity_notify(mdev, notify);
-
-   /* Remove all interfaces from the media device */
-   list_for_each_entry_safe(intf, tmp_intf, >interfaces,
-graph_obj.list) {
-   __media_remove_intf_links(intf);
-   media_gobj_destroy(>graph_obj);
-   kfree(intf);
-   }
-
mutex_unlock(>graph_mutex);
 
device_remove_file(>devnode.dev, _attr_model);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 10/17] media: Provide a way to the driver to set a private pointer

2016-08-19 Thread Sakari Ailus
Now that the media device can be allocated dynamically, drivers have no
longer a way to conveniently obtain the driver private data structure.
Provide one again in the form of a private pointer passed to the
media_device_alloc() function.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c |  3 ++-
 include/media/media-device.h | 15 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 6c8b689..27d5214 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -699,7 +699,7 @@ void media_device_init(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_init);
 
-struct media_device *media_device_alloc(struct device *dev)
+struct media_device *media_device_alloc(struct device *dev, void *priv)
 {
struct media_device *mdev;
 
@@ -716,6 +716,7 @@ struct media_device *media_device_alloc(struct device *dev)
media_devnode_init(>devnode);
mdev->dev = dev;
media_device_init(mdev);
+   mdev->priv = priv;
 
return mdev;
 }
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 8ccc8e8..cfcec1b 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -52,6 +52,7 @@ struct media_entity_notify {
  * struct media_device - Media device
  * @dev:   Parent device
  * @devnode:   Media device node
+ * @priv:  A pointer to driver private data
  * @driver_name: Optional device driver name. If not set, calls to
  * %MEDIA_IOC_DEVICE_INFO will return dev->driver->name.
  * This is needed for USB drivers for example, as otherwise
@@ -117,6 +118,7 @@ struct media_device {
/* dev->driver_data points to this struct. */
struct device *dev;
struct media_devnode devnode;
+   void *priv;
 
char model[32];
char driver_name[32];
@@ -200,6 +202,7 @@ void media_device_init(struct media_device *mdev);
  * media_device_alloc() - Allocate and initialise a media device
  *
  * @dev:   The associated struct device pointer
+ * @priv:  pointer to a driver private data structure
  *
  * Allocate and initialise a media device. Returns a media device.
  * The media device is refcounted, and this function returns a media
@@ -208,7 +211,7 @@ void media_device_init(struct media_device *mdev);
  * References are taken and given using media_device_get() and
  * media_device_put().
  */
-struct media_device *media_device_alloc(struct device *dev);
+struct media_device *media_device_alloc(struct device *dev, void *priv);
 
 /**
  * media_device_get() - Get a reference to a media device
@@ -235,6 +238,16 @@ struct media_device *media_device_alloc(struct device 
*dev);
} while (0)
 
 /**
+ * media_device_priv() - Obtain the driver private pointer
+ *
+ * Returns a pointer passed to the media_device_alloc() function.
+ */
+static inline void *media_device_priv(struct media_device *mdev)
+{
+   return mdev->priv;
+}
+
+/**
  * media_device_cleanup() - Cleanups a media device element
  *
  * @mdev:  pointer to struct _device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 13/17] media: Shuffle functions around

2016-08-19 Thread Sakari Ailus
As the call paths of the functions in question will change, move them
around in anticipation of that. No other changes.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 7f90cb82..0656daf 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -542,22 +542,6 @@ static DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
  * Registration/unregistration
  */
 
-static void media_device_release(struct media_devnode *devnode)
-{
-   struct media_device *mdev = to_media_device(devnode);
-
-   ida_destroy(>entity_internal_idx);
-   mdev->entity_internal_idx_max = 0;
-   media_entity_graph_walk_cleanup(>pm_count_walk);
-   mutex_destroy(>graph_mutex);
-   dev_dbg(devnode->parent, "Media device released\n");
-
-   if (mdev->release)
-   mdev->release(mdev);
-
-   kfree(mdev);
-}
-
 /**
  * media_device_register_entity - Register an entity with a media device
  * @mdev:  The media device
@@ -678,6 +662,34 @@ void media_device_unregister_entity(struct media_entity 
*entity)
 }
 EXPORT_SYMBOL_GPL(media_device_unregister_entity);
 
+int __must_check media_device_register_entity_notify(struct media_device *mdev,
+   struct media_entity_notify *nptr)
+{
+   mutex_lock(>graph_mutex);
+   list_add_tail(>list, >entity_notify);
+   mutex_unlock(>graph_mutex);
+   return 0;
+}
+EXPORT_SYMBOL_GPL(media_device_register_entity_notify);
+
+/*
+ * Note: Should be called with mdev->lock held.
+ */
+static void __media_device_unregister_entity_notify(struct media_device *mdev,
+   struct media_entity_notify *nptr)
+{
+   list_del(>list);
+}
+
+void media_device_unregister_entity_notify(struct media_device *mdev,
+   struct media_entity_notify *nptr)
+{
+   mutex_lock(>graph_mutex);
+   __media_device_unregister_entity_notify(mdev, nptr);
+   mutex_unlock(>graph_mutex);
+}
+EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
+
 /**
  * media_device_init() - initialize a media device
  * @mdev:  The media device
@@ -741,6 +753,22 @@ void media_device_cleanup(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_cleanup);
 
+static void media_device_release(struct media_devnode *devnode)
+{
+   struct media_device *mdev = to_media_device(devnode);
+
+   ida_destroy(>entity_internal_idx);
+   mdev->entity_internal_idx_max = 0;
+   media_entity_graph_walk_cleanup(>pm_count_walk);
+   mutex_destroy(>graph_mutex);
+   dev_dbg(devnode->parent, "Media device released\n");
+
+   if (mdev->release)
+   mdev->release(mdev);
+
+   kfree(mdev);
+}
+
 int __must_check __media_device_register(struct media_device *mdev,
 struct module *owner)
 {
@@ -770,34 +798,6 @@ int __must_check __media_device_register(struct 
media_device *mdev,
 }
 EXPORT_SYMBOL_GPL(__media_device_register);
 
-int __must_check media_device_register_entity_notify(struct media_device *mdev,
-   struct media_entity_notify *nptr)
-{
-   mutex_lock(>graph_mutex);
-   list_add_tail(>list, >entity_notify);
-   mutex_unlock(>graph_mutex);
-   return 0;
-}
-EXPORT_SYMBOL_GPL(media_device_register_entity_notify);
-
-/*
- * Note: Should be called with mdev->lock held.
- */
-static void __media_device_unregister_entity_notify(struct media_device *mdev,
-   struct media_entity_notify *nptr)
-{
-   list_del(>list);
-}
-
-void media_device_unregister_entity_notify(struct media_device *mdev,
-   struct media_entity_notify *nptr)
-{
-   mutex_lock(>graph_mutex);
-   __media_device_unregister_entity_notify(mdev, nptr);
-   mutex_unlock(>graph_mutex);
-}
-EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
-
 void media_device_unregister(struct media_device *mdev)
 {
struct media_entity *entity;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 12/17] v4l: Acquire a reference to the media device for every video device

2016-08-19 Thread Sakari Ailus
The video device depends on the existence of its media device --- if there
is one. Acquire a reference to it.

Signed-off-by: Sakari Ailus 
---
 drivers/media/v4l2-core/v4l2-dev.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
b/drivers/media/v4l2-core/v4l2-dev.c
index e6da353..cda04ff 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -171,6 +171,9 @@ static void v4l2_device_release(struct device *cd)
 {
struct video_device *vdev = to_video_device(cd);
struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
+#ifdef CONFIG_MEDIA_CONTROLLER
+   struct media_device *mdev = v4l2_dev->mdev;
+#endif
 
mutex_lock(_lock);
if (WARN_ON(video_device[vdev->minor] != vdev)) {
@@ -193,8 +196,8 @@ static void v4l2_device_release(struct device *cd)
 
mutex_unlock(_lock);
 
-#if defined(CONFIG_MEDIA_CONTROLLER)
-   if (v4l2_dev->mdev) {
+#ifdef CONFIG_MEDIA_CONTROLLER
+   if (mdev) {
/* Remove interfaces and interface links */
media_devnode_remove(vdev->intf_devnode);
if (vdev->entity.function != MEDIA_ENT_F_UNKNOWN)
@@ -220,6 +223,11 @@ static void v4l2_device_release(struct device *cd)
/* Decrease v4l2_device refcount */
if (v4l2_dev)
v4l2_device_put(v4l2_dev);
+
+#ifdef CONFIG_MEDIA_CONTROLLER
+   if (mdev)
+   media_device_put(mdev);
+#endif
 }
 
 static struct class video_class = {
@@ -808,6 +816,7 @@ static int video_register_media_controller(struct 
video_device *vdev, int type)
 
/* FIXME: how to create the other interface links? */
 
+   media_device_get(vdev->v4l2_dev->mdev);
 #endif
return 0;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 11/17] media: Add release callback for media device

2016-08-19 Thread Sakari Ailus
The release callback may be used by the driver to signal the release of
the media device. This makes it possible to embed a driver private struct
to the same memory allocation.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 11 ++-
 include/media/media-device.h |  8 +++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 27d5214..7f90cb82 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -552,6 +552,9 @@ static void media_device_release(struct media_devnode 
*devnode)
mutex_destroy(>graph_mutex);
dev_dbg(devnode->parent, "Media device released\n");
 
+   if (mdev->release)
+   mdev->release(mdev);
+
kfree(mdev);
 }
 
@@ -699,10 +702,16 @@ void media_device_init(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_init);
 
-struct media_device *media_device_alloc(struct device *dev, void *priv)
+struct media_device *media_device_alloc(struct device *dev, void *priv,
+   size_t size)
 {
struct media_device *mdev;
 
+   if (!size)
+   size = sizeof(*mdev);
+   else if (WARN_ON(size < sizeof(*mdev)))
+   return NULL;
+
dev = get_device(dev);
if (!dev)
return NULL;
diff --git a/include/media/media-device.h b/include/media/media-device.h
index cfcec1b..3b66232 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -152,6 +152,7 @@ struct media_device {
 
int (*link_notify)(struct media_link *link, u32 flags,
   unsigned int notification);
+   void (*release)(struct media_device *mdev);
 };
 
 /* We don't need to include pci.h or usb.h here */
@@ -203,15 +204,20 @@ void media_device_init(struct media_device *mdev);
  *
  * @dev:   The associated struct device pointer
  * @priv:  pointer to a driver private data structure
+ * @size:  size of a driver structure containing the media device
  *
  * Allocate and initialise a media device. Returns a media device.
  * The media device is refcounted, and this function returns a media
  * device the refcount of which is one (1).
  *
+ * The size parameter can be zero if the media_device is not embedded
+ * in another struct.
+ *
  * References are taken and given using media_device_get() and
  * media_device_put().
  */
-struct media_device *media_device_alloc(struct device *dev, void *priv);
+struct media_device *media_device_alloc(struct device *dev, void *priv,
+   size_t size);
 
 /**
  * media_device_get() - Get a reference to a media device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 07/17] media: Split initialisation and adding device

2016-08-19 Thread Sakari Ailus
As registering a device node of an entity belonging to a media device
will require a reference to the struct device. Taking that reference is
only possible once the device has been initialised, which took place only
when it was registered. Split this in two, and initialise the device when
the media device is allocated.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c  |  1 +
 drivers/media/media-devnode.c | 15 ++-
 drivers/media/platform/omap3isp/isp.c |  4 +++-
 include/media/media-devnode.h | 15 +++
 4 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 5a86d36..d527491 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -707,6 +707,7 @@ struct media_device *media_device_alloc(void)
if (!mdev)
return NULL;
 
+   media_devnode_init(>devnode);
media_device_init(mdev);
 
return mdev;
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 7481c96..aa8030b 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -219,6 +219,11 @@ static const struct file_operations media_devnode_fops = {
.llseek = no_llseek,
 };
 
+void media_devnode_init(struct media_devnode *devnode)
+{
+   device_initialize(>dev);
+}
+
 int __must_check media_devnode_register(struct media_devnode *devnode,
struct module *owner)
 {
@@ -256,7 +261,7 @@ int __must_check media_devnode_register(struct 
media_devnode *devnode,
if (devnode->parent)
devnode->dev.parent = devnode->parent;
dev_set_name(>dev, "media%d", devnode->minor);
-   ret = device_register(>dev);
+   ret = device_add(>dev);
if (ret < 0) {
pr_err("%s: device_register failed\n", __func__);
goto error;
@@ -291,7 +296,7 @@ void media_devnode_unregister(struct media_devnode *devnode)
 /*
  * Initialise media for linux
  */
-static int __init media_devnode_init(void)
+static int __init media_devnode_module_init(void)
 {
int ret;
 
@@ -313,14 +318,14 @@ static int __init media_devnode_init(void)
return 0;
 }
 
-static void __exit media_devnode_exit(void)
+static void __exit media_devnode_module_exit(void)
 {
bus_unregister(_bus_type);
unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES);
 }
 
-subsys_initcall(media_devnode_init);
-module_exit(media_devnode_exit)
+subsys_initcall(media_devnode_module_init);
+module_exit(media_devnode_module_exit)
 
 MODULE_AUTHOR("Laurent Pinchart ");
 MODULE_DESCRIPTION("Device node registration for media drivers");
diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index 5d54e2c..aa32537 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1726,8 +1726,10 @@ static int isp_register_entities(struct isp_device *isp)
goto done;
 
 done:
-   if (ret < 0)
+   if (ret < 0) {
isp_unregister_entities(isp);
+   media_device_put(>media_dev);
+   }
 
return ret;
 }
diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h
index a0f6823..5253a4b 100644
--- a/include/media/media-devnode.h
+++ b/include/media/media-devnode.h
@@ -102,6 +102,17 @@ struct media_devnode {
 #define to_media_devnode(cd) container_of(cd, struct media_devnode, dev)
 
 /**
+ * media_devnode_init - initialise a media devnode
+ *
+ * @devnode: struct media_devnode we want to initialise
+ *
+ * Initialise a media devnode. Note that after initialising the media
+ * devnode is refcounted. Releaseing references to it may be done
+ * using put_device.
+ */
+void media_devnode_init(struct media_devnode *devnode);
+
+/**
  * media_devnode_register - register a media device node
  *
  * @devnode: struct media_devnode we want to register a device node
@@ -112,10 +123,6 @@ struct media_devnode {
  * or if the registration of the device node fails.
  *
  * Zero is returned on success.
- *
- * Note that if the media_devnode_register call fails, the release() callback 
of
- * the media_devnode structure is *not* called, so the caller is responsible 
for
- * freeing any data.
  */
 int __must_check media_devnode_register(struct media_devnode *devnode,
struct module *owner);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 16/17] omap3isp: Release the isp device struct by media device callback

2016-08-19 Thread Sakari Ailus
Use the media device release callback to release the isp device's data
structure. This approach has the benefit of not releasing memory which may
still be accessed through open file handles whilst the isp driver is being
unbound.

Signed-off-by: Sakari Ailus 
---
 drivers/media/platform/omap3isp/isp.c | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index 1e42d37..217d4da 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1671,6 +1671,8 @@ static int isp_link_entity(
return media_create_pad_link(entity, i, input, pad, flags);
 }
 
+static void isp_release(struct media_device *mdev);
+
 static int isp_register_entities(struct isp_device *isp)
 {
int ret;
@@ -1683,6 +1685,7 @@ static int isp_register_entities(struct isp_device *isp)
sizeof(isp->media_dev->model));
isp->media_dev->hw_revision = isp->revision;
isp->media_dev->link_notify = v4l2_pipeline_link_notify;
+   isp->media_dev->release = isp_release;
 
isp->v4l2_dev.mdev = isp->media_dev;
ret = v4l2_device_register(isp->dev, >v4l2_dev);
@@ -1945,6 +1948,20 @@ static void isp_detach_iommu(struct isp_device *isp)
iommu_group_remove_device(isp->dev);
 }
 
+static void isp_release(struct media_device *mdev)
+{
+   struct isp_device *isp = media_device_priv(mdev);
+
+   isp_cleanup_modules(isp);
+   isp_xclk_cleanup(isp);
+
+   __omap3isp_get(isp, false);
+   isp_detach_iommu(isp);
+   __omap3isp_put(isp, false);
+
+   media_entity_enum_cleanup(>crashed);
+}
+
 static int isp_attach_iommu(struct isp_device *isp)
 {
struct dma_iommu_mapping *mapping;
@@ -2005,14 +2022,6 @@ static int isp_remove(struct platform_device *pdev)
 
v4l2_async_notifier_unregister(>notifier);
isp_unregister_entities(isp);
-   isp_cleanup_modules(isp);
-   isp_xclk_cleanup(isp);
-
-   __omap3isp_get(isp, false);
-   isp_detach_iommu(isp);
-   __omap3isp_put(isp, false);
-
-   media_entity_enum_cleanup(>crashed);
 
return 0;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 06/17] media: Dynamically allocate the media device

2016-08-19 Thread Sakari Ailus
From: Sakari Ailus 

Allow allocating the media device dynamically. As the struct media_device
embeds struct media_devnode, the lifetime of that object is that same than
that of the media_device.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 22 ++
 include/media/media-device.h | 38 ++
 2 files changed, 60 insertions(+)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index a431775..5a86d36 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -544,7 +544,15 @@ static DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
 
 static void media_device_release(struct media_devnode *devnode)
 {
+   struct media_device *mdev = to_media_device(devnode);
+
+   ida_destroy(>entity_internal_idx);
+   mdev->entity_internal_idx_max = 0;
+   media_entity_graph_walk_cleanup(>pm_count_walk);
+   mutex_destroy(>graph_mutex);
dev_dbg(devnode->parent, "Media device released\n");
+
+   kfree(mdev);
 }
 
 /**
@@ -691,6 +699,20 @@ void media_device_init(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_init);
 
+struct media_device *media_device_alloc(void)
+{
+   struct media_device *mdev;
+
+   mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+   if (!mdev)
+   return NULL;
+
+   media_device_init(mdev);
+
+   return mdev;
+}
+EXPORT_SYMBOL_GPL(media_device_alloc);
+
 void media_device_cleanup(struct media_device *mdev)
 {
ida_destroy(>entity_internal_idx);
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 4eee613..d1d45ab 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -197,6 +197,42 @@ static inline __must_check int media_entity_enum_init(
 void media_device_init(struct media_device *mdev);
 
 /**
+ * media_device_alloc() - Allocate and initialise a media device
+ *
+ * Allocate and initialise a media device. Returns a media device.
+ * The media device is refcounted, and this function returns a media
+ * device the refcount of which is one (1).
+ *
+ * References are taken and given using media_device_get() and
+ * media_device_put().
+ */
+struct media_device *media_device_alloc(void);
+
+/**
+ * media_device_get() - Get a reference to a media device
+ *
+ * mdev: media device
+ */
+#define media_device_get(mdev) \
+   do {\
+   dev_dbg((mdev)->dev, "%s: get media device %s\n",   \
+   __func__, (mdev)->bus_info);\
+   get_device(&(mdev)->devnode.dev);   \
+   } while (0)
+
+/**
+ * media_device_put() - Put a reference to a media device
+ *
+ * mdev: media device
+ */
+#define media_device_put(mdev) \
+   do {\
+   dev_dbg((mdev)->dev, "%s: put media device %s\n",   \
+   __func__, (mdev)->bus_info);\
+   put_device(&(mdev)->devnode.dev);   \
+   } while (0)
+
+/**
  * media_device_cleanup() - Cleanups a media device element
  *
  * @mdev:  pointer to struct _device
@@ -425,6 +461,8 @@ void __media_device_usb_init(struct media_device *mdev,
 const char *driver_name);
 
 #else
+#define media_device_get(mdev) do { } while (0)
+#define media_device_put(mdev) do { } while (0)
 static inline int media_device_register(struct media_device *mdev)
 {
return 0;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 09/17] media-device: struct media_device requires struct device

2016-08-19 Thread Sakari Ailus
The media device always has a device around. Require one as an argument
for media_device_alloc().

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 12 ++--
 include/media/media-device.h |  4 +++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index d527491..6c8b689 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -699,15 +699,22 @@ void media_device_init(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_init);
 
-struct media_device *media_device_alloc(void)
+struct media_device *media_device_alloc(struct device *dev)
 {
struct media_device *mdev;
 
+   dev = get_device(dev);
+   if (!dev)
+   return NULL;
+
mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
-   if (!mdev)
+   if (!mdev) {
+   put_device(dev);
return NULL;
+   }
 
media_devnode_init(>devnode);
+   mdev->dev = dev;
media_device_init(mdev);
 
return mdev;
@@ -720,6 +727,7 @@ void media_device_cleanup(struct media_device *mdev)
mdev->entity_internal_idx_max = 0;
media_entity_graph_walk_cleanup(>pm_count_walk);
mutex_destroy(>graph_mutex);
+   put_device(mdev->dev);
 }
 EXPORT_SYMBOL_GPL(media_device_cleanup);
 
diff --git a/include/media/media-device.h b/include/media/media-device.h
index d1d45ab..8ccc8e8 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -199,6 +199,8 @@ void media_device_init(struct media_device *mdev);
 /**
  * media_device_alloc() - Allocate and initialise a media device
  *
+ * @dev:   The associated struct device pointer
+ *
  * Allocate and initialise a media device. Returns a media device.
  * The media device is refcounted, and this function returns a media
  * device the refcount of which is one (1).
@@ -206,7 +208,7 @@ void media_device_init(struct media_device *mdev);
  * References are taken and given using media_device_get() and
  * media_device_put().
  */
-struct media_device *media_device_alloc(void);
+struct media_device *media_device_alloc(struct device *dev);
 
 /**
  * media_device_get() - Get a reference to a media device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 17/17] omap3isp: Don't rely on devm for memory resource management

2016-08-19 Thread Sakari Ailus
devm functions are fine for managing resources that are directly related
to the device at hand and that have no other dependencies. However, a
process holding a file handle to a device created by a driver for a device
may result in the file handle left behind after the device is long gone.
This will result in accessing released (and potentially reallocated)
memory.

Instead, rely on the media device which will stick around until all users
are gone.

Signed-off-by: Sakari Ailus 
---
 drivers/media/platform/omap3isp/isp.c | 38 ---
 drivers/media/platform/omap3isp/ispccp2.c |  3 ++-
 drivers/media/platform/omap3isp/isph3a_aewb.c | 20 +-
 drivers/media/platform/omap3isp/isph3a_af.c   | 20 +-
 drivers/media/platform/omap3isp/isphist.c |  5 ++--
 drivers/media/platform/omap3isp/ispstat.c |  2 ++
 6 files changed, 63 insertions(+), 25 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index 217d4da..3488ed3 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1370,7 +1370,7 @@ static int isp_get_clocks(struct isp_device *isp)
unsigned int i;
 
for (i = 0; i < ARRAY_SIZE(isp_clocks); ++i) {
-   clk = devm_clk_get(isp->dev, isp_clocks[i]);
+   clk = clk_get(isp->dev, isp_clocks[i]);
if (IS_ERR(clk)) {
dev_err(isp->dev, "clk_get %s failed\n", isp_clocks[i]);
return PTR_ERR(clk);
@@ -1382,6 +1382,14 @@ static int isp_get_clocks(struct isp_device *isp)
return 0;
 }
 
+static void isp_put_clocks(struct isp_device *isp)
+{
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(isp_clocks); ++i)
+   clk_put(isp->clock[i]);
+}
+
 /*
  * omap3isp_get - Acquire the ISP resource.
  *
@@ -1596,7 +1604,6 @@ static void isp_unregister_entities(struct isp_device 
*isp)
omap3isp_stat_unregister_entities(>isp_af);
omap3isp_stat_unregister_entities(>isp_hist);
 
-   v4l2_device_unregister(>v4l2_dev);
media_device_unregister(isp->media_dev);
 }
 
@@ -1952,6 +1959,8 @@ static void isp_release(struct media_device *mdev)
 {
struct isp_device *isp = media_device_priv(mdev);
 
+   v4l2_device_unregister(>v4l2_dev);
+
isp_cleanup_modules(isp);
isp_xclk_cleanup(isp);
 
@@ -1960,6 +1969,10 @@ static void isp_release(struct media_device *mdev)
__omap3isp_put(isp, false);
 
media_entity_enum_cleanup(>crashed);
+
+   isp_put_clocks(isp);
+
+   kfree(isp);
 }
 
 static int isp_attach_iommu(struct isp_device *isp)
@@ -2212,7 +2225,7 @@ static int isp_probe(struct platform_device *pdev)
int ret;
int i, m;
 
-   isp = devm_kzalloc(>dev, sizeof(*isp), GFP_KERNEL);
+   isp = kzalloc(sizeof(*isp), GFP_KERNEL);
if (!isp) {
dev_err(>dev, "could not allocate memory\n");
return -ENOMEM;
@@ -2221,21 +2234,23 @@ static int isp_probe(struct platform_device *pdev)
ret = of_property_read_u32(pdev->dev.of_node, "ti,phy-type",
   >phy_type);
if (ret)
-   return ret;
+   goto error_release_isp;
 
isp->syscon = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
  "syscon");
-   if (IS_ERR(isp->syscon))
-   return PTR_ERR(isp->syscon);
+   if (IS_ERR(isp->syscon)) {
+   ret = PTR_ERR(isp->syscon);
+   goto error_release_isp;
+   }
 
ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1,
 >syscon_offset);
if (ret)
-   return ret;
+   goto error_release_isp;
 
ret = isp_of_parse_nodes(>dev, >notifier);
if (ret < 0)
-   return ret;
+   goto error_release_isp;
 
isp->autoidle = autoidle;
 
@@ -2252,8 +2267,8 @@ static int isp_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, isp);
 
/* Regulators */
-   isp->isp_csiphy1.vdd = devm_regulator_get(>dev, "vdd-csiphy1");
-   isp->isp_csiphy2.vdd = devm_regulator_get(>dev, "vdd-csiphy2");
+   isp->isp_csiphy1.vdd = regulator_get(>dev, "vdd-csiphy1");
+   isp->isp_csiphy2.vdd = regulator_get(>dev, "vdd-csiphy2");
 
/* Clocks
 *
@@ -2385,6 +2400,9 @@ error_isp:
__omap3isp_put(isp, false);
 error:
mutex_destroy(>isp_mutex);
+   isp_put_clocks(isp);
+error_release_isp:
+   kfree(isp);
 
return ret;
 }
diff --git a/drivers/media/platform/omap3isp/ispccp2.c 
b/drivers/media/platform/omap3isp/ispccp2.c
index ca09523..d49ce8a 100644
--- a/drivers/media/platform/omap3isp/ispccp2.c
+++ b/drivers/media/platform/omap3isp/ispccp2.c
@@ -1135,7 +1135,7 @@ int 

[RFC v2 08/17] media-device: Make devnode.dev->kobj parent of devnode.cdev

2016-08-19 Thread Sakari Ailus
The struct cdev embedded in struct media_devnode contains its own kobj.
Instead of trying to manage its lifetime separately from struct
media_devnode, make the cdev kobj a parent of the struct media_device.dev
kobj.

The cdev will thus be released during unregistering the media_devnode, not
in media_devnode.dev kobj's release callback.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-devnode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index aa8030b..69f84a7 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -63,9 +63,6 @@ static void media_devnode_release(struct device *cd)
 
mutex_lock(_devnode_lock);
 
-   /* Delete the cdev on this minor as well */
-   cdev_del(>cdev);
-
/* Mark device node number as free */
clear_bit(devnode->minor, media_devnode_nums);
 
@@ -246,6 +243,7 @@ int __must_check media_devnode_register(struct 
media_devnode *devnode,
 
/* Part 2: Initialize and register the character device */
cdev_init(>cdev, _devnode_fops);
+   devnode->cdev.kobj.parent = >dev.kobj;
devnode->cdev.owner = owner;
 
ret = cdev_add(>cdev, MKDEV(MAJOR(media_dev_t), 
devnode->minor), 1);
@@ -291,6 +289,7 @@ void media_devnode_unregister(struct media_devnode *devnode)
clear_bit(MEDIA_FLAG_REGISTERED, >flags);
mutex_unlock(_devnode_lock);
device_unregister(>dev);
+   cdev_del(>cdev);
 }
 
 /*
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 03/17] Revert "[media] media-device: dynamically allocate struct media_devnode"

2016-08-19 Thread Sakari Ailus
This reverts commit a087ce704b80 ("[media] media-device: dynamically
allocate struct media_devnode"). The commit was part of an original
patchset to avoid crashes when an unregistering device is in use.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c   | 44 +++---
 drivers/media/media-devnode.c  |  7 +-
 drivers/media/usb/au0828/au0828-core.c |  4 ++--
 drivers/media/usb/uvc/uvc_driver.c |  2 +-
 include/media/media-device.h   |  5 +++-
 include/media/media-devnode.h  | 15 ++--
 6 files changed, 24 insertions(+), 53 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index e61fa66..a1cd50f 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -423,7 +423,7 @@ static long media_device_ioctl(struct file *filp, unsigned 
int cmd,
   unsigned long arg)
 {
struct media_devnode *devnode = media_devnode_data(filp);
-   struct media_device *dev = devnode->media_dev;
+   struct media_device *dev = to_media_device(devnode);
long ret;
 
mutex_lock(>graph_mutex);
@@ -495,7 +495,7 @@ static long media_device_compat_ioctl(struct file *filp, 
unsigned int cmd,
  unsigned long arg)
 {
struct media_devnode *devnode = media_devnode_data(filp);
-   struct media_device *dev = devnode->media_dev;
+   struct media_device *dev = to_media_device(devnode);
long ret;
 
switch (cmd) {
@@ -531,8 +531,7 @@ static const struct media_file_operations media_device_fops 
= {
 static ssize_t show_model(struct device *cd,
  struct device_attribute *attr, char *buf)
 {
-   struct media_devnode *devnode = to_media_devnode(cd);
-   struct media_device *mdev = devnode->media_dev;
+   struct media_device *mdev = to_media_device(to_media_devnode(cd));
 
return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model);
 }
@@ -705,34 +704,23 @@ EXPORT_SYMBOL_GPL(media_device_cleanup);
 int __must_check __media_device_register(struct media_device *mdev,
 struct module *owner)
 {
-   struct media_devnode *devnode;
int ret;
 
-   devnode = kzalloc(sizeof(*devnode), GFP_KERNEL);
-   if (!devnode)
-   return -ENOMEM;
-
/* Register the device node. */
-   mdev->devnode = devnode;
-   devnode->fops = _device_fops;
-   devnode->parent = mdev->dev;
-   devnode->release = media_device_release;
+   mdev->devnode.fops = _device_fops;
+   mdev->devnode.parent = mdev->dev;
+   mdev->devnode.release = media_device_release;
 
/* Set version 0 to indicate user-space that the graph is static */
mdev->topology_version = 0;
 
-   ret = media_devnode_register(mdev, devnode, owner);
-   if (ret < 0) {
-   mdev->devnode = NULL;
-   kfree(devnode);
+   ret = media_devnode_register(>devnode, owner);
+   if (ret < 0)
return ret;
-   }
 
-   ret = device_create_file(>dev, _attr_model);
+   ret = device_create_file(>devnode.dev, _attr_model);
if (ret < 0) {
-   mdev->devnode = NULL;
-   media_devnode_unregister(devnode);
-   kfree(devnode);
+   media_devnode_unregister(>devnode);
return ret;
}
 
@@ -783,7 +771,7 @@ void media_device_unregister(struct media_device *mdev)
mutex_lock(>graph_mutex);
 
/* Check if mdev was ever registered at all */
-   if (!media_devnode_is_registered(mdev->devnode)) {
+   if (!media_devnode_is_registered(>devnode)) {
mutex_unlock(>graph_mutex);
return;
}
@@ -806,13 +794,9 @@ void media_device_unregister(struct media_device *mdev)
 
mutex_unlock(>graph_mutex);
 
-   dev_dbg(mdev->dev, "Media device unregistered\n");
-
-   /* Check if mdev devnode was registered */
-   if (media_devnode_is_registered(mdev->devnode)) {
-   device_remove_file(>devnode->dev, _attr_model);
-   media_devnode_unregister(mdev->devnode);
-   }
+   device_remove_file(>devnode.dev, _attr_model);
+   dev_dbg(mdev->dev, "Media device unregistering\n");
+   media_devnode_unregister(>devnode);
 }
 EXPORT_SYMBOL_GPL(media_device_unregister);
 
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index ecdc02d..7481c96 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -44,7 +44,6 @@
 #include 
 
 #include 
-#include 
 
 #define MEDIA_NUM_DEVICES  256
 #define MEDIA_NAME "media"
@@ -75,8 +74,6 @@ static void media_devnode_release(struct device *cd)
/* Release media_devnode and perform other cleanups as needed. */
if (devnode->release)

[RFC v2 02/17] Revert "[media] media: fix use-after-free in cdev_put() when app exits after driver unbind"

2016-08-19 Thread Sakari Ailus
This reverts commit 5b28dde51d0c ("[media] media: fix use-after-free in
cdev_put() when app exits after driver unbind"). The commit was part of an
original patchset to avoid crashes when an unregistering device is in use.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c  |  6 ++
 drivers/media/media-devnode.c | 48 +--
 2 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 33a9952..e61fa66 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -723,16 +723,16 @@ int __must_check __media_device_register(struct 
media_device *mdev,
 
ret = media_devnode_register(mdev, devnode, owner);
if (ret < 0) {
-   /* devnode free is handled in media_devnode_*() */
mdev->devnode = NULL;
+   kfree(devnode);
return ret;
}
 
ret = device_create_file(>dev, _attr_model);
if (ret < 0) {
-   /* devnode free is handled in media_devnode_*() */
mdev->devnode = NULL;
media_devnode_unregister(devnode);
+   kfree(devnode);
return ret;
}
 
@@ -812,8 +812,6 @@ void media_device_unregister(struct media_device *mdev)
if (media_devnode_is_registered(mdev->devnode)) {
device_remove_file(>devnode->dev, _attr_model);
media_devnode_unregister(mdev->devnode);
-   /* devnode free is handled in media_devnode_*() */
-   mdev->devnode = NULL;
}
 }
 EXPORT_SYMBOL_GPL(media_device_unregister);
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 5b605ff..ecdc02d 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -63,8 +63,13 @@ static void media_devnode_release(struct device *cd)
struct media_devnode *devnode = to_media_devnode(cd);
 
mutex_lock(_devnode_lock);
+
+   /* Delete the cdev on this minor as well */
+   cdev_del(>cdev);
+
/* Mark device node number as free */
clear_bit(devnode->minor, media_devnode_nums);
+
mutex_unlock(_devnode_lock);
 
/* Release media_devnode and perform other cleanups as needed. */
@@ -72,7 +77,6 @@ static void media_devnode_release(struct device *cd)
devnode->release(devnode);
 
kfree(devnode);
-   pr_debug("%s: Media Devnode Deallocated\n", __func__);
 }
 
 static struct bus_type media_bus_type = {
@@ -201,8 +205,6 @@ static int media_release(struct inode *inode, struct file 
*filp)
/* decrease the refcount unconditionally since the release()
   return value is ignored. */
put_device(>dev);
-
-   pr_debug("%s: Media Release\n", __func__);
return 0;
 }
 
@@ -233,7 +235,6 @@ int __must_check media_devnode_register(struct media_device 
*mdev,
if (minor == MEDIA_NUM_DEVICES) {
mutex_unlock(_devnode_lock);
pr_err("could not get a free minor\n");
-   kfree(devnode);
return -ENFILE;
}
 
@@ -243,31 +244,27 @@ int __must_check media_devnode_register(struct 
media_device *mdev,
devnode->minor = minor;
devnode->media_dev = mdev;
 
-   /* Part 1: Initialize dev now to use dev.kobj for cdev.kobj.parent */
-   devnode->dev.bus = _bus_type;
-   devnode->dev.devt = MKDEV(MAJOR(media_dev_t), devnode->minor);
-   devnode->dev.release = media_devnode_release;
-   if (devnode->parent)
-   devnode->dev.parent = devnode->parent;
-   dev_set_name(>dev, "media%d", devnode->minor);
-   device_initialize(>dev);
-
/* Part 2: Initialize and register the character device */
cdev_init(>cdev, _devnode_fops);
devnode->cdev.owner = owner;
-   devnode->cdev.kobj.parent = >dev.kobj;
 
ret = cdev_add(>cdev, MKDEV(MAJOR(media_dev_t), 
devnode->minor), 1);
if (ret < 0) {
pr_err("%s: cdev_add failed\n", __func__);
-   goto cdev_add_error;
+   goto error;
}
 
-   /* Part 3: Add the media device */
-   ret = device_add(>dev);
+   /* Part 3: Register the media device */
+   devnode->dev.bus = _bus_type;
+   devnode->dev.devt = MKDEV(MAJOR(media_dev_t), devnode->minor);
+   devnode->dev.release = media_devnode_release;
+   if (devnode->parent)
+   devnode->dev.parent = devnode->parent;
+   dev_set_name(>dev, "media%d", devnode->minor);
+   ret = device_register(>dev);
if (ret < 0) {
-   pr_err("%s: device_add failed\n", __func__);
-   goto device_add_error;
+   pr_err("%s: device_register failed\n", __func__);
+   goto error;
}
 
/* Part 4: Activate this minor. The char device can now be used. */
@@ -275,15 

[RFC v2 01/17] Revert "[media] media: fix media devnode ioctl/syscall and unregister race"

2016-08-19 Thread Sakari Ailus
This reverts commit 6f0dd24a084a ("[media] media: fix media devnode
ioctl/syscall and unregister race"). The commit was part of an original
patchset to avoid crashes when an unregistering device is in use.

Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c  | 15 +++
 drivers/media/media-devnode.c |  8 +---
 include/media/media-devnode.h | 16 ++--
 3 files changed, 10 insertions(+), 29 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 1795abe..33a9952 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -732,7 +732,6 @@ int __must_check __media_device_register(struct 
media_device *mdev,
if (ret < 0) {
/* devnode free is handled in media_devnode_*() */
mdev->devnode = NULL;
-   media_devnode_unregister_prepare(devnode);
media_devnode_unregister(devnode);
return ret;
}
@@ -789,9 +788,6 @@ void media_device_unregister(struct media_device *mdev)
return;
}
 
-   /* Clear the devnode register bit to avoid races with media dev open */
-   media_devnode_unregister_prepare(mdev->devnode);
-
/* Remove all entities from the media device */
list_for_each_entry_safe(entity, next, >entities, graph_obj.list)
__media_device_unregister_entity(entity);
@@ -812,10 +808,13 @@ void media_device_unregister(struct media_device *mdev)
 
dev_dbg(mdev->dev, "Media device unregistered\n");
 
-   device_remove_file(>devnode->dev, _attr_model);
-   media_devnode_unregister(mdev->devnode);
-   /* devnode free is handled in media_devnode_*() */
-   mdev->devnode = NULL;
+   /* Check if mdev devnode was registered */
+   if (media_devnode_is_registered(mdev->devnode)) {
+   device_remove_file(>devnode->dev, _attr_model);
+   media_devnode_unregister(mdev->devnode);
+   /* devnode free is handled in media_devnode_*() */
+   mdev->devnode = NULL;
+   }
 }
 EXPORT_SYMBOL_GPL(media_device_unregister);
 
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index f2772ba..5b605ff 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -287,7 +287,7 @@ cdev_add_error:
return ret;
 }
 
-void media_devnode_unregister_prepare(struct media_devnode *devnode)
+void media_devnode_unregister(struct media_devnode *devnode)
 {
/* Check if devnode was ever registered at all */
if (!media_devnode_is_registered(devnode))
@@ -295,12 +295,6 @@ void media_devnode_unregister_prepare(struct media_devnode 
*devnode)
 
mutex_lock(_devnode_lock);
clear_bit(MEDIA_FLAG_REGISTERED, >flags);
-   mutex_unlock(_devnode_lock);
-}
-
-void media_devnode_unregister(struct media_devnode *devnode)
-{
-   mutex_lock(_devnode_lock);
/* Delete the cdev on this minor as well */
cdev_del(>cdev);
mutex_unlock(_devnode_lock);
diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h
index 37d4948..d5037a9 100644
--- a/include/media/media-devnode.h
+++ b/include/media/media-devnode.h
@@ -127,26 +127,14 @@ int __must_check media_devnode_register(struct 
media_device *mdev,
struct module *owner);
 
 /**
- * media_devnode_unregister_prepare - clear the media device node register bit
- * @devnode: the device node to prepare for unregister
- *
- * This clears the passed device register bit. Future open calls will be met
- * with errors. Should be called before media_devnode_unregister() to avoid
- * races with unregister and device file open calls.
- *
- * This function can safely be called if the device node has never been
- * registered or has already been unregistered.
- */
-void media_devnode_unregister_prepare(struct media_devnode *devnode);
-
-/**
  * media_devnode_unregister - unregister a media device node
  * @devnode: the device node to unregister
  *
  * This unregisters the passed device. Future open calls will be met with
  * errors.
  *
- * Should be called after media_devnode_unregister_prepare()
+ * This function can safely be called if the device node has never been
+ * registered or has already been unregistered.
  */
 void media_devnode_unregister(struct media_devnode *devnode);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 05/17] media: devnode: Rename mdev argument as devnode

2016-08-19 Thread Sakari Ailus
Historically, mdev argument name was being used on both struct
media_device and struct media_devnode. Recently most occurrences of mdev
referring to struct media_devnode were replaced by devnode, which makes
more sense. Fix the last remaining occurrence.

Fixes: 163f1e93e9950 ("[media] media-devnode: fix namespace mess")
Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 8bdc316..a431775 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -542,9 +542,9 @@ static DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
  * Registration/unregistration
  */
 
-static void media_device_release(struct media_devnode *mdev)
+static void media_device_release(struct media_devnode *devnode)
 {
-   dev_dbg(mdev->parent, "Media device released\n");
+   dev_dbg(devnode->parent, "Media device released\n");
 }
 
 /**
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 04/17] media: Remove useless curly braces and parentheses

2016-08-19 Thread Sakari Ailus
Signed-off-by: Sakari Ailus 
---
 drivers/media/media-device.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index a1cd50f..8bdc316 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -596,9 +596,8 @@ int __must_check media_device_register_entity(struct 
media_device *mdev,
   >pads[i].graph_obj);
 
/* invoke entity_notify callbacks */
-   list_for_each_entry_safe(notify, next, >entity_notify, list) {
-   (notify)->notify(entity, notify->notify_data);
-   }
+   list_for_each_entry_safe(notify, next, >entity_notify, list)
+   notify->notify(entity, notify->notify_data);
 
if (mdev->entity_internal_idx_max
>= mdev->pm_count_walk.ent_enum.idx_max) {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2 00/17] Make use of kref in media device, grab references as needed

2016-08-19 Thread Sakari Ailus
Hi folks,

Here's the second version of the media reference patchset I've been
working on for some time.

The lifetime of the media device (and media devnode) is now bound to that
of struct device embedded in it and its memory is only released once the
last reference is gone: unregistering is simply unregistering, it no
longer should release memory which could be further accessed.

A video node or a sub-device node also gets a reference to the media
device, i.e. the release function of the video device node will release
its reference to the media device. The same goes for file handles to the
media device.

As a side effect of this is that the media device, it is allocate together
with the media devnode. The driver may also rely its own resources to the
media device. Alternatively there's also a priv field to hold drivers
private pointer (for container_of() is an option in this case). We could
drop one of these options but currently both are possible.

I've tested this by manually unbinding the omap3isp platform device while
streaming. Driver changes are required for this to work; by not using
dynamic allocation (i.e. media_device_alloc()) the old behaviour is still
supported. This is still unlikely to be a grave problem as there are not
that many device drivers that support physically removable devices. We've
had this problem for other devices for many years without paying much
notice --- that doesn't mean I don't think at least drivers for removable
devices shouldn't be changed as part of the set later on, I'd just like to
get review comments on the approach first.

The three patches that originally partially resolved some of these issues
are reverted in the beginning of the set. I'm still posting this as an RFC
mainly since the testing is somewhat limited so far.

changes since v1:

- Drop kref in struct media_devnode, rely on struct device instead

- Do not add a separate struct holding the cdev. It remains in struct
  media_devnode instead.

v1 is available here:


-- 
Kind regards,
Sakari

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] uvc_v4l2: One function call less in uvc_ioctl_ctrl_map() after error detection

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring 
Date: Fri, 19 Aug 2016 11:00:38 +0200

The kfree() function was called in two cases by the uvc_ioctl_ctrl_map()
function during error handling even if the passed data structure element
contained a null pointer.

Adjust jump targets according to the Linux coding style convention.

Signed-off-by: Markus Elfring 
---
 drivers/media/usb/uvc/uvc_v4l2.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index a7e12fd..52a2af8 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -66,14 +66,14 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
if (xmap->menu_count == 0 ||
xmap->menu_count > UVC_MAX_CONTROL_MENU_ENTRIES) {
ret = -EINVAL;
-   goto done;
+   goto free_map;
}
 
size = xmap->menu_count * sizeof(*map->menu_info);
map->menu_info = memdup_user(xmap->menu_info, size);
if (IS_ERR(map->menu_info)) {
ret = PTR_ERR(map->menu_info);
-   goto done;
+   goto free_map;
}
 
map->menu_count = xmap->menu_count;
@@ -83,13 +83,12 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
uvc_trace(UVC_TRACE_CONTROL, "Unsupported V4L2 control type "
  "%u.\n", xmap->v4l2_type);
ret = -ENOTTY;
-   goto done;
+   goto free_map;
}
 
ret = uvc_ctrl_add_mapping(chain, map);
-
-done:
kfree(map->menu_info);
+free_map:
kfree(map);
 
return ret;
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] uvc_v4l2: Use memdup_user() rather than duplicating its implementation

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring 
Date: Fri, 19 Aug 2016 10:50:05 +0200

Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 drivers/media/usb/uvc/uvc_v4l2.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 05eed4b..a7e12fd 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -70,14 +70,9 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
}
 
size = xmap->menu_count * sizeof(*map->menu_info);
-   map->menu_info = kmalloc(size, GFP_KERNEL);
-   if (map->menu_info == NULL) {
-   ret = -ENOMEM;
-   goto done;
-   }
-
-   if (copy_from_user(map->menu_info, xmap->menu_info, size)) {
-   ret = -EFAULT;
+   map->menu_info = memdup_user(xmap->menu_info, size);
+   if (IS_ERR(map->menu_info)) {
+   ret = PTR_ERR(map->menu_info);
goto done;
}
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] uvc_v4l2: Fine-tuning for uvc_ioctl_ctrl_map()

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring 
Date: Fri, 19 Aug 2016 11:11:01 +0200

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Use memdup_user() rather than duplicating its implementation
  One function call less after error detection

 drivers/media/usb/uvc/uvc_v4l2.c | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] drm: Don't implement empty prepare_fb()/cleanup_fb()

2016-08-19 Thread Daniel Vetter
On Fri, Aug 19, 2016 at 11:39:29AM +0300, Laurent Pinchart wrote:
> The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's
> no need to implement empty stubs, and no need to explicitly set the
> function pointers to NULL either.
> 
> Signed-off-by: Laurent Pinchart 

Rebased onto Chris' patch (which I had already in the queue) and applied
to drm-misc.

Thanks, Daniel

> ---
>  drivers/gpu/drm/arc/arcpgu_crtc.c   |  2 --
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 15 ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 15 ---
>  drivers/gpu/drm/tegra/dc.c  | 17 -
>  drivers/gpu/drm/vc4/vc4_plane.c |  2 --
>  5 files changed, 51 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
> b/drivers/gpu/drm/arc/arcpgu_crtc.c
> index ee0a61c2861b..7130b044b004 100644
> --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
> +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
> @@ -183,8 +183,6 @@ static void arc_pgu_plane_atomic_update(struct drm_plane 
> *plane,
>  }
>  
>  static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
> - .prepare_fb = NULL,
> - .cleanup_fb = NULL,
>   .atomic_update = arc_pgu_plane_atomic_update,
>  };
>  
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c 
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> index e50467a0deb0..a7e5486bd1e9 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> @@ -169,25 +169,10 @@ static void fsl_dcu_drm_plane_atomic_update(struct 
> drm_plane *plane,
>   return;
>  }
>  
> -static void
> -fsl_dcu_drm_plane_cleanup_fb(struct drm_plane *plane,
> -  const struct drm_plane_state *new_state)
> -{
> -}
> -
> -static int
> -fsl_dcu_drm_plane_prepare_fb(struct drm_plane *plane,
> -  const struct drm_plane_state *new_state)
> -{
> - return 0;
> -}
> -
>  static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = {
>   .atomic_check = fsl_dcu_drm_plane_atomic_check,
>   .atomic_disable = fsl_dcu_drm_plane_atomic_disable,
>   .atomic_update = fsl_dcu_drm_plane_atomic_update,
> - .cleanup_fb = fsl_dcu_drm_plane_cleanup_fb,
> - .prepare_fb = fsl_dcu_drm_plane_prepare_fb,
>  };
>  
>  static void fsl_dcu_drm_plane_destroy(struct drm_plane *plane)
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
> b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index c3707d47cd89..635ead039b8b 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -815,19 +815,6 @@ static void ade_disable_channel(struct ade_plane *aplane)
>   ade_compositor_routing_disable(base, ch);
>  }
>  
> -static int ade_plane_prepare_fb(struct drm_plane *plane,
> - const struct drm_plane_state *new_state)
> -{
> - /* do nothing */
> - return 0;
> -}
> -
> -static void ade_plane_cleanup_fb(struct drm_plane *plane,
> -  const struct drm_plane_state *old_state)
> -{
> - /* do nothing */
> -}
> -
>  static int ade_plane_atomic_check(struct drm_plane *plane,
> struct drm_plane_state *state)
>  {
> @@ -895,8 +882,6 @@ static void ade_plane_atomic_disable(struct drm_plane 
> *plane,
>  }
>  
>  static const struct drm_plane_helper_funcs ade_plane_helper_funcs = {
> - .prepare_fb = ade_plane_prepare_fb,
> - .cleanup_fb = ade_plane_cleanup_fb,
>   .atomic_check = ade_plane_atomic_check,
>   .atomic_update = ade_plane_atomic_update,
>   .atomic_disable = ade_plane_atomic_disable,
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 8495bd01b544..3de7ce33d3d4 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -480,17 +480,6 @@ static const struct drm_plane_funcs 
> tegra_primary_plane_funcs = {
>   .atomic_destroy_state = tegra_plane_atomic_destroy_state,
>  };
>  
> -static int tegra_plane_prepare_fb(struct drm_plane *plane,
> -   const struct drm_plane_state *new_state)
> -{
> - return 0;
> -}
> -
> -static void tegra_plane_cleanup_fb(struct drm_plane *plane,
> -const struct drm_plane_state *old_fb)
> -{
> -}
> -
>  static int tegra_plane_state_add(struct tegra_plane *plane,
>struct drm_plane_state *state)
>  {
> @@ -624,8 +613,6 @@ static void tegra_plane_atomic_disable(struct drm_plane 
> *plane,
>  }
>  
>  static const struct drm_plane_helper_funcs tegra_primary_plane_helper_funcs 
> = {
> - .prepare_fb = tegra_plane_prepare_fb,
> - .cleanup_fb = tegra_plane_cleanup_fb,
>   .atomic_check = tegra_plane_atomic_check,
>   .atomic_update = tegra_plane_atomic_update,
>   .atomic_disable = 

[PATCH] cec-follower/cec-compliance: fix bug in string conversion

2016-08-19 Thread Johan Fjeldtvedt
In all_dev_types2s: don't try to erase the last two characters in the
string if it is empty.

This was fixed in cec-ctl, so the same fix is applied to cec-compliance
and cec-follower.

Signed-off-by: Johan Fjeldtvedt 
---
 utils/cec-compliance/cec-compliance.cpp | 4 +++-
 utils/cec-follower/cec-follower.cpp | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/utils/cec-compliance/cec-compliance.cpp 
b/utils/cec-compliance/cec-compliance.cpp
index c40d4b1..519c572 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -358,7 +358,9 @@ std::string all_dev_types2s(unsigned types)
s += "Audio System, ";
if (types & CEC_OP_ALL_DEVTYPE_SWITCH)
s += "Switch, ";
-   return s.erase(s.length() - 2, 2);
+   if (s.length())
+   return s.erase(s.length() - 2, 2);
+   return s;
 }
 
 std::string rc_src_prof2s(unsigned prof)
diff --git a/utils/cec-follower/cec-follower.cpp 
b/utils/cec-follower/cec-follower.cpp
index abb06a8..7850ecd 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -305,7 +305,9 @@ std::string all_dev_types2s(unsigned types)
s += "Audio System, ";
if (types & CEC_OP_ALL_DEVTYPE_SWITCH)
s += "Switch, ";
-   return s.erase(s.length() - 2, 2);
+   if (s.length())
+   return s.erase(s.length() - 2, 2);
+   return s;
 }
 
 std::string rc_src_prof2s(unsigned prof)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] v4l: rcar-fcp: Don't get/put module reference

2016-08-19 Thread Geert Uytterhoeven
On Fri, Aug 19, 2016 at 10:39 AM, Laurent Pinchart
 wrote:
> Direct callers of the FCP API hold a reference to the FCP module due to
> module linkage, there's no need to take another one manually. Take a
> reference to the device instead to ensure that it won't disappear being

... behind

> the caller's back.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] drm: Unconstify state argument to prepare_fb()/cleanup_fb()

2016-08-19 Thread Laurent Pinchart
The functions might need to modify the state to store memory-related
data.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++--
 drivers/gpu/drm/i915/intel_display.c| 4 ++--
 drivers/gpu/drm/i915/intel_drv.h| 4 ++--
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c   | 4 ++--
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c   | 4 ++--
 drivers/gpu/drm/omapdrm/omap_plane.c| 4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
 include/drm/drm_modeset_helper_vtables.h| 4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 016c191221f3..ae2b31dd9487 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -755,7 +755,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane 
*p,
 }
 
 static int atmel_hlcdc_plane_prepare_fb(struct drm_plane *p,
-   const struct drm_plane_state *new_state)
+   struct drm_plane_state *new_state)
 {
/*
 * FIXME: we should avoid this const -> non-const cast but it's
@@ -780,7 +780,7 @@ static int atmel_hlcdc_plane_prepare_fb(struct drm_plane *p,
 }
 
 static void atmel_hlcdc_plane_cleanup_fb(struct drm_plane *p,
-   const struct drm_plane_state *old_state)
+   struct drm_plane_state *old_state)
 {
/*
 * FIXME: we should avoid this const -> non-const cast but it's
diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index dcf93b3d4fb6..cf70de704b2a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13974,7 +13974,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
  */
 int
 intel_prepare_plane_fb(struct drm_plane *plane,
-  const struct drm_plane_state *new_state)
+  struct drm_plane_state *new_state)
 {
struct drm_device *dev = plane->dev;
struct drm_framebuffer *fb = new_state->fb;
@@ -14058,7 +14058,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
  */
 void
 intel_cleanup_plane_fb(struct drm_plane *plane,
-  const struct drm_plane_state *old_state)
+  struct drm_plane_state *old_state)
 {
struct drm_device *dev = plane->dev;
struct intel_plane_state *old_intel_state;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cc937a19b1ba..aa0d6679eff3 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1238,9 +1238,9 @@ void intel_finish_page_flip_cs(struct drm_i915_private 
*dev_priv, int pipe);
 void intel_finish_page_flip_mmio(struct drm_i915_private *dev_priv, int pipe);
 void intel_check_page_flip(struct drm_i915_private *dev_priv, int pipe);
 int intel_prepare_plane_fb(struct drm_plane *plane,
-  const struct drm_plane_state *new_state);
+  struct drm_plane_state *new_state);
 void intel_cleanup_plane_fb(struct drm_plane *plane,
-   const struct drm_plane_state *old_state);
+   struct drm_plane_state *old_state);
 int intel_plane_atomic_get_property(struct drm_plane *plane,
const struct drm_plane_state *state,
struct drm_property *property,
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c 
b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c
index 9f96dfe67769..0689a06bec8e 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c
@@ -99,7 +99,7 @@ static const struct drm_plane_funcs mdp4_plane_funcs = {
 };
 
 static int mdp4_plane_prepare_fb(struct drm_plane *plane,
-   const struct drm_plane_state *new_state)
+   struct drm_plane_state *new_state)
 {
struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane);
struct mdp4_kms *mdp4_kms = get_kms(plane);
@@ -113,7 +113,7 @@ static int mdp4_plane_prepare_fb(struct drm_plane *plane,
 }
 
 static void mdp4_plane_cleanup_fb(struct drm_plane *plane,
-   const struct drm_plane_state *old_state)
+   struct drm_plane_state *old_state)
 {
struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane);
struct mdp4_kms *mdp4_kms = get_kms(plane);
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c 
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index 432c09836b0e..1ef024df51a8 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -250,7 +250,7 @@ static const struct drm_plane_funcs mdp5_plane_funcs = {
 };
 
 static int mdp5_plane_prepare_fb(struct drm_plane 

[PATCH 4/6] v4l: rcar-fcp: Add an API to retrieve the FCP device

2016-08-19 Thread Laurent Pinchart
The new rcar_fcp_get_device() function retrieves the struct device
related to the FCP device. This is useful to handle DMA mapping through
the right device.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/rcar-fcp.c | 6 ++
 include/media/rcar-fcp.h  | 5 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/media/platform/rcar-fcp.c 
b/drivers/media/platform/rcar-fcp.c
index 7427be1c3741..60e7ec17d4e2 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -78,6 +78,12 @@ void rcar_fcp_put(struct rcar_fcp_device *fcp)
 }
 EXPORT_SYMBOL_GPL(rcar_fcp_put);
 
+struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
+{
+   return fcp->dev;
+}
+EXPORT_SYMBOL_GPL(rcar_fcp_get_device);
+
 /**
  * rcar_fcp_enable - Enable an FCP
  * @fcp: The FCP instance
diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h
index 8723f05c6321..b60a7b176c37 100644
--- a/include/media/rcar-fcp.h
+++ b/include/media/rcar-fcp.h
@@ -19,6 +19,7 @@ struct rcar_fcp_device;
 #if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP)
 struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np);
 void rcar_fcp_put(struct rcar_fcp_device *fcp);
+struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp);
 int rcar_fcp_enable(struct rcar_fcp_device *fcp);
 void rcar_fcp_disable(struct rcar_fcp_device *fcp);
 #else
@@ -27,6 +28,10 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const 
struct device_node *np)
return ERR_PTR(-ENOENT);
 }
 static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { }
+static inline struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
+{
+   return NULL;
+}
 static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp)
 {
return 0;
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] v4l: vsp1: Add API to map and unmap DRM buffers through the VSP

2016-08-19 Thread Laurent Pinchart
The display buffers must be mapped for DMA through the device that
performs memory access. Expose an API to map and unmap memory through
the VSP device to be used by the DU.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1_drm.c | 24 
 include/media/vsp1.h   |  3 +++
 2 files changed, 27 insertions(+)

diff --git a/drivers/media/platform/vsp1/vsp1_drm.c 
b/drivers/media/platform/vsp1/vsp1_drm.c
index f76131b192a4..0472cb4bc2e4 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -12,9 +12,11 @@
  */
 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -521,6 +523,28 @@ void vsp1_du_atomic_flush(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush);
 
+int vsp1_du_map_sg(struct device *dev, struct sg_table *sgt)
+{
+   struct vsp1_device *vsp1 = dev_get_drvdata(dev);
+   struct device *map_dev;
+
+   map_dev = vsp1->fcp ? rcar_fcp_get_device(vsp1->fcp) : dev;
+
+   return dma_map_sg(map_dev, sgt->sgl, sgt->nents, DMA_TO_DEVICE);
+}
+EXPORT_SYMBOL_GPL(vsp1_du_map_sg);
+
+void vsp1_du_unmap_sg(struct device *dev, struct sg_table *sgt)
+{
+   struct vsp1_device *vsp1 = dev_get_drvdata(dev);
+   struct device *map_dev;
+
+   map_dev = vsp1->fcp ? rcar_fcp_get_device(vsp1->fcp) : dev;
+
+   dma_unmap_sg(map_dev, sgt->sgl, sgt->nents, DMA_TO_DEVICE);
+}
+EXPORT_SYMBOL_GPL(vsp1_du_unmap_sg);
+
 /* 
-
  * Initialization
  */
diff --git a/include/media/vsp1.h b/include/media/vsp1.h
index 458b400373d4..8d3d07a3715e 100644
--- a/include/media/vsp1.h
+++ b/include/media/vsp1.h
@@ -13,6 +13,7 @@
 #ifndef __MEDIA_VSP1_H__
 #define __MEDIA_VSP1_H__
 
+#include 
 #include 
 #include 
 
@@ -37,5 +38,7 @@ void vsp1_du_atomic_begin(struct device *dev);
 int vsp1_du_atomic_update(struct device *dev, unsigned int rpf,
  const struct vsp1_du_atomic_config *cfg);
 void vsp1_du_atomic_flush(struct device *dev);
+int vsp1_du_map_sg(struct device *dev, struct sg_table *sgt);
+void vsp1_du_unmap_sg(struct device *dev, struct sg_table *sgt);
 
 #endif /* __MEDIA_VSP1_H__ */
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] drm: rcar-du: Map memory through the VSP device

2016-08-19 Thread Laurent Pinchart
For planes handled by a VSP instance, map the framebuffer memory through
the VSP to ensure proper IOMMU handling.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 74 ---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.h |  2 +
 2 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c 
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 83ebd162f3ef..851c2e78de0a 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -19,7 +19,9 @@
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -166,12 +168,9 @@ static void rcar_du_vsp_plane_setup(struct 
rcar_du_vsp_plane *plane)
cfg.dst.width = state->state.crtc_w;
cfg.dst.height = state->state.crtc_h;
 
-   for (i = 0; i < state->format->planes; ++i) {
-   struct drm_gem_cma_object *gem;
-
-   gem = drm_fb_cma_get_gem_obj(fb, i);
-   cfg.mem[i] = gem->paddr + fb->offsets[i];
-   }
+   for (i = 0; i < state->format->planes; ++i)
+   cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
+  + fb->offsets[i];
 
for (i = 0; i < ARRAY_SIZE(formats_kms); ++i) {
if (formats_kms[i] == state->format->fourcc) {
@@ -183,6 +182,67 @@ static void rcar_du_vsp_plane_setup(struct 
rcar_du_vsp_plane *plane)
vsp1_du_atomic_update(plane->vsp->vsp, plane->index, );
 }
 
+static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane,
+   struct drm_plane_state *state)
+{
+   struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state);
+   struct rcar_du_vsp *vsp = to_rcar_vsp_plane(plane)->vsp;
+   struct rcar_du_device *rcdu = vsp->dev;
+   unsigned int i;
+   int ret;
+
+   if (!state->fb)
+   return 0;
+
+   for (i = 0; i < rstate->format->planes; ++i) {
+   struct drm_gem_cma_object *gem =
+   drm_fb_cma_get_gem_obj(state->fb, i);
+   struct sg_table *sgt = >sg_tables[i];
+
+   ret = dma_get_sgtable(rcdu->dev, sgt, gem->vaddr, gem->paddr,
+ gem->base.size);
+   if (ret)
+   goto fail;
+
+   ret = vsp1_du_map_sg(vsp->vsp, sgt);
+   if (!ret) {
+   sg_free_table(sgt);
+   ret = -ENOMEM;
+   goto fail;
+   }
+   }
+
+   return 0;
+
+fail:
+   for (i--; i >= 0; i--) {
+   struct sg_table *sgt = >sg_tables[i];
+
+   vsp1_du_unmap_sg(vsp->vsp, sgt);
+   sg_free_table(sgt);
+   }
+
+   return ret;
+}
+
+static void rcar_du_vsp_plane_cleanup_fb(struct drm_plane *plane,
+struct drm_plane_state *state)
+{
+   struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state);
+   struct rcar_du_vsp *vsp = to_rcar_vsp_plane(plane)->vsp;
+   unsigned int i;
+
+   if (!state->fb)
+   return;
+
+   for (i = 0; i < rstate->format->planes; ++i) {
+   struct sg_table *sgt = >sg_tables[i];
+
+   vsp1_du_unmap_sg(vsp->vsp, sgt);
+   sg_free_table(sgt);
+   }
+}
+
 static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane,
  struct drm_plane_state *state)
 {
@@ -223,6 +283,8 @@ static void rcar_du_vsp_plane_atomic_update(struct 
drm_plane *plane,
 }
 
 static const struct drm_plane_helper_funcs rcar_du_vsp_plane_helper_funcs = {
+   .prepare_fb = rcar_du_vsp_plane_prepare_fb,
+   .cleanup_fb = rcar_du_vsp_plane_cleanup_fb,
.atomic_check = rcar_du_vsp_plane_atomic_check,
.atomic_update = rcar_du_vsp_plane_atomic_update,
 };
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h 
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
index 510dcc9c6816..bbb41610e38a 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
@@ -43,6 +43,7 @@ static inline struct rcar_du_vsp_plane 
*to_rcar_vsp_plane(struct drm_plane *p)
  * struct rcar_du_vsp_plane_state - Driver-specific plane state
  * @state: base DRM plane state
  * @format: information about the pixel format used by the plane
+ * @sg_tables: scatter-gather tables for the frame buffer memory
  * @alpha: value of the plane alpha property
  * @zpos: value of the plane zpos property
  */
@@ -50,6 +51,7 @@ struct rcar_du_vsp_plane_state {
struct drm_plane_state state;
 
const struct rcar_du_format_info *format;
+   struct sg_table sg_tables[3];
 
unsigned int alpha;
unsigned int zpos;
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to 

[PATCH 1/6] drm: Don't implement empty prepare_fb()/cleanup_fb()

2016-08-19 Thread Laurent Pinchart
The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's
no need to implement empty stubs, and no need to explicitly set the
function pointers to NULL either.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/arc/arcpgu_crtc.c   |  2 --
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 15 ---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 15 ---
 drivers/gpu/drm/tegra/dc.c  | 17 -
 drivers/gpu/drm/vc4/vc4_plane.c |  2 --
 5 files changed, 51 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
b/drivers/gpu/drm/arc/arcpgu_crtc.c
index ee0a61c2861b..7130b044b004 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -183,8 +183,6 @@ static void arc_pgu_plane_atomic_update(struct drm_plane 
*plane,
 }
 
 static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
-   .prepare_fb = NULL,
-   .cleanup_fb = NULL,
.atomic_update = arc_pgu_plane_atomic_update,
 };
 
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index e50467a0deb0..a7e5486bd1e9 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -169,25 +169,10 @@ static void fsl_dcu_drm_plane_atomic_update(struct 
drm_plane *plane,
return;
 }
 
-static void
-fsl_dcu_drm_plane_cleanup_fb(struct drm_plane *plane,
-const struct drm_plane_state *new_state)
-{
-}
-
-static int
-fsl_dcu_drm_plane_prepare_fb(struct drm_plane *plane,
-const struct drm_plane_state *new_state)
-{
-   return 0;
-}
-
 static const struct drm_plane_helper_funcs fsl_dcu_drm_plane_helper_funcs = {
.atomic_check = fsl_dcu_drm_plane_atomic_check,
.atomic_disable = fsl_dcu_drm_plane_atomic_disable,
.atomic_update = fsl_dcu_drm_plane_atomic_update,
-   .cleanup_fb = fsl_dcu_drm_plane_cleanup_fb,
-   .prepare_fb = fsl_dcu_drm_plane_prepare_fb,
 };
 
 static void fsl_dcu_drm_plane_destroy(struct drm_plane *plane)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index c3707d47cd89..635ead039b8b 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -815,19 +815,6 @@ static void ade_disable_channel(struct ade_plane *aplane)
ade_compositor_routing_disable(base, ch);
 }
 
-static int ade_plane_prepare_fb(struct drm_plane *plane,
-   const struct drm_plane_state *new_state)
-{
-   /* do nothing */
-   return 0;
-}
-
-static void ade_plane_cleanup_fb(struct drm_plane *plane,
-const struct drm_plane_state *old_state)
-{
-   /* do nothing */
-}
-
 static int ade_plane_atomic_check(struct drm_plane *plane,
  struct drm_plane_state *state)
 {
@@ -895,8 +882,6 @@ static void ade_plane_atomic_disable(struct drm_plane 
*plane,
 }
 
 static const struct drm_plane_helper_funcs ade_plane_helper_funcs = {
-   .prepare_fb = ade_plane_prepare_fb,
-   .cleanup_fb = ade_plane_cleanup_fb,
.atomic_check = ade_plane_atomic_check,
.atomic_update = ade_plane_atomic_update,
.atomic_disable = ade_plane_atomic_disable,
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 8495bd01b544..3de7ce33d3d4 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -480,17 +480,6 @@ static const struct drm_plane_funcs 
tegra_primary_plane_funcs = {
.atomic_destroy_state = tegra_plane_atomic_destroy_state,
 };
 
-static int tegra_plane_prepare_fb(struct drm_plane *plane,
- const struct drm_plane_state *new_state)
-{
-   return 0;
-}
-
-static void tegra_plane_cleanup_fb(struct drm_plane *plane,
-  const struct drm_plane_state *old_fb)
-{
-}
-
 static int tegra_plane_state_add(struct tegra_plane *plane,
 struct drm_plane_state *state)
 {
@@ -624,8 +613,6 @@ static void tegra_plane_atomic_disable(struct drm_plane 
*plane,
 }
 
 static const struct drm_plane_helper_funcs tegra_primary_plane_helper_funcs = {
-   .prepare_fb = tegra_plane_prepare_fb,
-   .cleanup_fb = tegra_plane_cleanup_fb,
.atomic_check = tegra_plane_atomic_check,
.atomic_update = tegra_plane_atomic_update,
.atomic_disable = tegra_plane_atomic_disable,
@@ -796,8 +783,6 @@ static const struct drm_plane_funcs 
tegra_cursor_plane_funcs = {
 };
 
 static const struct drm_plane_helper_funcs tegra_cursor_plane_helper_funcs = {
-   .prepare_fb = tegra_plane_prepare_fb,
-   .cleanup_fb = tegra_plane_cleanup_fb,
.atomic_check = tegra_cursor_atomic_check,
.atomic_update = 

[PATCH 3/6] v4l: rcar-fcp: Don't get/put module reference

2016-08-19 Thread Laurent Pinchart
Direct callers of the FCP API hold a reference to the FCP module due to
module linkage, there's no need to take another one manually. Take a
reference to the device instead to ensure that it won't disappear being
the caller's back.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/rcar-fcp.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/rcar-fcp.c 
b/drivers/media/platform/rcar-fcp.c
index f7bcbf7677a0..7427be1c3741 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -53,14 +53,7 @@ struct rcar_fcp_device *rcar_fcp_get(const struct 
device_node *np)
if (fcp->dev->of_node != np)
continue;
 
-   /*
-* Make sure the module won't be unloaded behind our back. This
-* is a poor man's safety net, the module should really not be
-* unloaded while FCP users can be active.
-*/
-   if (!try_module_get(fcp->dev->driver->owner))
-   fcp = NULL;
-
+   get_device(fcp->dev);
goto done;
}
 
@@ -81,7 +74,7 @@ EXPORT_SYMBOL_GPL(rcar_fcp_get);
 void rcar_fcp_put(struct rcar_fcp_device *fcp)
 {
if (fcp)
-   module_put(fcp->dev->driver->owner);
+   put_device(fcp->dev);
 }
 EXPORT_SYMBOL_GPL(rcar_fcp_put);
 
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] R-Car DU: Fix IOMMU operation when connected to VSP

2016-08-19 Thread Laurent Pinchart
Hello,

This patch series fixes the rcar-du-drm driver to support VSP plane sources
with an IOMMU. It is available for convenience at

git://linuxtv.org/pinchartl/media.git iommu/devel/du

On R-Car Gen3 the DU has no direct memory access but sources planes through
VSP instances. When an IOMMU is inserted between the VSP and memory, the DU
framebuffers need to be DMA mapped using the VSP device, not the DU device as
currently done. The same situation can also be reproduced on Gen2 hardware by
linking the VSP to the DU in DT [1], effectively disabling direct memory
access by the DU.

The situation is made quite complex by the fact that different planes can be
connected to different DU instances, and thus served by different IOMMUs (or,
in practice on existing hardware, by the same IOMMU but through different
micro-TLBs). We thus can't allocate and map buffers to the right device in a
single dma_alloc_wc() operation as done in the DRM CMA GEM helpers.

However, on such setups, the DU DT node doesn't reference IOMMUs as the DU
does not perform any direct memory access. We can thus keep the GEM object
allocation unchanged, and the DMA addresses that we receive in the DU driver
will be physical addresses. Those buffers then need to be mapped to the VSP
device when they are associated with planes. Fortunately the atomic framework
provides two plane helper operations, .prepare_fb() and .cleanup_fb() that we
can use for this purpose.

The reality is slightly more complex than this on Gen3, as an FCP device
instance sits between VSP instances and memory. It is the FCP devices that are
connected to the IOMMUs, and buffer mapping thus need to be performed using
the FCP devices. This isn't required on Gen2 as the platforms don't have any
FCPs.

Patches 1/6 and 2/6 unconstify the state argument to the .prepare_fb() and
.cleanup_fb() operations, to allow storing the mapped buffer addresses in the
state. Patches 3/6 and 4/6 then extend the rcar-fcp driver API to expose the
FCP struct device. Patch 5/6 extends the vsp1 driver API to allow mapping a
scatter-gather list to the VSP, with the implementation using the FCP devices
instead when available. Patch 6/6 then use the vsp1 mapping API in the
rcar-du-drm driver to map and unmap buffers when needed.

The series has been tested on Gen2 (Lager) only as the Gen3 IOMMU is known to
be broken.

A possible improvement is to modify the GEM object allocation mechanism to use
non-contiguous memory when the DU driver detects that all the VSP instances it
is connected to use an IOMMU (possibly through FCP devices).

An issue has been noticed with synchronization between page flip and VSP
operation. Buffers get unmapped (and possibly freed) before the VSP is done
reading them. The problem isn't new, but is much more noticeable with IOMMU
support enabled as any hardware access to unmapped memory generates an IOMMU
page fault immediately.

The series unfortunately contain a dependency between DRM and V4L2 patches,
complicating upstream merge. As there's no urgency to merge patch 6/6 due to
the IOMMU being broken on Gen3 at the moment, I propose merging patches
1/6-2/6 and 3/6-5/6 independently for the next kernel release.

I would particularly appreciate feedback on the APIs introduced by patches 4/6
and 5/6.

[1] https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg06589.html

Laurent Pinchart (6):
  drm: Don't implement empty prepare_fb()/cleanup_fb()
  drm: Unconstify state argument to prepare_fb()/cleanup_fb()
  v4l: rcar-fcp: Don't get/put module reference
  v4l: rcar-fcp: Add an API to retrieve the FCP device
  v4l: vsp1: Add API to map and unmap DRM buffers through the VSP
  drm: rcar-du: Map memory through the VSP device

 drivers/gpu/drm/arc/arcpgu_crtc.c   |  2 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |  4 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 15 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 15 -
 drivers/gpu/drm/i915/intel_display.c|  4 +-
 drivers/gpu/drm/i915/intel_drv.h|  4 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c   |  4 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c   |  4 +-
 drivers/gpu/drm/omapdrm/omap_plane.c|  4 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c   | 74 +++--
 drivers/gpu/drm/rcar-du/rcar_du_vsp.h   |  2 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  4 +-
 drivers/gpu/drm/tegra/dc.c  | 17 --
 drivers/gpu/drm/vc4/vc4_plane.c |  2 -
 drivers/media/platform/rcar-fcp.c   | 17 +++---
 drivers/media/platform/vsp1/vsp1_drm.c  | 24 
 include/drm/drm_modeset_helper_vtables.h|  4 +-
 include/media/rcar-fcp.h|  5 ++
 include/media/vsp1.h|  3 +
 19 files changed, 126 insertions(+), 82 deletions(-)

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line 

  1   2   >