TW2866 i2c driver and solo6x10

2016-07-27 Thread Marty Plummer
I have one of those rebranded chinese security dvrs, the ones with all the 
gaping
security holes. I'd like to fix that up and setup a good rtsp server on it, but
first comes low-level stuff, drivers and such. I've been squinting at the pcb 
and
ID'ing chips for a bit now, and I've figured most of them out. Looks like the 
actual
video processing is done on 4 tw2866 chips, though the kernel module has symbols
referring to tw2865. I've seen another driver in the kernel tree, the bluecherry
solo6x10, but that's on the pci bus. as far as I can figure, the dvr uses i2c 
for
them. So, what I'm wondering is would it be feasible to factor out some of the 
solo
functionality into a generic tw2865 driver and be able to pull from that for an 
i2c
kernel module? I'd really hate to have to rewrite the whole thing, duplicated 
code
and overworking are generally a bad idea, even if I do have a datasheet for the 
chip
in question



signature.asc
Description: OpenPGP digital signature


cron job: media_tree daily build: WARNINGS

2016-07-27 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:   Thu Jul 28 04:00:26 CEST 2016
git branch: test
git hash:   009a620848218d521f008141c62f56bf19294dd9
gcc version:i686-linux-gcc (GCC) 5.3.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: WARNINGS
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
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-rc1-i686: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
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-rc1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: WARNINGS
smatch: WARNINGS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.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: [GIT PULL for v4.8-rc1] media updates part II: documentation

2016-07-27 Thread Stephen Backway
Mauro,

