Commit Graph

312 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab
9e3d073009 [media] docs-rst: cleanup SVG files
The SVG files are larger than the draw dimentions, have long
lines and aren't cleaned. Use inkscape to automatically fix
those issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-17 09:07:13 -02:00
Mauro Carvalho Chehab
a45267ae40 [media] dtv-core: get rid of duplicated kernel-doc include
Somehow, two DVB headers were included twice. Remove the
duplication

Reported-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-17 09:03:18 -02:00
Kieran Bingham
4710b752e0 [media] v4l: Add Renesas R-Car FDP1 Driver
The FDP1 driver performs advanced de-interlacing on a memory 2 memory
based video stream, and supports conversion from YCbCr/YUV
to RGB pixel formats

Signed-off-by: Kieran Bingham <kieran+renesas@bingham.xyz>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 16:21:54 -02:00
Laurent Pinchart
446e412597 [media] v4l: ctrls: Add deinterlacing mode control
The menu control selects the operation mode of a video deinterlacer. The
menu entries are driver specific.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran@bingham.xyz>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 16:16:08 -02:00
Mauro Carvalho Chehab
71334ae42d [media] cec-ioc-adap-g-log-addrs.rst: describe CEC_LOG_ADDRS_FL_CDC_ONLY
The CEC_LOG_ADDRS_FL_CDC_ONLY flag is missing at the documentation,
causing this warning:
	Documentation/output/cec.h.rst:6: WARNING: undefined label: cec-log-addrs-fl-cdc-only (if the link has no caption the label must precede a section header)

Add a documentation for it, based on the commit that introduced the
flag.

Fixes: a69a168a1b ("[media] cec: add proper support for CDC-Only CEC devices")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 16:04:45 -02:00
Hans Verkuil
0dbacebede [media] cec: move the CEC framework out of staging and to media
The last open issues have been addressed, so it is time to move
this out of staging and into the mainline and to move the public
cec headers to include/uapi/linux.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:40:20 -02:00
Hans Verkuil
f5580d8d6f [media] cec: accept two replies for CEC_MSG_INITIATE_ARC
The CEC_MSG_INITIATE_ARC message is special since it is the ONLY
CEC message that accepts two possible valid replies:

CEC_MSG_REPORT_ARC_INITIATED and CEC_MSG_REPORT_ARC_TERMINATED.

So if the transmitted message is CEC_MSG_INITIATE_ARC and the remote
side replied with CEC_MSG_REPORT_ARC_INITIATED or CEC_MSG_REPORT_ARC_TERMINATED,
then a msg->reply value of CEC_MSG_REPORT_ARC_INITIATED or
CEC_MSG_REPORT_ARC_TERMINATED will match either reply.

I thought about either adding a second reply2 field, but that's ugly
for all other messages that have only one reply, and what if in the
future a new message is added that can have three replies?

Another option would be to add a cec_msg flag, but really, the combination
of CEC_MSG_REPORT_ARC_INITIATED and a reply value of one of the two
possible replies already functions as a flag.

Another advantage of this approach is that it is safe to re-use a
cec_msg struct. No need to zero a flags field or a reply2 field.

So since this really is an exception in the CEC specification, I
decided to implement it as an exception as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:34:55 -02:00
Hans Verkuil
adc0c62278 [media] cec: add CEC_MSG_FL_REPLY_TO_FOLLOWERS
Give the caller more control over how replies to a transmit are
handled. By default the reply will only go to the filehandle that
called CEC_TRANSMIT. If this new flag is set, then the reply will
also go to all followers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:32:56 -02:00
Hans Verkuil
f4062625ed [media] cec: add flag to cec_log_addrs to enable RC passthrough
By default the CEC_MSG_USER_CONTROL_PRESSED/RELEASED messages
are passed on to the follower(s) only. If the new
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU flag is set in the
flags field of struct cec_log_addrs then these messages are also
passed on to the remote control input subsystem and they will appear
as keystrokes.

