cron job: media_tree daily build: WARNINGS

2016-08-15 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:   Tue Aug 16 04:00:22 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/Tuesday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.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 RFC] [media] pixfmt-packed-rgb.rst: rotate a big table

2016-08-15 Thread Mauro Carvalho Chehab
Rotates the big RGB packed table to landscape.

This is actually an example patch that depends on the past RFCv2 9 patches
series I sent before.

It uses LaTex adjustbox extension to rotate the packed RGB big table,
and rotate it to landscape. This way, the table appears on the entire
page.

It should be noticed, however, that the table is not well displayed, as the size
hints are not ok. Not sure how to fix such issue.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/conf.py  | 3 +++
 Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst | 9 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index e081f56a019c..2bc91fcc6d1f 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -291,6 +291,9 @@ latex_elements = {
 \\setromanfont{DejaVu Sans}
 \\setmonofont{DejaVu Sans Mono}
 
+   % To allow adjusting table sizes
+   \\usepackage{adjustbox}
+
  '''
 }
 
diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst 
b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
index c7aa2e91ac78..9a909cd99361 100644
--- a/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
@@ -19,6 +19,10 @@ graphics frame buffers. They occupy 8, 16, 24 or 32 bits per 
pixel.
 These are all packed-pixel formats, meaning all the data for a pixel lie
 next to each other in memory.
 
+.. raw:: latex
+
+\begin{landscape}
+\begin{adjustbox}{width=\columnwidth}
 
 .. _rgb-formats:
 
@@ -26,7 +30,6 @@ next to each other in memory.
 :header-rows:  2
 :stub-columns: 0
 
-
 -  .. row 1
 
-  Identifier
@@ -942,6 +945,10 @@ next to each other in memory.
 
-  b\ :sub:`0`
 
+.. raw:: latex
+
+\end{adjustbox}
+\end{landscape}
 
 Bit 7 is the most significant bit.
 
-- 
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 0/7] doc-rst: sphinx sub-folders & parseheaders directive

2016-08-15 Thread Jonathan Corbet
On Mon, 15 Aug 2016 10:21:07 +0200
Markus Heiser  wrote:

> Jonathan, we had this already, I gave you the links to "python community
> norms" and tools, please read/use them.
> 
> * https://www.python.org/dev/peps/pep-0008/
> * https://www.pylint.org/
> 
> Some of these norms might be unusual for C developers.

Markus, please.  I'm pretty well familiar with the Python language, have
read and written quite a bit of Python code, and understand the
conventions.  I don't need to be talked down to here.

I just reviewed PEP8.  Nothing I mentioned is sanctioned there; indeed, it
says to limit lines to 79 characters and no space before commas.

Please remember that, when you put code into the kernel, that code is no
longer in your own personal sandbox.  Other developers will have to look
at and understand it, and the community will have to maintain it long
after you have moved on to other things.  We should do everything we can
to make that code accessible to kernel folks, and that includes, IMO, not
flying in the face of the kernel's coding conventions.  

Happily, normal Python conventions don't actually look all that strange to
developers used to the kernel's style - at least to those who understand
Python!  There's no reason why we can't create Python code that looks fine
to Python programmers without putting off kernel developers.  It's not a
matter of "eye candy," it's a real maintenance issue, so could you please
humor me on this?

Thanks,

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


[PATCH RFC v2 0/9] Make PDF output for media book to work

2016-08-15 Thread Mauro Carvalho Chehab
This patch series fix the severe issues related to LaTeX output with media.
After applying it, "make pdfdocs" generates the Kernel documentation with
all books upstream, including the media books.

There are still some caveats, but the end result can be seen at:
https://mchehab.fedorapeople.org/TheLinuxKernel.pdf

To help people testing it, I pushed the patches on this series, plus two patches
from Jani at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=docs-next

This series contain:

1) 3 patches fixing LaTeX handling at Documentation/conf.py

Those patches use "xelatex" instead of "pdflatex", with fix support for
UTF-8 characters, needed by the media books. It also fixes the breakages
on LaTeX Sphinx output for notes inside tables. Finally, it allows rotating
some pages at the PDF output. This is needed in order to output very big
tables. Patches to rotate such tables are not in this series.

2) a patch that makes usage of Sphinx math extension;

3) One patch converting some GIF files to PNG (needed by pdflatex).
   Didn't check if xelatex needs it, but it is still a good idea to use PNG.

4) 3 fixup patches (that are actually independent of this series

5)  A hack that does two things:
- comment out C blocks inside tables, as Sphinx 1.4.5 produces a broken
  LaTeX file if it sees such blocks;

- Cleans the auto-generated rst files, as the escape codes there are meant
  to work with HTML, and not LaTeX. It is likely easy to fix the perl 
script to do
  the right thing here, but, as Markus is writing a Sphinx extension for it,
  let's discuss it uptream before doing rework.

PS.: The last patch are not meant to be merged. Merging the other ones should
be OK.

Mauro Carvalho Chehab (9):
  docs-rst: allow generating some LaTeX pages in landscape
  docs-rst: improve output for .. notes:: on LaTeX
  docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
  [media] pixfmt-007.rst: use Sphinx math:: expressions
  [media] pixfmt-nv12mt.rst: use PNG instead of GIF
  [media] vidioc-enumstd.rst: fix a broken reference
  [media] vidioc-enumstd.rst: remove bullets from sound carrier
  [media] docs-rst: better use the .. note:: tag
  HACK: make pdfdocs build with media books

 Documentation/Makefile.sphinx  |   7 +-
 Documentation/conf.py  |  56 --
 Documentation/media/uapi/cec/cec-func-close.rst|   4 +-
 Documentation/media/uapi/cec/cec-func-ioctl.rst|   4 +-
 Documentation/media/uapi/cec/cec-func-open.rst |   4 +-
 Documentation/media/uapi/cec/cec-func-poll.rst |   4 +-
 Documentation/media/uapi/cec/cec-intro.rst |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst|   4 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |   4 +-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst|   4 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |   4 +-
 .../media/uapi/dvb/dvb-fe-read-status.rst  |   4 +-
 Documentation/media/uapi/dvb/dvbapi.rst|   4 +-
 Documentation/media/uapi/dvb/dvbproperty.rst   |   4 +-
 Documentation/media/uapi/dvb/examples.rst  |   4 +-
 Documentation/media/uapi/dvb/fe-get-info.rst   |   4 +-
 Documentation/media/uapi/dvb/fe-read-status.rst|   4 +-
 Documentation/media/uapi/dvb/frontend.rst  |   4 +-
 .../media/uapi/rc/lirc-set-wideband-receiver.rst   |   4 +-
 Documentation/media/uapi/v4l/audio.rst |   4 +-
 Documentation/media/uapi/v4l/buffer.rst|  13 +-
 Documentation/media/uapi/v4l/crop.rst  |  12 +-
 Documentation/media/uapi/v4l/dev-codec.rst |   4 +-
 Documentation/media/uapi/v4l/dev-osd.rst   |   4 +-
 Documentation/media/uapi/v4l/dev-overlay.rst   |   8 +-
 Documentation/media/uapi/v4l/dev-rds.rst   |   4 +-
 Documentation/media/uapi/v4l/extended-controls.rst |   4 +-
 Documentation/media/uapi/v4l/func-mmap.rst |   4 +-
 Documentation/media/uapi/v4l/pixfmt-006.rst|   4 +-
 Documentation/media/uapi/v4l/pixfmt-007.rst| 187 ++---
 Documentation/media/uapi/v4l/pixfmt-nv12mt.rst |   4 +-
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif  | Bin 2108 -> 0 bytes
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png  | Bin 0 -> 1920 bytes
 .../v4l/pixfmt-nv12mt_files/nv12mt_example.gif | Bin 6858 -> 0 bytes
 .../v4l/pixfmt-nv12mt_files/nv12mt_example.png | Bin 0 -> 5261 bytes
 Documentation/media/uapi/v4l/pixfmt-sbggr16.rst|   4 +-
 Documentation/media/uapi/v4l/pixfmt-y16-be.rst |   4 +-
 Documentation/media/uapi/v4l/pixfmt-y16.rst|   4 +-
 Documentation/media/uapi/v4l/standard.rst  |   4 +-
 Documentation/media/uapi/v4l/tuner.rst |   4 +-
 Documentation/media/uapi/v4l/userp.rst |   4 +-
 

[PATCH 1/9] docs-rst: allow generating some LaTeX pages in landscape

2016-08-15 Thread Mauro Carvalho Chehab
Portrait is too small for some tables used at the media docs.
So, allow documents to tell Sphinx to generate some pages
in landscape by using:

.. raw:: latex

\begin{landscape}



.. raw:: latex

\end{landscape}

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 96b7aa66c89c..9ed1a2e39b4f 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -252,16 +252,19 @@ htmlhelp_basename = 'TheLinuxKerneldoc'
 
 latex_elements = {
 # The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+'papersize': 'a4paper',
 
 # The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+'pointsize': '10pt',
 
 # Latex figure (float) alignment
 #'figure_align': 'htbp',
+
+# Additional stuff for the LaTeX preamble.
+'preamble': '''
+% Allow generate some pages in landscape
+\\usepackage{lscape}
+ '''
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
-- 
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 RFC v2 7/9] [media] vidioc-enumstd.rst: remove bullets from sound carrier

2016-08-15 Thread Mauro Carvalho Chehab
The items at the sound carrier had a bullet. Those are not needed.

So, get rid of them.

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

diff --git a/Documentation/media/uapi/v4l/vidioc-enumstd.rst 
b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
index a936fe32ce9c..f61f0c6b0723 100644
--- a/Documentation/media/uapi/v4l/vidioc-enumstd.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
@@ -330,8 +330,7 @@ support digital TV. See also the Linux DVB API at
 
-  4433618.75 ?? 1
 
-   -  :cspan:`3` f\ :sub:`OR` = 4406250 ?? 2000, f\ :sub:`OB` = 425
- ?? 2000
+   -  :cspan:`3` f\ :sub:`OR` = 4406250 ?? 2000, f\ :sub:`OB` = 425 ?? 
2000
 
 -  .. row 5
 
@@ -363,27 +362,27 @@ support digital TV. See also the Linux DVB API at
 
-  Sound carrier relative to vision carrier (MHz)
 
-   -  + 4.5
+   -  4.5
 
-   -  + 4.5
+   -  4.5
 
-   -  + 4.5
+   -  4.5
 
-   -  + 5.5 ?? 0.001  [#f4]_  [#f5]_  [#f6]_  [#f7]_
+   -  5.5 ?? 0.001  [#f4]_  [#f5]_  [#f6]_  [#f7]_
 
-   -  + 6.5 ?? 0.001
+   -  6.5 ?? 0.001
 
-   -  + 5.5
+   -  5.5
 
-   -  + 5.9996 ?? 0.0005
+   -  5.9996 ?? 0.0005
 
-   -  + 5.5 ?? 0.001
+   -  5.5 ?? 0.001
 
-   -  + 6.5 ?? 0.001
+   -  6.5 ?? 0.001
 
-   -  + 6.5
+   -  6.5
 
-   -  + 6.5  [#f8]_
+   -  6.5 [#f8]_
 
 
 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 RFC v2 5/9] [media] pixfmt-nv12mt.rst: use PNG instead of GIF

2016-08-15 Thread Mauro Carvalho Chehab
pdflatex doesn't like gif images:
None:None: WARNING: no matching candidate for image URI 
u'media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.*'
None:None: WARNING: no matching candidate for image URI 
u'media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.*'

But it works fine with png. So, convert them. As a plus, PNG images
are smaller.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/pixfmt-nv12mt.rst   |   4 ++--
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif| Bin 2108 -> 0 bytes
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png| Bin 0 -> 1920 bytes
 .../uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif  | Bin 6858 -> 0 bytes
 .../uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png  | Bin 0 -> 5261 bytes
 5 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png
 delete mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif
 create mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png

diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst 
b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
index 6198941bb814..1e6fdf0194f5 100644
--- a/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
@@ -36,7 +36,7 @@ Layout of macroblocks in memory is presented in the following 
figure.
 .. _nv12mt:
 
 .. figure::  pixfmt-nv12mt_files/nv12mt.*
-:alt:nv12mt.gif
+:alt:nv12mt.png
 :align:  center
 
 V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
@@ -53,7 +53,7 @@ interleaved. Height of the buffer is aligned to 32.
 .. _nv12mt_ex:
 
 .. figure::  pixfmt-nv12mt_files/nv12mt_example.*
-:alt:nv12mt_example.gif
+:alt:nv12mt_example.png
 :align:  center
 
 Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif 
b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
deleted file mode 100644
index 
ef2d4cf8367b97293eb9139de0f33d0a2ac236be..
GIT binary patch
literal 0
HcmV?d1

literal 2108
zcmb`E`9IT-1IOQ+qvdLI6(2NWh4B$mqGFB~bIqI`Ov+J?J|;e;^kHT0IblWJ*`TR@ettFfwykFz0RpGX8Qtpc((LKc?crMQAH8KYFSWD99Kv!>_lN%eRo>u79{QY=Bb|r;(6+q+1bsx
zxvy`8-AZ)6z3Cv$DzebNmJoNG}9=Ei%vD-U3yExrFy-({S>>SJpRz|$mrO(VC>MdmlKl{FQ#T@
zCtuCI77p1x0NyMM-@RX*TKTvp_`JS33@mZJb^Yl4*&(_Qd{8V%hZ`riKuxi}>Dopq
zO>kaLJV^(c{>X$am`p2!XESZ86${gJ4af*Lx;d*6=Zrn{WpL(bjDYWP)L~JMrG

[PATCH RFC v2 6/9] [media] vidioc-enumstd.rst: fix a broken reference

2016-08-15 Thread Mauro Carvalho Chehab
Somehow, the conversion broke a reference here. Re-add it.

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

diff --git a/Documentation/media/uapi/v4l/vidioc-enumstd.rst 
b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
index 6699b26cdeb4..a936fe32ce9c 100644
--- a/Documentation/media/uapi/v4l/vidioc-enumstd.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
@@ -269,7 +269,7 @@ support digital TV. See also the Linux DVB API at
 
 .. _video-standards:
 
-.. flat-table:: Video Standards (based on [])
+.. flat-table:: Video Standards (based on :ref:`itu470`)
 :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 RFC v2 9/9] HACK: make pdfdocs build with media books

2016-08-15 Thread Mauro Carvalho Chehab
-
PLEASE DO NOT APPLY THIS UPSTREAM
-

This hack addresses two issues with pdf generation from media
books:

1) Sphinx doesn't do the right thing if a block of code
   is inside a table. This sounds a Sphinx bug. Perhaps it
   can be fixed by preloading some LaTeX code.

2) the file output doesn't do the right thing for PDF.
   This is likely due to the lack of some escape chars when
   generating the output rst file.

This hack makes the document to build fully.

Please notice that tables are not built well yet, as most are too
big. We can very likely fix several of them by rotating the page
to landscape.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx|  1 +
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst |  8 
 Documentation/media/uapi/v4l/vidioc-querycap.rst | 20 ++--
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index aa7ff32be589..8aa4fffda860 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -49,6 +49,7 @@ ifeq ($(HAVE_PDFLATEX),0)
@echo "  SKIPSphinx $@ target."
 else # HAVE_PDFLATEX
$(call cmd,sphinx,latex)
+   (cd $(BUILDDIR); for i in *.rst; do echo >$$i; done)
$(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex
 endif # HAVE_PDFLATEX
 
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
index 4715261631ab..7df7bee142b6 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -107,10 +107,10 @@ one until ``EINVAL`` is returned.
 
 
  .. _v4l2-fourcc:
- .. code-block:: c
-
- #define v4l2_fourcc(a,b,c,d) 
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
-
+..   .. code-block:: c
+..
+..   #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-querycap.rst 
b/Documentation/media/uapi/v4l/vidioc-querycap.rst
index b10fed313f99..96ea81344696 100644
--- a/Documentation/media/uapi/v4l/vidioc-querycap.rst
+++ b/Documentation/media/uapi/v4l/vidioc-querycap.rst
@@ -118,16 +118,16 @@ specification the ioctl returns an ``EINVAL`` error code.
-  :cspan:`2`
 
 
- .. code-block:: c
-
- #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
- __u32 version = KERNEL_VERSION(0, 8, 1);
-
- printf ("Version: %u.%u.%u\\n",
- (version >> 16) & 0xFF,
- (version >> 8) & 0xFF,
-  version & 0xFF);
+..   .. code-block:: c
+..
+..   #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+..
+..   __u32 version = KERNEL_VERSION(0, 8, 1);
+..
+..   printf ("Version: %u.%u.%u\\n",
+..   (version >> 16) & 0xFF,
+..   (version >> 8) & 0xFF,
+..version & 0xFF);
 
 -  .. row 6
 
-- 
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 RFC v2 8/9] [media] docs-rst: better use the .. note:: tag

2016-08-15 Thread Mauro Carvalho Chehab
Change multi-line note tags to be more symetric, e. g. not starting
the text together witht the tag.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-close.rst  |  4 +++-
 Documentation/media/uapi/cec/cec-func-ioctl.rst  |  4 +++-
 Documentation/media/uapi/cec/cec-func-open.rst   |  4 +++-
 Documentation/media/uapi/cec/cec-func-poll.rst   |  4 +++-
 Documentation/media/uapi/cec/cec-intro.rst   |  4 +++-
 Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst |  4 +++-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst  |  4 +++-
 .../media/uapi/cec/cec-ioc-adap-g-phys-addr.rst  |  4 +++-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst |  4 +++-
 Documentation/media/uapi/cec/cec-ioc-g-mode.rst  |  4 +++-
 Documentation/media/uapi/cec/cec-ioc-receive.rst |  4 +++-
 Documentation/media/uapi/dvb/dvb-fe-read-status.rst  |  4 +++-
 Documentation/media/uapi/dvb/dvbapi.rst  |  4 +++-
 Documentation/media/uapi/dvb/dvbproperty.rst |  4 +++-
 Documentation/media/uapi/dvb/examples.rst|  4 +++-
 Documentation/media/uapi/dvb/fe-get-info.rst |  4 +++-
 Documentation/media/uapi/dvb/fe-read-status.rst  |  4 +++-
 Documentation/media/uapi/dvb/frontend.rst|  4 +++-
 .../media/uapi/rc/lirc-set-wideband-receiver.rst |  4 +++-
 Documentation/media/uapi/v4l/audio.rst   |  4 +++-
 Documentation/media/uapi/v4l/buffer.rst  | 13 ++---
 Documentation/media/uapi/v4l/crop.rst| 12 +---
 Documentation/media/uapi/v4l/dev-codec.rst   |  4 +++-
 Documentation/media/uapi/v4l/dev-osd.rst |  4 +++-
 Documentation/media/uapi/v4l/dev-overlay.rst |  8 ++--
 Documentation/media/uapi/v4l/dev-rds.rst |  4 +++-
 Documentation/media/uapi/v4l/extended-controls.rst   |  4 +++-
 Documentation/media/uapi/v4l/func-mmap.rst   |  4 +++-
 Documentation/media/uapi/v4l/pixfmt-006.rst  |  4 +++-
 Documentation/media/uapi/v4l/pixfmt-007.rst  | 12 +---
 Documentation/media/uapi/v4l/pixfmt-sbggr16.rst  |  4 +++-
 Documentation/media/uapi/v4l/pixfmt-y16-be.rst   |  4 +++-
 Documentation/media/uapi/v4l/pixfmt-y16.rst  |  4 +++-
 Documentation/media/uapi/v4l/standard.rst|  4 +++-
 Documentation/media/uapi/v4l/tuner.rst   |  4 +++-
 Documentation/media/uapi/v4l/userp.rst   |  4 +++-
 Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst   |  4 +++-
 Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst  |  4 +++-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst |  9 ++---
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst|  4 +++-
 Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst  |  4 +++-
 Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst  |  4 +++-
 Documentation/media/uapi/v4l/vidioc-enumaudioout.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst   |  4 +++-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst   |  4 +++-
 Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst  |  8 ++--
 Documentation/media/uapi/v4l/vidioc-g-modulator.rst  |  4 +++-
 Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst  |  8 ++--
 Documentation/media/uapi/v4l/vidioc-qbuf.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst| 16 
 Documentation/media/uapi/v4l/vidioc-querystd.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-streamon.rst |  4 +++-
 Documentation/media/uapi/v4l/vidioc-subscribe-event.rst  |  4 +++-
 Documentation/media/v4l-drivers/bttv.rst |  1 +
 56 files changed, 206 insertions(+), 69 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-close.rst 
b/Documentation/media/uapi/cec/cec-func-close.rst
index bb94e4358910..bdbb9e545ae4 100644
--- a/Documentation/media/uapi/cec/cec-func-close.rst
+++ b/Documentation/media/uapi/cec/cec-func-close.rst
@@ -32,7 +32,9 @@ Arguments
 Description
 ===
 
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+   This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
 
 Closes the cec device. Resources associated with the file descriptor are
diff --git a/Documentation/media/uapi/cec/cec-func-ioctl.rst 
b/Documentation/media/uapi/cec/cec-func-ioctl.rst
index d0279e6d2734..170bdd56211e 100644
--- a/Documentation/media/uapi/cec/cec-func-ioctl.rst
+++ b/Documentation/media/uapi/cec/cec-func-ioctl.rst
@@ -38,7 +38,9 @@ Arguments
 

[PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-15 Thread Mauro Carvalho Chehab
pdflatex doesn't accept using some UTF-8 chars, like
"equal or less than" or "equal or greater than" chars. However,
the media documents use them. So, we need to use XeLaTeX for
conversion, and a font that accepts such characters.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx |  6 +++---
 Documentation/conf.py | 11 +++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index fc29e08085aa..aa7ff32be589 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -26,7 +26,7 @@ else ifneq ($(DOCBOOKS),)
 else # HAVE_SPHINX
 
 # User-friendly check for pdflatex
-HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; else 
echo 0; fi)
+HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else 
echo 0; fi)
 
 # Internal variables.
 PAPEROPT_a4 = -D latex_paper_size=a4
@@ -45,11 +45,11 @@ htmldocs:
 
 pdfdocs:
 ifeq ($(HAVE_PDFLATEX),0)
-   $(warning The 'pdflatex' command was not found. Make sure you have it 
installed and in PATH to produce PDF output.)
+   $(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 cmd,sphinx,latex)
-   $(Q)$(MAKE) -C $(BUILDDIR)/latex
+   $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex
 endif # HAVE_PDFLATEX
 
 epubdocs:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index bbf2878d9945..f4469cd0340d 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -260,6 +260,10 @@ latex_elements = {
 # Latex figure (float) alignment
 #'figure_align': 'htbp',
 
+# Don't mangle with UTF-8 chars
+'inputenc': '',
+'utf8extra': '',
+
 # Additional stuff for the LaTeX preamble.
 'preamble': '''
 % Allow generate some pages in landscape
@@ -287,6 +291,13 @@ latex_elements = {
   \\end{graybox}
 }
\\makeatother
+
+   % Use some font with UTF-8 support with XeLaTeX
+\\usepackage{fontspec}
+\\setsansfont{DejaVu Serif}
+\\setromanfont{DejaVu Sans}
+\\setmonofont{DejaVu Sans Mono}
+
  '''
 }
 
-- 
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 RFC v2 4/9] [media] pixfmt-007.rst: use Sphinx math:: expressions

2016-08-15 Thread Mauro Carvalho Chehab
Enrich math formulas by using the Sphinx math. That will allow
using those formulas on pdf documents as well.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/conf.py   |   9 +-
 Documentation/media/uapi/v4l/pixfmt-007.rst | 175 ++--
 2 files changed, 115 insertions(+), 69 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index f4469cd0340d..e081f56a019c 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,14 +28,7 @@ sys.path.insert(0, os.path.abspath('sphinx'))
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
-
-# Gracefully handle missing rst2pdf.
-try:
-import rst2pdf
-extensions += ['rst2pdf.pdfbuilder']
-except ImportError:
-pass
+extensions = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 
'kernel_include']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst 
b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 8c946b0c63a0..2ecace31b9f5 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -72,23 +72,29 @@ SMPTE C set, so this colorspace is sometimes called SMPTE C 
as well.
 The transfer function defined for SMPTE 170M is the same as the one
 defined in Rec. 709.
 
-L' = -1.099(-L) :sup:`0.45` + 0.099 for L ??? -0.018
+.. math::
 
-L' = 4.5L for -0.018 < L < 0.018
+L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le-0.018
 
-L' = 1.099L :sup:`0.45` - 0.099 for L ??? 0.018
+L' = 4.5L \text{, for } -0.018 < L < 0.018
+
+L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
 
 Inverse Transfer function:
 
-L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ??? -0.081
+.. math::
 
-L = L' / 4.5 for -0.081 < L' < 0.081
+L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, 
for } L' \le -0.081
 
-L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ??? 0.081
+L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081
+
+L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } 
L' \ge 0.081
 
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
+.. math::
+
 Y' = 0.299R' + 0.587G' + 0.114B'
 
 Cb = -0.169R' - 0.331G' + 0.5B'
@@ -169,23 +175,29 @@ The full name of this standard is Rec. ITU-R BT.709-5.
 Transfer function. Normally L is in the range [0???1], but for the
 extended gamut xvYCC encoding values outside that range are allowed.
 
-L' = -1.099(-L) :sup:`0.45` + 0.099 for L ??? -0.018
+.. math::
 
-L' = 4.5L for -0.018 < L < 0.018
+L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le -0.018
 
-L' = 1.099L :sup:`0.45` - 0.099 for L ??? 0.018
+L' = 4.5L \text{, for } -0.018 < L < 0.018
+
+L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
 
 Inverse Transfer function:
 
-L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ??? -0.081
+.. math::
 
-L = L' / 4.5 for -0.081 < L' < 0.081
+L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } 
L' \le -0.081
 
-L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ??? 0.081
+L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081
+
+L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } 
L' \ge 0.081
 
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_709`` encoding:
 
+.. math::
+
 Y' = 0.2126R' + 0.7152G' + 0.0722B'
 
 Cb = -0.1146R' - 0.3854G' + 0.5B'
@@ -210,22 +222,26 @@ similar to the Rec. 709 encoding, but it allows for R', 
G' and B' values
 that are outside the range [0???1]. The resulting Y', Cb and Cr values are
 scaled and offset:
 
-Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256)
+.. math::
 
-Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B')
+Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256}
 
-Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B')
+Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B')
+
+Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B')
 
 The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is
 similar to the BT.601 encoding, but it allows for R', G' and B' values
 that are outside the range [0???1]. The resulting Y', Cb and Cr values are
 scaled and offset:
 
-Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256)
+.. math::
 
-Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B')
+Y' = \frac{219}{256} * (0.299R' + 0.587G' + 0.114B') + \frac{16}{256}
 
-Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B')
+Cb = \frac{224}{256} * (-0.169R' - 0.331G' + 0.5B')
+
+Cr = \frac{224}{256} * (0.5R' - 

[PATCH RFC v2 2/9] docs-rst: improve output for .. notes:: on LaTeX

2016-08-15 Thread Mauro Carvalho Chehab
The output for those notes are bad in pdf, as they're not
in a box with a different color. Also, it causes the output
to not build if the note is inside a table.

Change its implementation to avoid the above troubles.

The logic there came from:

https://stackoverflow.com/questions/606746/how-to-customize-an-existing-latex-environment-without-interfering-with-other-en

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 9ed1a2e39b4f..bbf2878d9945 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -264,6 +264,29 @@ latex_elements = {
 'preamble': '''
 % Allow generate some pages in landscape
 \\usepackage{lscape}
+
+% Put notes in gray color and let them be inside a table
+
+\\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
+
+\\makeatletter\\newenvironment{graybox}{%
+   
\\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}%
+   \\colorbox{MyGray}{\\usebox{\\@tempboxa}}
+}\\makeatother
+
+\\makeatletter
+\\renewenvironment{notice}[2]{
+  \\begin{graybox}
+  \\bf\\it
+  \\def\\py@noticetype{#1}
+  \\par\\strong{#2}
+  \\csname py@noticestart@#1\\endcsname
+}
+   {
+  \\csname py@noticeend@\\py@noticetype\\endcsname
+  \\end{graybox}
+}
+   \\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


[PATCH v4 10/13] media: platform: pxa_camera: make a standalone v4l2 device

2016-08-15 Thread Robert Jarzmik
This patch removes the soc_camera API dependency from pxa_camera.
In the current status :
 - all previously captures are working the same on pxa270
 - the s_crop() call was removed, judged not working
   (see what happens soc_camera_s_crop() when get_crop() == NULL)
 - if the pixel clock is provided by then sensor, ie. not MCLK, the dual
   stage change is not handled yet.
   => there is no in-tree user of this, so I'll let it that way

 - the MCLK is not yet finished, it's as in the legacy way,
   ie. activated at video device opening and closed at video device
   closing.
   In a subsequence patch pxa_camera_mclk_ops should be used, and
   platform data MCLK ignored. It will be the sensor's duty to request
   the clock and enable it, which will end in pxa_camera_mclk_ops.

Signed-off-by: Robert Jarzmik 
---
Since v1:
  - function namings were cleaned into pxac_XXX_()
  - function were regrouped in the 3 big categories :
- device probing/removal : pxa_camera_*()
- videobuf2 : pxac_vb2_*()
- v42l file operations : pxac_vidioc_*()
- internal driver functions : pxa_camera_*() : to be found a cute
  pattern for RFC v3
Since v2:
  - split functions
  - start_streaming() implemented
Since v3:
  - conflict in void *alloc_ctxt by struct device *alloc_devs change
  - ctrl_handler for video device added
  - 2 ioctrl disables removed
  - disable sensor module removal, it will be loaded forever ...
---
 drivers/media/platform/soc_camera/Kconfig  |   2 +-
 drivers/media/platform/soc_camera/pxa_camera.c | 752 +
 include/linux/platform_data/media/camera-pxa.h |   2 +
 3 files changed, 517 insertions(+), 239 deletions(-)

diff --git a/drivers/media/platform/soc_camera/Kconfig 
b/drivers/media/platform/soc_camera/Kconfig
index 3f927f96763a..0bf33ccf9a1e 100644
--- a/drivers/media/platform/soc_camera/Kconfig
+++ b/drivers/media/platform/soc_camera/Kconfig
@@ -19,7 +19,7 @@ config SOC_CAMERA_PLATFORM
 
 config VIDEO_PXA27x
tristate "PXA27x Quick Capture Interface driver"
-   depends on VIDEO_DEV && PXA27x && SOC_CAMERA && HAS_DMA
+   depends on VIDEO_DEV && PXA27x && HAS_DMA
select VIDEOBUF2_DMA_SG
select SG_SPLIT
---help---
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index a2fedc9bb71c..395cd398c32b 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2006, Sascha Hauer, Pengutronix
  * Copyright (C) 2008, Guennadi Liakhovetski 
+ * Copyright (C) 2016, Robert Jarzmik 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -22,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -32,13 +35,16 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 
+#include 
+#include 
+
 #include 
 
 #include 
@@ -46,6 +52,9 @@
 #define PXA_CAM_VERSION "0.0.6"
 #define PXA_CAM_DRV_NAME "pxa27x-camera"
 
+#define DEFAULT_WIDTH  640
+#define DEFAULT_HEIGHT 480
+
 /* Camera Interface */
 #define CICR0  0x
 #define CICR1  0x0004
@@ -169,7 +178,25 @@
CICR0_EOFM | CICR0_FOM)
 
 #define sensor_call(cam, o, f, args...) \
-   v4l2_subdev_call(sd, o, f, ##args)
+   v4l2_subdev_call(cam->sensor, o, f, ##args)
+
+/*
+ * Format handling
+ */
+/**
+ * struct soc_camera_format_xlate - match between host and sensor formats
+ * @code: code of a sensor provided format
+ * @host_fmt: host format after host translation from code
+ *
+ * Host and sensor translation structure. Used in table of host and sensor
+ * formats matchings in soc_camera_device. A host can override the generic list
+ * generation by implementing get_formats(), and use it for format checks and
+ * format setup.
+ */
+struct soc_camera_format_xlate {
+   u32 code;
+   const struct soc_mbus_pixelfmt *host_fmt;
+};
 
 /*
  * Structures
@@ -198,7 +225,18 @@ struct pxa_buffer {
 };
 
 struct pxa_camera_dev {
-   struct soc_camera_host  soc_host;
+   struct v4l2_device  v4l2_dev;
+   struct video_device vdev;
+   struct v4l2_async_notifier notifier;
+   struct vb2_queuevb2_vq;
+   struct v4l2_subdev  *sensor;
+   struct soc_camera_format_xlate *user_formats;
+   const struct soc_camera_format_xlate *current_fmt;
+   struct v4l2_pix_format  current_pix;
+
+   struct v4l2_async_subdev asd;
+   struct v4l2_async_subdev *asds[1];
+
/*
 * PXA27x is only supposed to handle one camera on its Quick Capture
 * interface. If 

[PATCH v4 08/13] media: platform: pxa_camera: add buffer sequencing

2016-08-15 Thread Robert Jarzmik
Add sequence numbers to completed buffers.

Signed-off-by: Robert Jarzmik 
---
Since v3: reset buffer sequence number in start_streaming()
---
 drivers/media/platform/soc_camera/pxa_camera.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index f3922a99405b..2471d036a835 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -223,6 +223,7 @@ struct pxa_camera_dev {
struct list_headcapture;
 
spinlock_t  lock;
+   unsigned intbuf_sequence;
 
struct pxa_buffer   *active;
struct tasklet_struct   task_eof;
@@ -423,10 +424,13 @@ static void pxa_camera_wakeup(struct pxa_camera_dev 
*pcdev,
  struct pxa_buffer *buf)
 {
struct vb2_buffer *vb = >vbuf.vb2_buf;
+   struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
 
/* _init is used to debug races, see comment in pxa_camera_reqbufs() */
list_del_init(>queue);
vb->timestamp = ktime_get_ns();
+   vbuf->sequence = pcdev->buf_sequence++;
+   vbuf->field = V4L2_FIELD_NONE;
vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
dev_dbg(pcdev_to_dev(pcdev), "%s dequeud buffer (buf=0x%p)\n",
__func__, buf);
@@ -1022,6 +1026,7 @@ static int pxac_vb2_start_streaming(struct vb2_queue *vq, 
unsigned int count)
dev_dbg(pcdev_to_dev(pcdev), "%s(count=%d) active=%p\n",
__func__, count, pcdev->active);
 
+   pcdev->buf_sequence = 0;
if (!pcdev->active)
pxa_camera_start_capture(pcdev);
 
-- 
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


[PATCH v4 03/13] media: mt9m111: move mt9m111 out of soc_camera

2016-08-15 Thread Robert Jarzmik
As the mt9m111 is now working as a standalone v4l2 subdevice sensor,
move it out of soc_camera directory and severe its dependency on
soc_camera.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/i2c/Kconfig  |7 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/mt9m111.c| 1033 
 drivers/media/i2c/soc_camera/Kconfig   |7 +-
 drivers/media/i2c/soc_camera/Makefile  |1 -
 drivers/media/i2c/soc_camera/mt9m111.c | 1033 
 6 files changed, 1046 insertions(+), 1036 deletions(-)
 create mode 100644 drivers/media/i2c/mt9m111.c
 delete mode 100644 drivers/media/i2c/soc_camera/mt9m111.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index ce9006e10a30..7f8790507660 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -571,6 +571,13 @@ config VIDEO_MT9M032
  This driver supports MT9M032 camera sensors from Aptina, monochrome
  models only.
 
+config VIDEO_MT9M111
+   tristate "mt9m111, mt9m112 and mt9m131 support"
+   depends on I2C && VIDEO_V4L2
+   help
+ This driver supports MT9M111, MT9M112 and MT9M131 cameras from
+ Micron/Aptina
+
 config VIDEO_MT9P031
tristate "Aptina MT9P031 support"
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 94f2c99e890d..a1a82331bebc 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_VIDEO_OV7640) += ov7640.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
 obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o
+obj-$(CONFIG_VIDEO_MT9M111) += mt9m111.o
 obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
 obj-$(CONFIG_VIDEO_MT9T001) += mt9t001.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
new file mode 100644
index ..b7c4f371bae1
--- /dev/null
+++ b/drivers/media/i2c/mt9m111.c
@@ -0,0 +1,1033 @@
+/*
+ * Driver for MT9M111/MT9M112/MT9M131 CMOS Image Sensor from Micron/Aptina
+ *
+ * Copyright (C) 2008, Robert Jarzmik 
+ *
+ * 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.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * MT9M111, MT9M112 and MT9M131:
+ * i2c address is 0x48 or 0x5d (depending on SADDR pin)
+ * The platform has to define struct i2c_board_info objects and link to them
+ * from struct soc_camera_host_desc
+ */
+
+/*
+ * Sensor core register addresses (0x000..0x0ff)
+ */
+#define MT9M111_CHIP_VERSION   0x000
+#define MT9M111_ROW_START  0x001
+#define MT9M111_COLUMN_START   0x002
+#define MT9M111_WINDOW_HEIGHT  0x003
+#define MT9M111_WINDOW_WIDTH   0x004
+#define MT9M111_HORIZONTAL_BLANKING_B  0x005
+#define MT9M111_VERTICAL_BLANKING_B0x006
+#define MT9M111_HORIZONTAL_BLANKING_A  0x007
+#define MT9M111_VERTICAL_BLANKING_A0x008
+#define MT9M111_SHUTTER_WIDTH  0x009
+#define MT9M111_ROW_SPEED  0x00a
+#define MT9M111_EXTRA_DELAY0x00b
+#define MT9M111_SHUTTER_DELAY  0x00c
+#define MT9M111_RESET  0x00d
+#define MT9M111_READ_MODE_B0x020
+#define MT9M111_READ_MODE_A0x021
+#define MT9M111_FLASH_CONTROL  0x023
+#define MT9M111_GREEN1_GAIN0x02b
+#define MT9M111_BLUE_GAIN  0x02c
+#define MT9M111_RED_GAIN   0x02d
+#define MT9M111_GREEN2_GAIN0x02e
+#define MT9M111_GLOBAL_GAIN0x02f
+#define MT9M111_CONTEXT_CONTROL0x0c8
+#define MT9M111_PAGE_MAP   0x0f0
+#define MT9M111_BYTE_WISE_ADDR 0x0f1
+
+#define MT9M111_RESET_SYNC_CHANGES (1 << 15)
+#define MT9M111_RESET_RESTART_BAD_FRAME(1 << 9)
+#define MT9M111_RESET_SHOW_BAD_FRAMES  (1 << 8)
+#define MT9M111_RESET_RESET_SOC(1 << 5)
+#define MT9M111_RESET_OUTPUT_DISABLE   (1 << 4)
+#define MT9M111_RESET_CHIP_ENABLE  (1 << 3)
+#define MT9M111_RESET_ANALOG_STANDBY   (1 << 2)
+#define MT9M111_RESET_RESTART_FRAME(1 << 1)
+#define MT9M111_RESET_RESET_MODE   (1 << 0)
+
+#define MT9M111_RM_FULL_POWER_RD   (0 << 10)
+#define MT9M111_RM_LOW_POWER_RD(1 << 10)
+#define MT9M111_RM_COL_SKIP_4X (1 << 5)
+#define MT9M111_RM_ROW_SKIP_4X (1 << 4)
+#define MT9M111_RM_COL_SKIP_2X (1 << 3)
+#define MT9M111_RM_ROW_SKIP_2X (1 << 2)
+#define MT9M111_RMB_MIRROR_COLS(1 << 1)
+#define MT9M111_RMB_MIRROR_ROWS(1 << 0)
+#define MT9M111_CTXT_CTRL_RESTART  (1 << 15)
+#define 

[PATCH v4 01/13] media: mt9m111: make a standalone v4l2 subdevice

2016-08-15 Thread Robert Jarzmik
Remove the soc_camera adherence. Mostly the change removes the power
manipulation provided by soc_camera, and instead :
 - powers on the sensor when the s_power control is activated
 - powers on the sensor in initial probe
 - enables and disables the MCLK provided to it in power on/off

Signed-off-by: Robert Jarzmik 
---
 drivers/media/i2c/soc_camera/mt9m111.c | 51 ++
 1 file changed, 15 insertions(+), 36 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/mt9m111.c 
b/drivers/media/i2c/soc_camera/mt9m111.c
index 6dfaead6aaa8..a7efaa5964d1 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -16,10 +16,11 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 /*
  * MT9M111, MT9M112 and MT9M131:
@@ -388,7 +389,7 @@ static int mt9m111_s_crop(struct v4l2_subdev *sd, const 
struct v4l2_crop *a)
struct v4l2_rect rect = a->c;
struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);
int width, height;
-   int ret;
+   int ret, align = 0;
 
if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
@@ -396,17 +397,19 @@ static int mt9m111_s_crop(struct v4l2_subdev *sd, const 
struct v4l2_crop *a)
if (mt9m111->fmt->code == MEDIA_BUS_FMT_SBGGR8_1X8 ||
mt9m111->fmt->code == MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE) {
/* Bayer format - even size lengths */
-   rect.width  = ALIGN(rect.width, 2);
-   rect.height = ALIGN(rect.height, 2);
+   align = 1;
/* Let the user play with the starting pixel */
}
 
/* FIXME: the datasheet doesn't specify minimum sizes */
-   soc_camera_limit_side(, ,
-MT9M111_MIN_DARK_COLS, 2, MT9M111_MAX_WIDTH);
-
-   soc_camera_limit_side(, ,
-MT9M111_MIN_DARK_ROWS, 2, MT9M111_MAX_HEIGHT);
+   v4l_bound_align_image(, 2, MT9M111_MAX_WIDTH, align,
+ , 2, MT9M111_MAX_HEIGHT, align, 0);
+   rect.left = clamp(rect.left, MT9M111_MIN_DARK_COLS,
+ MT9M111_MIN_DARK_COLS + MT9M111_MAX_WIDTH -
+ (__s32)rect.width);
+   rect.top = clamp(rect.top, MT9M111_MIN_DARK_ROWS,
+MT9M111_MIN_DARK_ROWS + MT9M111_MAX_HEIGHT -
+(__s32)rect.height);
 
width = min(mt9m111->width, rect.width);
height = min(mt9m111->height, rect.height);
@@ -775,17 +778,16 @@ static int mt9m111_init(struct mt9m111 *mt9m111)
 static int mt9m111_power_on(struct mt9m111 *mt9m111)
 {
struct i2c_client *client = v4l2_get_subdevdata(>subdev);
-   struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
int ret;
 
-   ret = soc_camera_power_on(>dev, ssdd, mt9m111->clk);
+   ret = v4l2_clk_enable(mt9m111->clk);
if (ret < 0)
return ret;
 
ret = mt9m111_resume(mt9m111);
if (ret < 0) {
dev_err(>dev, "Failed to resume the sensor: %d\n", ret);
-   soc_camera_power_off(>dev, ssdd, mt9m111->clk);
+   v4l2_clk_disable(mt9m111->clk);
}
 
return ret;
@@ -793,11 +795,8 @@ static int mt9m111_power_on(struct mt9m111 *mt9m111)
 
 static void mt9m111_power_off(struct mt9m111 *mt9m111)
 {
-   struct i2c_client *client = v4l2_get_subdevdata(>subdev);
-   struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
-
mt9m111_suspend(mt9m111);
-   soc_camera_power_off(>dev, ssdd, mt9m111->clk);
+   v4l2_clk_disable(mt9m111->clk);
 }
 
 static int mt9m111_s_power(struct v4l2_subdev *sd, int on)
@@ -854,14 +853,10 @@ static int mt9m111_enum_mbus_code(struct v4l2_subdev *sd,
 static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
 {
-   struct i2c_client *client = v4l2_get_subdevdata(sd);
-   struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
-
cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING |
V4L2_MBUS_HSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_HIGH |
V4L2_MBUS_DATA_ACTIVE_HIGH;
cfg->type = V4L2_MBUS_PARALLEL;
-   cfg->flags = soc_camera_apply_board_flags(ssdd, cfg);
 
return 0;
 }
@@ -933,20 +928,8 @@ static int mt9m111_probe(struct i2c_client *client,
 {
struct mt9m111 *mt9m111;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
-   struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
int ret;
 
-   if (client->dev.of_node) {
-   ssdd = devm_kzalloc(>dev, sizeof(*ssdd), GFP_KERNEL);
-   if (!ssdd)
-   return -ENOMEM;
-   client->dev.platform_data = ssdd;
-   }
-   if (!ssdd) {
-   

[PATCH v4 00/13] pxa_camera transition to v4l2 standalone device

2016-08-15 Thread Robert Jarzmik
Hi Hans,

Now only your comments have been taken between v3 and v4, the buffer sequence
number reset, and the rebase on top of v4.8-rc1, which makes the diffstat with
the former submission :
 drivers/media/i2c/mt9m111.c   | 14 ++
 drivers/media/platform/pxa_camera.c   | 45 
+
 drivers/media/platform/soc_camera/Kconfig | 12 ++--
 3 files changed, 9 insertions(+), 62 deletions(-)

I've also put the whole serie here if you want to fetch and review from git 
directly :
 - git fetch https://github.com/rjarzmik/linux.git work/v4l2

The result of v4l-compliance -s is in [1].
The result of v4l-compliance -f is in [2].

Happy review.

--
Robert

Robert Jarzmik (13):
  media: mt9m111: make a standalone v4l2 subdevice
  media: mt9m111: use only the SRGB colorspace
  media: mt9m111: move mt9m111 out of soc_camera
  media: platform: pxa_camera: convert to vb2
  media: platform: pxa_camera: trivial move of functions
  media: platform: pxa_camera: introduce sensor_call
  media: platform: pxa_camera: make printk consistent
  media: platform: pxa_camera: add buffer sequencing
  media: platform: pxa_camera: remove set_crop
  media: platform: pxa_camera: make a standalone v4l2 device
  media: platform: pxa_camera: add debug register access
  media: platform: pxa_camera: change stop_streaming semantics
  media: platform: pxa_camera: move pxa_camera out of soc_camera

 drivers/media/i2c/Kconfig  |7 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/mt9m111.c| 1033 
 drivers/media/i2c/soc_camera/Kconfig   |7 +-
 drivers/media/i2c/soc_camera/Makefile  |1 -
 drivers/media/i2c/soc_camera/mt9m111.c | 1054 
 drivers/media/platform/Kconfig |8 +
 drivers/media/platform/Makefile|1 +
 drivers/media/platform/pxa_camera.c| 2096 
 drivers/media/platform/soc_camera/Kconfig  |8 -
 drivers/media/platform/soc_camera/Makefile |1 -
 drivers/media/platform/soc_camera/pxa_camera.c | 1866 -
 include/linux/platform_data/media/camera-pxa.h |2 +
 13 files changed, 3153 insertions(+), 2932 deletions(-)
 create mode 100644 drivers/media/i2c/mt9m111.c
 delete mode 100644 drivers/media/i2c/soc_camera/mt9m111.c
 create mode 100644 drivers/media/platform/pxa_camera.c
 delete mode 100644 drivers/media/platform/soc_camera/pxa_camera.c

-- 
2.1.4

[1] v4l-compliance -s
v4l2-compliance SHA   : f1348b4a819271d4138d62be5cee2e5aed1601d7

Driver Info:
Driver name   : pxa27x-camera
Card type : PXA_Camera
Bus info  : platform:pxa-camera
Driver version: 4.8.0
Capabilities  : 0x8421
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0421
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (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
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
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 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)

Test input 0:

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
fail: v4l2-test-controls.cpp(782): subscribe event for control 
'User Controls' failed
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 7 Private Controls: 0

Format ioctls:

[PATCH v4 04/13] media: platform: pxa_camera: convert to vb2

2016-08-15 Thread Robert Jarzmik
Convert pxa_camera from videobuf to videobuf2.

As the soc_camera was already compatible with videobuf2, the port is
quite straightforward.

The special case of this code in which the vb2 to prepare is "too
big" in terms of size for the new capture format, the pxa_camera will
fail.

Signed-off-by: Robert Jarzmik 
---
Since v1: took into account Hans's comments
  renamed all vb2 functions to pxac_vb2_*()
Since v2: spit queue_buffer() and start_streaming()
Since v3: replace void *alloc_ctxs by struct device *alloc_devs
---
 drivers/media/platform/soc_camera/Kconfig  |   4 +-
 drivers/media/platform/soc_camera/pxa_camera.c | 580 -
 2 files changed, 270 insertions(+), 314 deletions(-)

diff --git a/drivers/media/platform/soc_camera/Kconfig 
b/drivers/media/platform/soc_camera/Kconfig
index 39f66414f621..3f927f96763a 100644
--- a/drivers/media/platform/soc_camera/Kconfig
+++ b/drivers/media/platform/soc_camera/Kconfig
@@ -19,8 +19,8 @@ config SOC_CAMERA_PLATFORM
 
 config VIDEO_PXA27x
tristate "PXA27x Quick Capture Interface driver"
-   depends on VIDEO_DEV && PXA27x && SOC_CAMERA
-   select VIDEOBUF_DMA_SG
+   depends on VIDEO_DEV && PXA27x && SOC_CAMERA && HAS_DMA
+   select VIDEOBUF2_DMA_SG
select SG_SPLIT
---help---
  This is a v4l2 driver for the PXA27x Quick Capture Interface
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 2aaf4a8f71a0..5bf97c6b6810 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -34,7 +34,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -180,13 +180,16 @@ enum pxa_camera_active_dma {
 /* buffer for one video frame */
 struct pxa_buffer {
/* common v4l buffer stuff -- must be first */
-   struct videobuf_buffer  vb;
+   struct vb2_v4l2_buffer  vbuf;
+   struct list_headqueue;
u32 code;
+   int nb_planes;
/* our descriptor lists for Y, U and V channels */
struct dma_async_tx_descriptor  *descs[3];
dma_cookie_tcookie[3];
struct scatterlist  *sg[3];
int sg_len[3];
+   size_t  plane_sizes[3];
int inwork;
enum pxa_camera_active_dma  active_dma;
 };
@@ -230,59 +233,19 @@ struct pxa_cam {
 
 static const char *pxa_cam_driver_description = "PXA_Camera";
 
-static unsigned int vid_limit = 16;/* Video memory limit, in Mb */
-
 /*
  *  Videobuf operations
  */
-static int pxa_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
- unsigned int *size)
+static struct pxa_buffer *vb2_to_pxa_buffer(struct vb2_buffer *vb)
 {
-   struct soc_camera_device *icd = vq->priv_data;
-
-   dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
-
-   *size = icd->sizeimage;
-
-   if (0 == *count)
-   *count = 32;
-   if (*size * *count > vid_limit * 1024 * 1024)
-   *count = (vid_limit * 1024 * 1024) / *size;
+   struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
 
-   return 0;
+   return container_of(vbuf, struct pxa_buffer, vbuf);
 }
 
-static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf)
+static struct device *pcdev_to_dev(struct pxa_camera_dev *pcdev)
 {
-   struct soc_camera_device *icd = vq->priv_data;
-   struct videobuf_dmabuf *dma = videobuf_to_dma(>vb);
-   int i;
-
-   BUG_ON(in_interrupt());
-
-   dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
-   >vb, buf->vb.baddr, buf->vb.bsize);
-
-   /*
-* This waits until this buffer is out of danger, i.e., until it is no
-* longer in STATE_QUEUED or STATE_ACTIVE
-*/
-   videobuf_waiton(vq, >vb, 0, 0);
-
-   for (i = 0; i < 3 && buf->descs[i]; i++) {
-   dmaengine_desc_free(buf->descs[i]);
-   kfree(buf->sg[i]);
-   buf->descs[i] = NULL;
-   buf->sg[i] = NULL;
-   buf->sg_len[i] = 0;
-   }
-   videobuf_dma_unmap(vq->dev, dma);
-   videobuf_dma_free(dma);
-
-   buf->vb.state = VIDEOBUF_NEEDS_INIT;
-
-   dev_dbg(icd->parent, "%s end (vb=0x%p) 0x%08lx %d\n", __func__,
-   >vb, buf->vb.baddr, buf->vb.bsize);
+   return pcdev->soc_host.v4l2_dev.dev;
 }
 
 static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
@@ -312,31 +275,26 @@ static void pxa_camera_dma_irq_v(void *data)
 /**
  * pxa_init_dma_channel - init dma descriptors
  * @pcdev: pxa camera device
- * @buf: pxa buffer to find pxa dma channel
+ * @vb: videobuffer2 buffer
  * @dma: dma video buffer
  * @channel: dma channel (0 => 'Y', 1 => 'U', 2 => 'V')
  * 

[PATCH v4 06/13] media: platform: pxa_camera: introduce sensor_call

2016-08-15 Thread Robert Jarzmik
Introduce sensor_call(), which will be used for all sensor invocations.
This is a preparation move to v4l2 device conversion, ie. soc_camera
adherence removal.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/soc_camera/pxa_camera.c | 27 ++
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 0a9e4bdccece..171e3c57615c 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -168,6 +168,9 @@
CICR0_PERRM | CICR0_QDM | CICR0_CDM | CICR0_SOFM | \
CICR0_EOFM | CICR0_FOM)
 
+#define sensor_call(cam, o, f, args...) \
+   v4l2_subdev_call(sd, o, f, ##args)
+
 /*
  * Structures
  */
@@ -731,7 +734,7 @@ static void pxa_camera_setup_cicr(struct soc_camera_device 
*icd,
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
unsigned long dw, bpp;
u32 cicr0, cicr1, cicr2, cicr3, cicr4 = 0, y_skip_top;
-   int ret = v4l2_subdev_call(sd, sensor, g_skip_top_lines, _skip_top);
+   int ret = sensor_call(pcdev, sensor, g_skip_top_lines, _skip_top);
 
if (ret < 0)
y_skip_top = 0;
@@ -1074,7 +1077,7 @@ static int pxa_camera_set_bus_param(struct 
soc_camera_device *icd)
if (ret < 0)
return ret;
 
-   ret = v4l2_subdev_call(sd, video, g_mbus_config, );
+   ret = sensor_call(pcdev, video, g_mbus_config, );
if (!ret) {
common_flags = soc_mbus_config_compatible(,
  bus_flags);
@@ -1118,7 +1121,7 @@ static int pxa_camera_set_bus_param(struct 
soc_camera_device *icd)
}
 
cfg.flags = common_flags;
-   ret = v4l2_subdev_call(sd, video, s_mbus_config, );
+   ret = sensor_call(pcdev, video, s_mbus_config, );
if (ret < 0 && ret != -ENOIOCTLCMD) {
dev_dbg(icd->parent, "camera s_mbus_config(0x%lx) returned 
%d\n",
common_flags, ret);
@@ -1145,7 +1148,7 @@ static int pxa_camera_try_bus_param(struct 
soc_camera_device *icd,
if (ret < 0)
return ret;
 
-   ret = v4l2_subdev_call(sd, video, g_mbus_config, );
+   ret = sensor_call(pcdev, video, g_mbus_config, );
if (!ret) {
common_flags = soc_mbus_config_compatible(,
  bus_flags);
@@ -1196,7 +1199,7 @@ static int pxa_camera_get_formats(struct 
soc_camera_device *icd, unsigned int id
};
const struct soc_mbus_pixelfmt *fmt;
 
-   ret = v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, );
+   ret = sensor_call(pcdev, pad, enum_mbus_code, NULL, );
if (ret < 0)
/* No more formats */
return 0;
@@ -1298,7 +1301,7 @@ static int pxa_camera_set_crop(struct soc_camera_device 
*icd,
if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
icd->sense = 
 
-   ret = v4l2_subdev_call(sd, video, s_crop, a);
+   ret = sensor_call(pcdev, video, s_crop, a);
 
icd->sense = NULL;
 
@@ -1308,7 +1311,7 @@ static int pxa_camera_set_crop(struct soc_camera_device 
*icd,
return ret;
}
 
-   ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
+   ret = sensor_call(pcdev, pad, get_fmt, NULL, );
if (ret < 0)
return ret;
 
@@ -1320,7 +1323,7 @@ static int pxa_camera_set_crop(struct soc_camera_device 
*icd,
v4l_bound_align_image(>width, 48, 2048, 1,
>height, 32, 2048, 0,
fourcc == V4L2_PIX_FMT_YUV422P ? 4 : 0);
-   ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, );
+   ret = sensor_call(pcdev, pad, set_fmt, NULL, );
if (ret < 0)
return ret;
 
@@ -1385,7 +1388,7 @@ static int pxa_camera_set_fmt(struct soc_camera_device 
*icd,
mf->colorspace  = pix->colorspace;
mf->code= xlate->code;
 
-   ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, );
+   ret = sensor_call(pcdev, pad, set_fmt, NULL, );
 
if (mf->code != xlate->code)
return -EINVAL;
@@ -1460,7 +1463,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device 
*icd,
mf->colorspace  = pix->colorspace;
mf->code= xlate->code;
 
-   ret = v4l2_subdev_call(sd, pad, set_fmt, _cfg, );
+   ret = sensor_call(pcdev, pad, set_fmt, _cfg, );
if (ret < 0)
return ret;
 
@@ -1518,7 +1521,7 @@ static int pxa_camera_suspend(struct device *dev)
 
if (pcdev->soc_host.icd) {
struct v4l2_subdev *sd = 
soc_camera_to_subdev(pcdev->soc_host.icd);
-   ret = v4l2_subdev_call(sd, core, s_power, 0);
+   ret = sensor_call(pcdev, core, s_power, 0);
   

[PATCH v4 02/13] media: mt9m111: use only the SRGB colorspace

2016-08-15 Thread Robert Jarzmik
mt9m111 being a camera sensor, its colorspace should always be SRGB, for
both RGB based formats or YCbCr based ones.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/i2c/soc_camera/mt9m111.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/mt9m111.c 
b/drivers/media/i2c/soc_camera/mt9m111.c
index a7efaa5964d1..b7c4f371bae1 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -188,10 +188,10 @@ struct mt9m111_datafmt {
 };
 
 static const struct mt9m111_datafmt mt9m111_colour_fmts[] = {
-   {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG},
-   {MEDIA_BUS_FMT_YVYU8_2X8, V4L2_COLORSPACE_JPEG},
-   {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG},
-   {MEDIA_BUS_FMT_VYUY8_2X8, V4L2_COLORSPACE_JPEG},
+   {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_SRGB},
+   {MEDIA_BUS_FMT_YVYU8_2X8, V4L2_COLORSPACE_SRGB},
+   {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_SRGB},
+   {MEDIA_BUS_FMT_VYUY8_2X8, V4L2_COLORSPACE_SRGB},
{MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, V4L2_COLORSPACE_SRGB},
{MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, V4L2_COLORSPACE_SRGB},
{MEDIA_BUS_FMT_RGB565_2X8_LE, V4L2_COLORSPACE_SRGB},
-- 
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


[PATCH v4 05/13] media: platform: pxa_camera: trivial move of functions

2016-08-15 Thread Robert Jarzmik
Move the functions in the file to be regrouped into meaningful blocks :
 1. pxa camera core handling functions, manipulating the herdware
 2. videobuf2 functions, dealing with video buffers
 3. video ioctl (vidioc) related functions
 4. driver probing, removal, suspend and resume

This patch doesn't modify a single line of code.

Signed-off-by: Robert Jarzmik 
---
Since v3: replace void *alloc_ctxt by struct device *alloc_devs impact
---
 drivers/media/platform/soc_camera/pxa_camera.c | 475 +
 1 file changed, 242 insertions(+), 233 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 5bf97c6b6810..0a9e4bdccece 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -538,239 +538,6 @@ out:
spin_unlock_irqrestore(>lock, flags);
 }
 
-static void pxa_buffer_cleanup(struct pxa_buffer *buf)
-{
-   int i;
-
-   for (i = 0; i < 3 && buf->descs[i]; i++) {
-   dmaengine_desc_free(buf->descs[i]);
-   kfree(buf->sg[i]);
-   buf->descs[i] = NULL;
-   buf->sg[i] = NULL;
-   buf->sg_len[i] = 0;
-   buf->plane_sizes[i] = 0;
-   }
-   buf->nb_planes = 0;
-}
-
-static int pxa_buffer_init(struct pxa_camera_dev *pcdev,
-  struct pxa_buffer *buf)
-{
-   struct vb2_buffer *vb = >vbuf.vb2_buf;
-   struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
-   int nb_channels = pcdev->channels;
-   int i, ret = 0;
-   unsigned long size = vb2_plane_size(vb, 0);
-
-   switch (nb_channels) {
-   case 1:
-   buf->plane_sizes[0] = size;
-   break;
-   case 3:
-   buf->plane_sizes[0] = size / 2;
-   buf->plane_sizes[1] = size / 4;
-   buf->plane_sizes[2] = size / 4;
-   break;
-   default:
-   return -EINVAL;
-   };
-   buf->nb_planes = nb_channels;
-
-   ret = sg_split(sgt->sgl, sgt->nents, 0, nb_channels,
-  buf->plane_sizes, buf->sg, buf->sg_len, GFP_KERNEL);
-   if (ret < 0) {
-   dev_err(pcdev_to_dev(pcdev),
-   "sg_split failed: %d\n", ret);
-   return ret;
-   }
-   for (i = 0; i < nb_channels; i++) {
-   ret = pxa_init_dma_channel(pcdev, buf, i,
-  buf->sg[i], buf->sg_len[i]);
-   if (ret) {
-   pxa_buffer_cleanup(buf);
-   return ret;
-   }
-   }
-   INIT_LIST_HEAD(>queue);
-
-   return ret;
-}
-
-static void pxac_vb2_cleanup(struct vb2_buffer *vb)
-{
-   struct pxa_buffer *buf = vb2_to_pxa_buffer(vb);
-   struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vb->vb2_queue);
-
-   dev_dbg(pcdev_to_dev(pcdev),
-"%s(vb=%p)\n", __func__, vb);
-   pxa_buffer_cleanup(buf);
-}
-
-static void pxac_vb2_queue(struct vb2_buffer *vb)
-{
-   struct pxa_buffer *buf = vb2_to_pxa_buffer(vb);
-   struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vb->vb2_queue);
-
-   dev_dbg(pcdev_to_dev(pcdev),
-"%s(vb=%p) nb_channels=%d size=%lu active=%p\n",
-   __func__, vb, pcdev->channels, vb2_get_plane_payload(vb, 0),
-   pcdev->active);
-
-   list_add_tail(>queue, >capture);
-
-   pxa_dma_add_tail_buf(pcdev, buf);
-}
-
-/*
- * Please check the DMA prepared buffer structure in :
- *   Documentation/video4linux/pxa_camera.txt
- * Please check also in pxa_camera_check_link_miss() to understand why DMA 
chain
- * modification while DMA chain is running will work anyway.
- */
-static int pxac_vb2_prepare(struct vb2_buffer *vb)
-{
-   struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vb->vb2_queue);
-   struct pxa_buffer *buf = vb2_to_pxa_buffer(vb);
-   struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue);
-   int ret = 0;
-
-   switch (pcdev->channels) {
-   case 1:
-   case 3:
-   vb2_set_plane_payload(vb, 0, icd->sizeimage);
-   break;
-   default:
-   return -EINVAL;
-   }
-
-   dev_dbg(pcdev_to_dev(pcdev),
-"%s (vb=%p) nb_channels=%d size=%lu\n",
-   __func__, vb, pcdev->channels, vb2_get_plane_payload(vb, 0));
-
-   WARN_ON(!icd->current_fmt);
-
-#ifdef DEBUG
-   /*
-* This can be useful if you want to see if we actually fill
-* the buffer with something
-*/
-   for (i = 0; i < vb->num_planes; i++)
-   memset((void *)vb2_plane_vaddr(vb, i),
-  0xaa, vb2_get_plane_payload(vb, i));
-#endif
-
-   /*
-* I think, in buf_prepare you only have to protect global data,
-* the actual buffer is yours
-*/
-   buf->inwork = 0;
-   

[PATCH v4 13/13] media: platform: pxa_camera: move pxa_camera out of soc_camera

2016-08-15 Thread Robert Jarzmik
As the conversion to a v4l2 standalone device is finished, move
pxa_camera one directory up and finish severing any dependency to
soc_camera.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/Kconfig |8 +
 drivers/media/platform/Makefile|1 +
 drivers/media/platform/pxa_camera.c| 2096 
 drivers/media/platform/soc_camera/Kconfig  |8 -
 drivers/media/platform/soc_camera/Makefile |1 -
 drivers/media/platform/soc_camera/pxa_camera.c | 2096 
 6 files changed, 2105 insertions(+), 2105 deletions(-)
 create mode 100644 drivers/media/platform/pxa_camera.c
 delete mode 100644 drivers/media/platform/soc_camera/pxa_camera.c

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index f25344bc7912..299af1977d61 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -91,6 +91,14 @@ config VIDEO_OMAP3_DEBUG
---help---
  Enable debug messages on OMAP 3 camera controller driver.
 
+config VIDEO_PXA27x
+   tristate "PXA27x Quick Capture Interface driver"
+   depends on VIDEO_DEV && PXA27x && HAS_DMA
+   select VIDEOBUF2_DMA_SG
+   select SG_SPLIT
+   ---help---
+ This is a v4l2 driver for the PXA27x Quick Capture Interface
+
 config VIDEO_S3C_CAMIF
tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver"
depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 21771c1a13fb..e38918bbe0d0 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += marvell-ccic/
 obj-$(CONFIG_VIDEO_MMP_CAMERA) += marvell-ccic/
 
 obj-$(CONFIG_VIDEO_OMAP3)  += omap3isp/
+obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o soc_camera/soc_mediabus.o
 
 obj-$(CONFIG_VIDEO_VIU) += fsl-viu.o
 
diff --git a/drivers/media/platform/pxa_camera.c 
b/drivers/media/platform/pxa_camera.c
new file mode 100644
index ..868c6ad4784c
--- /dev/null
+++ b/drivers/media/platform/pxa_camera.c
@@ -0,0 +1,2096 @@
+/*
+ * V4L2 Driver for PXA camera host
+ *
+ * Copyright (C) 2006, Sascha Hauer, Pengutronix
+ * Copyright (C) 2008, Guennadi Liakhovetski 
+ * Copyright (C) 2016, Robert Jarzmik 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define PXA_CAM_VERSION "0.0.6"
+#define PXA_CAM_DRV_NAME "pxa27x-camera"
+
+#define DEFAULT_WIDTH  640
+#define DEFAULT_HEIGHT 480
+
+/* Camera Interface */
+#define CICR0  0x
+#define CICR1  0x0004
+#define CICR2  0x0008
+#define CICR3  0x000C
+#define CICR4  0x0010
+#define CISR   0x0014
+#define CIFR   0x0018
+#define CITOR  0x001C
+#define CIBR0  0x0028
+#define CIBR1  0x0030
+#define CIBR2  0x0038
+
+#define CICR0_DMAEN(1 << 31)   /* DMA request enable */
+#define CICR0_PAR_EN   (1 << 30)   /* Parity enable */
+#define CICR0_SL_CAP_EN(1 << 29)   /* Capture enable for slave 
mode */
+#define CICR0_ENB  (1 << 28)   /* Camera interface enable */
+#define CICR0_DIS  (1 << 27)   /* Camera interface disable */
+#define CICR0_SIM  (0x7 << 24) /* Sensor interface mode mask */
+#define CICR0_TOM  (1 << 9)/* Time-out mask */
+#define CICR0_RDAVM(1 << 8)/* Receive-data-available mask */
+#define CICR0_FEM  (1 << 7)/* FIFO-empty mask */
+#define CICR0_EOLM (1 << 6)/* End-of-line mask */
+#define CICR0_PERRM(1 << 5)/* Parity-error mask */
+#define CICR0_QDM  (1 << 4)/* Quick-disable mask */
+#define CICR0_CDM  (1 << 3)/* Disable-done mask */
+#define CICR0_SOFM (1 << 2)/* Start-of-frame mask */
+#define CICR0_EOFM (1 << 1)/* End-of-frame mask */
+#define CICR0_FOM  (1 << 0)/* FIFO-overrun mask */
+
+#define CICR1_TBIT (1 << 31)   /* Transparency bit */
+#define CICR1_RGBT_CONV(0x3 << 29) /* RGBT conversion mask */
+#define CICR1_PPL  (0x7ff << 15)   /* Pixels per line mask */
+#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
+#define CICR1_RGB_F(1 << 11)   /* RGB format */
+#define 

[PATCH v4 09/13] media: platform: pxa_camera: remove set_crop

2016-08-15 Thread Robert Jarzmik
This is to be seen as a regression as the set_crop function is
removed. This is a temporary situation in the v4l2 porting, and will
have to be added later.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/soc_camera/pxa_camera.c | 76 --
 1 file changed, 76 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 2471d036a835..a2fedc9bb71c 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -1295,81 +1295,6 @@ static int pxa_camera_check_frame(u32 width, u32 height)
(width & 0x01);
 }
 
-static int pxa_camera_set_crop(struct soc_camera_device *icd,
-  const struct v4l2_crop *a)
-{
-   const struct v4l2_rect *rect = >c;
-   struct device *dev = icd->parent;
-   struct soc_camera_host *ici = to_soc_camera_host(dev);
-   struct pxa_camera_dev *pcdev = ici->priv;
-   struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
-   struct soc_camera_sense sense = {
-   .master_clock = pcdev->mclk,
-   .pixel_clock_max = pcdev->ciclk / 4,
-   };
-   struct v4l2_subdev_format fmt = {
-   .which = V4L2_SUBDEV_FORMAT_ACTIVE,
-   };
-   struct v4l2_mbus_framefmt *mf = 
-   struct pxa_cam *cam = icd->host_priv;
-   u32 fourcc = icd->current_fmt->host_fmt->fourcc;
-   int ret;
-
-   /* If PCLK is used to latch data from the sensor, check sense */
-   if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
-   icd->sense = 
-
-   ret = sensor_call(pcdev, video, s_crop, a);
-
-   icd->sense = NULL;
-
-   if (ret < 0) {
-   dev_warn(pcdev_to_dev(pcdev), "Failed to crop to %ux%u@%u:%u\n",
-rect->width, rect->height, rect->left, rect->top);
-   return ret;
-   }
-
-   ret = sensor_call(pcdev, pad, get_fmt, NULL, );
-   if (ret < 0)
-   return ret;
-
-   if (pxa_camera_check_frame(mf->width, mf->height)) {
-   /*
-* Camera cropping produced a frame beyond our capabilities.
-* FIXME: just extract a subframe, that we can process.
-*/
-   v4l_bound_align_image(>width, 48, 2048, 1,
-   >height, 32, 2048, 0,
-   fourcc == V4L2_PIX_FMT_YUV422P ? 4 : 0);
-   ret = sensor_call(pcdev, pad, set_fmt, NULL, );
-   if (ret < 0)
-   return ret;
-
-   if (pxa_camera_check_frame(mf->width, mf->height)) {
-   dev_warn(pcdev_to_dev(pcdev),
-"Inconsistent state. Use S_FMT to repair\n");
-   return -EINVAL;
-   }
-   }
-
-   if (sense.flags & SOCAM_SENSE_PCLK_CHANGED) {
-   if (sense.pixel_clock > sense.pixel_clock_max) {
-   dev_err(pcdev_to_dev(pcdev),
-   "pixel clock %lu set by the camera too high!",
-   sense.pixel_clock);
-   return -EIO;
-   }
-   recalculate_fifo_timeout(pcdev, sense.pixel_clock);
-   }
-
-   icd->user_width = mf->width;
-   icd->user_height= mf->height;
-
-   pxa_camera_setup_cicr(icd, cam->flags, fourcc);
-
-   return ret;
-}
-
 static int pxa_camera_set_fmt(struct soc_camera_device *icd,
  struct v4l2_format *f)
 {
@@ -1582,7 +1507,6 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops 
= {
.remove = pxa_camera_remove_device,
.clock_start= pxa_camera_clock_start,
.clock_stop = pxa_camera_clock_stop,
-   .set_crop   = pxa_camera_set_crop,
.get_formats= pxa_camera_get_formats,
.put_formats= pxa_camera_put_formats,
.set_fmt= pxa_camera_set_fmt,
-- 
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


[PATCH v4 11/13] media: platform: pxa_camera: add debug register access

2016-08-15 Thread Robert Jarzmik
Add pxa_camera registers access through advanced video debugging.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/soc_camera/pxa_camera.c | 32 ++
 1 file changed, 32 insertions(+)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 395cd398c32b..fb89b85f59ab 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -1342,6 +1342,34 @@ static int pxa_camera_check_frame(u32 width, u32 height)
(width & 0x01);
 }
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int pxac_vidioc_g_register(struct file *file, void *priv,
+ struct v4l2_dbg_register *reg)
+{
+   struct pxa_camera_dev *pcdev = video_drvdata(file);
+
+   if (reg->reg > CIBR2)
+   return -ERANGE;
+
+   reg->val = __raw_readl(pcdev->base + reg->reg);
+   reg->size = sizeof(__u32);
+   return 0;
+}
+
+static int pxac_vidioc_s_register(struct file *file, void *priv,
+ const struct v4l2_dbg_register *reg)
+{
+   struct pxa_camera_dev *pcdev = video_drvdata(file);
+
+   if (reg->reg > CIBR2)
+   return -ERANGE;
+   if (reg->size != sizeof(__u32))
+   return -EINVAL;
+   __raw_writel(reg->val, pcdev->base + reg->reg);
+   return 0;
+}
+#endif
+
 static int pxac_vidioc_enum_fmt_vid_cap(struct file *filp, void  *priv,
struct v4l2_fmtdesc *f)
 {
@@ -1592,6 +1620,10 @@ static const struct v4l2_ioctl_ops pxa_camera_ioctl_ops 
= {
.vidioc_expbuf  = vb2_ioctl_expbuf,
.vidioc_streamon= vb2_ioctl_streamon,
.vidioc_streamoff   = vb2_ioctl_streamoff,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_register  = pxac_vidioc_g_register,
+   .vidioc_s_register  = pxac_vidioc_s_register,
+#endif
 };
 
 static struct v4l2_clk_ops pxa_camera_mclk_ops = {
-- 
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


[PATCH v4 12/13] media: platform: pxa_camera: change stop_streaming semantics

2016-08-15 Thread Robert Jarzmik
Instead of the legacy behavior where it was required to wait for all
video buffers to be finished by the hardware, use a cancel like strategy
: as soon as the stop_streaming() call is done, abort all DMA transfers,
report the already buffers as failed and return.

This makes stop_streaming() more a "cancel capture" than a "wait for end
of capture" semantic.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/soc_camera/pxa_camera.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index fb89b85f59ab..868c6ad4784c 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -523,7 +523,8 @@ static void pxa_camera_stop_capture(struct pxa_camera_dev 
*pcdev)
 }
 
 static void pxa_camera_wakeup(struct pxa_camera_dev *pcdev,
- struct pxa_buffer *buf)
+ struct pxa_buffer *buf,
+ enum vb2_buffer_state state)
 {
struct vb2_buffer *vb = >vbuf.vb2_buf;
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
@@ -645,7 +646,7 @@ static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
}
buf->active_dma &= ~act_dma;
if (!buf->active_dma) {
-   pxa_camera_wakeup(pcdev, buf);
+   pxa_camera_wakeup(pcdev, buf, VB2_BUF_STATE_DONE);
pxa_camera_check_link_miss(pcdev, last_buf->cookie[chan],
   last_issued);
}
@@ -1087,7 +1088,15 @@ static int pxac_vb2_start_streaming(struct vb2_queue 
*vq, unsigned int count)
 
 static void pxac_vb2_stop_streaming(struct vb2_queue *vq)
 {
-   vb2_wait_for_all_buffers(vq);
+   struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vq);
+   struct pxa_buffer *buf, *tmp;
+
+   dev_dbg(pcdev_to_dev(pcdev), "%s active=%p\n",
+   __func__, pcdev->active);
+   pxa_camera_stop_capture(pcdev);
+
+   list_for_each_entry_safe(buf, tmp, >capture, queue)
+   pxa_camera_wakeup(pcdev, buf, VB2_BUF_STATE_ERROR);
 }
 
 static struct vb2_ops pxac_vb2_ops = {
-- 
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


[PATCH v4 07/13] media: platform: pxa_camera: make printk consistent

2016-08-15 Thread Robert Jarzmik
Make all print consistent by always using :
 - dev_xxx(pcdev_to_dev(pcdev), )

This prepares the soc_camera adherence removal by making these call rely
on only pcdev, and not the soc_camera icd structure.

Signed-off-by: Robert Jarzmik 
---
 drivers/media/platform/soc_camera/pxa_camera.c | 70 --
 1 file changed, 43 insertions(+), 27 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
b/drivers/media/platform/soc_camera/pxa_camera.c
index 171e3c57615c..f3922a99405b 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -236,6 +236,14 @@ struct pxa_cam {
 
 static const char *pxa_cam_driver_description = "PXA_Camera";
 
+static struct pxa_camera_dev *icd_to_pcdev(struct soc_camera_device *icd)
+{
+   struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+   struct pxa_camera_dev *pcdev = ici->priv;
+
+   return pcdev;
+}
+
 /*
  *  Videobuf operations
  */
@@ -465,7 +473,6 @@ static void pxa_camera_check_link_miss(struct 
pxa_camera_dev *pcdev,
 static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
   enum pxa_camera_active_dma act_dma)
 {
-   struct device *dev = pcdev_to_dev(pcdev);
struct pxa_buffer *buf, *last_buf;
unsigned long flags;
u32 camera_status, overrun;
@@ -476,7 +483,7 @@ static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
spin_lock_irqsave(>lock, flags);
 
camera_status = __raw_readl(pcdev->base + CISR);
-   dev_dbg(dev, "camera dma irq, cisr=0x%x dma=%d\n",
+   dev_dbg(pcdev_to_dev(pcdev), "camera dma irq, cisr=0x%x dma=%d\n",
camera_status, act_dma);
overrun = CISR_IFO_0;
if (pcdev->channels == 3)
@@ -522,7 +529,7 @@ static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
   NULL, _issued);
if (camera_status & overrun &&
last_status != DMA_COMPLETE) {
-   dev_dbg(dev, "FIFO overrun! CISR: %x\n",
+   dev_dbg(pcdev_to_dev(pcdev), "FIFO overrun! CISR: %x\n",
camera_status);
pxa_camera_stop_capture(pcdev);
list_for_each_entry(buf, >capture, queue)
@@ -545,7 +552,6 @@ static u32 mclk_get_divisor(struct platform_device *pdev,
struct pxa_camera_dev *pcdev)
 {
unsigned long mclk = pcdev->mclk;
-   struct device *dev = >dev;
u32 div;
unsigned long lcdclk;
 
@@ -555,7 +561,8 @@ static u32 mclk_get_divisor(struct platform_device *pdev,
/* mclk <= ciclk / 4 (27.4.2) */
if (mclk > lcdclk / 4) {
mclk = lcdclk / 4;
-   dev_warn(dev, "Limiting master clock to %lu\n", mclk);
+   dev_warn(pcdev_to_dev(pcdev),
+"Limiting master clock to %lu\n", mclk);
}
 
/* We verify mclk != 0, so if anyone breaks it, here comes their Oops */
@@ -565,7 +572,7 @@ static u32 mclk_get_divisor(struct platform_device *pdev,
if (pcdev->platform_flags & PXA_CAMERA_MCLK_EN)
pcdev->mclk = lcdclk / (2 * (div + 1));
 
-   dev_dbg(dev, "LCD clock %luHz, target freq %luHz, divisor %u\n",
+   dev_dbg(pcdev_to_dev(pcdev), "LCD clock %luHz, target freq %luHz, 
divisor %u\n",
lcdclk, mclk, div);
 
return div;
@@ -662,7 +669,9 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
 
 static int pxa_camera_add_device(struct soc_camera_device *icd)
 {
-   dev_info(icd->parent, "PXA Camera driver attached to camera %d\n",
+   struct pxa_camera_dev *pcdev = icd_to_pcdev(icd);
+
+   dev_info(pcdev_to_dev(pcdev), "PXA Camera driver attached to camera 
%d\n",
 icd->devnum);
 
return 0;
@@ -670,7 +679,9 @@ static int pxa_camera_add_device(struct soc_camera_device 
*icd)
 
 static void pxa_camera_remove_device(struct soc_camera_device *icd)
 {
-   dev_info(icd->parent, "PXA Camera driver detached from camera %d\n",
+   struct pxa_camera_dev *pcdev = icd_to_pcdev(icd);
+
+   dev_info(pcdev_to_dev(pcdev), "PXA Camera driver detached from camera 
%d\n",
 icd->devnum);
 }
 
@@ -1082,7 +1093,7 @@ static int pxa_camera_set_bus_param(struct 
soc_camera_device *icd)
common_flags = soc_mbus_config_compatible(,
  bus_flags);
if (!common_flags) {
-   dev_warn(icd->parent,
+   dev_warn(pcdev_to_dev(pcdev),
 "Flags incompatible: camera 0x%x, host 
0x%lx\n",
 cfg.flags, bus_flags);
return -EINVAL;
@@ -1123,7 +1134,7 @@ static int pxa_camera_set_bus_param(struct 
soc_camera_device *icd)
cfg.flags = common_flags;
ret = sensor_call(pcdev, 

[PATCH] MAINTAINERS: atmel-isc: add entry for Atmel ISC

2016-08-15 Thread Nicolas Ferre
Add the MAINTAINERS' entry for Microchip / Atmel Image Sensor Controller.

Signed-off-by: Nicolas Ferre 
Cc: Songjun Wu 
---
 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 45c98485c3f0..84786643ba4c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7750,6 +7750,14 @@ T:   git git://git.monstr.eu/linux-2.6-microblaze.git
 S: Supported
 F: arch/microblaze/
 
+MICROCHIP / ATMEL ISC DRIVER
+M: Songjun Wu 
+L: linux-media@vger.kernel.org
+S: Supported
+F: drivers/media/platform/atmel/atmel-isc.c
+F: drivers/media/platform/atmel/atmel-isc-regs.h
+F: devicetree/bindings/media/atmel-isc.txt
+
 MICROSOFT SURFACE PRO 3 BUTTON DRIVER
 M: Chen Yu 
 L: platform-driver-...@vger.kernel.org
-- 
2.9.0

--
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 RFC 0/5] Start changing media docs to build with PDF

2016-08-15 Thread Mauro Carvalho Chehab
This series are experimental patches that change some things at the media
books in order to make pdflatex to produce a valid document.

The first patch use Sphinx math extension. Please notice that it only works if
the rst2pdf extension is disabled, as otherwise Sphinx 1.4.x will complain about
duplicated math modules. So, it can only be applied if we give up using rst2pdf
or find the bug that prevents using it together with the math extension at the
Sphinx conf.py.

The other two patches fix some additional issues that are needed for the Latex
output to work. 

The forth patch is actually a bug fix, and should be merged upstream anyway.

The last patch is actually a HACK!!! should *never* be merged upstream as-is.

It is there to show that somehow, Sphinx LaTeX tables output is broken. On 
several
places where we add a note or an attention on a table row, the Latex output is
broken.  I suspect that the bug is actually when multiple lines are generated 
inside
a table row, but I don't know enough about LaTeX to be sure...

Anyway, this is just a PoC. I don't care enough about PDF output to try fixing
the issues at rst2pdf or at Sphinx LaTeX output (needed by pdflatex). Yet, I'd 
like
to see patch 1 applied, as the math expressions look a way better using LaTeX
math than before. Yet, if we do that, we'll end by needing the LaTeX big 
dependency chain.

Mauro Carvalho Chehab (5):
  [media] pixfmt-007.rst: use Sphinx math:: expressions
  [media] pixfmt-nv12mt.rst: use PNG instead of GIF
  [media] docs-rst: get rid of extra less or equal symbols
  [media] vidioc-enumstd.rst: fix a broken reference
  HACK

 Documentation/conf.py  |   9 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst|   2 +-
 Documentation/media/uapi/v4l/buffer.rst|  15 +-
 Documentation/media/uapi/v4l/dev-overlay.rst   |   7 +-
 Documentation/media/uapi/v4l/pixfmt-007.rst| 175 ++---
 Documentation/media/uapi/v4l/pixfmt-nv12mt.rst |   4 +-
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif  | Bin 2108 -> 0 bytes
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png  | Bin 0 -> 1920 bytes
 .../v4l/pixfmt-nv12mt_files/nv12mt_example.gif | Bin 6858 -> 0 bytes
 .../v4l/pixfmt-nv12mt_files/nv12mt_example.png | Bin 0 -> 5261 bytes
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |  17 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |  14 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst|   2 +-
 13 files changed, 152 insertions(+), 93 deletions(-)
 delete mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png
 delete mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif
 create mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png

-- 
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 RFC 4/5] [media] vidioc-enumstd.rst: fix a broken reference

2016-08-15 Thread Mauro Carvalho Chehab
Somehow, the conversion broke a reference here. Re-add it.

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

diff --git a/Documentation/media/uapi/v4l/vidioc-enumstd.rst 
b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
index 6699b26cdeb4..a936fe32ce9c 100644
--- a/Documentation/media/uapi/v4l/vidioc-enumstd.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enumstd.rst
@@ -269,7 +269,7 @@ support digital TV. See also the Linux DVB API at
 
 .. _video-standards:
 
-.. flat-table:: Video Standards (based on [])
+.. flat-table:: Video Standards (based on :ref:`itu470`)
 :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 RFC 2/5] [media] pixfmt-nv12mt.rst: use PNG instead of GIF

2016-08-15 Thread Mauro Carvalho Chehab
pdflatex doesn't like gif images:
None:None: WARNING: no matching candidate for image URI 
u'media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.*'
None:None: WARNING: no matching candidate for image URI 
u'media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.*'

But it works fine with png. So, convert them. As a plus, PNG images
are smaller.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/pixfmt-nv12mt.rst   |   4 ++--
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif| Bin 2108 -> 0 bytes
 .../media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png| Bin 0 -> 1920 bytes
 .../uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif  | Bin 6858 -> 0 bytes
 .../uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png  | Bin 0 -> 5261 bytes
 5 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png
 delete mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.gif
 create mode 100644 
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png

diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst 
b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
index 6198941bb814..1e6fdf0194f5 100644
--- a/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
@@ -36,7 +36,7 @@ Layout of macroblocks in memory is presented in the following 
figure.
 .. _nv12mt:
 
 .. figure::  pixfmt-nv12mt_files/nv12mt.*
-:alt:nv12mt.gif
+:alt:nv12mt.png
 :align:  center
 
 V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
@@ -53,7 +53,7 @@ interleaved. Height of the buffer is aligned to 32.
 .. _nv12mt_ex:
 
 .. figure::  pixfmt-nv12mt_files/nv12mt_example.*
-:alt:nv12mt_example.gif
+:alt:nv12mt_example.png
 :align:  center
 
 Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif 
b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.gif
deleted file mode 100644
index 
ef2d4cf8367b97293eb9139de0f33d0a2ac236be..
GIT binary patch
literal 0
HcmV?d1

literal 2108
zcmb`E`9IT-1IOQ+qvdLI6(2NWh4B$mqGFB~bIqI`Ov+J?J|;e;^kHT0IblWJ*`TR@ettFfwykFz0RpGX8Qtpc((LKc?crMQAH8KYFSWD99Kv!>_lN%eRo>u79{QY=Bb|r;(6+q+1bsx
zxvy`8-AZ)6z3Cv$DzebNmJoNG}9=Ei%vD-U3yExrFy-({S>>SJpRz|$mrO(VC>MdmlKl{FQ#T@
zCtuCI77p1x0NyMM-@RX*TKTvp_`JS33@mZJb^Yl4*&(_Qd{8V%hZ`riKuxi}>Dopq
zO>kaLJV^(c{>X$am`p2!XESZ86${gJ4af*Lx;d*6=Zrn{WpL(bjDYWP)L~JMrG

[PATCH RFC 3/5] [media] docs-rst: get rid of extra less or equal symbols

2016-08-15 Thread Mauro Carvalho Chehab
The LaTeX output format doesn't support less or equal UTF-8
symbols. So, we need to get rid of them or to convert to
math expressions.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 2 +-
 Documentation/media/uapi/v4l/dev-overlay.rst  | 7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

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 04ee90099676..a7315a8d219a 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
@@ -114,7 +114,7 @@ logical address types are already defined will return with 
error ``EBUSY``.
 
-  ``num_log_addrs``
 
-   -  Number of logical addresses to set up. Must be ???
+   -  Number of logical addresses to set up. Must be less or equal to
  ``available_log_addrs`` as returned by
  :ref:`CEC_ADAP_G_CAPS`. All arrays in
  this structure are only filled up to index
diff --git a/Documentation/media/uapi/v4l/dev-overlay.rst 
b/Documentation/media/uapi/v4l/dev-overlay.rst
index 92b4471b0c6e..13359134b468 100644
--- a/Documentation/media/uapi/v4l/dev-overlay.rst
+++ b/Documentation/media/uapi/v4l/dev-overlay.rst
@@ -216,7 +216,12 @@ bits like:
 
 ((__u8 *) bitmap)[w.width * y + x / 8] & (1 << (x & 7))
 
-where ``0`` ??? x < ``w.width`` and ``0`` ??? y <``w.height``. [#f2]_
+where [#f2]_:
+
+.. math::
+
+0 \le x < w.width \text{, and }
+0 \le y < w.height
 
 When a clipping bit mask is not supported the driver ignores this field,
 its contents after calling :ref:`VIDIOC_S_FMT ` are
-- 
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 RFC 1/5] [media] pixfmt-007.rst: use Sphinx math:: expressions

2016-08-15 Thread Mauro Carvalho Chehab
Enrich math formulas by using the Sphinx math. That will allow
using those formulas on pdf documents as well.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/conf.py   |   9 +-
 Documentation/media/uapi/v4l/pixfmt-007.rst | 175 ++--
 2 files changed, 115 insertions(+), 69 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 96b7aa66c89c..163782912df9 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,14 +28,7 @@ sys.path.insert(0, os.path.abspath('sphinx'))
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
-
-# Gracefully handle missing rst2pdf.
-try:
-import rst2pdf
-extensions += ['rst2pdf.pdfbuilder']
-except ImportError:
-pass
+extensions = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 
'kernel_include']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst 
b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 8c946b0c63a0..2ecace31b9f5 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -72,23 +72,29 @@ SMPTE C set, so this colorspace is sometimes called SMPTE C 
as well.
 The transfer function defined for SMPTE 170M is the same as the one
 defined in Rec. 709.
 
-L' = -1.099(-L) :sup:`0.45` + 0.099 for L ??? -0.018
+.. math::
 
-L' = 4.5L for -0.018 < L < 0.018
+L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le-0.018
 
-L' = 1.099L :sup:`0.45` - 0.099 for L ??? 0.018
+L' = 4.5L \text{, for } -0.018 < L < 0.018
+
+L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
 
 Inverse Transfer function:
 
-L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ??? -0.081
+.. math::
 
-L = L' / 4.5 for -0.081 < L' < 0.081
+L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, 
for } L' \le -0.081
 
-L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ??? 0.081
+L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081
+
+L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } 
L' \ge 0.081
 
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
+.. math::
+
 Y' = 0.299R' + 0.587G' + 0.114B'
 
 Cb = -0.169R' - 0.331G' + 0.5B'
@@ -169,23 +175,29 @@ The full name of this standard is Rec. ITU-R BT.709-5.
 Transfer function. Normally L is in the range [0???1], but for the
 extended gamut xvYCC encoding values outside that range are allowed.
 
-L' = -1.099(-L) :sup:`0.45` + 0.099 for L ??? -0.018
+.. math::
 
-L' = 4.5L for -0.018 < L < 0.018
+L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le -0.018
 
-L' = 1.099L :sup:`0.45` - 0.099 for L ??? 0.018
+L' = 4.5L \text{, for } -0.018 < L < 0.018
+
+L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
 
 Inverse Transfer function:
 
-L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ??? -0.081
+.. math::
 
-L = L' / 4.5 for -0.081 < L' < 0.081
+L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } 
L' \le -0.081
 
-L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ??? 0.081
+L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081
+
+L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } 
L' \ge 0.081
 
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_709`` encoding:
 
+.. math::
+
 Y' = 0.2126R' + 0.7152G' + 0.0722B'
 
 Cb = -0.1146R' - 0.3854G' + 0.5B'
@@ -210,22 +222,26 @@ similar to the Rec. 709 encoding, but it allows for R', 
G' and B' values
 that are outside the range [0???1]. The resulting Y', Cb and Cr values are
 scaled and offset:
 
-Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256)
+.. math::
 
-Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B')
+Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256}
 
-Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B')
+Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B')
+
+Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B')
 
 The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is
 similar to the BT.601 encoding, but it allows for R', G' and B' values
 that are outside the range [0???1]. The resulting Y', Cb and Cr values are
 scaled and offset:
 
-Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256)
+.. math::
 
-Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B')
+Y' = \frac{219}{256} * (0.299R' + 0.587G' + 0.114B') + \frac{16}{256}
 
-Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B')
+Cb = \frac{224}{256} * (-0.169R' - 0.331G' + 0.5B')
+
+Cr = \frac{224}{256} * (0.5R' - 

[PATCH RFC 5/5] HACK!!!!

2016-08-15 Thread Mauro Carvalho Chehab
Please, never apply this!

This hack comments out some stuff, in order to fix a few table outputs when
using Sphinx LaTeX output and pdflatex. Please notice that this *won't* fix
all bugs. A lot more similar hacks is needed, as it seems that Sphinx LaTeX
is broken for non-trivial tables.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/buffer.rst | 15 ++-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst| 17 +
 Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst | 14 --
 3 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 5deb4a46f992..0b0af04ec955 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -166,11 +166,16 @@ struct v4l2_buffer
  output device because the application did not pass new data in
  time.
 
- .. note:: This may count the frames received e.g. over USB, without
-taking into account the frames dropped by the remote hardware due
-to limited compression throughput or bus bandwidth. These devices
-identify by not enumerating any video standards, see
-:ref:`standard`.
+ FOO
+
+..   .. note::
+..
+..  This may count the frames received e.g. over USB, without
+..  taking into account the frames dropped by the remote hardware due
+..  to limited compression throughput or bus bandwidth. These devices
+..  identify by not enumerating any video standards, see
+..  :ref:`standard`.
+
 
 -  .. row 10
 
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
index 90996f69d6ae..f4b79975aefd 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -51,7 +51,6 @@ one until ``EINVAL`` is returned.
 :stub-columns: 0
 :widths:   1 1 2
 
-
 -  .. row 1
 
-  __u32
@@ -106,15 +105,17 @@ one until ``EINVAL`` is returned.
 
 
  .. _v4l2-fourcc:
- .. code-block:: c
-
- #define v4l2_fourcc(a,b,c,d) 
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
-
+..   .. code-block:: c
+..
+..   #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`.
-
- .. attention:: These codes are not the same as those used
-in the Windows world.
+..
+..   .. attention::
+..
+..  These codes are not the same as those used
+..  in the Windows world.
 
 -  .. row 7
 
diff --git a/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
index 00ab5e19cc1d..8564b9c2983e 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst
@@ -129,12 +129,14 @@ of the corresponding tuner/modulator is set.
-  :cspan:`2` The supported modulation systems of this frequency
  band. See :ref:`band-modulation`.
 
- .. note:: Currently only one modulation system per frequency band
-is supported. More work will need to be done if multiple
-modulation systems are possible. Contact the linux-media
-mailing list
-(`https://linuxtv.org/lists.php `__)
-if you need such functionality.
+..   .. note::
+..
+..  Currently only one modulation system per frequency band
+..  is supported. More work will need to be done if multiple
+..  modulation systems are possible. Contact the linux-media
+..  mailing list
+..  (`https://linuxtv.org/lists.php `__)
+..  if you need such functionality.
 
 -  .. row 8
 
-- 
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 v2] dma-buf: Wait on the reservation object when sync'ing before CPU access

2016-08-15 Thread Daniel Vetter
On Mon, Aug 15, 2016 at 04:42:18PM +0100, Chris Wilson wrote:
> Rendering operations to the dma-buf are tracked implicitly via the
> reservation_object (dmabuf->resv). This is used to allow poll() to
> wait upon outstanding rendering (or just query the current status of
> rendering). The dma-buf sync ioctl allows userspace to prepare the
> dma-buf for CPU access, which should include waiting upon rendering.
> (Some drivers may need to do more work to ensure that the dma-buf mmap
> is coherent as well as complete.)
> 
> v2: Always wait upon the reservation object implicitly. We choose to do
> it after the native handler in case it can do so more efficiently.
> 
> Testcase: igt/prime_vgem
> Testcase: igt/gem_concurrent_blit # *vgem*
> Signed-off-by: Chris Wilson 
> Cc: Sumit Semwal 
> Cc: Daniel Vetter 
> Cc: Eric Anholt 
> Cc: linux-media@vger.kernel.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linaro-mm-...@lists.linaro.org
> Cc: linux-ker...@vger.kernel.org
> ---
>  drivers/dma-buf/dma-buf.c | 23 +++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index ddaee60ae52a..cf04d249a6a4 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -586,6 +586,22 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment 
> *attach,
>  }
>  EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment);
>  
> +static int __dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
> +   enum dma_data_direction direction)
> +{
> + bool write = (direction == DMA_BIDIRECTIONAL ||
> +   direction == DMA_TO_DEVICE);
> + struct reservation_object *resv = dmabuf->resv;
> + long ret;
> +
> + /* Wait on any implicit rendering fences */
> + ret = reservation_object_wait_timeout_rcu(resv, write, true,
> +   MAX_SCHEDULE_TIMEOUT);
> + if (ret < 0)
> + return ret;
> +
> + return 0;
> +}
>  
>  /**
>   * dma_buf_begin_cpu_access - Must be called before accessing a dma_buf from 
> the
> @@ -608,6 +624,13 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
>   if (dmabuf->ops->begin_cpu_access)
>   ret = dmabuf->ops->begin_cpu_access(dmabuf, direction);
>  
> + /* Ensure that all fences are waited upon - but we first allow
> +  * the native handler the chance to do so more efficiently if it
> +  * chooses. A double invocation here will be reasonably cheap no-op.
> +  */
> + if (ret == 0)
> + ret = __dma_buf_begin_cpu_access(dmabuf, direction);

Not sure we should wait first and the flush or the other way round. But I
don't think it'll matter for any current dma-buf exporter, so meh.

Reviewed-by: Daniel Vetter 

Sumits, can you pls pick this one up and put into drm-misc?
-Daniel

> +
>   return ret;
>  }
>  EXPORT_SYMBOL_GPL(dma_buf_begin_cpu_access);
> -- 
> 2.8.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
--
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 v2] dma-buf: Wait on the reservation object when sync'ing before CPU access

2016-08-15 Thread Chris Wilson
Rendering operations to the dma-buf are tracked implicitly via the
reservation_object (dmabuf->resv). This is used to allow poll() to
wait upon outstanding rendering (or just query the current status of
rendering). The dma-buf sync ioctl allows userspace to prepare the
dma-buf for CPU access, which should include waiting upon rendering.
(Some drivers may need to do more work to ensure that the dma-buf mmap
is coherent as well as complete.)

v2: Always wait upon the reservation object implicitly. We choose to do
it after the native handler in case it can do so more efficiently.

Testcase: igt/prime_vgem
Testcase: igt/gem_concurrent_blit # *vgem*
Signed-off-by: Chris Wilson 
Cc: Sumit Semwal 
Cc: Daniel Vetter 
Cc: Eric Anholt 
Cc: linux-media@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: linaro-mm-...@lists.linaro.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/dma-buf/dma-buf.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index ddaee60ae52a..cf04d249a6a4 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -586,6 +586,22 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment 
*attach,
 }
 EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment);
 
+static int __dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
+ enum dma_data_direction direction)
+{
+   bool write = (direction == DMA_BIDIRECTIONAL ||
+ direction == DMA_TO_DEVICE);
+   struct reservation_object *resv = dmabuf->resv;
+   long ret;
+
+   /* Wait on any implicit rendering fences */
+   ret = reservation_object_wait_timeout_rcu(resv, write, true,
+ MAX_SCHEDULE_TIMEOUT);
+   if (ret < 0)
+   return ret;
+
+   return 0;
+}
 
 /**
  * dma_buf_begin_cpu_access - Must be called before accessing a dma_buf from 
the
@@ -608,6 +624,13 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
if (dmabuf->ops->begin_cpu_access)
ret = dmabuf->ops->begin_cpu_access(dmabuf, direction);
 
+   /* Ensure that all fences are waited upon - but we first allow
+* the native handler the chance to do so more efficiently if it
+* chooses. A double invocation here will be reasonably cheap no-op.
+*/
+   if (ret == 0)
+   ret = __dma_buf_begin_cpu_access(dmabuf, direction);
+
return ret;
 }
 EXPORT_SYMBOL_GPL(dma_buf_begin_cpu_access);
-- 
2.8.1

--
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 v2] dma-buf: Wait on the reservation object when sync'ing before CPU access

2016-08-15 Thread Chris Wilson
Rendering operations to the dma-buf are tracked implicitly via the
reservation_object (dmabuf->resv). This is used to allow poll() to
wait upon outstanding rendering (or just query the current status of
rendering). The dma-buf sync ioctl allows userspace to prepare the
dma-buf for CPU access, which should include waiting upon rendering.
(Some drivers may need to do more work to ensure that the dma-buf mmap
is coherent as well as complete.)

v2: Always wait upon the reservation object implicitly. We choose to do
it after the native handler in case it can do so more efficiently.

Testcase: igt/prime_vgem
Testcase: igt/gem_concurrent_blit # *vgem*
Signed-off-by: Chris Wilson 
Cc: Sumit Semwal 
Cc: Daniel Vetter 
Cc: Eric Anholt 
Cc: linux-media@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: linaro-mm-...@lists.linaro.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/dma-buf/dma-buf.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index ddaee60ae52a..cf04d249a6a4 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -586,6 +586,22 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment 
*attach,
 }
 EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment);
 
+static int __dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
+ enum dma_data_direction direction)
+{
+   bool write = (direction == DMA_BIDIRECTIONAL ||
+ direction == DMA_TO_DEVICE);
+   struct reservation_object *resv = dmabuf->resv;
+   long ret;
+
+   /* Wait on any implicit rendering fences */
+   ret = reservation_object_wait_timeout_rcu(resv, write, true,
+ MAX_SCHEDULE_TIMEOUT);
+   if (ret < 0)
+   return ret;
+
+   return 0;
+}
 
 /**
  * dma_buf_begin_cpu_access - Must be called before accessing a dma_buf from 
the
@@ -608,6 +624,13 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
if (dmabuf->ops->begin_cpu_access)
ret = dmabuf->ops->begin_cpu_access(dmabuf, direction);
 
+   /* Ensure that all fences are waited upon - but we first allow
+* the native handler the chance to do so more efficiently if it
+* chooses. A double invocation here will be reasonably cheap no-op.
+*/
+   if (ret == 0)
+   ret = __dma_buf_begin_cpu_access(dmabuf, direction);
+
return ret;
 }
 EXPORT_SYMBOL_GPL(dma_buf_begin_cpu_access);
-- 
2.8.1

--
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


TS discontinuity invalid eit section

2016-08-15 Thread Nedveďal Marián

Hi,

I have PCI_e tbs6928(FE)-linux tbs driver; usb TT 3650CI-media build drivers.
For both cards noticing the same problem-astra 23.5;dvb-s2 transp.(not all).
It's about problem drivers.Tested with dvblast, mumudvb, vdr.

~$ dvblast -f 12363000
...
warning: TS discontinuity on pid   18 expected_cc 15 got  0 (EPG, sid 0)
warning: TS discontinuity on pid   18 expected_cc  7 got  8 (EPG, sid 0)
warning: invalid EIT section received on PID 18
error type: invalid_eit_section pid: 18
warning: TS discontinuity on pid   18 expected_cc  2 got  3 (EPG, sid 0)
...

image falls apart.
Tested on different kernels(ubuntu,debian).
It can do anything to help?
--
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] doc-rst: add index to sub-folders

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

Add a index if only a sub-folder is build e.g.::

  make SPHINXDIRS=media cleandocs htmldocs

BTW: removed dead search link in the top-index file

Signed-off-by: Markus Heiser 
---
 Documentation/gpu/conf.py | 2 ++
 Documentation/gpu/index.rst   | 7 +++
 Documentation/index.rst   | 1 -
 Documentation/media/conf.py   | 2 ++
 Documentation/media/index.rst | 7 +++
 5 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Documentation/gpu/conf.py b/Documentation/gpu/conf.py
index d60bcd0..6314d17 100644
--- a/Documentation/gpu/conf.py
+++ b/Documentation/gpu/conf.py
@@ -1,3 +1,5 @@
 # -*- coding: utf-8; mode: python -*-
 
 project = "Linux GPU Driver Developer's Guide"
+
+tags.add("subproject")
diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst
index fcac0fa..5ff3d2b 100644
--- a/Documentation/gpu/index.rst
+++ b/Documentation/gpu/index.rst
@@ -12,3 +12,10 @@ Linux GPU Driver Developer's Guide
drm-uapi
i915
vga-switcheroo
+
+.. only::  subproject
+
+   Indices
+   ===
+
+   * :ref:`genindex`
diff --git a/Documentation/index.rst b/Documentation/index.rst
index bdd9525..a15f818 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -19,4 +19,3 @@ Indices and tables
 ==
 
 * :ref:`genindex`
-* :ref:`search`
diff --git a/Documentation/media/conf.py b/Documentation/media/conf.py
index 62bdba2..77cb2bb 100644
--- a/Documentation/media/conf.py
+++ b/Documentation/media/conf.py
@@ -1,3 +1,5 @@
 # -*- coding: utf-8; mode: python -*-
 
 project = 'Linux Media Subsystem Documentation'
+
+tags.add("subproject")
diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst
index e85c557..7f8f0af 100644
--- a/Documentation/media/index.rst
+++ b/Documentation/media/index.rst
@@ -10,3 +10,10 @@ Contents:
media_kapi
dvb-drivers/index
v4l-drivers/index
+
+.. only::  subproject
+
+   Indices
+   ===
+
+   * :ref:`genindex`
-- 
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


[PATCHv3 10/10] [media] rcar-vin: move media bus information to struct rvin_graph_entity

2016-08-15 Thread Niklas Söderlund
The primary reason for this change is to prepare for Gen3 support where
there will be more then one possible video source. Each source will have
its own media bus format and code, so it needs to be moved from the per
device structure to a structure used to represent an individual
connection to a video source.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 12 ++--
 drivers/media/platform/rcar-vin/rcar-dma.c  | 10 +-
 drivers/media/platform/rcar-vin/rcar-v4l2.c |  2 +-
 drivers/media/platform/rcar-vin/rcar-vin.h  |  9 +
 4 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index 39bf6fc..64999a2 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -31,9 +31,9 @@
 
 #define notifier_to_vin(n) container_of(n, struct rvin_dev, notifier)
 
-static bool rvin_mbus_supported(struct rvin_dev *vin)
+static bool rvin_mbus_supported(struct rvin_graph_entity *entity)
 {
-   struct v4l2_subdev *sd = vin->digital.subdev;
+   struct v4l2_subdev *sd = entity->subdev;
struct v4l2_subdev_mbus_code_enum code = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
@@ -46,7 +46,7 @@ static bool rvin_mbus_supported(struct rvin_dev *vin)
case MEDIA_BUS_FMT_YUYV8_2X8:
case MEDIA_BUS_FMT_YUYV10_2X10:
case MEDIA_BUS_FMT_RGB888_1X24:
-   vin->source.code = code.code;
+   entity->code = code.code;
return true;
default:
break;
@@ -62,14 +62,14 @@ static int rvin_digital_notify_complete(struct 
v4l2_async_notifier *notifier)
int ret;
 
/* Verify subdevices mbus format */
-   if (!rvin_mbus_supported(vin)) {
+   if (!rvin_mbus_supported(>digital)) {
vin_err(vin, "Unsupported media bus format for %s\n",
vin->digital.subdev->name);
return -EINVAL;
}
 
vin_dbg(vin, "Found media bus format for %s: %d\n",
-   vin->digital.subdev->name, vin->source.code);
+   vin->digital.subdev->name, vin->digital.code);
 
ret = v4l2_device_register_subdev_nodes(>v4l2_dev);
if (ret < 0) {
@@ -170,7 +170,7 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin)
}
of_node_put(np);
 
-   ret = rvin_digitial_parse_v4l2(vin, ep, >mbus_cfg);
+   ret = rvin_digitial_parse_v4l2(vin, ep, >digital.mbus_cfg);
of_node_put(ep);
if (ret)
return ret;
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
b/drivers/media/platform/rcar-vin/rcar-dma.c
index 3df3f0c..46abdb0 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -163,7 +163,7 @@ static int rvin_setup(struct rvin_dev *vin)
/*
 * Input interface
 */
-   switch (vin->source.code) {
+   switch (vin->digital.code) {
case MEDIA_BUS_FMT_YUYV8_1X16:
/* BT.601/BT.1358 16bit YCbCr422 */
vnmc |= VNMC_INF_YUV16;
@@ -171,7 +171,7 @@ static int rvin_setup(struct rvin_dev *vin)
break;
case MEDIA_BUS_FMT_YUYV8_2X8:
/* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */
-   vnmc |= vin->mbus_cfg.type == V4L2_MBUS_BT656 ?
+   vnmc |= vin->digital.mbus_cfg.type == V4L2_MBUS_BT656 ?
VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601;
input_is_yuv = true;
break;
@@ -180,7 +180,7 @@ static int rvin_setup(struct rvin_dev *vin)
break;
case MEDIA_BUS_FMT_YUYV10_2X10:
/* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */
-   vnmc |= vin->mbus_cfg.type == V4L2_MBUS_BT656 ?
+   vnmc |= vin->digital.mbus_cfg.type == V4L2_MBUS_BT656 ?
VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601;
input_is_yuv = true;
break;
@@ -192,11 +192,11 @@ static int rvin_setup(struct rvin_dev *vin)
dmr2 = VNDMR2_FTEV | VNDMR2_VLV(1);
 
/* Hsync Signal Polarity Select */
-   if (!(vin->mbus_cfg.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW))
+   if (!(vin->digital.mbus_cfg.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW))
dmr2 |= VNDMR2_HPS;
 
/* Vsync Signal Polarity Select */
-   if (!(vin->mbus_cfg.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW))
+   if (!(vin->digital.mbus_cfg.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW))
dmr2 |= VNDMR2_VPS;
 
/*
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index ef3464d..d0e9d65 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ 

[PATCHv3 07/10] [media] rcar-vin: add dependency on MEDIA_CONTROLLER

2016-08-15 Thread Niklas Söderlund
This is done in preparation for Gen3 support where media controller
support will be mandatory for the driver.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/Kconfig | 2 +-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 7 +--
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/Kconfig 
b/drivers/media/platform/rcar-vin/Kconfig
index b2ff2d4..111d2a1 100644
--- a/drivers/media/platform/rcar-vin/Kconfig
+++ b/drivers/media/platform/rcar-vin/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_RCAR_VIN
tristate "R-Car Video Input (VIN) Driver"
-   depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA
+   depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA && 
MEDIA_CONTROLLER
depends on ARCH_RENESAS || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG
---help---
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 3f80a0b..09df396 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -771,10 +771,7 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
struct v4l2_mbus_framefmt *mf = 
struct video_device *vdev = >vdev;
struct v4l2_subdev *sd = vin_to_source(vin);
-#if defined(CONFIG_MEDIA_CONTROLLER)
-   int pad_idx;
-#endif
-   int ret;
+   int pad_idx, ret;
 
v4l2_set_subdev_hostdata(sd, vin);
 
@@ -821,7 +818,6 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
V4L2_CAP_READWRITE;
 
vin->src_pad_idx = 0;
-#if defined(CONFIG_MEDIA_CONTROLLER)
for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SOURCE)
break;
@@ -829,7 +825,6 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
return -EINVAL;
 
vin->src_pad_idx = pad_idx;
-#endif
fmt.pad = vin->src_pad_idx;
 
/* Try to improve our guess of a reasonable window format */
-- 
2.9.2

--
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


[PATCHv3 08/10] [media] rcar-vin: move chip check for pixelformat support

2016-08-15 Thread Niklas Söderlund
The check for if the specific pixelformat is supported on the current
chip should happen in VIDIOC_S_FMT and VIDIOC_TRY_FMT and not when we
try to setup the hardware for streaming.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-dma.c  | 8 +++-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 +
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
b/drivers/media/platform/rcar-vin/rcar-dma.c
index 496aa97..3df3f0c 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -225,11 +225,9 @@ static int rvin_setup(struct rvin_dev *vin)
dmr = 0;
break;
case V4L2_PIX_FMT_XBGR32:
-   if (vin->chip == RCAR_GEN2 || vin->chip == RCAR_H1) {
-   dmr = VNDMR_EXRGB;
-   break;
-   }
-   /* fall through */
+   /* Note: not supported on M1 */
+   dmr = VNDMR_EXRGB;
+   break;
default:
vin_err(vin, "Invalid pixelformat (0x%x)\n",
vin->format.pixelformat);
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 09df396..ef3464d 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -192,6 +192,11 @@ static int __rvin_try_format(struct rvin_dev *vin,
pix->sizeimage = max_t(u32, pix->sizeimage,
   rvin_format_sizeimage(pix));
 
+   if (vin->chip == RCAR_M1 && pix->pixelformat == V4L2_PIX_FMT_XBGR32) {
+   vin_err(vin, "pixel format XBGR32 not supported on M1\n");
+   return -EINVAL;
+   }
+
vin_dbg(vin, "Requested %ux%u Got %ux%u bpl: %d size: %d\n",
rwidth, rheight, pix->width, pix->height,
pix->bytesperline, pix->sizeimage);
-- 
2.9.2

--
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


[PATCHv3 02/10] [media] rcar-vin: reduce indentation in rvin_s_dv_timings()

2016-08-15 Thread Niklas Söderlund
Align style with the rest of the driver.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index f26e3cd..72fe6bc 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -504,16 +504,18 @@ static int rvin_s_dv_timings(struct file *file, void 
*priv_fh,
 {
struct rvin_dev *vin = video_drvdata(file);
struct v4l2_subdev *sd = vin_to_source(vin);
-   int err;
-
-   err = v4l2_subdev_call(sd, video, s_dv_timings, timings);
-   if (!err) {
-   vin->source.width = timings->bt.width;
-   vin->source.height = timings->bt.height;
-   vin->format.width = timings->bt.width;
-   vin->format.height = timings->bt.height;
-   }
-   return err;
+   int ret;
+
+   ret = v4l2_subdev_call(sd, video, s_dv_timings, timings);
+   if (ret)
+   return ret;
+
+   vin->source.width = timings->bt.width;
+   vin->source.height = timings->bt.height;
+   vin->format.width = timings->bt.width;
+   vin->format.height = timings->bt.height;
+
+   return 0;
 }
 
 static int rvin_g_dv_timings(struct file *file, void *priv_fh,
-- 
2.9.2

--
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


[PATCHv3 09/10] [media] rcar-vin: rework how subdeivce is found and bound

2016-08-15 Thread Niklas Söderlund
The original drivers code to find a subdevice by looking in the DT grpah
and how the callbacks to the v4l2 async bind framework where poorly
written. The most obvious example of badness was the duplication of data
in the struct rvin_graph_entity.

This patch removes the data duplication, simplifies the parsing of the
DT graph and add checks to the v4l2 callbacks.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 232 +---
 drivers/media/platform/rcar-vin/rcar-vin.h  |   8 +-
 2 files changed, 111 insertions(+), 129 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index 3941134..39bf6fc 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -31,15 +31,13 @@
 
 #define notifier_to_vin(n) container_of(n, struct rvin_dev, notifier)
 
-static int rvin_mbus_supported(struct rvin_dev *vin)
+static bool rvin_mbus_supported(struct rvin_dev *vin)
 {
-   struct v4l2_subdev *sd;
+   struct v4l2_subdev *sd = vin->digital.subdev;
struct v4l2_subdev_mbus_code_enum code = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
 
-   sd = vin_to_source(vin);
-
code.index = 0;
while (!v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, )) {
code.index++;
@@ -49,8 +47,6 @@ static int rvin_mbus_supported(struct rvin_dev *vin)
case MEDIA_BUS_FMT_YUYV10_2X10:
case MEDIA_BUS_FMT_RGB888_1X24:
vin->source.code = code.code;
-   vin_dbg(vin, "Found supported media bus format: %d\n",
-   vin->source.code);
return true;
default:
break;
@@ -65,17 +61,22 @@ static int rvin_digital_notify_complete(struct 
v4l2_async_notifier *notifier)
struct rvin_dev *vin = notifier_to_vin(notifier);
int ret;
 
+   /* Verify subdevices mbus format */
+   if (!rvin_mbus_supported(vin)) {
+   vin_err(vin, "Unsupported media bus format for %s\n",
+   vin->digital.subdev->name);
+   return -EINVAL;
+   }
+
+   vin_dbg(vin, "Found media bus format for %s: %d\n",
+   vin->digital.subdev->name, vin->source.code);
+
ret = v4l2_device_register_subdev_nodes(>v4l2_dev);
if (ret < 0) {
vin_err(vin, "Failed to register subdev nodes\n");
return ret;
}
 
-   if (!rvin_mbus_supported(vin)) {
-   vin_err(vin, "No supported mediabus format found\n");
-   return -EINVAL;
-   }
-
return rvin_v4l2_probe(vin);
 }
 
@@ -85,7 +86,14 @@ static void rvin_digital_notify_unbind(struct 
v4l2_async_notifier *notifier,
 {
struct rvin_dev *vin = notifier_to_vin(notifier);
 
-   rvin_v4l2_remove(vin);
+   if (vin->digital.subdev == subdev) {
+   vin_dbg(vin, "unbind digital subdev %s\n", subdev->name);
+   rvin_v4l2_remove(vin);
+   vin->digital.subdev = NULL;
+   return;
+   }
+
+   vin_err(vin, "no entity for subdev %s to unbind\n", subdev->name);
 }
 
 static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
@@ -94,89 +102,111 @@ static int rvin_digital_notify_bound(struct 
v4l2_async_notifier *notifier,
 {
struct rvin_dev *vin = notifier_to_vin(notifier);
 
-   vin_dbg(vin, "subdev %s bound\n", subdev->name);
+   v4l2_set_subdev_hostdata(subdev, vin);
 
-   vin->digital.entity = >entity;
-   vin->digital.subdev = subdev;
+   if (vin->digital.asd.match.of.node == subdev->dev->of_node) {
+   vin_dbg(vin, "bound digital subdev %s\n", subdev->name);
+   vin->digital.subdev = subdev;
+   return 0;
+   }
 
-   return 0;
+   vin_err(vin, "no entity for subdev %s to bind\n", subdev->name);
+   return -EINVAL;
 }
 
-static int rvin_digital_parse(struct rvin_dev *vin,
- struct device_node *node)
+static int rvin_digitial_parse_v4l2(struct rvin_dev *vin,
+   struct device_node *ep,
+   struct v4l2_mbus_config *mbus_cfg)
 {
-   struct device_node *remote;
-   struct device_node *ep = NULL;
-   struct device_node *next;
-   int ret = 0;
-
-   while (1) {
-   next = of_graph_get_next_endpoint(node, ep);
-   if (!next)
-   break;
+   struct v4l2_of_endpoint v4l2_ep;
+   int ret;
 
-   of_node_put(ep);
-   ep = next;
+   ret = v4l2_of_parse_endpoint(ep, _ep);
+   if (ret) {
+   vin_err(vin, "Could not parse v4l2 endpoint\n");
+   return -EINVAL;
+   }
 
-   remote = 

[PATCHv3 05/10] [media] rcar-vin: return correct error from platform_get_irq()

2016-08-15 Thread Niklas Söderlund
Fix a error from the original driver where the wrong error code is
returned if the driver fails to get a IRQ number from
platform_get_irq().

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index a1eb26b..3941134 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -282,8 +282,8 @@ static int rcar_vin_probe(struct platform_device *pdev)
return PTR_ERR(vin->base);
 
irq = platform_get_irq(pdev, 0);
-   if (irq <= 0)
-   return ret;
+   if (irq < 0)
+   return irq;
 
ret = rvin_dma_probe(vin, irq);
if (ret)
-- 
2.9.2

--
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


[PATCHv3 00/10] rcar-vin: clean up and prepare for Gen3

2016-08-15 Thread Niklas Söderlund
Hi,

This series cleans up issues that have been found in the driver and 
prepares it for Gen3 support. The series is based on v4.8-rc1 and is 
tested om Koelsch. The most noteworthy fix in in the series is patch 
9/10 that fixes a of_node_put() warning during loading of the driver.

The series is the first cleanup series but all patches are marked as v3 
since they have been broken out of the Gen3 enablement series which have 
been stuck for a while. Hopefully these cleanups can be picked up and 
then I can rebase and repost all other pending rcar-vin patches ontop of 
this clean up. The changlog from the Gen3 enablement branch is however 
kept here for reference.

Changes since v2:
- Drop all Gen3 enablement patches.
- Split a large cosmetic cleanup patch in smaller ones.
- Fix comment from Sergei about return code from platform_get_irq().
- Rebase ontop of v4.8-rc1

Changes since v1:
- Address review comments from Laurent.
- Split cleanup of driver to smaller chunks.
- Remove initial work for v4l2 framework changes to support a pad aware
s_stream operation.
- Picked up patch for incorrect media bus format.
- Removed Ulrich patches which now have been picked up in media_tree.

Niklas Söderlund (10):
  [media] rcar-vin: fix indentation errors in rcar-v4l2.c
  [media] rcar-vin: reduce indentation in rvin_s_dv_timings()
  [media] rcar-vin: arrange enum chip_id in chronological order
  [media] rcar-vin: rename entity to digital
  [media] rcar-vin: return correct error from platform_get_irq()
  [media] rcar-vin: do not use v4l2_device_call_until_err()
  [media] rcar-vin: add dependency on MEDIA_CONTROLLER
  [media] rcar-vin: move chip check for pixelformat support
  [media] rcar-vin: rework how subdeivce is found and bound
  [media] rcar-vin: move media bus information to struct
rvin_graph_entity

 drivers/media/platform/rcar-vin/Kconfig |   2 +-
 drivers/media/platform/rcar-vin/rcar-core.c | 258 +---
 drivers/media/platform/rcar-vin/rcar-dma.c  |  18 +-
 drivers/media/platform/rcar-vin/rcar-v4l2.c |  91 +-
 drivers/media/platform/rcar-vin/rcar-vin.h  |  25 +--
 5 files changed, 186 insertions(+), 208 deletions(-)

-- 
2.9.2

--
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


[PATCHv3 06/10] [media] rcar-vin: do not use v4l2_device_call_until_err()

2016-08-15 Thread Niklas Söderlund
Fix a error from the original driver where v4l2_device_call_until_err()
where used for the pad specific v4l2 operation set_fmt.  Also fix up the
error path from this fix so if there is an error it will be propagated
to the caller.

The error path label have also been renamed as a result from a
nitpicking review comment since we are fixing other issues here.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 72fe6bc..3f80a0b 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -114,10 +114,9 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 
format.pad = vin->src_pad_idx;
 
-   ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt,
-pad_cfg, );
-   if (ret < 0)
-   goto cleanup;
+   ret = v4l2_subdev_call(sd, pad, set_fmt, pad_cfg, );
+   if (ret < 0 && ret != -ENOIOCTLCMD)
+   goto done;
 
v4l2_fill_pix_format(pix, );
 
@@ -127,9 +126,9 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
vin_dbg(vin, "Source resolution: %ux%u\n", source->width,
source->height);
 
-cleanup:
+done:
v4l2_subdev_free_pad_config(pad_cfg);
-   return 0;
+   return ret;
 }
 
 static int __rvin_try_format(struct rvin_dev *vin,
-- 
2.9.2

--
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


[PATCHv3 01/10] [media] rcar-vin: fix indentation errors in rcar-v4l2.c

2016-08-15 Thread Niklas Söderlund
Fix broken indentations and line breaks.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 46 +
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 10a5c10..f26e3cd 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -93,9 +93,9 @@ static u32 rvin_format_sizeimage(struct v4l2_pix_format *pix)
  */
 
 static int __rvin_try_format_source(struct rvin_dev *vin,
-   u32 which,
-   struct v4l2_pix_format *pix,
-   struct rvin_source_fmt *source)
+   u32 which,
+   struct v4l2_pix_format *pix,
+   struct rvin_source_fmt *source)
 {
struct v4l2_subdev *sd;
struct v4l2_subdev_pad_config *pad_cfg;
@@ -133,9 +133,9 @@ cleanup:
 }
 
 static int __rvin_try_format(struct rvin_dev *vin,
-u32 which,
-struct v4l2_pix_format *pix,
-struct rvin_source_fmt *source)
+u32 which,
+struct v4l2_pix_format *pix,
+struct rvin_source_fmt *source)
 {
const struct rvin_video_format *info;
u32 rwidth, rheight, walign;
@@ -219,7 +219,7 @@ static int rvin_try_fmt_vid_cap(struct file *file, void 
*priv,
struct rvin_source_fmt source;
 
return __rvin_try_format(vin, V4L2_SUBDEV_FORMAT_TRY, >fmt.pix,
-);
+);
 }
 
 static int rvin_s_fmt_vid_cap(struct file *file, void *priv,
@@ -233,7 +233,7 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv,
return -EBUSY;
 
ret = __rvin_try_format(vin, V4L2_SUBDEV_FORMAT_ACTIVE, >fmt.pix,
-   );
+   );
if (ret)
return ret;
 
@@ -334,8 +334,8 @@ static int rvin_s_selection(struct file *file, void *fh,
vin->crop = s->r = r;
 
vin_dbg(vin, "Cropped %dx%d@%d:%d of %dx%d\n",
-r.width, r.height, r.left, r.top,
-vin->source.width, vin->source.height);
+   r.width, r.height, r.left, r.top,
+   vin->source.width, vin->source.height);
break;
case V4L2_SEL_TGT_COMPOSE:
/* Make sure compose rect fits inside output format */
@@ -359,8 +359,8 @@ static int rvin_s_selection(struct file *file, void *fh,
vin->compose = s->r = r;
 
vin_dbg(vin, "Compose %dx%d@%d:%d in %dx%d\n",
-r.width, r.height, r.left, r.top,
-vin->format.width, vin->format.height);
+   r.width, r.height, r.left, r.top,
+   vin->format.width, vin->format.height);
break;
default:
return -EINVAL;
@@ -483,7 +483,7 @@ static int rvin_subscribe_event(struct v4l2_fh *fh,
 }
 
 static int rvin_enum_dv_timings(struct file *file, void *priv_fh,
-   struct v4l2_enum_dv_timings *timings)
+   struct v4l2_enum_dv_timings *timings)
 {
struct rvin_dev *vin = video_drvdata(file);
struct v4l2_subdev *sd = vin_to_source(vin);
@@ -500,14 +500,13 @@ static int rvin_enum_dv_timings(struct file *file, void 
*priv_fh,
 }
 
 static int rvin_s_dv_timings(struct file *file, void *priv_fh,
-   struct v4l2_dv_timings *timings)
+struct v4l2_dv_timings *timings)
 {
struct rvin_dev *vin = video_drvdata(file);
struct v4l2_subdev *sd = vin_to_source(vin);
int err;
 
-   err = v4l2_subdev_call(sd,
-   video, s_dv_timings, timings);
+   err = v4l2_subdev_call(sd, video, s_dv_timings, timings);
if (!err) {
vin->source.width = timings->bt.width;
vin->source.height = timings->bt.height;
@@ -518,27 +517,25 @@ static int rvin_s_dv_timings(struct file *file, void 
*priv_fh,
 }
 
 static int rvin_g_dv_timings(struct file *file, void *priv_fh,
-   struct v4l2_dv_timings *timings)
+struct v4l2_dv_timings *timings)
 {
struct rvin_dev *vin = video_drvdata(file);
struct v4l2_subdev *sd = vin_to_source(vin);
 
-   return v4l2_subdev_call(sd,
-   video, g_dv_timings, timings);
+   return v4l2_subdev_call(sd, video, g_dv_timings, timings);
 }
 
 static int rvin_query_dv_timings(struct file 

[PATCHv3 03/10] [media] rcar-vin: arrange enum chip_id in chronological order

2016-08-15 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-vin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
b/drivers/media/platform/rcar-vin/rcar-vin.h
index 31ad39a..b9274132 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -30,9 +30,9 @@
 #define HW_BUFFER_MASK 0x7f
 
 enum chip_id {
-   RCAR_GEN2,
RCAR_H1,
RCAR_M1,
+   RCAR_GEN2,
 };
 
 /**
-- 
2.9.2

--
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


[PATCHv3 04/10] [media] rcar-vin: rename entity to digital

2016-08-15 Thread Niklas Söderlund
When Gen3 support is added to the driver more then one possible video
source entity will be possible. Knowing that the name entity is a bad
one, rename it to digital since it will deal with the digital input
source.

Signed-off-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 46 ++---
 drivers/media/platform/rcar-vin/rcar-vin.h  |  6 ++--
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index 4b2007b..a1eb26b 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -60,7 +60,7 @@ static int rvin_mbus_supported(struct rvin_dev *vin)
return false;
 }
 
-static int rvin_graph_notify_complete(struct v4l2_async_notifier *notifier)
+static int rvin_digital_notify_complete(struct v4l2_async_notifier *notifier)
 {
struct rvin_dev *vin = notifier_to_vin(notifier);
int ret;
@@ -79,31 +79,31 @@ static int rvin_graph_notify_complete(struct 
v4l2_async_notifier *notifier)
return rvin_v4l2_probe(vin);
 }
 
-static void rvin_graph_notify_unbind(struct v4l2_async_notifier *notifier,
-struct v4l2_subdev *sd,
-struct v4l2_async_subdev *asd)
+static void rvin_digital_notify_unbind(struct v4l2_async_notifier *notifier,
+  struct v4l2_subdev *subdev,
+  struct v4l2_async_subdev *asd)
 {
struct rvin_dev *vin = notifier_to_vin(notifier);
 
rvin_v4l2_remove(vin);
 }
 
-static int rvin_graph_notify_bound(struct v4l2_async_notifier *notifier,
-  struct v4l2_subdev *subdev,
-  struct v4l2_async_subdev *asd)
+static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
+struct v4l2_subdev *subdev,
+struct v4l2_async_subdev *asd)
 {
struct rvin_dev *vin = notifier_to_vin(notifier);
 
vin_dbg(vin, "subdev %s bound\n", subdev->name);
 
-   vin->entity.entity = >entity;
-   vin->entity.subdev = subdev;
+   vin->digital.entity = >entity;
+   vin->digital.subdev = subdev;
 
return 0;
 }
 
-static int rvin_graph_parse(struct rvin_dev *vin,
-   struct device_node *node)
+static int rvin_digital_parse(struct rvin_dev *vin,
+ struct device_node *node)
 {
struct device_node *remote;
struct device_node *ep = NULL;
@@ -131,10 +131,10 @@ static int rvin_graph_parse(struct rvin_dev *vin,
}
 
/* Remote node to connect */
-   if (!vin->entity.node) {
-   vin->entity.node = remote;
-   vin->entity.asd.match_type = V4L2_ASYNC_MATCH_OF;
-   vin->entity.asd.match.of.node = remote;
+   if (!vin->digital.node) {
+   vin->digital.node = remote;
+   vin->digital.asd.match_type = V4L2_ASYNC_MATCH_OF;
+   vin->digital.asd.match.of.node = remote;
ret++;
}
}
@@ -144,13 +144,13 @@ static int rvin_graph_parse(struct rvin_dev *vin,
return ret;
 }
 
-static int rvin_graph_init(struct rvin_dev *vin)
+static int rvin_digital_init(struct rvin_dev *vin)
 {
struct v4l2_async_subdev **subdevs = NULL;
int ret;
 
/* Parse the graph to extract a list of subdevice DT nodes. */
-   ret = rvin_graph_parse(vin, vin->dev->of_node);
+   ret = rvin_digital_parse(vin, vin->dev->of_node);
if (ret < 0) {
vin_err(vin, "Graph parsing failed\n");
goto done;
@@ -173,13 +173,13 @@ static int rvin_graph_init(struct rvin_dev *vin)
goto done;
}
 
-   subdevs[0] = >entity.asd;
+   subdevs[0] = >digital.asd;
 
vin->notifier.subdevs = subdevs;
vin->notifier.num_subdevs = 1;
-   vin->notifier.bound = rvin_graph_notify_bound;
-   vin->notifier.unbind = rvin_graph_notify_unbind;
-   vin->notifier.complete = rvin_graph_notify_complete;
+   vin->notifier.bound = rvin_digital_notify_bound;
+   vin->notifier.unbind = rvin_digital_notify_unbind;
+   vin->notifier.complete = rvin_digital_notify_complete;
 
ret = v4l2_async_notifier_register(>v4l2_dev, >notifier);
if (ret < 0) {
@@ -192,7 +192,7 @@ static int rvin_graph_init(struct rvin_dev *vin)
 done:
if (ret < 0) {
v4l2_async_notifier_unregister(>notifier);
-   of_node_put(vin->entity.node);
+   of_node_put(vin->digital.node);
}
 
return ret;
@@ -289,7 +289,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
   

Re: [PATCH v3 09/14] media: platform: pxa_camera: add buffer sequencing

2016-08-15 Thread Robert Jarzmik
Hans Verkuil  writes:

> On 08/15/2016 03:26 PM, Robert Jarzmik wrote:
>> Robert Jarzmik  writes:
>> I've seen no documentation on the rules applicable to this sequence number:
>>  - should it be reset if a "start streaming" operation occurs ?
>
> start_streaming is the recommended place for setting the counter to 0. It's 
> what
> v4l2-compliance expects.
>
> It is not documented since 1) not every driver does this and 2) there may
> be cases where this behavior is not desired.
>
> That said, I have yet to see a driver where zeroing this in start_streaming
> is not appropriate.

Thanks for the information Hans, I'll modify this patch accordingly.

Cheers.

--
Robert
--
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/5] doc-rst: moved *duplicate* warnings to nitpicky mode

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

Moved the *duplicate C object description* warnings for function
declarations in the nitpicky mode. In nitpick mode, you can suppress
those warnings (e.g. ioctl) with::

  nitpicky = True
  nitpick_ignore = [
  ("c:func", "ioctl"),
  ]

See Sphinx documentation for the config values for ``nitpick`` and
``nitpick_ignore`` [1].

With this change all the ".. cpp:function:: int ioctl(..)" descriptions
(found in the media book) can be migrated to ".. c:function:: int
ioctl(..)", without getting any warnings. E.g.::

  .. cpp:function:: int ioctl( int fd, int request, struct cec_event *argp )

  .. c:function:: int ioctl( int fd, int request, struct cec_event *argp )

The main effect, is that we get those *CPP-types* back into Sphinx's C-
namespace and we need no longer to distinguish between c/cpp references,
when we refer a function like the ioctl.

[1] 
http://www.sphinx-doc.org/en/stable/config.html?highlight=nitpick#confval-nitpicky

Signed-off-by: Markus Heiser 
---
 Documentation/sphinx/cdomain.py | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
index 99cd035..cb4e8c9 100644
--- a/Documentation/sphinx/cdomain.py
+++ b/Documentation/sphinx/cdomain.py
@@ -10,6 +10,10 @@ u"""
 
 List of customizations:
 
+* Moved the *duplicate C object description* warnings for function
+  declarations in the nitpicky mode. See Sphinx documentation for
+  the config values for ``nitpick`` and ``nitpick_ignore``.
+
 * Add option 'name' to the "c:function:" directive.  With option 'name' the
   ref-name of a function can be modified. E.g.::
 
@@ -60,6 +64,29 @@ class CObject(Base_CObject):
 pass
 return fullname
 
+def add_target_and_index(self, name, sig, signode):
+# for C API items we add a prefix since names are usually not qualified
+# by a module name and so easily clash with e.g. section titles
+targetname = 'c.' + name
+if targetname not in self.state.document.ids:
+signode['names'].append(targetname)
+signode['ids'].append(targetname)
+signode['first'] = (not self.names)
+self.state.document.note_explicit_target(signode)
+inv = self.env.domaindata['c']['objects']
+if (name in inv and self.env.config.nitpicky):
+if self.objtype == 'function':
+if ('c:func', name) not in self.env.config.nitpick_ignore:
+self.state_machine.reporter.warning(
+'duplicate C object description of %s, ' % name +
+'other instance in ' + 
self.env.doc2path(inv[name][0]),
+line=self.lineno)
+inv[name] = (self.env.docname, self.objtype)
+
+indextext = self.get_index_text(name)
+if indextext:
+self.indexnode['entries'].append(('single', indextext,
+  targetname, '', None))
 
 class CDomain(Base_CDomain):
 
-- 
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 2/5] doc-rst:c-domain: ref-name of a function declaration

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

Add option 'name' to the "c:function:" directive.  With option 'name'
the ref-name of a function can be modified. E.g.::

.. c:function:: int ioctl( int fd, int request )
   :name: VIDIOC_LOG_STATUS

The func-name (e.g. ioctl) remains in the output but the ref-name
changed from ``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for
this function is also changed to ``VIDIOC_LOG_STATUS`` and the function
can now referenced by::

:c:func:`VIDIOC_LOG_STATUS`

Signed-off-by: Markus Heiser 
---
 Documentation/kernel-documentation.rst | 29 +
 Documentation/sphinx/cdomain.py| 31 +++
 2 files changed, 60 insertions(+)

diff --git a/Documentation/kernel-documentation.rst 
b/Documentation/kernel-documentation.rst
index 391decc..a0dcae1 100644
--- a/Documentation/kernel-documentation.rst
+++ b/Documentation/kernel-documentation.rst
@@ -107,6 +107,35 @@ Here are some specific guidelines for the kernel 
documentation:
   the order as encountered."), having the higher levels the same overall makes
   it easier to follow the documents.
 
+
+the C domain
+
+
+The `Sphinx C Domain`_ (name c) is suited for documentation of C API. E.g. a
+function prototype:
+
+.. code-block:: rst
+
+.. c:function:: int ioctl( int fd, int request )
+
+The C domain of the kernel-doc has some additional features. E.g. you can
+*rename* the reference name of a function with a common name like ``open`` or
+``ioctl``:
+
+.. code-block:: rst
+
+ .. c:function:: int ioctl( int fd, int request )
+:name: VIDIOC_LOG_STATUS
+
+The func-name (e.g. ioctl) remains in the output but the ref-name changed from
+``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for this function is also
+changed to ``VIDIOC_LOG_STATUS`` and the function can now referenced by:
+
+.. code-block:: rst
+
+ :c:func:`VIDIOC_LOG_STATUS`
+
+
 list tables
 ---
 
diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
index c32387a..99cd035 100644
--- a/Documentation/sphinx/cdomain.py
+++ b/Documentation/sphinx/cdomain.py
@@ -7,8 +7,24 @@ u"""
 
 :copyright:  Copyright (C) 2016  Markus Heiser
 :license:GPL Version 2, June 1991 see Linux/COPYING for details.
+
+List of customizations:
+
+* Add option 'name' to the "c:function:" directive.  With option 'name' the
+  ref-name of a function can be modified. E.g.::
+
+  .. c:function:: int ioctl( int fd, int request )
+ :name: VIDIOC_LOG_STATUS
+
+  The func-name (e.g. ioctl) remains in the output but the ref-name changed
+  from 'ioctl' to 'VIDIOC_LOG_STATUS'. The function is referenced by::
+
+  * :c:func:`VIDIOC_LOG_STATUS` or
+  * :any:`VIDIOC_LOG_STATUS` (``:any:`` needs sphinx 1.3)
 """
 
+from docutils.parsers.rst import directives
+
 from sphinx.domains.c import CObject as Base_CObject
 from sphinx.domains.c import CDomain as Base_CDomain
 
@@ -29,6 +45,21 @@ class CObject(Base_CObject):
 """
 Description of a C language object.
 """
+option_spec = {
+"name" : directives.unchanged
+}
+
+def handle_signature(self, sig, signode):
+"""Transform a C signature into RST nodes."""
+fullname = super(CObject, self).handle_signature(sig, signode)
+if "name" in self.options:
+if self.objtype == 'function':
+fullname = self.options["name"]
+else:
+# FIXME: handle :name: value of other declaration types?
+pass
+return fullname
+
 
 class CDomain(Base_CDomain):
 
-- 
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 5/5] doc-rst: migrate ioctl CEC_DQEVENT to c-domain

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

This is only one example, demonstrating the benefits of the patch
series.  The CEC_DQEVENT ioctl is migrated to the sphinx c-domain and
referred by ":name: CEC_DQEVENT".

With this change the indirection using ":ref:`CEC_DQEVENT` is no longer
needed, we can refer the ioctl directly with ":c:func:`CEC_DQEVENT`". As
addition in the index, there is a entry "CEC_DQEVENT (C function)".

Signed-off-by: Markus Heiser 
---
 Documentation/media/uapi/cec/cec-func-open.rst   | 2 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-open.rst 
b/Documentation/media/uapi/cec/cec-func-open.rst
index 38fd7e0..7c0f981 100644
--- a/Documentation/media/uapi/cec/cec-func-open.rst
+++ b/Documentation/media/uapi/cec/cec-func-open.rst
@@ -32,7 +32,7 @@ Arguments
 Open flags. Access mode must be ``O_RDWR``.
 
 When the ``O_NONBLOCK`` flag is given, the
-:ref:`CEC_RECEIVE ` and :ref:`CEC_DQEVENT ` 
ioctls
+:ref:`CEC_RECEIVE ` and :c:func:`CEC_DQEVENT` ioctls
 will return the ``EAGAIN`` error code when no message or event is 
available, and
 ioctls :ref:`CEC_TRANSMIT `,
 :ref:`CEC_ADAP_S_PHYS_ADDR ` and
diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 7a6d6d0..4e12e6c 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -15,7 +15,8 @@ CEC_DQEVENT - Dequeue a CEC event
 Synopsis
 
 
-.. cpp:function:: int ioctl( int fd, int request, struct cec_event *argp )
+.. c:function:: int ioctl( int fd, int request, struct cec_event *argp )
+   :name: CEC_DQEVENT
 
 Arguments
 =
@@ -36,7 +37,7 @@ Description
and is currently only available as a staging kernel module.
 
 CEC devices can send asynchronous events. These can be retrieved by
-calling :ref:`ioctl CEC_DQEVENT `. If the file descriptor is in
+calling :c:func:`CEC_DQEVENT`. If the file descriptor is in
 non-blocking mode and no event is pending, then it will return -1 and
 set errno to the ``EAGAIN`` error code.
 
-- 
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/5] doc-rst: add boilerplate to customize c-domain

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

Add a sphinx-extension to customize the sphinx c-domain.  No functional
changes right yet, just the boilerplate code.

Signed-off-by: Markus Heiser 
---
 Documentation/conf.py   |  2 +-
 Documentation/sphinx/cdomain.py | 44 +
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/sphinx/cdomain.py

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 5c06b01..dc46d23 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -29,7 +29,7 @@ from load_config import loadConfig
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
+extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain']
 
 # Gracefully handle missing rst2pdf.
 try:
diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py
new file mode 100644
index 000..c32387a
--- /dev/null
+++ b/Documentation/sphinx/cdomain.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8; mode: python -*-
+u"""
+cdomain
+~~~
+
+Replacement for the sphinx c-domain.
+
+:copyright:  Copyright (C) 2016  Markus Heiser
+:license:GPL Version 2, June 1991 see Linux/COPYING for details.
+"""
+
+from sphinx.domains.c import CObject as Base_CObject
+from sphinx.domains.c import CDomain as Base_CDomain
+
+__version__  = '1.0'
+
+def setup(app):
+
+app.override_domain(CDomain)
+
+return dict(
+version = __version__
+, parallel_read_safe = True
+, parallel_write_safe = True
+)
+
+class CObject(Base_CObject):
+
+"""
+Description of a C language object.
+"""
+
+class CDomain(Base_CDomain):
+
+"""C language domain."""
+name = 'c'
+label = 'C'
+directives = {
+'function': CObject,
+'member':   CObject,
+'macro':CObject,
+'type': CObject,
+'var':  CObject,
+}
-- 
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


[RFC PATCH 0/5] doc-rst: improvements Sphinx's C-domain

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

Hi,

this is my approach to eliminate some distortions we have with the c/cpp Sphinx
domains. The C domain is simple: it assumes that all functions, enums, etc
are global, e. g. there should be just one function called "ioctl", or "open".
With the 'name' option e.g.:

.. c:function:: int ioctl( int fd, int request )
   :name: VIDIOC_LOG_STATUS

we can rename those functions. Another nice feature around this *global*
namespace topic is, that the *duplicate C object description* warnings for
function declarations are moved to the nitpicky mode.

Thanks for your comments

  -- Markus --

Markus Heiser (5):
  doc-rst: add boilerplate to customize c-domain
  doc-rst:c-domain: ref-name of a function declaration
  doc-rst: moved *duplicate* warnings to nitpicky mode
  doc-rst: Revert "kernel-doc: fix handling of address_space tags"
  doc-rst: migrate ioctl CEC_DQEVENT to c-domain

 Documentation/conf.py|   2 +-
 Documentation/kernel-documentation.rst   |  29 +++
 Documentation/media/uapi/cec/cec-func-open.rst   |   2 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst |   5 +-
 Documentation/sphinx/cdomain.py  | 102 +++
 scripts/kernel-doc   |   3 -
 6 files changed, 136 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/sphinx/cdomain.py

-- 
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/5] doc-rst: Revert "kernel-doc: fix handling of address_space tags"

2016-08-15 Thread Markus Heiser
From: Markus Heiser 

This reverts commit a88b1672d4ddf9895eb53e6980926d5e960dea8e.

>From the origin comit log::

  The RST cpp:function handler is very pedantic: it doesn't allow any
  macros like __user on it

Since the kernel-doc parser does NOT make use of the cpp:domain, there
is no need to change the kernel-doc parser eleminating the address_space
tags.

Signed-off-by: Markus Heiser 
---
 scripts/kernel-doc | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 4f2e904..ba081c7 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1849,9 +1849,6 @@ sub output_function_rst(%) {
$count++;
$type = $args{'parametertypes'}{$parameter};
 
-   # RST doesn't like address_space tags at function prototypes
-   $type =~ s/__(user|kernel|iomem|percpu|pmem|rcu)\s*//;
-
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function
print $1 . $parameter . ") (" . $2;
-- 
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


[ANN] HDMI CEC: added cec-compliance/cec-follower utilities

2016-08-15 Thread Hans Verkuil

Two new CEC utilities have been added to the v4l-utils repository:

https://git.linuxtv.org/v4l-utils.git/

The cec-follower utility can emulate a CEC device, implementing the
follower functionality needed.

The cec-compliance utility can test a remote CEC device and check how
compliant it is against the CEC specification.

A major problem with CEC implementations is that they often poorly
adhere to the standard. These two utilities are an attempt to provide
a way to test CEC implementations.

Many thanks go to Johan Fjeldtvedt for working on this as part of his
Cisco Summer internship!

The linux-media mailinglist is the main point of contact, and patches
improving these utilities are welcome.

Note that these CEC features have currently limited coverage:

One Touch Record
Deck Control
Device Menu Control
Audio Rate Control
Tuner Control
Timer Programming
Capability Discovery and Control
Vendor Specific Commands

There is also no or very limited support for Unregistered devices,
CEC switches and CDC-only devices.

The compliance tests are based on CEC 2.0, although some tests are
slightly different for CEC 1.4 devices.

If you want to experiment with these utilities, then the easiest method
is to use the vivid driver from kernel 4.8. That driver provides two
emulated CEC devices.

modprobe vivid

This creates two cec devices: cec0 is that of the HDMI receiver, cec1
is the device for the HDMI transmitter.

This can be verified with 'cec-ctl -d0' and 'cec-ctl -d1'. The physical
address of the receiver is reported as 0.0.0.0, that of the transmitter
as 1.0.0.0.

Note: -dX is short-hand for -d /dev/cecX.

The next step is to configure these two devices:

cec-ctl -d0 --tv
cec-ctl -d1 --playback

This configures the receiver as a TV and the transmitter as a playback
device.

Now start cec-follower to emulate the playback device:

cec-follower -d1

And start the compliance test to test the follower implementation:

cec-compliance -d0 -r4

The -r4 option says that it should test the remote CEC device with logical
address 4 (i.e. the playback device).

These utilities require that the cec device is configured (e.g. the
CEC_S_LOG_ADDRS ioctl was called), otherwise they will refuse to run.
That's why cec-ctl is needed to configure the two vivid cec devices.

Some tests require interactive mode. Add the -i option to enable that.
Especially tests relating to Standby mode need a human to look at the TV
to verify it is really in standby or not.

Below is the full output for the compliance run from the example above. Sadly,
it is very unlikely you'll see 0 failures with real CEC implementations.

Regards,

Hans

Example of a compliance run:

$ cec-compliance -r4
Driver Info:
Driver Name: vivid
Adapter Name   : vivid-000-vid-cap0
Capabilities   : 0x003e
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 4.8.0
Available Logical Addresses: 1
Physical Address   : 0.0.0.0
Logical Address Mask   : 0x0001
CEC Version: 2.0
Vendor ID  : 0x000c03
Logical Addresses  : 1

  Logical Address  : 0
Primary Device Type: TV
Logical Address Type   : TV
All Device Types   : TV
RC TV Profile  : None
Device Features:
None

Compliance test for device /dev/cec0:

The test results mean the following:
OK  Supported correctly by the device.
OK (Not Supported)  Not supported and not mandatory for the device.
OK (Presumed)   Presumably supported.  Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be 
supported for this device.
OK (Refused)Supported by the device, but was refused.
FAILFailed and was expected to be supported by this 
device.

Find remote devices:
Polling: OK

Network topology:
System Information for device 4 (Playback Device 1) from device 0 (TV):
CEC Version: 2.0
Physical Address   : 1.0.0.0
Primary Device Type: Playback
Vendor ID  : 0x000c03
OSD Name   : 'Playback'
Power Status   : On

testing CEC local LA 0 (TV) to remote LA 4 (Playback Device 1):
Core:
Feature aborts unknown messages: OK
Feature aborts Abort message: OK

Give Device Power Status feature:
Give Device Power Status: OK
Report Device Power Status: OK (Presumed)

System Information feature:
Polling 

Re: [PATCH v3 09/14] media: platform: pxa_camera: add buffer sequencing

2016-08-15 Thread Hans Verkuil
On 08/15/2016 03:26 PM, Robert Jarzmik wrote:
> Robert Jarzmik  writes:
> 
>> Add sequence numbers to completed buffers.
>>
>> Signed-off-by: Robert Jarzmik 
>> ---
>>  drivers/media/platform/soc_camera/pxa_camera.c | 5 +
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
>> b/drivers/media/platform/soc_camera/pxa_camera.c
>> index d66443ac1f4d..8a65f126d091 100644
>> --- a/drivers/media/platform/soc_camera/pxa_camera.c
>> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
>> @@ -401,6 +402,7 @@ static void pxa_camera_start_capture(struct 
>> pxa_camera_dev *pcdev)
>>  unsigned long cicr0;
>>  
>>  dev_dbg(pcdev_to_dev(pcdev), "%s\n", __func__);
>> +pcdev->buf_sequence = 0;
> 
> I'm not so sure this is the right place to reset the buffer sequence.
> 
> I've seen no documentation on the rules applicable to this sequence number:
>  - should it be reset if a "start streaming" operation occurs ?

start_streaming is the recommended place for setting the counter to 0. It's what
v4l2-compliance expects.

It is not documented since 1) not every driver does this and 2) there may
be cases where this behavior is not desired.

That said, I have yet to see a driver where zeroing this in start_streaming
is not appropriate.

Regards,

Hans

>  - should it be reset if a streams stops by lack of video buffers queued ?
>  - should it be reset in queue_setup() like in other drivers ?
> 
> Or should it _never_ be reset and only be a monotonic raising number ?
> 
> Cheers.
> 
> --
> Robert
> 
--
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 v3 09/14] media: platform: pxa_camera: add buffer sequencing

2016-08-15 Thread Robert Jarzmik
Robert Jarzmik  writes:

> Add sequence numbers to completed buffers.
>
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/media/platform/soc_camera/pxa_camera.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
> b/drivers/media/platform/soc_camera/pxa_camera.c
> index d66443ac1f4d..8a65f126d091 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -401,6 +402,7 @@ static void pxa_camera_start_capture(struct 
> pxa_camera_dev *pcdev)
>   unsigned long cicr0;
>  
>   dev_dbg(pcdev_to_dev(pcdev), "%s\n", __func__);
> + pcdev->buf_sequence = 0;

I'm not so sure this is the right place to reset the buffer sequence.

I've seen no documentation on the rules applicable to this sequence number:
 - should it be reset if a "start streaming" operation occurs ?
 - should it be reset if a streams stops by lack of video buffers queued ?
 - should it be reset in queue_setup() like in other drivers ?

Or should it _never_ be reset and only be a monotonic raising number ?

Cheers.

--
Robert
--
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 v3 3/4] media: Add Mediatek MDP Driver

2016-08-15 Thread Hans Verkuil
On 08/09/2016 03:58 PM, Minghsiu Tsai wrote:
> Add MDP driver for MT8173
> 
> Signed-off-by: Minghsiu Tsai 
> ---
>  drivers/media/platform/Kconfig|   16 +
>  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 |  240 +
>  drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h  |  126 +++
>  drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c  | 1263 
> +
>  drivers/media/platform/mtk-mdp/mtk_mdp_m2m.h  |   22 +
>  drivers/media/platform/mtk-mdp/mtk_mdp_regs.c |  153 +++
>  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, 2573 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..4bb874b 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -166,6 +166,22 @@ 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

This needs a 'depends on HAS_DMA' as well.

> + 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



> +
> +/*
> + * Return true if rectangle a is enclosed in rectangle b, or false otherwise.
> + */
> +static bool mtk_mdp_m2m_is_rectangle_enclosed(struct v4l2_rect *a,
> +  struct v4l2_rect *b)
> +{
> + if (a->left < b->left || a->top < b->top)
> + return false;
> +
> + if (a->left + a->width > b->left + b->width)
> + return false;
> +
> + if (a->top + a->height > b->top + b->height)
> + return false;
> +
> + return true;
> +}
> +
> +static int mtk_mdp_m2m_g_selection(struct file *file, void *fh,
> +struct v4l2_selection *s)
> +{
> + struct mtk_mdp_frame *frame;
> + struct mtk_mdp_ctx *ctx = fh_to_ctx(fh);
> +
> + if ((s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
> + (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)) {
> + mtk_mdp_dbg(1, "[%d] invalid type:%d", ctx->id, s->type);
> + return -EINVAL;
> + }
> +
> + frame = mtk_mdp_ctx_get_frame(ctx, s->type);
> +
> + switch (s->target) {
> + case V4L2_SEL_TGT_COMPOSE_DEFAULT:
> + case V4L2_SEL_TGT_COMPOSE_BOUNDS:
> + case V4L2_SEL_TGT_CROP_BOUNDS:
> + case V4L2_SEL_TGT_CROP_DEFAULT:
> + s->r.left = 0;
> + s->r.top = 0;
> + s->r.width = frame->width;
> + s->r.height = frame->height;
> + return 0;
> +
> + case V4L2_SEL_TGT_COMPOSE:
> + case V4L2_SEL_TGT_CROP:
> + s->r.left = frame->crop.left;
> + s->r.top = frame->crop.top;
> + s->r.width = frame->crop.width;
> + s->r.height = frame->crop.height;
> + return 0;
> + }

This isn't right. For VIDEO_CAPTURE you support the COMPOSE targets, and for
the VIDEO_OUTPUT you support the CROP targets. Right now I can use e.g. TGT_CROP
with VIDEO_CAPTURE, which isn't correct.

s_selection has the same problem.

> +
> + return -EINVAL;
> +}
> +
> +static int mtk_mdp_check_scaler_ratio(struct 

Re: [PATCH] doc-rst: kernel-doc: fix handling of address_space tags

2016-08-15 Thread Markus Heiser

Am 22.07.2016 um 16:46 schrieb Mauro Carvalho Chehab :

> The RST cpp:function handler is very pedantic: it doesn't allow any
> macros like __user on it:
> 
>   Documentation/media/kapi/dtv-core.rst:28: WARNING: Error when parsing 
> function declaration.
>   If the function has no return type:
> Error in declarator or parameters and qualifiers
> Invalid definition: Expecting "(" in parameters_and_qualifiers. 
> [error at 8]
>   ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * rbuf, 
> size_t idx, int offset, u8 __user * buf, size_t len)
>   ^
>   If the function has a return type:
> Error in declarator or parameters and qualifiers
> If pointer to member declarator:
>   Invalid definition: Expected '::' in pointer to member (function). 
> [error at 37]
> ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * 
> rbuf, size_t idx, int offset, u8 __user * buf, size_t len)
> -^
> If declarator-id:
>   Invalid definition: Expecting "," or ")" in 
> parameters_and_qualifiers, got "*". [error at 102]
> ssize_t dvb_ringbuffer_pkt_read_user (struct dvb_ringbuffer * 
> rbuf, size_t idx, int offset, u8 __user * buf, size_t len)
> 
> --^
> 

May I'am wrong, but as far as I know, we get this error only 
if we are using the CPP-domain. Since the kernel-doc parser
uses the C-domain, we should not have those error messages
(tested here with sphinx 1.4).

That said, I don't see the need to change the kernel-doc parser
eleminating the address_space tags.

Or did I missed some point?

-- Markus --

> So, we have to remove it from the function prototype.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
> scripts/kernel-doc | 4 
> 1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 41eade332307..4394746cc1aa 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1848,6 +1848,10 @@ sub output_function_rst(%) {
>   }
>   $count++;
>   $type = $args{'parametertypes'}{$parameter};
> +
> + # RST doesn't like address_space tags at function prototypes
> + $type =~ s/__(user|kernel|iomem|percpu|pmem|rcu)\s*//;
> +
>   if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
>   # pointer-to-function
>   print $1 . $parameter . ") (" . $2;
> -- 
> 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

--
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 v3 14/14] media: platform: pxa_camera: move pxa_camera out of soc_camera

2016-08-15 Thread Robert Jarzmik
Robert Jarzmik  writes:

> As the conversion to a v4l2 standalone device is finished, move
> pxa_camera one directory up and finish severing any dependency to
> soc_camera.

> diff --git a/drivers/media/platform/soc_camera/Kconfig 
> b/drivers/media/platform/soc_camera/Kconfig
> index 0bf33ccf9a1e..10f49214b521 100644
> --- a/drivers/media/platform/soc_camera/Kconfig
> +++ b/drivers/media/platform/soc_camera/Kconfig
> @@ -25,8 +25,8 @@ config VIDEO_PXA27x
>   ---help---
> This is a v4l2 driver for the PXA27x Quick Capture Interface
>  
> -config VIDEO_RCAR_VIN_OLD
> - tristate "R-Car Video Input (VIN) support (DEPRECATED)"
> +config VIDEO_RCAR_VIN
> + tristate "R-Car Video Input (VIN) support"
>   depends on VIDEO_DEV && SOC_CAMERA
>   depends on ARCH_RENESAS || COMPILE_TEST
>   depends on HAS_DMA
This is wrong, looks like a rebase error, where instead of removing the
VIDEO_PXA27x config parameter I modify an RCAR_VIN one.

I will fix that for next iteration.

Cheers.

--
Robert
--
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 v6 4/4] rcar-vin: implement EDID control ioctls

2016-08-15 Thread Ulrich Hecht
On Mon, Aug 15, 2016 at 10:48 AM, Hans Verkuil  wrote:
> On 08/15/2016 10:37 AM, Ulrich Hecht wrote:
>> On Sat, Aug 13, 2016 at 3:30 PM, Hans Verkuil  wrote:
>>> On 07/22/2016 11:09 AM, Ulrich Hecht wrote:
 Adds G_EDID and S_EDID.

 Signed-off-by: Ulrich Hecht 
 ---
  drivers/media/platform/rcar-vin/rcar-v4l2.c | 33 
 +
  1 file changed, 33 insertions(+)

 diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
 b/drivers/media/platform/rcar-vin/rcar-v4l2.c
 index 396eabc..57e040c 100644
 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
 +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
 @@ -661,6 +661,36 @@ static int rvin_dv_timings_cap(struct file *file, 
 void *priv_fh,
   return ret;
  }

 +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid 
 *edid)
 +{
 + struct rvin_dev *vin = video_drvdata(file);
 + int input, ret;
 +
 + input = edid->pad;
 + edid->pad = vin->inputs[input].sink_idx;
>>>
>>> There is no vin->inputs array. Are there some other patches that need to be 
>>> merged
>>> first?
>>
>> It depends on "[PATCHv2 12/16] [media] rcar-vin: allow subdevices to
>> be bound late" from "[PATCHv2 00/16] rcar-vin: Enable Gen3 support".
>> Does that series have a chance of getting merged any time soon?
>
> I hope to review it today or Friday.
>
> Can you repost anyway: the dts patches don't apply cleanly anymore, and
> I prefer that you fix that. I want to avoid making a mistake when I fix them 
> up.

The patches are current, but they depend on changes in the
renesas-drivers tree not upstream yet.
Should we perhaps split this series into code and DT?

CU
Uli
--
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 v3 0/9] Add MT8173 Video Decoder Driver

2016-08-15 Thread Tiffany Lin
Hi Hans,


On Mon, 2016-08-15 at 11:07 +0200, Hans Verkuil wrote:
> On 08/15/2016 11:03 AM, Tiffany Lin wrote:
> > Hi Hans,
> > 
> > I upstream v4 on 8/10, I don't know why this version is not shown in
> > https://patchwork.kernel.org.
> > But I could see it in other link.
> > http://www.spinics.net/lists/arm-kernel/msg523095.html
> > I refine DocBook and vb2 queue_setup function in v4.
> > 
> > For the MT21 format, if I put MT21 into separate patch, this patch
> > series will build fail, I was confused how to fix this issue?
> 
> Just don't implement that pixelformat yet. I.e. everything else can be
> implemented, just don't add MT21 to the list of pixelformats. Do that in
> a separate patch at the end.
> 
> If that pixelformat isn't exposed, then nobody will use it either :-)
> 
Got it now.
Thanks a lot.


best regards,
Tiffany

> Regards,
> 
>   Hans


--
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 v3 0/9] Add MT8173 Video Decoder Driver

2016-08-15 Thread Hans Verkuil
On 08/15/2016 11:03 AM, Tiffany Lin wrote:
> Hi Hans,
> 
> I upstream v4 on 8/10, I don't know why this version is not shown in
> https://patchwork.kernel.org.
> But I could see it in other link.
> http://www.spinics.net/lists/arm-kernel/msg523095.html
> I refine DocBook and vb2 queue_setup function in v4.
> 
> For the MT21 format, if I put MT21 into separate patch, this patch
> series will build fail, I was confused how to fix this issue?

Just don't implement that pixelformat yet. I.e. everything else can be
implemented, just don't add MT21 to the list of pixelformats. Do that in
a separate patch at the end.

If that pixelformat isn't exposed, then nobody will use it either :-)

Regards,

Hans
--
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 v3 0/9] Add MT8173 Video Decoder Driver

2016-08-15 Thread Tiffany Lin
Hi Hans,

I upstream v4 on 8/10, I don't know why this version is not shown in
https://patchwork.kernel.org.
But I could see it in other link.
http://www.spinics.net/lists/arm-kernel/msg523095.html
I refine DocBook and vb2 queue_setup function in v4.

For the MT21 format, if I put MT21 into separate patch, this patch
series will build fail, I was confused how to fix this issue?


For VP9, I will merge this three patchs to V4L2 Decoder patch series.
 * linux-media: [v1,1/3] videodev2.h: add V4L2_PIX_FMT_VP9 format.
 - http://patchwork.linuxtv.org/patch/34392/
 * linux-media: [v1,3/3] V4L: add VP9 format documentation
 - http://patchwork.linuxtv.org/patch/34393/
 * linux-media: [v1,2/3] v4l2-ioctl: add VP9 format description.
 - http://patchwork.linuxtv.org/patch/34394/


best regards,
Tiffany


On Mon, 2016-08-15 at 10:30 +0200, Hans Verkuil wrote:
> Hi Tiffany,
> 
> This needs a v4: the DocBook format has been replaced by sphinx, and I also 
> see that
> the vb2 queue_setup function is out-of-date (the allocation contexts no 
> longer exist).
> 
> There were also a lot of comments about the MT21 format. I recommend 
> splitting off the
> code adding MT21 into separate patches at the end of the patch series. That 
> way if there
> are more comments it is easy to merge everything but those patches relating 
> to MT21.
> 
> Can you also add the patches for the new V4L2_PIX_FMT_VP9 to this patch 
> series? Those
> needs to be updated as well due to the move to sphinx.
> 
> Thanks!
> 
>   Hans
> 
> On 05/30/2016 02:29 PM, Tiffany Lin wrote:
> > ==
> >  Introduction
> > ==
> > 
> > The purpose of this series is to add the driver for video codec hw embedded 
> > in the Mediatek's MT8173 SoCs.
> > Mediatek Video Codec is able to handle video decoding of in a range of 
> > formats.
> > 
> > This patch series add Mediatek block format V4L2_PIX_FMT_MT21, the decoder 
> > driver will decoded bitstream to
> > V4L2_PIX_FMT_MT21 format.
> > 
> > This patch series rely on MTK VPU driver in patch series "Add MT8173 Video 
> > Encoder Driver and VPU Driver"[1]
> > and patch "CHROMIUM: v4l: Add V4L2_PIX_FMT_VP9 definition"[2] for VP9 
> > support.
> > Mediatek Video Decoder 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.linuxtv.org/patch/33734/
> > [2]https://chromium-review.googlesource.com/#/c/245241/
> > 
> > ==
> >  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, i.e. bitstream)
> > and CAPTURE (for destination buffers, i.e. decoded video frames).
> > OUTPUT and CAPTURE buffer could be MMAP or DMABUF memory type.
> > VIDIOC_G_CTRL and VIDIOC_G_EXT_CTRLS return 
> > V4L2_CID_MIN_BUFFERS_FOR_CAPTURE only when dirver in MTK_STATE_HEADER
> > state, or it will return EAGAIN.
> > Driver do not support subscribe event for control 'User Controls' for now.
> > And it default support export DMABUF for other display drivers.
> > 
> > Change in v3:
> > 1. Refine vdec hw clock setting
> > 2. Refine vp9 codec driver
> > 3. Refine v4l2 codec driver
> > 
> > Change in v2:
> > 1. Add documentation for V4L2_PIX_FMT_MT21
> > 2. Remove DRM_FORMAT_MT21
> > 2. Refine code according to review comments
> > 
> > v4l2-compliance test output:
> > localhost Encode # ./v4l2-compliance -d /dev/video0
> > Driver Info:
> > Driver name   : mtk-vcodec-dec
> > Card type : platform:mt8173
> > Bus info  : platform:mt8173
> > Driver version: 4.4.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/video0 (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
> > 
> > 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 

Re: [PATCH v6 4/4] rcar-vin: implement EDID control ioctls

2016-08-15 Thread Hans Verkuil
On 08/15/2016 10:37 AM, Ulrich Hecht wrote:
> On Sat, Aug 13, 2016 at 3:30 PM, Hans Verkuil  wrote:
>> On 07/22/2016 11:09 AM, Ulrich Hecht wrote:
>>> Adds G_EDID and S_EDID.
>>>
>>> Signed-off-by: Ulrich Hecht 
>>> ---
>>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 33 
>>> +
>>>  1 file changed, 33 insertions(+)
>>>
>>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
>>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> index 396eabc..57e040c 100644
>>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> @@ -661,6 +661,36 @@ static int rvin_dv_timings_cap(struct file *file, void 
>>> *priv_fh,
>>>   return ret;
>>>  }
>>>
>>> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>>> +{
>>> + struct rvin_dev *vin = video_drvdata(file);
>>> + int input, ret;
>>> +
>>> + input = edid->pad;
>>> + edid->pad = vin->inputs[input].sink_idx;
>>
>> There is no vin->inputs array. Are there some other patches that need to be 
>> merged
>> first?
> 
> It depends on "[PATCHv2 12/16] [media] rcar-vin: allow subdevices to
> be bound late" from "[PATCHv2 00/16] rcar-vin: Enable Gen3 support".
> Does that series have a chance of getting merged any time soon?

I hope to review it today or Friday.

Can you repost anyway: the dts patches don't apply cleanly anymore, and
I prefer that you fix that. I want to avoid making a mistake when I fix them up.

Regards,

Hans
--
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 v6 4/4] rcar-vin: implement EDID control ioctls

2016-08-15 Thread Ulrich Hecht
On Sat, Aug 13, 2016 at 3:30 PM, Hans Verkuil  wrote:
> On 07/22/2016 11:09 AM, Ulrich Hecht wrote:
>> Adds G_EDID and S_EDID.
>>
>> Signed-off-by: Ulrich Hecht 
>> ---
>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 33 
>> +
>>  1 file changed, 33 insertions(+)
>>
>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> index 396eabc..57e040c 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> @@ -661,6 +661,36 @@ static int rvin_dv_timings_cap(struct file *file, void 
>> *priv_fh,
>>   return ret;
>>  }
>>
>> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>> +{
>> + struct rvin_dev *vin = video_drvdata(file);
>> + int input, ret;
>> +
>> + input = edid->pad;
>> + edid->pad = vin->inputs[input].sink_idx;
>
> There is no vin->inputs array. Are there some other patches that need to be 
> merged
> first?

It depends on "[PATCHv2 12/16] [media] rcar-vin: allow subdevices to
be bound late" from "[PATCHv2 00/16] rcar-vin: Enable Gen3 support".
Does that series have a chance of getting merged any time soon?

CU
Uli
--
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 v3 0/9] Add MT8173 Video Decoder Driver

2016-08-15 Thread Hans Verkuil
Hi Tiffany,

This needs a v4: the DocBook format has been replaced by sphinx, and I also see 
that
the vb2 queue_setup function is out-of-date (the allocation contexts no longer 
exist).

There were also a lot of comments about the MT21 format. I recommend splitting 
off the
code adding MT21 into separate patches at the end of the patch series. That way 
if there
are more comments it is easy to merge everything but those patches relating to 
MT21.

Can you also add the patches for the new V4L2_PIX_FMT_VP9 to this patch series? 
Those
needs to be updated as well due to the move to sphinx.

Thanks!

Hans

On 05/30/2016 02:29 PM, Tiffany Lin wrote:
> ==
>  Introduction
> ==
> 
> The purpose of this series is to add the driver for video codec hw embedded 
> in the Mediatek's MT8173 SoCs.
> Mediatek Video Codec is able to handle video decoding of in a range of 
> formats.
> 
> This patch series add Mediatek block format V4L2_PIX_FMT_MT21, the decoder 
> driver will decoded bitstream to
> V4L2_PIX_FMT_MT21 format.
> 
> This patch series rely on MTK VPU driver in patch series "Add MT8173 Video 
> Encoder Driver and VPU Driver"[1]
> and patch "CHROMIUM: v4l: Add V4L2_PIX_FMT_VP9 definition"[2] for VP9 support.
> Mediatek Video Decoder 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.linuxtv.org/patch/33734/
> [2]https://chromium-review.googlesource.com/#/c/245241/
> 
> ==
>  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, i.e. bitstream)
> and CAPTURE (for destination buffers, i.e. decoded video frames).
> OUTPUT and CAPTURE buffer could be MMAP or DMABUF memory type.
> VIDIOC_G_CTRL and VIDIOC_G_EXT_CTRLS return V4L2_CID_MIN_BUFFERS_FOR_CAPTURE 
> only when dirver in MTK_STATE_HEADER
> state, or it will return EAGAIN.
> Driver do not support subscribe event for control 'User Controls' for now.
> And it default support export DMABUF for other display drivers.
> 
> Change in v3:
> 1. Refine vdec hw clock setting
> 2. Refine vp9 codec driver
> 3. Refine v4l2 codec driver
> 
> Change in v2:
> 1. Add documentation for V4L2_PIX_FMT_MT21
> 2. Remove DRM_FORMAT_MT21
> 2. Refine code according to review comments
> 
> v4l2-compliance test output:
> localhost Encode # ./v4l2-compliance -d /dev/video0
> Driver Info:
> Driver name   : mtk-vcodec-dec
> Card type : platform:mt8173
> Bus info  : platform:mt8173
> Driver version: 4.4.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/video0 (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
> 
> 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_QUERYCTRL/MENU: OK
> fail: 
> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-controls.cpp(357): 
> g_ctrl returned an error (11)
> test VIDIOC_G/S_CTRL: FAIL
> fail: 
> ../../../v4l-utils-1.6.0/utils/v4l2-compliance/v4l2-test-controls.cpp(579): 
> 

Re: [PATCH 0/7] doc-rst: sphinx sub-folders & parseheaders directive

2016-08-15 Thread Markus Heiser

Am 14.08.2016 um 20:09 schrieb Jonathan Corbet :

> On Sat, 13 Aug 2016 16:12:41 +0200
> Markus Heiser  wrote:
> 
>> this series is a consolidation on Jon's docs-next branch. It merges the 
>> "sphinx
>> sub-folders" patch [1] and the "parseheaders directive" patch [2] on top of
>> Jon's docs-next.
>> 
>> In sense of consolidation, it also includes:
>> 
>> *  doc-rst: add media/conf_nitpick.py
>> 
>>   Adds media/conf_nitpick.py from mchehab/docs-next [3].
>> 
>> *  doc-rst: migrated media build to parseheaders directive
> 
> OK, I have applied the first five of these,

Thanks!

> but stopped at parse-header.
> At this point, I have a few requests.  These are in approximate order of
> decreasing importance, but they're all important, I think.
> 
> - The new directive could really use some ... documentation.  Preferably in
>  kernel-documentation.rst with the rest.  What is parse-header, how does
>  it differ from kernel-doc, why might a kernel developer doing
>  documentation want (or not want) to use it?  That's all pretty obscure
>  now.  If we want others to jump onto this little bandwagon of ours, we
>  need to make sure it's all really clear.

This could be answered by Mauro.

> - Along those lines, is parse-header the right name for this thing?
>  "Parsing" isn't necessarily the goal of somebody who uses this directive,
>  right?  They want to extract documentation information.  Can we come up
>  with a better name?

Mauro, what is your suggestion and how would we go on in this topic?

> - Can we please try to get the coding style a bit more in line with both
>  kernel and Python community norms?  

Jonathan, we had this already, I gave you the links to "python community
norms" and tools, please read/use them.

* https://www.python.org/dev/peps/pep-0008/
* https://www.pylint.org/

Some of these norms might be unusual for C developers.

> I suspect some people will get grumpy
>  if they see this code.  In particular:
> 
>- Please try to stick to the 80-column limit when possible.  Python
>  makes that a bit harder than C does, and please don't put in
>  ridiculous line breaks that make the code worse.  But sticking a bit
>  closer to the rule would be good.
> 
>- The "#" lines around function/class
>  definition lines or other comments are not helpful, please avoid
>  them.  Instead, placing a real comment with actual informative text
>  above the function/class would be a good thing.  (I could live with
>  Python docstrings if you prefer, though I will confess I prefer
>  ordinary comments).
> 
>- No commas at the beginning of continuation lines, please; that would
>  get you yelled at in C code.  If you need to break a function call
>  (or whatever), please put the commas at the end of the line as is
>  done elsewhere.
> 
>  Sorry to poke at nits here, but we want others in the kernel community to
>  be able to look at this code, and that will be easier if we stick closer
>  to the usual rules.

OK, if that's all you find, I will paint a eye candy picture for you.

-- Markus --

--
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 2/3] soc-camera/rcar-vin: remove obsolete driver

2016-08-15 Thread Hans Verkuil
On 08/02/2016 09:35 AM, Hans Verkuil wrote:
> 
> 
> On 08/01/2016 10:41 PM, Niklas Söderlund wrote:
>> On 2016-08-01 11:31:11 +0300, Laurent Pinchart wrote:
>>> Hi Hans,
>>>
>>> Thank you for the patch.
>>>
>>> On Monday 01 Aug 2016 09:54:24 Hans Verkuil wrote:
 From: Hans Verkuil 

 This driver has been replaced by the non-soc-camera rcar-vin driver.
 The soc-camera framework is being deprecated, so drop this older
 rcar-vin driver in favor of the newer version that does not rely on
 this deprecated framework.

 Signed-off-by: Hans Verkuil 
 Cc: Laurent Pinchart 
 Cc: Guennadi Liakhovetski 
 Cc: Niklas Söderlund 
>>>
>>> I'm all for removal of dead code :-)
>>>
>>> Acked-by: Laurent Pinchart 
>>>
>>> But please get Niklas' ack to confirm that the new driver supports all the 
>>> feature available in the old one.
>>
>> I'm all for removing this code. And I do believe the new driver supports 
>> (almost, see 1) all features this one do. There are however two known 
>> issues with the new driver which maybe should be resolved before the old 
>> one is removed.
>>
>> 1. The soc-camera driver call g_std to determine video standard if field 
>>is V4L2_FIELD_INTERLACED. The new driver dose not.
>>
>>I'm preparing a patch which restores this functionality and hope to 
>>post it soon.
> 
> Shouldn't be a problem to get that in for 4.9.
> 
>>
>> 2. There is a error in the DT parsing code where of_node_put() is called 
>>twice resulting in a nice backtrace while booting if the debug config 
>>options are enabled.
>>
>>There is a fix for this in the Gen3 enablement series but maybe I 
>>should break it out from there and post it separately?
> 
> Yes please. It sounds as if this should be backported to 4.8-rcX as well?

Just to be certain: no patches for these two issues have been posted yet,
right?

We're getting very close to being able to drop soc-camera as a framework, and
I'd love to finish that for 4.9.

Regards,

Hans

> 
>>
>> I would like to solve issue no 1 before we remove the soc-camera driver, 
>> hopefully we can do so shortly.
> 
> The removal of the old driver is for 4.9, so there is a lot of time.
> 
> Regards,
> 
>   Hans
> --
> 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


[GIT PULL FOR v4.9] Add touch API and atmel_mxt_ts/synaptics drivers

2016-08-15 Thread Hans Verkuil
This patch series adds support for /dev/v4l-touchX devices.

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 touch

for you to fetch changes up to 28a645cb215786839742b276b6d5279dfd7995e7:

  Documentation: add support for V4L touch devices (2016-08-15 09:52:33 +0200)


Nick Dyer (11):
  Input: atmel_mxt_ts - update MAINTAINERS email address
  v4l2-core: Add support for touch devices
  Input: atmel_mxt_ts - add support for T37 diagnostic data
  Input: atmel_mxt_ts - output diagnostic debug via V4L2 device
  Input: atmel_mxt_ts - read touchscreen size
  Input: atmel_mxt_ts - handle diagnostic data orientation
  Input: atmel_mxt_ts - add diagnostic data support for mXT1386
  Input: atmel_mxt_ts - add support for reference data
  Input: synaptics-rmi4 - add support for F54 diagnostics
  Input: sur40 - use new V4L2 touch input type
  Documentation: add support for V4L touch devices

 Documentation/media/kapi/v4l2-dev.rst |   1 +
 Documentation/media/uapi/mediactl/media-types.rst |  24 +-
 Documentation/media/uapi/v4l/dev-touch.rst|  56 
 Documentation/media/uapi/v4l/devices.rst  |   1 +
 Documentation/media/uapi/v4l/pixfmt-tch-td08.rst  |  80 ++
 Documentation/media/uapi/v4l/pixfmt-tch-td16.rst  | 111 
 Documentation/media/uapi/v4l/pixfmt-tch-tu08.rst  |  78 ++
 Documentation/media/uapi/v4l/pixfmt-tch-tu16.rst  | 110 
 Documentation/media/uapi/v4l/pixfmt.rst   |   1 +
 Documentation/media/uapi/v4l/tch-formats.rst  |  18 ++
 Documentation/media/uapi/v4l/vidioc-enuminput.rst |   8 +
 Documentation/media/uapi/v4l/vidioc-querycap.rst  |   8 +
 Documentation/media/videodev2.h.rst.exceptions|   2 +
 MAINTAINERS   |   6 +-
 drivers/input/rmi4/Kconfig|  11 +
 drivers/input/rmi4/Makefile   |   1 +
 drivers/input/rmi4/rmi_bus.c  |   3 +
 drivers/input/rmi4/rmi_driver.h   |   1 +
 drivers/input/rmi4/rmi_f54.c  | 756 
++
 drivers/input/touchscreen/Kconfig |   8 +
 drivers/input/touchscreen/atmel_mxt_ts.c  | 520 
++
 drivers/input/touchscreen/sur40.c | 122 +---
 drivers/media/media-entity.c  |   2 +
 drivers/media/v4l2-core/v4l2-dev.c|  14 +-
 drivers/media/v4l2-core/v4l2-ioctl.c  |  36 ++-
 include/media/v4l2-dev.h  |   4 +-
 include/uapi/linux/media.h|   1 +
 include/uapi/linux/videodev2.h|   9 +
 28 files changed, 1940 insertions(+), 52 deletions(-)
 create mode 100644 Documentation/media/uapi/v4l/dev-touch.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-td08.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-td16.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-tu08.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-tu16.rst
 create mode 100644 Documentation/media/uapi/v4l/tch-formats.rst
 create mode 100644 drivers/input/rmi4/rmi_f54.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


[PATCH] media-types.rst: fix typo

2016-08-15 Thread Hans Verkuil
Fix copy-and-paste error: the radio devices are /dev/radio, not /dev/vbi.

Signed-off-by: Hans Verkuil <
---
diff --git a/Documentation/media/uapi/mediactl/media-types.rst 
b/Documentation/media/uapi/mediactl/media-types.rst
index 0265edc..a0f737a 100644
--- a/Documentation/media/uapi/mediactl/media-types.rst
+++ b/Documentation/media/uapi/mediactl/media-types.rst
@@ -405,7 +405,7 @@ Types and flags used to represent the media graph elements

-  Device node interface for radio (V4L)

-   -  typically, /dev/vbi?
+   -  typically, /dev/radio?

 -  .. row 9

--
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 v9 0/2] [media] atmel-isc: add driver for Atmel ISC

2016-08-15 Thread Wu, Songjun



On 8/15/2016 15:34, Hans Verkuil wrote:

On 08/11/2016 09:06 AM, Songjun Wu wrote:

The Image Sensor Controller driver includes two parts.
1) Driver code to implement the ISC function.
2) Device tree binding documentation, it describes how
   to add the ISC in device tree.


So close...

Running checkpatch gives me:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#133:
new file mode 100644

Can you make a patch adding an entry to MAINTAINERS? No need to repost the other
two.


Thank you.
Nicolas or I will make a patch to add an entry to MAINTAINERS.


Regards,

Hans


--
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 v9 0/2] [media] atmel-isc: add driver for Atmel ISC

2016-08-15 Thread Hans Verkuil
On 08/11/2016 09:06 AM, Songjun Wu wrote:
> The Image Sensor Controller driver includes two parts.
> 1) Driver code to implement the ISC function.
> 2) Device tree binding documentation, it describes how
>to add the ISC in device tree.

So close...

Running checkpatch gives me:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#133:
new file mode 100644

Can you make a patch adding an entry to MAINTAINERS? No need to repost the other
two.

Regards,

Hans
--
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] Fixed for mediatek encoder

2016-08-15 Thread Hans Verkuil
Various fixes for 4.8 for the new mediatek encoder driver.

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 for-v4.8b

for you to fetch changes up to 14afb4c1a43bd05012cc0994691a0e19533a9908:

  vcodec:mediatek: Refine VP8 encoder driver (2016-08-15 09:23:35 +0200)


Tiffany Lin (7):
  vcodec:mediatek:code refine for v4l2 Encoder driver
  vcodec:mediatek: Fix fops_vcodec_release flow for V4L2 Encoder
  vcodec:mediatek: Fix visible_height larger than coded_height issue in 
s_fmt_out
  vcodec:mediatek: Add timestamp and timecode copy for V4L2 Encoder
  vcodec:mediatek: change H264 profile default to profile high
  vcodec:mediatek: Refine H264 encoder driver
  vcodec:mediatek: Refine VP8 encoder driver

 drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |  1 -
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 42 
++
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |  6 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h|  1 -
 drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c  | 16 
 drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c   | 16 +++-
 6 files changed, 46 insertions(+), 36 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 v9 0/2] [media] atmel-isc: add driver for Atmel ISC

2016-08-15 Thread Wu, Songjun



On 8/15/2016 15:15, Hans Verkuil wrote:

On 08/15/2016 08:09 AM, Wu, Songjun wrote:



On 8/12/2016 15:32, Hans Verkuil wrote:

One quick question:

On 08/11/2016 09:06 AM, Songjun Wu wrote:

The Image Sensor Controller driver includes two parts.
1) Driver code to implement the ISC function.
2) Device tree binding documentation, it describes how
   to add the ISC in device tree.

Test result with v4l-utils.
# v4l2-compliance -f
v4l2-compliance SHA   : not available

Driver Info:
Driver name   : atmel_isc
Card type : Atmel Image Sensor Controller
Bus info  : platform:atmel_isc f0008000.isc
Driver version: 4.7.0
Capabilities  : 0x8421
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0421
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (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
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 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)

Test input 0:

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


Can you confirm that the sensor subdevice you are using does not have any 
controls?
I ask since that is fairly unusual, so I want to make sure that controls are 
really
not supported in this setup.


Sorry for the late reply.
The subdevice I use supports controls, but I did not develop the v4l2
controls in the sensor driver.


So you mean the sensor hardware has controls, but the sensor driver doesn't 
implement
them? Do I understand you correctly?


Yes, your understanding is correct.


Should I add the v4l2 controls and test again?


If the sensor driver does not implement controls (i.e. has a struct 
v4l2_ctrl_handler),
then everything is fine and the v4l2-compliance output is correct.

Please confirm this. I just want to be 100% certain about this before I make 
the pull
request.

I can confirm this. I use the sensor ov7740, and the driver is developed 
by myself, I did not add the v4l2 controls into the sensor driver for now.



Thanks,

Hans


--
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] cec-core.rst: convert old cec.txt to sphinx.

2016-08-15 Thread Hans Verkuil
On 08/15/2016 09:14 AM, Markus Heiser wrote:
> Hi Hans,
> 
> you don't need to change the header underlines if you don't want.
> Any file could start with e.g. "===" headers marking the top 
> section and "---" marking the subsections, independent on which
> level this file is included in a toctree.
> 
> http://static.lwn.net/kerneldoc/kernel-documentation.html#specific-guidelines-for-the-kernel-documentation
> http://www.sphinx-doc.org/en/stable/rest.html#sections

Thanks for the info.

I really need to spend some time reading up on the syntax, but so much to do,
so little time :-(

Regards,

Hans

> 
> -- Markus --
> 
> Am 14.08.2016 um 15:18 schrieb Hans Verkuil :
> 
>> Convert the old ascii CEC kapi documentation to sphinx documentation.
>>
>> No textual changes, just an initial conversion.
>>
>> Signed-off-by: Hans Verkuil 
>> ---
>> Documentation/{cec.txt => media/kapi/cec-core.rst} | 202 
>> -
>> Documentation/media/media_kapi.rst |   1 +
>> MAINTAINERS|   4 +-
>> 3 files changed, 119 insertions(+), 88 deletions(-)
>> rename Documentation/{cec.txt => media/kapi/cec-core.rst} (53%)
>>
>> diff --git a/Documentation/cec.txt b/Documentation/media/kapi/cec-core.rst
>> similarity index 53%
>> rename from Documentation/cec.txt
>> rename to Documentation/media/kapi/cec-core.rst
>> index 75155fe..b776a59 100644
>> --- a/Documentation/cec.txt
>> +++ b/Documentation/media/kapi/cec-core.rst
>> @@ -1,5 +1,5 @@
>> CEC Kernel Support
>> -==
>> +--
>>
>> The CEC framework provides a unified kernel interface for use with HDMI CEC
>> hardware. It is designed to handle a multiple types of hardware (receivers,
>> @@ -10,7 +10,7 @@ feature into the kernel's remote control framework.
>>
>>
>> The CEC Protocol
>> -
>> +
>>
>> The CEC protocol enables consumer electronic devices to communicate with each
>> other through the HDMI connection. The protocol uses logical addresses in the
>> @@ -28,62 +28,65 @@ http://www.microprocessor.org/HDMISpecification13a.pdf
>>
>>
>> The Kernel Interface
>> -
>> +
>>
>> 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,
>> +..  code-block:: c
>> +
>> +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);
>> +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.
>> -
>> -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.
>> +- ``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.
>> +- ``name``: the name of the CEC adapter. Note: this name will be copied.
>> +- ``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
>> +  adapter can handle. Must be 1 <= ``available_las`` <= 
>> ``CEC_MAX_LOG_ADDRS``.
>> +- ``parent``: the parent device.
>>
>> -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
>> -adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
>> +To register the ``/dev/cecX`` device node and the remote control device (if
>> +``CEC_CAP_RC`` is set) you call:
>>
>> -parent: the parent device.
>> +..  code-block:: c
>>
>> -
>> -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);
>> +int cec_register_adapter(struct cec_adapter *adap);
>>
>> To unregister the devices call:
>>
>> -void cec_unregister_adapter(struct cec_adapter *adap);
>> +..  code-block:: c
>> +
>> +void cec_unregister_adapter(struct cec_adapter 

Re: [PATCH] cec-core.rst: convert old cec.txt to sphinx.

2016-08-15 Thread Markus Heiser
Hi Hans,

you don't need to change the header underlines if you don't want.
Any file could start with e.g. "===" headers marking the top 
section and "---" marking the subsections, independent on which
level this file is included in a toctree.

http://static.lwn.net/kerneldoc/kernel-documentation.html#specific-guidelines-for-the-kernel-documentation
http://www.sphinx-doc.org/en/stable/rest.html#sections

-- Markus --

Am 14.08.2016 um 15:18 schrieb Hans Verkuil :

> Convert the old ascii CEC kapi documentation to sphinx documentation.
> 
> No textual changes, just an initial conversion.
> 
> Signed-off-by: Hans Verkuil 
> ---
> Documentation/{cec.txt => media/kapi/cec-core.rst} | 202 -
> Documentation/media/media_kapi.rst |   1 +
> MAINTAINERS|   4 +-
> 3 files changed, 119 insertions(+), 88 deletions(-)
> rename Documentation/{cec.txt => media/kapi/cec-core.rst} (53%)
> 
> diff --git a/Documentation/cec.txt b/Documentation/media/kapi/cec-core.rst
> similarity index 53%
> rename from Documentation/cec.txt
> rename to Documentation/media/kapi/cec-core.rst
> index 75155fe..b776a59 100644
> --- a/Documentation/cec.txt
> +++ b/Documentation/media/kapi/cec-core.rst
> @@ -1,5 +1,5 @@
> CEC Kernel Support
> -==
> +--
> 
> The CEC framework provides a unified kernel interface for use with HDMI CEC
> hardware. It is designed to handle a multiple types of hardware (receivers,
> @@ -10,7 +10,7 @@ feature into the kernel's remote control framework.
> 
> 
> The CEC Protocol
> -
> +
> 
> The CEC protocol enables consumer electronic devices to communicate with each
> other through the HDMI connection. The protocol uses logical addresses in the
> @@ -28,62 +28,65 @@ http://www.microprocessor.org/HDMISpecification13a.pdf
> 
> 
> The Kernel Interface
> -
> +
> 
> 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,
> +..  code-block:: c
> +
> +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);
> +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.
> -
> -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.
> +- ``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.
> +- ``name``: the name of the CEC adapter. Note: this name will be copied.
> +- ``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
> +  adapter can handle. Must be 1 <= ``available_las`` <= 
> ``CEC_MAX_LOG_ADDRS``.
> +- ``parent``: the parent device.
> 
> -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
> - adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
> +To register the ``/dev/cecX`` device node and the remote control device (if
> +``CEC_CAP_RC`` is set) you call:
> 
> -parent: the parent device.
> +..  code-block:: c
> 
> -
> -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);
> +int cec_register_adapter(struct cec_adapter *adap);
> 
> To unregister the devices call:
> 
> -void cec_unregister_adapter(struct cec_adapter *adap);
> +..  code-block:: c
> +
> +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
> -cec_unregister_adapter() to clean up, never cec_delete_adapter(). The
> +Note: if ``cec_register_adapter()`` fails, then call 
> ``cec_delete_adapter()`` 

Re: [PATCH v9 0/2] [media] atmel-isc: add driver for Atmel ISC

2016-08-15 Thread Hans Verkuil
On 08/15/2016 08:09 AM, Wu, Songjun wrote:
> 
> 
> On 8/12/2016 15:32, Hans Verkuil wrote:
>> One quick question:
>>
>> On 08/11/2016 09:06 AM, Songjun Wu wrote:
>>> The Image Sensor Controller driver includes two parts.
>>> 1) Driver code to implement the ISC function.
>>> 2) Device tree binding documentation, it describes how
>>>to add the ISC in device tree.
>>>
>>> Test result with v4l-utils.
>>> # v4l2-compliance -f
>>> v4l2-compliance SHA   : not available
>>>
>>> Driver Info:
>>> Driver name   : atmel_isc
>>> Card type : Atmel Image Sensor Controller
>>> Bus info  : platform:atmel_isc f0008000.isc
>>> Driver version: 4.7.0
>>> Capabilities  : 0x8421
>>> Video Capture
>>> Streaming
>>> Extended Pix Format
>>> Device Capabilities
>>> Device Caps   : 0x0421
>>> Video Capture
>>> Streaming
>>> Extended Pix Format
>>>
>>> Compliance test for device /dev/video0 (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
>>> test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>> Inputs: 1 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)
>>>
>>> Test input 0:
>>>
>>> Control ioctls:
>>> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>> test VIDIOC_QUERYCTRL: OK (Not Supported)
>>> test VIDIOC_G/S_CTRL: OK (Not Supported)
>>> test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>> Standard Controls: 0 Private Controls: 0
>>
>> Can you confirm that the sensor subdevice you are using does not have any 
>> controls?
>> I ask since that is fairly unusual, so I want to make sure that controls are 
>> really
>> not supported in this setup.
>>
> Sorry for the late reply.
> The subdevice I use supports controls, but I did not develop the v4l2 
> controls in the sensor driver.

So you mean the sensor hardware has controls, but the sensor driver doesn't 
implement
them? Do I understand you correctly?

> Should I add the v4l2 controls and test again?

If the sensor driver does not implement controls (i.e. has a struct 
v4l2_ctrl_handler),
then everything is fine and the v4l2-compliance output is correct.

Please confirm this. I just want to be 100% certain about this before I make 
the pull
request.

Thanks,

Hans
--
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] New tw5864 driver (v3)

2016-08-15 Thread Hans Verkuil
Passed v4l2-compliance, see https://patchwork.linuxtv.org/patch/35671/
for more details about the device.

Regards,

Hans

Change since v2: fix commit log of first patch: contained text that should have 
been removed.
Change since v1: fix Kconfig dependency.

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 tw5864

for you to fetch changes up to d65dc0593dc31b97e432b9d666d7eab1dce970db:

  tw5864: add missing HAS_DMA dependency (2016-08-15 08:59:11 +0200)


Andrey Utkin (1):
  pci: Add tw5864 driver

Hans Verkuil (1):
  tw5864: add missing HAS_DMA dependency

 MAINTAINERS |8 +
 drivers/media/pci/Kconfig   |1 +
 drivers/media/pci/Makefile  |1 +
 drivers/media/pci/tw5864/Kconfig|   12 +
 drivers/media/pci/tw5864/Makefile   |3 +
 drivers/media/pci/tw5864/tw5864-core.c  |  359 ++
 drivers/media/pci/tw5864/tw5864-h264.c  |  259 
 drivers/media/pci/tw5864/tw5864-reg.h   | 2133 
+++
 drivers/media/pci/tw5864/tw5864-util.c  |   37 ++
 drivers/media/pci/tw5864/tw5864-video.c | 1514 
++
 drivers/media/pci/tw5864/tw5864.h   |  205 ++
 11 files changed, 4532 insertions(+)
 create mode 100644 drivers/media/pci/tw5864/Kconfig
 create mode 100644 drivers/media/pci/tw5864/Makefile
 create mode 100644 drivers/media/pci/tw5864/tw5864-core.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-h264.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-reg.h
 create mode 100644 drivers/media/pci/tw5864/tw5864-util.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-video.c
 create mode 100644 drivers/media/pci/tw5864/tw5864.h
--
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 v9 0/2] [media] atmel-isc: add driver for Atmel ISC

2016-08-15 Thread Wu, Songjun



On 8/12/2016 15:32, Hans Verkuil wrote:

One quick question:

On 08/11/2016 09:06 AM, Songjun Wu wrote:

The Image Sensor Controller driver includes two parts.
1) Driver code to implement the ISC function.
2) Device tree binding documentation, it describes how
   to add the ISC in device tree.

Test result with v4l-utils.
# v4l2-compliance -f
v4l2-compliance SHA   : not available

Driver Info:
Driver name   : atmel_isc
Card type : Atmel Image Sensor Controller
Bus info  : platform:atmel_isc f0008000.isc
Driver version: 4.7.0
Capabilities  : 0x8421
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0421
Video Capture
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (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
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 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)

Test input 0:

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


Can you confirm that the sensor subdevice you are using does not have any 
controls?
I ask since that is fairly unusual, so I want to make sure that controls are 
really
not supported in this setup.


Sorry for the late reply.
The subdevice I use supports controls, but I did not develop the v4l2 
controls in the sensor driver.

Should I add the v4l2 controls and test again?


Regards,

Hans


--
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