Are these doc-rst changes planned to be applied to the linux-media tree?
(https://git.linuxtv.org/media_tree.git/tree/Documentation)

As at the moment if you follow the linux-media build instructions to
develop and send patches, you do not see the new doc-rst files and
therefore cannot include them in the patch.
(https://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers)

Thanks
Stephen.

On 28 July 2016 at 00:01, Mauro Carvalho Chehab  wrote:
> Hi Linus,
>
> Please pull from:
>   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
> tags/media/v4.8-4
>
> For media documentation updates.
>
> This patch series does the conversion of all media documentation stuff
> to Restrutured Text markup format and add them to the Documentation/index.rst
> file. The media documentation was grouped into 4 books:
> - media uAPI;
> - media kAPI;
> - V4L driver-specific documentation;
> - DVB driver-specific documentation.
>
> It also contains several documentation improvements.
>
> Thanks!
> Mauro
>
> ---
>
> PS.: this is nearly identical to the previous pull request.
> The only difference is that I removed an already applied patch
> from the patch series.
>
> A trivial conflict is expected when merging Documentation/index.rst,
> as both my tree and Daniel Vetter's tree will be adding files there.
>
>
> The following changes since commit 9c1958fc326a0a0a533ec8e86ea6fa30977207de:
>
>   Merge tag 'media/v4.8-1' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2016-07-26 
> 18:59:59 -0700)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
> tags/media/v4.8-4
>
> for you to fetch changes up to 85538b1ad145c67198cb55d02de14ba269cc323d:
>
>   Merge branch 'topic/docs-next' into v4l_for_linus (2016-07-27 10:45:04 
> -0300)
>
> 
> media updates for v4.8-rc1
>
> 
> Hans Verkuil (5):
>   [media] pixfmt-006.rst: add missing V4L2_YCBCR_ENC_SMPTE240M
>   [media] vidioc-g-dv-timings.rst: document interlaced defines
>   [media] doc-rst: update CEC_RECEIVE
>   [media] doc-rst: improve CEC documentation
>   [media] doc-rst: cec: update documentation
>
> Markus Heiser (10):
>   doc-rst: linux_tv DocBook to reST migration (docs-next)
>   doc-rst: boilerplate HTML theme customization
>   doc-rst: customize RTD theme, table & full width
>   doc-rst: customize RTD theme, captions & inline literal
>   doc-rst: auto-generate: fixed include "output/*.h.rst" content
>   doc-rst: add kernel-include directive
>   doc-rst: linux_tv/Makefile: Honor quiet make O=dir
>   [media] doc-rst: linux_tv CEC part, DocBook to reST migration
>   [media] doc-rst: linux_tc CEC enhanced markup
>   [media] doc-rst: media: reordered top sectioning
>
> Mauro Carvalho Chehab (313):
>   Merge branch 'docs-next' of git://git.lwn.net/linux into devel/docs-next
>   doc-rst: linuxt_tv: update the documentation year
>   doc-rst: some fixups at linux_tv/index
>   doc-rst: v4l2: Fix authors and revisions lists
>   doc-rst: querycap: fix troubles on some references
>   doc-rst: linux_tv/index: add xrefs for document divisions
>   doc-rst: app-pri: Fix a bad reference
>   doc-rst: video: use reference for VIDIOC_ENUMINPUT
>   doc-rst: v4l2: numerate the V4L2 chapters
>   doc-rst: video: Restore the captions for the examples
>   doc-rst: audio: Fix some cross references
>   doc-rst: linux_tv: Replace reference names to match ioctls
>   doc-rst: linux_tv: simplify references
>   doc-rst: linux_tv: convert lots of consts to references
>   doc-rst: linux_tv: don't simplify VIDIOC_G_foo references
>   doc-rst: audio: re-add captions for the examples
>   doc-rst: standard: read the example captions
>   doc-rst: linux_tv: remove controls
>   doc-rst: control: read the example captions
>   doc-rst: control: Fix missing reference for example 8
>   doc-rst: extended-controls: use reference for VIDIOC_S_CTRL
>   doc-rst: vidioc-queryctl: change the title of this chapter
>   doc-rst: linux_tv: supress lots of warnings
>   doc-rst: planar-apis: fix some conversion troubles
>   doc-rst: crop: fix conversion on this file
>   doc-rst: selection-api-005: Fix ReST parsing
>   doc-rst: linux_tv: use Example x.y. instead of a single number
>   doc-rst: selection-api-006: add missing captions
>   doc-rst: linux_tv: Error codes should be const
>   doc-rst: linux_tv: use references for structures
>   doc-rst: linux_tv: Fix remaining undefined references
>   doc-rst: pixfmt-007: Fix formula parsing
>   doc-rst: fdl-appendix: Fix formatting issues
>   doc-rst: linux_tv: fix some 

Re: [PATCH] doc-rst: Remove the media docbook

2016-07-27 Thread Jonathan Corbet
On Wed, 27 Jul 2016 06:32:31 -0300
Mauro Carvalho Chehab  wrote:

> This patch should be applied after Linus handle my media documentation
> pull request. Do you prefer to send the patch yourself, or if I do it?

If you want it to go up for 4.8, just go ahead and send it in, no need for
a middleman.

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


Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-07-27 Thread Matwey V. Kornilov
Hello,

I've just biseced commit, which introduced this issue

commit f551e13529833e052f75ec628a8af7b034af20f9
Author: Bin Liu 
Date:   Mon Apr 25 15:53:30 2016 -0500

Revert "usb: musb: musb_host: Enable HCD_BH flag to handle urb
return in bottom half"

I have not checked yet, if it was intentionnaly fixed.

2016-07-23 22:24 GMT+03:00 Matwey V. Kornilov :
> 2016-07-20 21:56 GMT+03:00 Matwey V. Kornilov :
>> 2016-07-20 18:06 GMT+03:00 Bin Liu :
>>> Hi,
>>>
>>> On Wed, Jul 20, 2016 at 05:44:56PM +0300, Matwey V. Kornilov wrote:
 2016-07-20 17:13 GMT+03:00 Bin Liu :
 > Hi,
 >
 > On Wed, Jul 20, 2016 at 09:09:42AM +0300, Matwey V. Kornilov wrote:
 >> 2016-07-20 0:34 GMT+03:00 Bin Liu :
 >> > Hi,
 >> >
 >> > On Wed, Jul 20, 2016 at 12:25:44AM +0300, Matwey V. Kornilov wrote:
 >> >> 2016-07-19 23:56 GMT+03:00 Bin Liu :
 >> >> > Hi,
 >> >> >
 >> >> > On Tue, Jul 19, 2016 at 11:21:17PM +0300, mat...@sai.msu.ru wrote:
 >> >> >> Hello,
 >> >> >>
 >> >> >> I have Philips SPC 900 camera (0471:0329) connected to my AM335x 
 >> >> >> based BeagleBoneBlack SBC.
 >> >> >> I am sure that both of them are fine and work properly.
 >> >> >> I am running Linux 4.6.4 (my kernel config is available at 
 >> >> >> https://clck.ru/A2kQs ) and I've just discovered, that there is 
 >> >> >> an issue with frame transfer when high resolution formats are 
 >> >> >> used.
 >> >> >>
 >> >> >> The issue is the following. I use simple v4l2 example tool (taken 
 >> >> >> from API docs), which source code is available at 
 >> >> >> http://pastebin.com/grcNXxfe
 >> >> >>
 >> >> >> When I use (see line 488) 640x480 frames
 >> >> >>
 >> >> >> fmt.fmt.pix.width   = 640;
 >> >> >> fmt.fmt.pix.height  = 480;
 >> >> >>
 >> >> >> then I get "select timeout" and don't get any frames.
 >> >> >>
 >> >> >> When I use 320x240 frames
 >> >> >>
 >> >> >> fmt.fmt.pix.width   = 320;
 >> >> >> fmt.fmt.pix.height  = 240;
 >> >> >>
 >> >> >> then about 60% frames are missed. An example outpout of ./a.out 
 >> >> >> -f is available at https://yadi.sk/d/aRka8xWPtSc4y
 >> >> >> It looks like there are pauses between bulks of frames (frame 
 >> >> >> counter and timestamp as returned from v4l2 API):
 >> >> >>
 >> >> >> 3 3705.142553
 >> >> >> 8 3705.342533
 >> >> >> 13 3705.542517
 >> >> >> 110 3708.776208
 >> >> >> 115 3708.976190
 >> >> >> 120 3709.176169
 >> >> >> 125 3709.376152
 >> >> >> 130 3709.576144
 >> >> >> 226 3712.807848
 >> >> >>
 >> >> >> When I use tiny 160x120 frames
 >> >> >>
 >> >> >> fmt.fmt.pix.width   = 160;
 >> >> >> fmt.fmt.pix.height  = 120;
 >> >> >>
 >> >> >> then more frames are received. See output example at 
 >> >> >> https://yadi.sk/d/DedBmH6ftSc9t
 >> >> >> That is why I thought that everything was fine in May when used 
 >> >> >> tiny xawtv window to check kernel OOPS presence (see 
 >> >> >> http://www.spinics.net/lists/linux-usb/msg141188.html for 
 >> >> >> reference)
 >> >> >>
 >> >> >> Even more. When I introduce USB hub between the host and the 
 >> >> >> webcam, I can not receive even any 320x240 frames.
 >> >> >>
 >> >> >> I've managed to use ftrace to see what is going on when no frames 
 >> >> >> are received.
 >> >> >> I've found that pwc_isoc_handler is called frequently as the 
 >> >> >> following:
 >> >> >>
 >> >> >>  0)   |  pwc_isoc_handler [pwc]() {
 >> >> >>  0)   |usb_submit_urb [usbcore]() {
 >> >> >>  0)   |  usb_submit_urb.part.3 [usbcore]() {
 >> >> >>  0)   |usb_hcd_submit_urb [usbcore]() {
 >> >> >>  0)   0.834 us|  usb_get_urb [usbcore]();
 >> >> >>  0)   |  musb_map_urb_for_dma [musb_hdrc]() {
 >> >> >>  0)   0.792 us|usb_hcd_map_urb_for_dma 
 >> >> >> [usbcore]();
 >> >> >>  0)   5.750 us|  }
 >> >> >>  0)   |  musb_urb_enqueue [musb_hdrc]() {
 >> >> >>  0)   0.750 us|_raw_spin_lock_irqsave();
 >> >> >>  0)   |usb_hcd_link_urb_to_ep [usbcore]() 
 >> >> >> {
 >> >> >>  0)   0.792 us|  _raw_spin_lock();
 >> >> >>  0)   0.791 us|  _raw_spin_unlock();
 >> >> >>  0) + 10.500 us   |}
 >> >> >>  0)   0.791 us|_raw_spin_unlock_irqrestore();
 >> >> >>  0) + 25.375 us   |  }
 >> >> >>  0) + 45.208 us   |}
 >> >> >>  0) + 51.042 us   |  }
 >> >> >>  0) + 