This used to be the default behavior, but now you have to explicitly
enable it. This is done to force the caller to think about possible
security issues (e.g. if these messages are used to enter passwords).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:32:07 -02:00
Hans Verkuil
77edf603f2 [media] cec rst: convert tables and drop the 'row' comments
This uses Laurent's python script to convert all tables, dropping
the useless 'row' comments.

See commit c2b66cafdf ("[media] v4l: doc: Remove row numbers from tables")
for the script that was used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:30:54 -02:00
Hans Verkuil
93d39efdb1 [media] control.rst: improve the queryctrl code examples
The code examples on how to enumerate controls were really long in the
tooth. Update them.

Using FLAG_NEXT_CTRL is preferred these days, so give that example first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:27:11 -02:00
Hans Verkuil
e92ca73b70 [media] cec-core.rst: improve documentation
Improve the internal CEC documentation. In particular add a section
that specifies that transmit-related interrupts should be processed
before receive interrupts.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 15:26:13 -02:00
Hans Verkuil
a5e18f1401 [media] vidioc-g-dv-timings.rst: document the new dv_timings flags
Document the new flags.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 14:37:57 -02:00
Sakari Ailus
708f48e76d [media] v4l: Document that m2m devices have a file handle specific context
Memory-to-memory V4L2 devices all have file handle specific context.
Say this in the API documentation so that the user space may rely on it
being the case.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:29:44 -02:00
Masanari Iida
84512f3e1c [media] v4l: doc: Fix typo in vidioc-g-tuner.rst
This patch fix spelling typos found in vidioc-g-tuner.rst

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16 13:22:02 -02:00
Mauro Carvalho Chehab
3907fae86e [media] cardlist: convert them to asciiart tables
Instead of using codeblock for the cardlists, use tables, in
order to improve their visual when presenting them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 07:23:50 -02:00
Mauro Carvalho Chehab
9fd79cf350 [media] gspca-cardlist.rst: update camera names
For those cameras that were missing descriptions, update using
some web research:
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_STV0680.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_ZC3XX.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_KINECT.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SPCA561.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_VICAM.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_DTCS033.html
	https://bugs.launchpad.net/ubuntu/+source/linux/+bug/564979
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_PAC7302.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SONIXB.html
	https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SONIXJ.html

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 07:22:40 -02:00
Mauro Carvalho Chehab
c3739983d4 [media] gspca-cardlist.rst: update cardlist from drivers USB IDs
There are several missing USB IDs that are defined on gspca
drivers. Add them.

The missing entries were found/created using the following script:

<script>
use strict;
use File::Find;

my $src = "drivers/media/usb/gspca/";
my $table = 0;
my %data;

my $id;

my $len = 0;

open IN, "Documentation/media/v4l-drivers/gspca-cardlist.rst";
while (<IN>) {
	if (m/^=+\s+=+\s+=+$/) {
		$table++;
		next;
	}
	next if ($table != 2);
	if (m/^(\S+)\s+(\S+)\s+(.*)/) {
		$id = "$1_$2";
		$data{$id}->{driver} = $1;
		$data{$id}->{usb_id} = $2;
		$data{$id}->{name} = $3;
		$data{$id}->{valid} = 0;

		$len = length($3) if (length($3) > $len);
	}
}
close IN;