Re: [PATCH] [media] dw2102: Add support for Terratec Cinergy S2 USB BOX

2016-07-27 Thread Benjamin Larsson

On 07/18/2016 01:59 PM, Mauro Carvalho Chehab wrote:

It would be
nice if both Philipp and Benjamin test such patch, for us to be sure
that it would work for both.

Regards,
Mauro


I added it to the dvbsky driver so I guess that Philipp has to do the 
testing.


MvH
Benjamin Larsson
--
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


hello linux

2016-07-27 Thread JULIAN GARDNER
Good morning linux



http://test.professioneelinhuren.nl/individual.php?similar=yd1yds72wx3zd6gv


JULIAN
--
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-rc1] media updates part II: documentation

2016-07-27 Thread Mauro Carvalho Chehab
Hi Linus,

Please pull from:
  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v4.8-4

For media documentation updates.

This patch series does the conversion of all media documentation stuff
to Restrutured Text markup format and add them to the Documentation/index.rst
file. The media documentation was grouped into 4 books:
- media uAPI;
- media kAPI;
- V4L driver-specific documentation;
- DVB driver-specific documentation.

It also contains several documentation improvements.

Thanks!
Mauro

---

PS.: this is nearly identical to the previous pull request.
The only difference is that I removed an already applied patch
from the patch series.

A trivial conflict is expected when merging Documentation/index.rst,
as both my tree and Daniel Vetter's tree will be adding files there.


The following changes since commit 9c1958fc326a0a0a533ec8e86ea6fa30977207de:

  Merge tag 'media/v4.8-1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2016-07-26 
18:59:59 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v4.8-4

for you to fetch changes up to 85538b1ad145c67198cb55d02de14ba269cc323d:

  Merge branch 'topic/docs-next' into v4l_for_linus (2016-07-27 10:45:04 -0300)


media updates for v4.8-rc1


Hans Verkuil (5):
  [media] pixfmt-006.rst: add missing V4L2_YCBCR_ENC_SMPTE240M
  [media] vidioc-g-dv-timings.rst: document interlaced defines
  [media] doc-rst: update CEC_RECEIVE
  [media] doc-rst: improve CEC documentation
  [media] doc-rst: cec: update documentation

Markus Heiser (10):
  doc-rst: linux_tv DocBook to reST migration (docs-next)
  doc-rst: boilerplate HTML theme customization
  doc-rst: customize RTD theme, table & full width
  doc-rst: customize RTD theme, captions & inline literal
  doc-rst: auto-generate: fixed include "output/*.h.rst" content
  doc-rst: add kernel-include directive
  doc-rst: linux_tv/Makefile: Honor quiet make O=dir
  [media] doc-rst: linux_tv CEC part, DocBook to reST migration
  [media] doc-rst: linux_tc CEC enhanced markup
  [media] doc-rst: media: reordered top sectioning

Mauro Carvalho Chehab (313):
  Merge branch 'docs-next' of git://git.lwn.net/linux into devel/docs-next
  doc-rst: linuxt_tv: update the documentation year
  doc-rst: some fixups at linux_tv/index
  doc-rst: v4l2: Fix authors and revisions lists
  doc-rst: querycap: fix troubles on some references
  doc-rst: linux_tv/index: add xrefs for document divisions
  doc-rst: app-pri: Fix a bad reference
  doc-rst: video: use reference for VIDIOC_ENUMINPUT
  doc-rst: v4l2: numerate the V4L2 chapters
  doc-rst: video: Restore the captions for the examples
  doc-rst: audio: Fix some cross references
  doc-rst: linux_tv: Replace reference names to match ioctls
  doc-rst: linux_tv: simplify references
  doc-rst: linux_tv: convert lots of consts to references
  doc-rst: linux_tv: don't simplify VIDIOC_G_foo references
  doc-rst: audio: re-add captions for the examples
  doc-rst: standard: read the example captions
  doc-rst: linux_tv: remove controls
  doc-rst: control: read the example captions
  doc-rst: control: Fix missing reference for example 8
  doc-rst: extended-controls: use reference for VIDIOC_S_CTRL
  doc-rst: vidioc-queryctl: change the title of this chapter
  doc-rst: linux_tv: supress lots of warnings
  doc-rst: planar-apis: fix some conversion troubles
  doc-rst: crop: fix conversion on this file
  doc-rst: selection-api-005: Fix ReST parsing
  doc-rst: linux_tv: use Example x.y. instead of a single number
  doc-rst: selection-api-006: add missing captions
  doc-rst: linux_tv: Error codes should be const
  doc-rst: linux_tv: use references for structures
  doc-rst: linux_tv: Fix remaining undefined references
  doc-rst: pixfmt-007: Fix formula parsing
  doc-rst: fdl-appendix: Fix formatting issues
  doc-rst: linux_tv: fix some warnings due to '*'
  doc-rst: fe_property_parameters: improve descriptions
  doc-rst: vidioc-g-edid remove a duplicate declaration
  doc-rst: open: fix some warnings
  doc-rst: rw fix a warning
  doc-rst: extended-controls: "count" is a constant
  doc-rst: pixfmt-004: Add an extra reference
  doc-rst: linux_tv: remove trailing comments
  doc-rst: pixfmt-y12i: correct format conversion
  doc-rst: pixfmt-uyvy: remove an empty column
  doc-rst: pixfmt-yvyu: remove an empty column
  doc-rst: pixfmt-vyuy: remove an empty column
  doc-rst: pixfmt-41p: remove empty columns
  doc-rst: pixfmt-yuv422m: remove an empty column
  doc-rst: pixfmt-yuv444m: remove 

Re: [GIT PULL for v4.8-rc1] media updates part II: documentation

2016-07-27 Thread Mauro Carvalho Chehab
Em Wed, 27 Jul 2016 11:53:16 +0200
Hans Verkuil  escreveu:

> Hi Mauro, Linus,
> 
> On 07/27/2016 11:23 AM, Mauro Carvalho Chehab wrote:
> > Hi Linus,
> > 
> > Please pull from:
> >   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
> > tags/media/v4.8-4
> > 
> > For media documentation updates.
> > 
> > This patch series does the conversion of all media documentation stuff
> > to Restrutured Text markup format and add them to the 
> > Documentation/index.rst
> > file. The media documentation was grouped into 4 books:
> > - media uAPI;
> > - media kAPI;
> > - V4L driver-specific documentation;
> > - DVB driver-specific documentation.
> > 
> > It also contains several documentation improvements and one fixup patch for
> > a core issue with cropcap.  
> 
> FYI: the cropcap fixup patch (v4l2-ioctl: fix stupid mistake in cropcap 
> condition)
> is already upstream (it got merged just before 4.7 was released).
> 
> So that patch can be dropped.

True. Will resend the pull request without that patch.

> 
> Regards,
> 
>   Hans

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


Re: Memory freeing when dmabuf fds are exported with VIDIOC_EXPBUF

2016-07-27 Thread Laurent Pinchart
Hello Kobayashi-san,