sub parse_dir {
        my $file = $File::Find::name;

	open IN, $file;

	my $driver = $file;

	$driver =~ s,($src),,;

	$driver =~ s,/.*,,;
	$driver =~ s,\.c$,,;

	while (<IN>) {
		next if (m,/\*.*USB_DEVICE,);
		if (m/USB_DEVICE[^\(]*\(\s*0x(\S+)\s*\,\s*0x(\S+)\)(.*)/) {
			my $n = "$1:$2";
			my $o = $3;
			$id = "${driver}_$n";

			$data{$id}->{valid} = 1;

			next if (defined $data{$id}->{driver});

			$data{$id}->{driver} = $driver;
			$data{$id}->{usb_id} = $n;

			if ($o =~ m,\/\*\s*(.*)\*\/,) {
				$n = $1;
				$n =~ s/\s+//;
				$data{$id}->{name} = $n;
			} else {
				$data{$id}->{name} = "";
			}
		}
	}
	close IN;
}

find({wanted => \&parse_dir, no_chdir => 1}, $src);

print "The gspca cards list\n";
print "====================\n\n";
print "The modules for the gspca webcam drivers are:\n\n";
print "- gspca_main: main driver\n";
print "- gspca\\_\\ *driver*: subdriver module with *driver* as follows\n\n";
print "=========	=========	" . "=" x $len . "\n";
print "*driver*	vend:prod	Device\n";
print "=========	=========	" . "=" x $len . "\n";

foreach my $id (sort { $data{$a}->{usb_id} . $data{$a}->{driver} cmp $data{$b}->{usb_id} . $data{$b}->{driver} } keys %data) {
	next if (!$data{$id}->{valid});

	my $s = sprintf "%-15s %s\t%s\n",
		$data{$id}->{driver}, $data{$id}->{usb_id}, $data{$id}->{name};

	# Replace tabs by spaces
	$s =~ s/[ \t]+$//;
        $s =~ s<^ {8}> <\t>;
        $s =~ s<^ {1,7}\t> <\t>;
        $s =~ s< {1,7}\t> <\t>;

	printf $s;
}
print "=========	=========	" . "=" x $len . "\n";
</script>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 07:22:01 -02:00
Mauro Carvalho Chehab
959fe10443 [media] gspca-cardlist.rst: sort entries and adjust table margins
Some entries are out of order.

While here, clear spaces/tabs.

The content remains the same, with the exeption of one duplicated
entry from the same driver, where two different brand names share
the same entry. The content of such cell was merged, using a
comma.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24 07:19:59 -02:00
Ricardo Ribalda Delgado
5f3d32ec73 [media] Documentation: Add HSV encodings
Describe the hsv_enc field and its use.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 15:53:19 -02:00
Ricardo Ribalda Delgado
05b6f8a552 [media] Documentation: Add Ricardo Ribalda
My initials were on the Changelog, but there was no link to my name.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 15:46:42 -02:00
Ricardo Ribalda Delgado
9bef7546b0 [media] Documentation: Add HSV format
Describe the HSV formats

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 15:46:17 -02:00
Hans Verkuil
a0345caf7f [media] pixfmt-reserved.rst: Improve MT21C documentation
Improve the MT21C documentation, making it clearer that this format
requires the MDP for further processing.

Also fix the fourcc (it was a fivecc :-) )

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 12:09:52 -02:00
Tiffany Lin
a38b7ce98b [media] docs-rst: Add compressed video formats used on MT8173 codec driver
Add V4L2_PIX_FMT_MT21C documentation

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 12:09:35 -02:00
Tiffany Lin
988fcf0c0e [media] Add documentation for V4L2_PIX_FMT_VP9
Add documentation for V4L2_PIX_FMT_VP9.

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Wu-Cheng Li <wuchengli@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21 12:09:31 -02:00
Mauro Carvalho Chehab
9fce0c2265 Linux 4.8
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJX8Zc4AAoJEHm+PkMAQRiGQG8H/2Hd4IwJh75snGY5LAiWt6ra
 kGM/SobvLAMtcoxXCeHqf2bZrxa2Zz9tnEzhuLMGaf9a3l79xHa8YumK5KS1JPGV
 6lZBvuPi8BIyT0cpYH000e5ehHfhP6pSGJKZ2EuLv43HcBeVZEGAf3/8jSAlNA15
 bwFy2ZEkwJGThbnT6au0Y3s9h8LcNjtllu9hjfb+/9oNGvp8r4QhdVodIqIQ4cv6
 SeUfv7Pn2LZDMCSaTP9bh2KaR4dwYZHFsVe75x2wND5Sfq7DVBBfFkAoV/RwJDTM
 gBc3PNnmzb/tix6ohOrSQnSiGsXv1uASxvHH3RD2zG6g7Aj9Eq/+Z7ZdPu2+o+U=
 =U+ef
 -----END PGP SIGNATURE-----

Merge tag 'v4.8' into patchwork

Linux 4.8