(CC'ing Hans Verkuil and Marek Szyprowski)

On Wednesday 27 Jul 2016 16:51:47 Kazunori Kobayashi wrote:
> Hi,
> 
> I have a question about memory freeing by calling REQBUF(0) before all the
> dmabuf fds exported with VIDIOC_EXPBUF are closed.
> 
> In calling REQBUF(0), videobuf2-core returns -EBUSY when the reference count
> of a vb2 buffer is more than 1. When dmabuf fds are not exported (usual
> V4L2_MEMORY_MMAP case), the check is no problem, but when dmabuf fds are
> exported and some of them are not closed (in other words the references to
> that memory are left), we cannot succeed in calling REQBUF(0) despite being
> able to free the memory after all the references are dropped.
> 
> Actually REQBUF(0) does not force a vb2 buffer to be freed but decreases
> the refcount of it. Also all the vb2 memory allocators that support dmabuf
> exporting (dma-contig, dma-sg, vmalloc) implements memory freeing by
> release() of dma_buf_ops, so I think there is no need to return -EBUSY when
> exporting dmabuf fds.
> 
> Could you please tell me what you think?

I think you're right. vb2 allocates the vb2_buffer and the memops-specific 
structure separately. videobuf2-core.c will free the vb2_buffer instance, but 
won't touch the memops-specific structure or the buffer memory. Both of these 
are reference-counted in the memops allocators. We could thus allow REQBUFS(0) 
to proceed even when buffers have been exported (or at least after fixing the 
small issues we'll run into, I have a feeling that this is too easy to be 
true).

Hans, Marek, any opinion on this ?

> The code that I am talking about is in
> drivers/media/v4l2-core/videobuf2-core.c:
> 
>if (*count == 0 || q->num_buffers != 0 || q->memory != memory) {
>   /*
>* We already have buffers allocated, so first check if they
>* are not in use and can be freed.
>*/
>   mutex_lock(>mmap_lock);
>   if (q->memory == VB2_MEMORY_MMAP && __buffers_in_use(q)) {
>   mutex_unlock(>mmap_lock);
>   dprintk(1, "memory in use, cannot free\n");
>   return -EBUSY;
>   }

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] doc-rst: Remove the media docbook

2016-07-27 Thread Hans Verkuil


On 07/27/2016 11:32 AM, Mauro Carvalho Chehab wrote:
> Now that all media documentation was converted to Sphinx, we
> should get rid of the old DocBook one, as we don't want people
> to submit patches against the old stuff.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Acked-by: Hans Verkuil 

I'd like to take the opportunity to thank all those who worked so
hard on this, esp. Markus and Mauro. Great job!

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: [GIT PULL for v4.8-rc1] media updates part II: documentation

2016-07-27 Thread Hans Verkuil
Hi Mauro, Linus,

On 07/27/2016 11:23 AM, Mauro Carvalho Chehab wrote:
> Hi Linus,
> 
> Please pull from:
>   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
> tags/media/v4.8-4
> 
> For media documentation updates.
> 
> This patch series does the conversion of all media documentation stuff
> to Restrutured Text markup format and add them to the Documentation/index.rst
> file. The media documentation was grouped into 4 books:
>   - media uAPI;
>   - media kAPI;
>   - V4L driver-specific documentation;
>   - DVB driver-specific documentation.
> 
> It also contains several documentation improvements and one fixup patch for
> a core issue with cropcap.

FYI: the cropcap fixup patch (v4l2-ioctl: fix stupid mistake in cropcap 
condition)
is already upstream (it got merged just before 4.7 was released).

So that patch can be dropped.

Regards,

Hans

> 
> PS.: After this patch series, the media DocBook is deprecated and should
> be removed. I'll add such patch on a future pull request.
> 
> Thanks!
> Mauro
> 
> The following changes since commit 9c1958fc326a0a0a533ec8e86ea6fa30977207de:
> 
>   Merge tag 'media/v4.8-1' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2016-07-26 
> 18:59:59 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
> tags/media/v4.8-4
> 
> for you to fetch changes up to 9701e696fedbb70a26ecc1c28ece6a2c8e9f220c:
> 
>   Merge branch 'topic/docs-next' into v4l_for_linus (2016-07-27 06:12:29 
> -0300)
> 
> 
> media updates for v4.8-rc1
> 
> 
> Hans Verkuil (6):
>   [media] pixfmt-006.rst: add missing V4L2_YCBCR_ENC_SMPTE240M
>   [media] vidioc-g-dv-timings.rst: document interlaced defines
>   [media] doc-rst: update CEC_RECEIVE
>   [media] doc-rst: improve CEC documentation
>   [media] doc-rst: cec: update documentation
>   [media] v4l2-ioctl: fix stupid mistake in cropcap condition
> 
> Markus Heiser (10):
>   doc-rst: linux_tv DocBook to reST migration (docs-next)
>   doc-rst: boilerplate HTML theme customization
>   doc-rst: customize RTD theme, table & full width
>   doc-rst: customize RTD theme, captions & inline literal
>   doc-rst: auto-generate: fixed include "output/*.h.rst" content
>   doc-rst: add kernel-include directive
>   doc-rst: linux_tv/Makefile: Honor quiet make O=dir
>   [media] doc-rst: linux_tv CEC part, DocBook to reST migration
>   [media] doc-rst: linux_tc CEC enhanced markup
>   [media] doc-rst: media: reordered top sectioning
> 
> Mauro Carvalho Chehab (314):
>   Merge branch 'docs-next' of git://git.lwn.net/linux into devel/docs-next
>   doc-rst: linuxt_tv: update the documentation year
>   doc-rst: some fixups at linux_tv/index
>   doc-rst: v4l2: Fix authors and revisions lists
>   doc-rst: querycap: fix troubles on some references
>   doc-rst: linux_tv/index: add xrefs for document divisions
>   doc-rst: app-pri: Fix a bad reference
>   doc-rst: video: use reference for VIDIOC_ENUMINPUT
>   doc-rst: v4l2: numerate the V4L2 chapters
>   doc-rst: video: Restore the captions for the examples
>   doc-rst: audio: Fix some cross references
>   doc-rst: linux_tv: Replace reference names to match ioctls
>   doc-rst: linux_tv: simplify references
>   doc-rst: linux_tv: convert lots of consts to references
>   doc-rst: linux_tv: don't simplify VIDIOC_G_foo references
>   doc-rst: audio: re-add captions for the examples
>   doc-rst: standard: read the example captions
>   doc-rst: linux_tv: remove controls
>   doc-rst: control: read the example captions
>   doc-rst: control: Fix missing reference for example 8
>   doc-rst: extended-controls: use reference for VIDIOC_S_CTRL
>   doc-rst: vidioc-queryctl: change the title of this chapter
>   doc-rst: linux_tv: supress lots of warnings
>   doc-rst: planar-apis: fix some conversion troubles
>   doc-rst: crop: fix conversion on this file
>   doc-rst: selection-api-005: Fix ReST parsing
>   doc-rst: linux_tv: use Example x.y. instead of a single number
>   doc-rst: selection-api-006: add missing captions
>   doc-rst: linux_tv: Error codes should be const
>   doc-rst: linux_tv: use references for structures
>   doc-rst: linux_tv: Fix remaining undefined references
>   doc-rst: pixfmt-007: Fix formula parsing
>   doc-rst: fdl-appendix: Fix formatting issues
>   doc-rst: linux_tv: fix some warnings due to '*'
>   doc-rst: fe_property_parameters: improve descriptions
>   doc-rst: vidioc-g-edid remove a duplicate declaration
>   doc-rst: open: fix some warnings
>   doc-rst: rw fix a warning
>   doc-rst: extended-controls: "count" is a constant
>   

[PATCH] doc-rst: Remove the media docbook

2016-07-27 Thread Mauro Carvalho Chehab
Now that all media documentation was converted to Sphinx, we
should get rid of the old DocBook one, as we don't want people
to submit patches against the old stuff.

Signed-off-by: Mauro Carvalho Chehab 
---

Jon,

This patch should be applied after Linus handle my media documentation
pull request. Do you prefer to send the patch yourself, or if I do it?

 Documentation/DocBook/Makefile |   10 +-
 Documentation/DocBook/media/.gitignore |1 -
 Documentation/DocBook/media/Makefile   |  427 --
 Documentation/DocBook/media/bayer.png.b64  |  171 -
 Documentation/DocBook/media/constraints.png.b64|   59 -
 Documentation/DocBook/media/crop.gif.b64   |  105 -
 Documentation/DocBook/media/dvb/.gitignore |1 -
 Documentation/DocBook/media/dvb/audio.xml  | 1314 -
 Documentation/DocBook/media/dvb/ca.xml |  582 ---
 Documentation/DocBook/media/dvb/demux.xml  | 1162 -
 Documentation/DocBook/media/dvb/dvbapi.xml |  156 -
 Documentation/DocBook/media/dvb/dvbproperty.xml| 1680 --
 Documentation/DocBook/media/dvb/dvbstb.pdf |  Bin 1881 -> 0 bytes
 Documentation/DocBook/media/dvb/examples.xml   |  367 --
 .../media/dvb/fe-diseqc-recv-slave-reply.xml   |   78 -
 .../DocBook/media/dvb/fe-diseqc-reset-overload.xml |   51 -
 .../DocBook/media/dvb/fe-diseqc-send-burst.xml |   89 -
 .../media/dvb/fe-diseqc-send-master-cmd.xml|   72 -
 .../media/dvb/fe-enable-high-lnb-voltage.xml   |   61 -
 Documentation/DocBook/media/dvb/fe-get-info.xml|  266 -
 .../DocBook/media/dvb/fe-get-property.xml  |   81 -
 Documentation/DocBook/media/dvb/fe-read-status.xml |  107 -
 .../media/dvb/fe-set-frontend-tune-mode.xml|   64 -
 Documentation/DocBook/media/dvb/fe-set-tone.xml|   91 -
 Documentation/DocBook/media/dvb/fe-set-voltage.xml |   69 -
 Documentation/DocBook/media/dvb/frontend.xml   |  269 -
 .../DocBook/media/dvb/frontend_legacy_api.xml  |  654 ---
 Documentation/DocBook/media/dvb/intro.xml  |  211 -
 Documentation/DocBook/media/dvb/net.xml|  238 -
 Documentation/DocBook/media/dvb/video.xml  | 1968 ---
 Documentation/DocBook/media/dvbstb.png.b64 |  398 --
 Documentation/DocBook/media/fieldseq_bt.gif.b64|  447 --
 Documentation/DocBook/media/fieldseq_tb.gif.b64|  445 --
 Documentation/DocBook/media/nv12mt.gif.b64 |   37 -
 Documentation/DocBook/media/nv12mt_example.gif.b64 |  121 -
 Documentation/DocBook/media/pipeline.png.b64   |  213 -
 Documentation/DocBook/media/selection.png.b64  |  206 -
 .../DocBook/media/typical_media_device.svg |   28 -
 Documentation/DocBook/media/v4l/.gitignore |1 -
 Documentation/DocBook/media/v4l/biblio.xml |  381 --
 Documentation/DocBook/media/v4l/capture.c.xml  |  659 ---
 Documentation/DocBook/media/v4l/cec-api.xml|   75 -
 Documentation/DocBook/media/v4l/cec-func-close.xml |   64 -
 Documentation/DocBook/media/v4l/cec-func-ioctl.xml |   78 -
 Documentation/DocBook/media/v4l/cec-func-open.xml  |  104 -
 Documentation/DocBook/media/v4l/cec-func-poll.xml  |   94 -
 .../DocBook/media/v4l/cec-ioc-adap-g-caps.xml  |  151 -
 .../DocBook/media/v4l/cec-ioc-adap-g-log-addrs.xml |  329 --
 .../DocBook/media/v4l/cec-ioc-adap-g-phys-addr.xml |   86 -
 .../DocBook/media/v4l/cec-ioc-dqevent.xml  |  202 -
 Documentation/DocBook/media/v4l/cec-ioc-g-mode.xml |  255 -
 .../DocBook/media/v4l/cec-ioc-receive.xml  |  274 -
 Documentation/DocBook/media/v4l/common.xml | 1102 
 Documentation/DocBook/media/v4l/compat.xml | 2723 --
 Documentation/DocBook/media/v4l/controls.xml   | 5505 
 Documentation/DocBook/media/v4l/crop.pdf   |  Bin 5846 -> 0 bytes
 Documentation/DocBook/media/v4l/dev-capture.xml|  110 -
 Documentation/DocBook/media/v4l/dev-codec.xml  |   27 -
 Documentation/DocBook/media/v4l/dev-effect.xml |   17 -
 Documentation/DocBook/media/v4l/dev-event.xml  |   43 -
 Documentation/DocBook/media/v4l/dev-osd.xml|  149 -
 Documentation/DocBook/media/v4l/dev-output.xml |  106 -
 Documentation/DocBook/media/v4l/dev-overlay.xml|  368 --
 Documentation/DocBook/media/v4l/dev-radio.xml  |   49 -
 Documentation/DocBook/media/v4l/dev-raw-vbi.xml|  345 --
 Documentation/DocBook/media/v4l/dev-rds.xml|  196 -
 Documentation/DocBook/media/v4l/dev-sdr.xml|  126 -
 Documentation/DocBook/media/v4l/dev-sliced-vbi.xml |  706 ---
 Documentation/DocBook/media/v4l/dev-subdev.xml |  478 --
 Documentation/DocBook/media/v4l/dev-teletext.xml   |   29 -
 Documentation/DocBook/media/v4l/driver.xml |  200 -
 Documentation/DocBook/media/v4l/fdl-appendix.xml   |  671 ---
 Documentation/DocBook/media/v4l/fieldseq_bt.pdf|  Bin 9185 -> 0 bytes
 Documentation/DocBook/media/v4l/fieldseq_tb.pdf 

[GIT PULL for v4.8-rc1] media updates part II: documentation

2016-07-27 Thread Mauro Carvalho Chehab
Hi Linus,

Please pull from:
  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v4.8-4

For media documentation updates.

This patch series does the conversion of all media documentation stuff
to Restrutured Text markup format and add them to the Documentation/index.rst
file. The media documentation was grouped into 4 books:
- media uAPI;
- media kAPI;
- V4L driver-specific documentation;
- DVB driver-specific documentation.

It also contains several documentation improvements and one fixup patch for
a core issue with cropcap.

PS.: After this patch series, the media DocBook is deprecated and should
be removed. I'll add such patch on a future pull request.

Thanks!
Mauro

The following changes since commit 9c1958fc326a0a0a533ec8e86ea6fa30977207de:

  Merge tag 'media/v4.8-1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2016-07-26 
18:59:59 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v4.8-4

for you to fetch changes up to 9701e696fedbb70a26ecc1c28ece6a2c8e9f220c:

  Merge branch 'topic/docs-next' into v4l_for_linus (2016-07-27 06:12:29 -0300)


media updates for v4.8-rc1


Hans Verkuil (6):
  [media] pixfmt-006.rst: add missing V4L2_YCBCR_ENC_SMPTE240M
  [media] vidioc-g-dv-timings.rst: document interlaced defines
  [media] doc-rst: update CEC_RECEIVE
  [media] doc-rst: improve CEC documentation
  [media] doc-rst: cec: update documentation
  [media] v4l2-ioctl: fix stupid mistake in cropcap condition

Markus Heiser (10):
  doc-rst: linux_tv DocBook to reST migration (docs-next)
  doc-rst: boilerplate HTML theme customization
  doc-rst: customize RTD theme, table & full width
  doc-rst: customize RTD theme, captions & inline literal
  doc-rst: auto-generate: fixed include "output/*.h.rst" content
  doc-rst: add kernel-include directive
  doc-rst: linux_tv/Makefile: Honor quiet make O=dir
  [media] doc-rst: linux_tv CEC part, DocBook to reST migration
  [media] doc-rst: linux_tc CEC enhanced markup
  [media] doc-rst: media: reordered top sectioning

Mauro Carvalho Chehab (314):
  Merge branch 'docs-next' of git://git.lwn.net/linux into devel/docs-next
  doc-rst: linuxt_tv: update the documentation year
  doc-rst: some fixups at linux_tv/index
  doc-rst: v4l2: Fix authors and revisions lists
  doc-rst: querycap: fix troubles on some references
  doc-rst: linux_tv/index: add xrefs for document divisions
  doc-rst: app-pri: Fix a bad reference
  doc-rst: video: use reference for VIDIOC_ENUMINPUT
  doc-rst: v4l2: numerate the V4L2 chapters
  doc-rst: video: Restore the captions for the examples
  doc-rst: audio: Fix some cross references
  doc-rst: linux_tv: Replace reference names to match ioctls
  doc-rst: linux_tv: simplify references
  doc-rst: linux_tv: convert lots of consts to references
  doc-rst: linux_tv: don't simplify VIDIOC_G_foo references
  doc-rst: audio: re-add captions for the examples
  doc-rst: standard: read the example captions
  doc-rst: linux_tv: remove controls
  doc-rst: control: read the example captions
  doc-rst: control: Fix missing reference for example 8
  doc-rst: extended-controls: use reference for VIDIOC_S_CTRL
  doc-rst: vidioc-queryctl: change the title of this chapter
  doc-rst: linux_tv: supress lots of warnings
  doc-rst: planar-apis: fix some conversion troubles
  doc-rst: crop: fix conversion on this file
  doc-rst: selection-api-005: Fix ReST parsing
  doc-rst: linux_tv: use Example x.y. instead of a single number
  doc-rst: selection-api-006: add missing captions
  doc-rst: linux_tv: Error codes should be const
  doc-rst: linux_tv: use references for structures
  doc-rst: linux_tv: Fix remaining undefined references
  doc-rst: pixfmt-007: Fix formula parsing
  doc-rst: fdl-appendix: Fix formatting issues
  doc-rst: linux_tv: fix some warnings due to '*'
  doc-rst: fe_property_parameters: improve descriptions
  doc-rst: vidioc-g-edid remove a duplicate declaration
  doc-rst: open: fix some warnings
  doc-rst: rw fix a warning
  doc-rst: extended-controls: "count" is a constant
  doc-rst: pixfmt-004: Add an extra reference
  doc-rst: linux_tv: remove trailing comments
  doc-rst: pixfmt-y12i: correct format conversion
  doc-rst: pixfmt-uyvy: remove an empty column
  doc-rst: pixfmt-yvyu: remove an empty column
  doc-rst: pixfmt-vyuy: remove an empty column
  doc-rst: pixfmt-41p: remove empty columns
  doc-rst: pixfmt-yuv422m: remove an empty column
  doc-rst: pixfmt-yuv444m: remove empty columns
  doc-rst: pixfmt-yuv422p: 

Memory freeing when dmabuf fds are exported with VIDIOC_EXPBUF

2016-07-27 Thread Kazunori Kobayashi
Hi,

I have a question about memory freeing by calling REQBUF(0) before all the
dmabuf fds exported with VIDIOC_EXPBUF are closed.

In calling REQBUF(0), videobuf2-core returns -EBUSY when the reference count
of a vb2 buffer is more than 1. When dmabuf fds are not exported (usual 
V4L2_MEMORY_MMAP case),
the check is no problem, but when dmabuf fds are exported and some of them are
not closed (in other words the references to that memory are left),
we cannot succeed in calling REQBUF(0) despite being able to free the memory
after all the references are dropped.

Actually REQBUF(0) does not force a vb2 buffer to be freed but decreases
the refcount of it. Also all the vb2 memory allocators that support dmabuf 
exporting
(dma-contig, dma-sg, vmalloc) implements memory freeing by release() of 
dma_buf_ops,
so I think there is no need to return -EBUSY when exporting dmabuf fds.

Could you please tell me what you think?

The code that I am talking about is in drivers/media/v4l2-core/videobuf2-core.c:

   if (*count == 0 || q->num_buffers != 0 || q->memory != memory) {
  /*
   * We already have buffers allocated, so first check if they
   * are not in use and can be freed.
   */
  mutex_lock(>mmap_lock);
  if (q->memory == VB2_MEMORY_MMAP && __buffers_in_use(q)) {
  mutex_unlock(>mmap_lock);
  dprintk(1, "memory in use, cannot free\n");
  return -EBUSY;
  }

Regards,
Kobayashi
-- 
-
IGEL Co.,Ltd. Kazunori Kobayashi
kkoba...@igel.co.jp
http://www.igel.co.jp/
--
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: media: vb2-dma-contig: fix sizeof(pointer) allocation

2016-07-27 Thread Marek Szyprowski

Hi Alexey


On 2016-07-27 09:37, Alexey Dobriyan wrote:

Signed-off-by: Alexey Dobriyan 


A fix for this issue has been already queued:
https://patchwork.linuxtv.org/patch/35582/


---

  drivers/media/v4l2-core/videobuf2-dma-contig.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -749,7 +749,7 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_memops);
  int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
  {
if (!dev->dma_parms) {
-   dev->dma_parms = kzalloc(sizeof(dev->dma_parms), GFP_KERNEL);
+   dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
}




Best regards
--
Marek Szyprowski, PhD
Samsung R Institute Poland

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


media: vb2-dma-contig: fix sizeof(pointer) allocation

2016-07-27 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan 
---

 drivers/media/v4l2-core/videobuf2-dma-contig.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -749,7 +749,7 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_memops);
 int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
 {
if (!dev->dma_parms) {
-   dev->dma_parms = kzalloc(sizeof(dev->dma_parms), GFP_KERNEL);
+   dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
}
--
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