* tag 'v4.8': (1761 commits)
  Linux 4.8
  ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
  MIPS: CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems
  include/linux/property.h: fix typo/compile error
  ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock()
  mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page()
  MAINTAINERS: Switch to kernel.org email address for Javi Merino
  x86/entry/64: Fix context tracking state warning when load_gs_index fails
  x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we don't have CPUID
  x86/vdso: Fix building on big endian host
  x86/boot: Fix another __read_cr4() case on 486
  sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock
  sctp: change to check peer prsctp_capable when using prsctp polices
  sctp: remove prsctp_param from sctp_chunk
  sctp: move sent_count to the memory hole in sctp_chunk
  tg3: Avoid NULL pointer dereference in tg3_io_error_detected()
  x86/init: Fix cr4_init_shadow() on CR4-less machines
  MIPS: Fix detection of unsupported highmem with cache aliases
  MIPS: Malta: Fix IOCU disable switch read for MIPS64
  MIPS: Fix BUILD_ROLLBACK_PROLOGUE for microMIPS
  ...
2016-10-05 16:43:53 -03:00
Mauro Carvalho Chehab
e383ce0736 [media] get rid of a number of problems at the cross references
As warned by linuxdoc[1] tool, using:

$ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

    include/media/v4l2-dev.h:118 :WARN: function name from comment differs:  v4l2_prio_close <--> v4l2_prio_check
    include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs:  if_vid_dec_index <--> if_vid_dec_pad_index
    include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs:  if_aud_dec_index <--> if_aud_dec_pad_index
    include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs:  v4l2_m2m_num_src_bufs_ready <--> v4l2_m2m_num_dst_bufs_ready
    drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs:  cintlog2 <--> intlog2
    include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs:  s_radio <--> v4l2_subdev_tuner_ops
    include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs:  v4l2_set_subdevdata <--> v4l2_set_subdev_hostdata
    include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs:  v4l2_get_subdevdata <--> v4l2_get_subdev_hostdata
    drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs:  dvb_ringbuffer_writeuser <--> dvb_ringbuffer_write_user
    include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs:  vb2_ops <--> vb2_buf_ops
    include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
    include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs:  media_entity_enum_test <--> media_entity_enum_test_and_set
    include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs:  gobj_to_entity <--> gobj_to_pad
    include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs:  gobj_to_entity <--> gobj_to_link
    include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs:  gobj_to_entity <--> gobj_to_intf
    include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs:  gobj_to_entity <--> intf_to_devnode
    include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs:  rc_open <--> rc_close
    include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
    include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs:  v4l2_prio_close <--> v4l2_prio_check
    include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

[1] https://return42.github.io/linuxdoc/linux.html

The above are real issues at the documentation. On several cases,
caused by cut-and-paste.

 Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-22 10:00:23 -03:00
Laurent Pinchart
c2b66cafdf [media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.

All changes have been generated by the following script.

import io
import re
import sys

def process_table(fname, data):
	if fname.endswith('hist-v4l2.rst'):
		data = re.sub(u'\n{1,2}\t( ?)  -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
		data = re.sub(u'\n(\t|       )-  \.\. row [0-9]+\n\t  ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
	else:
		data = re.sub(u'\n{1,2}       -( ?) ?', u'\n      -\\1', data, flags = re.MULTILINE)
		data = re.sub(u'(\n?)(\n\n    -  \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. row [0-9]+\n      -( ?) ?', u'    * -\\1', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. row [0-9]+\n       \.\. (_[A-Z0-9_`-]*:)', u'\n    -  .. \\1', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. (_[A-Z0-9_`-]*:)\n      -', u'    * .. \\1\n\n      -', data, flags = re.MULTILINE)
		data = re.sub(u'^       - ', u'      -', data, flags = re.MULTILINE)
		data = re.sub(u'^(\t{1,2})  ', u'\\1', data, flags = re.MULTILINE)

	return data

def process_file(fname, data):
	buf = io.StringIO(data)
	output = ''
	in_table = False
	table_separator = 0

	for line in buf.readlines():
		if line.find('.. flat-table::') != -1:
			in_table = True
			table = ''
		elif in_table and not re.match('^[\t\n]|(    )', line):
			in_table = False
			output += process_table(fname, table)

		if in_table:
			table += line
		else:
			output += line

	if in_table:
		in_table = False
		output += process_table(fname, table)

	return output

fname = sys.argv[1]

data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-22 07:03:14 -03:00
Laurent Pinchart
c19584882a [media] v4l: doc: Prepare for table reorganization
Fix a few indentation issues to enable automated table reorganization
by a regex-based script.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-22 06:50:03 -03:00
Mauro Carvalho Chehab
4053aad5f1 [media] videodev2.h.rst.exceptions: fix warnings
Changeset ab6343956f9c ("[media] V4L2: Add documentation for SDI timings
and related flags") added documentation for new V4L2 defines, but
it forgot to update videodev2.h.rst.exceptions to point to where
the documentation for those new values will be inside the book,
causing those warnings:

    Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-dv-bt-std-sdi (if the link has no caption the label must precede a section header)
    Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-dv-fl-first-field-extra-line (if the link has no caption the label must precede a section header)
    Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-in-st-no-v-lock (if the link has no caption the label must precede a section header)
    Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-in-st-no-std-lock (if the link has no caption the label must precede a section header)

Fixes: ab6343956f9c ("[media] V4L2: Add documentation for SDI timings and related flags")

Cc: Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19 14:34:42 -03:00
Charles-Antoine Couret
e74c8cda4c [media] V4L2: Add documentation for SDI timings and related flags
Describe new needed constants defined by SDI format.

Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19 14:34:41 -03:00
Hans Verkuil
09d6e35fdf [media] v4l-drivers/fourcc.rst: fix typo
Linux4Linux -> Video4Linux

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19 12:54:07 -03:00
Sakari Ailus
82dec0a7db [media] media: Add 1X16 16-bit raw bayer media bus code definitions
The codes will be called:

	MEDIA_BUS_FMT_SBGGR16_1X16
	MEDIA_BUS_FMT_SGBRG16_1X16
	MEDIA_BUS_FMT_SGRBG16_1X16
	MEDIA_BUS_FMT_SRGGB16_1X16

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:16:36 -03:00
Jouni Ukkonen
cfe4135994 [media] media: Add 1X14 14-bit raw bayer media bus code definitions
The codes will be called:

	MEDIA_BUS_FMT_SBGGR14_1X14
	MEDIA_BUS_FMT_SGBRG14_1X14
	MEDIA_BUS_FMT_SGRBG14_1X14
	MEDIA_BUS_FMT_SRGGB14_1X14

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:15:50 -03:00
Sakari Ailus
e42c475418 [media] doc-rst: 16-bit BGGR is always 16 bits
The V4L2_PIX_FMT_SBGGR16 format is documented to contain samples of fewer
than 16 bits. However, we do have specific definitions for smaller sample
sizes. Therefore, this note is redundant from the API point of view.

Currently only two drivers, am437x and davinci, use the
V4L2_PIX_FMT_SBGGR16 pixelformat currently. The sampling precision is
understood to be 16 bits in all current cases.

Remove the note on sampling precision.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:09:38 -03:00
Sakari Ailus
96c59bfbf6 [media] doc-rst: Unify documentation of the 8-bit bayer formats
The other raw bayer formats had a single sample depth dependent definition
whereas the 8-bit formats had one page for each. Unify the documentation
of the 8-bit formats.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:08:47 -03:00
Sakari Ailus
88646d37da [media] doc-rst: Clean up raw bayer pixel format definitions
- Explicitly state that the most significant n bits are zeroed on 10 and
  12 bpp formats.
- Remove extra comma from the last entry of the format list
- Add a missing colon before a list
- Use figures versus word numerals consistently

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:07:29 -03:00
Sakari Ailus
f5176d3807 [media] doc-rst: Fix number of zeroed high order bits in 12-bit raw format defs
The number of high order bits in samples was documented to be 6 for 12-bit
data. This is clearly wrong, fix it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:06:47 -03:00
Sakari Ailus
72e8138c5d [media] doc-rst: Correct the ordering of LSBs of the 10-bit raw packed formats
The 10-bit packed raw bayer format documented that the data of the first
pixel of a four-pixel group was found in the first byte and the two
highest bits of the fifth byte. This was not entirely correct. The two
bits in the fifth byte are the two lowest bits. The second pixel occupies
the second byte and third and fourth least significant bits and so on.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 11:04:04 -03:00
Mauro Carvalho Chehab
434b67c578 [media] conf_nitpick.py: ignore C domain data used on vb2
Ignore external C domain structs and functions used by VB2
header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:18:07 -03:00
Mauro Carvalho Chehab
bcb53f0708 [media] conf_nitpick.py: ignore an opaque struct from v4l2-mem2mem.h
The v4l2_m2m_dev is opaque: its meaning is only known by
v4l2-mem2mem.c. Ignore it on nitpick mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:14:14 -03:00
Mauro Carvalho Chehab
e9de2d89a7 [media] docs-rst: fix two wrong :name: tags
There's a typo there, causing 4 warnings:

  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: name
  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: lirc
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: name
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: v4l2

 Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:58:26 -03:00
Mauro Carvalho Chehab
16f8306b34 [media] media-ioc-g-topology.rst: fix a c domain reference
One reference there is still using :ref:. Fix it, to solve this
warning:
  Documentation/media/uapi/mediactl/media-ioc-g-topology.rst:236: WARNING: undefined label: media-v2-intf-devnode (if the link has no caption the label must precede a section header)

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:58:06 -03:00
Mauro Carvalho Chehab
8b98db6b2b [media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0
The struct v4l2_mpeg_vbi_ITV0 is identical to struct v4l2_mpeg_vbi_itv0,
except by its size, and it is documented at the same place at the
book.

Fix cross reference for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:57:44 -03:00
Mauro Carvalho Chehab
56683d7dea [media] docs-rst: fix cross-references for videodev2.h
There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:

	# funcs is a file with the broken functions/references
	for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); do
		i=${i//-/_}
		echo $i
		j=${i//_/-}
		for k in $(git grep -l "_$j:" Documentation/); do
			sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/media/*.exceptions); do
			sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/); do
			sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a && mv a $k
		done
		for k in $(git grep -l "<$j>" include/media); do
			sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a $k
		done
	done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:57:23 -03:00
Mauro Carvalho Chehab
be831b34c2 [media] hist-v4l2.rst: don't do refs to old structures
Several structs were renamed or removed during V4L2 development.
Don't try to cross-reference the legacy ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:56:53 -03:00
Mauro Carvalho Chehab
e452134cee [media] libv4l-introduction.rst: improve crossr-references
Use C cross-references to mention the V4L2 API calls on all
places it occurs inside this file.

While here, also mark constants as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:56:33 -03:00
Mauro Carvalho Chehab
9281f251be [media] libv4l-introdution.rst: fix function definitions
c:type is not the right tag for function definitions.
Replace them by .. c:function::

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:56:03 -03:00
Mauro Carvalho Chehab
39b6b9005f [media] fix clock_gettime cross-references
Fix those warnings:

	Documentation/media/uapi/cec/cec-ioc-dqevent.rst:124: WARNING: c:func reference target not found: clock_gettime(2)

By replacing it with the right function name, using this shell script:

	for i in `find Documentation/media -type f`; do sed 's,clock_gettime(2),clock_gettime,' <$i >a && mv a $i; done

Please notice that this will make the nitpick mode to shut up
complaining about that, becasue clock_gettime is on its exclude list,
but the cross reference will be undefined until someone documents
this function at the core documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:55:43 -03:00
Mauro Carvalho Chehab
a17a954efd [media] docs-rst: fix some broken struct references
The :c:type: references point to the structure name, and not to
struct foo.

Fixed via this shell script:

	for i in `find Documentation/media -type f`; do perl -ne 'if (s/\:c\:type\:\`struct\s*(\S+)\`/struct :c:type:`$1`/) { s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  } print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:55:18 -03:00