Re: Submit media entity without media device

2016-08-16 Thread Sakari Ailus
Hi Ramiro,

On Tue, Aug 16, 2016 at 04:13:46PM +0100, Ramiro Oliveira wrote:
> Just adding some people to the CC list.
> 
> 
> On 28-06-2016 13:00, Ramiro Oliveira wrote:
> > Hi all,
> >
> > We at Synopsys have a media device driver and in that media device we have a
> > media entity for our CSI-2 Host.
> >
> > At the moment we aren't ready to submit the entire media device, so I was
> > wondering if it was possible to submit a media entity driver separately, 
> > without
> > the rest of the architecture, and if so where should we place it.

Just the CSI-2 receiver support should be fine. You can then extend it later
on to cover more functionality. A media device is still needed: media
entities may not exist without the media device. The media graph may well be
amended later on. (But changing what's already there should be avoided as it
changes the user space interface.)

Pick a name, typically hardware block names or such work the best in such
cases. If yours is a platform driver it'll go under
drivers/media/platform (PCI goes under pci and so on).

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-08-16 Thread Hans Verkuil
On 08/16/2016 11:29 PM, Steve Preston wrote:
> I realize this is a long shot but I was directed to this mailing list as one 
> possibility  . 
>  
> I work with a group of amateur astronomers who use analog video cameras to 
> record occultations ( www.occulations.org ).  Several observers have been 
> using the StarTech SVID2USB2 class of analog capture devices (USB dongle) 
> under Windows.  The StarTech devices are one of the few such devices which 
> are readily available today. These StarTech devices seemed to be based on the 
> empia 28xx + SAA71xx chipset devices which have some support in the linux 
> kernel.  Unfortunately, we are having trouble with the StarTech devices in 
> Linux.  Does anyone on this list know of anyone in the linxtv.org (or 
> related) community that might be willing to help us modify a current driver 
> to enable the StarTech device(s)?  Or, do you know of anyone who currently 
> works with analog video capture hardware in linux who might be willing to 
> provide other ideas?

Usually adding support for a new device is a matter of adding an entry to 
drivers/media/usb/em28xx/em28xx-cards.c.

Something like the EM2860_BOARD_TYPHOON_DVD_MAKER could be a starting point 
since it seems very similar.

I'm assuming that the problem is that the device isn't recognized, but since 
you don't actually say what the problem is I might be wrong...

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


[RFC PATCH 4/7] ov7670: get xvclk

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

Get the clock for this sensor.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/ov7670.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index fe527b2..57adf3d 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -10,6 +10,7 @@
  * This file may be distributed under the terms of the GNU General
  * Public License, version 2.
  */
+#include 
 #include 
 #include 
 #include 
@@ -18,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -228,6 +230,7 @@ struct ov7670_info {
struct v4l2_ctrl *hue;
};
struct ov7670_format_struct *fmt;  /* Current format */
+   struct v4l2_clk *clk;
int min_width;  /* Filter out smaller sizes */
int min_height; /* Filter out smaller sizes */
int clock_speed;/* External clock speed (MHz) */
@@ -1588,8 +1591,19 @@ static int ov7670_probe(struct i2c_client *client,
info->pclk_hb_disable = true;
}
 
+   info->clk = v4l2_clk_get(&client->dev, "xvclk");
+   if (IS_ERR(info->clk))
+   return -EPROBE_DEFER;
+   v4l2_clk_enable(info->clk);
+
+   info->clock_speed = v4l2_clk_get_rate(info->clk) / 100;
+   if (info->clock_speed < 12 ||
+   info->clock_speed > 48)
+   return -EINVAL;
+
/* Make sure it's an ov7670 */
ret = ov7670_detect(sd);
+
if (ret) {
v4l_dbg(1, debug, client,
"chip found @ 0x%x (%s) is not an ov7670 chip.\n",
@@ -1682,6 +1696,7 @@ static int ov7670_remove(struct i2c_client *client)
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&sd->entity);
 #endif
+   v4l2_clk_put(info->clk);
return 0;
 }
 
-- 
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


[RFC PATCH 6/7] atmel-isi: remove dependency of the soc-camera framework

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

This patch converts the atmel-isi driver from a soc-camera driver to a driver
that is stand-alone.

Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/soc_camera/Kconfig |3 +-
 drivers/media/platform/soc_camera/atmel-isi.c | 1216 +++--
 2 files changed, 721 insertions(+), 498 deletions(-)

diff --git a/drivers/media/platform/soc_camera/Kconfig 
b/drivers/media/platform/soc_camera/Kconfig
index 39f6641..f74e358 100644
--- a/drivers/media/platform/soc_camera/Kconfig
+++ b/drivers/media/platform/soc_camera/Kconfig
@@ -54,9 +54,8 @@ config VIDEO_SH_MOBILE_CEU
 
 config VIDEO_ATMEL_ISI
tristate "ATMEL Image Sensor Interface (ISI) support"
-   depends on VIDEO_DEV && SOC_CAMERA
+   depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA
depends on ARCH_AT91 || COMPILE_TEST
-   depends on HAS_DMA
select VIDEOBUF2_DMA_CONTIG
---help---
  This module makes the ATMEL Image Sensor Interface available
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 30211f6..9947acb 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -22,18 +22,22 @@
 #include 
 #include 
 #include 
-
-#include 
-#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
 
 #include "atmel-isi.h"
 
-#define MAX_BUFFER_NUM 32
 #define MAX_SUPPORT_WIDTH  2048
 #define MAX_SUPPORT_HEIGHT 2048
-#define VID_LIMIT_BYTES(16 * 1024 * 1024)
 #define MIN_FRAME_RATE 15
 #define FRAME_INTERVAL_MILLI_SEC   (1000 / MIN_FRAME_RATE)
 
@@ -65,9 +69,39 @@ struct frame_buffer {
struct list_head list;
 };
 
+struct isi_graph_entity {
+   struct device_node *node;
+   struct media_entity *entity;
+   struct v4l2_subdev_pad_config *config;
+
+   struct v4l2_async_subdev asd;
+   struct v4l2_subdev *subdev;
+};
+
+/*
+ * struct isi_format - ISI media bus format information
+ * @fourcc:Fourcc code for this format
+ * @mbus_code: V4L2 media bus format code.
+ * @bpp:   Bytes per pixel (when stored in memory)
+ * @swap:  Byte swap configuration value
+ * @support:   Indicates format supported by subdev
+ * @skip:  Skip duplicate format supported by subdev
+ */
+struct isi_format {
+   u32 fourcc;
+   u32 mbus_code;
+   u8  bpp;
+   u32 swap;
+
+   boolsupport;
+   boolskip;
+};
+
+
 struct atmel_isi {
/* Protects the access of variables shared with the ISR */
-   spinlock_t  lock;
+   spinlock_t  irqlock;
+   struct device   *dev;
void __iomem*regs;
 
int sequence;
@@ -76,7 +110,7 @@ struct atmel_isi {
struct fbd  *p_fb_descriptors;
dma_addr_t  fb_descriptors_phys;
struct  list_head dma_desc_head;
-   struct isi_dma_desc dma_desc[MAX_BUFFER_NUM];
+   struct isi_dma_desc dma_desc[VIDEO_MAX_FRAME];
boolenable_preview_path;
 
struct completion   complete;
@@ -90,9 +124,22 @@ struct atmel_isi {
struct list_headvideo_buffer_list;
struct frame_buffer *active;
 
-   struct soc_camera_host  soc_host;
+   struct v4l2_device  v4l2_dev;
+   struct video_device *vdev;
+   struct v4l2_async_notifier  notifier;
+   struct isi_graph_entity entity;
+   struct v4l2_format  fmt;
+
+   struct isi_format   **user_formats;
+   unsigned intnum_user_formats;
+   const struct isi_format *current_fmt;
+
+   struct mutexlock;
+   struct vb2_queuequeue;
 };
 
+#define notifier_to_isi(n) container_of(n, struct atmel_isi, notifier)
+
 static void isi_writel(struct atmel_isi *isi, u32 reg, u32 val)
 {
writel(val, isi->regs + reg);
@@ -102,107 +149,46 @@ static u32 isi_readl(struct atmel_isi *isi, u32 reg)
return readl(isi->regs + reg);
 }
 
-static u32 setup_cfg2_yuv_swap(struct atmel_isi *isi,
-   const struct soc_camera_format_xlate *xlate)
-{
-   if (xlate->host_fmt->fourcc == V4L2_PIX_FMT_YUYV) {
-   /* all convert to YUYV */
-   switch (xlate->code) {
-   case MEDIA_BUS_FMT_VYUY8_2X8:
-   return ISI_CFG2_YCC_SWAP_MODE_3;
-   case MEDIA_BUS_FMT_UYVY8_2X8:
-   return ISI_CFG2_YCC_SWAP_MODE_2;
-   case MEDIA_BUS_FMT_YVYU8_2X8:
-  

[RFC PATCH 7/7] sama5d3 dts: enable atmel-isi

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

This illustrates the changes needed to the dts in order to hook up the
ov7670. I don't plan on merging this.

Signed-off-by: Hans Verkuil 
---
 arch/arm/boot/dts/at91-sama5d3_xplained.dts | 61 ++---
 arch/arm/boot/dts/sama5d3.dtsi  |  4 +-
 2 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts 
b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
index c51fc65..ac7f7f3 100644
--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
@@ -65,18 +65,53 @@
status = "okay";
};
 
+   isi0: isi@f0034000 {
+   status = "okay";
+   port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   isi_0: endpoint {
+   reg = <0>;
+   remote-endpoint = <&ov7670_0>;
+   bus-width = <8>;
+   vsync-active = <1>;
+   hsync-active = <1>;
+   };
+   };
+   };
+
i2c0: i2c@f0014000 {
pinctrl-0 = <&pinctrl_i2c0_pu>;
-   status = "okay";
+   status = "disabled";
};
 
i2c1: i2c@f0018000 {
status = "okay";
 
+   ov7670: camera@0x21 {
+   compatible = "ovti,ov7670";
+   reg = <0x21>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_pck0_as_isi_mck 
&pinctrl_sensor_power &pinctrl_sensor_reset>;
+   resetb-gpios = <&pioE 11 
GPIO_ACTIVE_LOW>;
+   pwdn-gpios = <&pioE 13 
GPIO_ACTIVE_HIGH>;
+   clocks = <&pck0>;
+   clock-names = "xvclk";
+   assigned-clocks = <&pck0>;
+   assigned-clock-rates = <2400>;
+
+   port {
+   ov7670_0: endpoint {
+   remote-endpoint = 
<&isi_0>;
+   bus-width = <8>;
+   };
+   };
+   };
+
pmic: act8865@5b {
compatible = "active-semi,act8865";
reg = <0x5b>;
-   status = "disabled";
+   status = "okay";
 
regulators {
vcc_1v8_reg: DCDC_REG1 {
@@ -130,7 +165,7 @@
pwm0: pwm@f002c000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm0_pwmh0_0 
&pinctrl_pwm0_pwmh1_0>;
-   status = "okay";
+   status = "disabled";
};
 
usart0: serial@f001c000 {
@@ -143,7 +178,7 @@
};
 
uart0: serial@f0024000 {
-   status = "okay";
+   status = "disabled";
};
 
mmc1: mmc@f800 {
@@ -181,7 +216,7 @@
i2c2: i2c@f801c000 {
dmas = <0>, <0>;/* Do not use DMA for 
i2c2 */
pinctrl-0 = <&pinctrl_i2c2_pu>;
-   status = "okay";
+   status = "disabled";
};
 
macb1: ethernet@f802c000 {
@@ -200,6 +235,22 @@
};
 
pinctrl@f200 {
+   camera_sensor {
+   pinctrl_pck0_as_isi_mck: 
pck0_as_isi_mck-0 {
+   atmel,pins =
+   ; /* ISI_MCK */
+   };
+
+   pinctrl_sensor_power: sensor_power-0 {
+  

[RFC PATCH 3/7] ov7670: fix g/s_parm

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

Drop unnecesary memset. Drop the unnecessary extendedmode check and
set the V4L2_CAP_TIMEPERFRAME capability.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/ov7670.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 26ad1a2..fe527b2 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -1047,7 +1047,6 @@ static int ov7670_g_parm(struct v4l2_subdev *sd, struct 
v4l2_streamparm *parms)
if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
 
-   memset(cp, 0, sizeof(struct v4l2_captureparm));
cp->capability = V4L2_CAP_TIMEPERFRAME;
info->devtype->get_framerate(sd, &cp->timeperframe);
 
@@ -1062,9 +1061,8 @@ static int ov7670_s_parm(struct v4l2_subdev *sd, struct 
v4l2_streamparm *parms)
 
if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
-   if (cp->extendedmode != 0)
-   return -EINVAL;
 
+   cp->capability = V4L2_CAP_TIMEPERFRAME;
return info->devtype->set_framerate(sd, tpf);
 }
 
-- 
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


[RFC PATCH 5/7] ov7670: add devicetree support

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

Add DT support. Use it to get the reset and pwdn pins (if there are any).
Tested with one sensor requiring reset/pwdn and one sensor that doesn't
have reset/pwdn pins.

Signed-off-by: Hans Verkuil 
---
 .../devicetree/bindings/media/i2c/ov7670.txt   | 44 +++
 MAINTAINERS|  1 +
 drivers/media/i2c/ov7670.c | 51 ++
 3 files changed, 96 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7670.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ov7670.txt 
b/Documentation/devicetree/bindings/media/i2c/ov7670.txt
new file mode 100644
index 000..3231c47
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov7670.txt
@@ -0,0 +1,44 @@
+* Omnivision OV7670 CMOS sensor
+
+The Omnivision OV7670 sensor support multiple resolutions output, such as
+CIF, SVGA, UXGA. It also can support YUV422/420, RGB565/555 or raw RGB
+output format.
+
+Required Properties:
+- compatible: should be "ovti,ov7670"
+- clocks: reference to the xvclk input clock.
+- clock-names: should be "xvclk".
+
+Optional Properties:
+- resetb-gpios: reference to the GPIO connected to the resetb pin, if any.
+- pwdn-gpios: reference to the GPIO connected to the pwdn pin, if any.
+
+The device node must contain one 'port' child node for its digital output
+video port, in accordance with the video interface bindings defined in
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+   i2c1: i2c@f0018000 {
+   status = "okay";
+
+   ov7670: camera@0x21 {
+   compatible = "ovti,ov7670";
+   reg = <0x21>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_pck0_as_isi_mck 
&pinctrl_sensor_power &pinctrl_sensor_reset>;
+   resetb-gpios = <&pioE 11 GPIO_ACTIVE_LOW>;
+   pwdn-gpios = <&pioE 13 GPIO_ACTIVE_HIGH>;
+   clocks = <&pck0>;
+   clock-names = "xvclk";
+   assigned-clocks = <&pck0>;
+   assigned-clock-rates = <2400>;
+
+   port {
+   ov7670_0: endpoint {
+   remote-endpoint = <&isi_0>;
+   bus-width = <8>;
+   };
+   };
+   };
+   };
diff --git a/MAINTAINERS b/MAINTAINERS
index 20bb1d0..1fec3a6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8615,6 +8615,7 @@ L:linux-media@vger.kernel.org
 T: git git://linuxtv.org/media_tree.git
 S: Maintained
 F: drivers/media/i2c/ov7670.c
+F: Documentation/devicetree/bindings/media/i2c/ov7670.txt
 
 ONENAND FLASH DRIVER
 M: Kyungmin Park 
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 57adf3d..a401b99 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -17,6 +17,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -231,6 +234,8 @@ struct ov7670_info {
};
struct ov7670_format_struct *fmt;  /* Current format */
struct v4l2_clk *clk;
+   struct gpio_desc *resetb_gpio;
+   struct gpio_desc *pwdn_gpio;
int min_width;  /* Filter out smaller sizes */
int min_height; /* Filter out smaller sizes */
int clock_speed;/* External clock speed (MHz) */
@@ -1551,6 +1556,40 @@ static const struct ov7670_devtype ov7670_devdata[] = {
},
 };
 
+static int ov7670_probe_dt(struct i2c_client *client,
+   struct ov7670_info *info)
+{
+   /* Request the reset GPIO deasserted */
+   info->resetb_gpio = devm_gpiod_get_optional(&client->dev, "resetb",
+   GPIOD_OUT_LOW);
+   if (!info->resetb_gpio)
+   dev_dbg(&client->dev, "resetb gpio is not assigned!\n");
+   else if (IS_ERR(info->resetb_gpio)) {
+   dev_info(&client->dev, "no resetb\n");
+   return PTR_ERR(info->resetb_gpio);
+   }
+
+   /* Request the power down GPIO asserted */
+   info->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "pwdn",
+   GPIOD_OUT_LOW);
+   if (!info->pwdn_gpio)
+   dev_dbg(&client->dev, "pwdn gpio is not assigned!\n");
+   else if (IS_ERR(info->pwdn_gpio)) {
+   dev_info(&client->dev, "no pwdn\n");
+   return PTR_ERR(info->pwdn_gpio);
+   }
+
+   if (info->resetb_gpio) {
+   /* Active the resetb pin to perform a reset pulse */
+   gpiod_direction_output(info->resetb_gpio, 1);
+   usleep_range(3000, 5000);
+   gpiod_direction_output(info->resetb_gpio, 0);
+   }
+   usleep_range(3000, 5000);
+
+

[RFC PATCH 2/7] ov7670: call v4l2_async_register_subdev

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

Add v4l2-async support for this driver.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/ov7670.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 25f46c7..26ad1a2 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -1662,6 +1662,14 @@ static int ov7670_probe(struct i2c_client *client,
v4l2_ctrl_cluster(2, &info->saturation);
v4l2_ctrl_handler_setup(&info->hdl);
 
+   ret = v4l2_async_register_subdev(&info->sd);
+   if (ret < 0) {
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   media_entity_cleanup(&info->sd.entity);
+#endif
+   return ret;
+   }
+
return 0;
 }
 
-- 
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


[RFC PATCH 1/7] ov7670: add media controller support

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

Add media controller support.

Signed-off-by: Hans Verkuil 
---
 drivers/media/i2c/ov7670.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 56cfb5c..25f46c7 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -210,6 +210,7 @@ struct ov7670_devtype {
 struct ov7670_format_struct;  /* coming later */
 struct ov7670_info {
struct v4l2_subdev sd;
+   struct media_pad pad;
struct v4l2_ctrl_handler hdl;
struct {
/* gain cluster */
@@ -1641,6 +1642,16 @@ static int ov7670_probe(struct i2c_client *client,
v4l2_ctrl_handler_free(&info->hdl);
return err;
}
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   info->pad.flags = MEDIA_PAD_FL_SOURCE;
+   info->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
+   ret = media_entity_pads_init(&info->sd.entity, 1, &info->pad);
+   if (ret < 0) {
+   v4l2_ctrl_handler_free(&info->hdl);
+   return ret;
+   }
+#endif
/*
 * We have checked empirically that hw allows to read back the gain
 * value chosen by auto gain but that's not the case for auto exposure.
@@ -1662,6 +1673,9 @@ static int ov7670_remove(struct i2c_client *client)
 
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&info->hdl);
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   media_entity_cleanup(&sd->entity);
+#endif
return 0;
 }
 
-- 
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


[RFC PATCH 0/7] atmel-isi: convert to a standalone driver

2016-08-16 Thread Hans Verkuil
From: Hans Verkuil 

This patch series converts the soc-camera atmel-isi to a standalone V4L2
driver.

The first 5 patches improve the ov7670 sensor driver, mostly adding modern
features such as MC and DT support.

The next patch converts the atmel-isi in-place. The final patch adds support
for this to the dts. I'm not at this moment planning to actually merge it,
it's an example only.

Once Songjun Wu's atmel-isc driver is merged I plan to make a follow-up patch
that moves this driver into the new platform/atmel directory.

Tested with my sama5d3-Xplained board and two ov7670 sensors: one with and one
without reset/pwdn pins.

Regards,

Hans

Hans Verkuil (7):
  ov7670: add media controller support
  ov7670: call v4l2_async_register_subdev
  ov7670: fix g/s_parm
  ov7670: get xvclk
  ov7670: add devicetree support
  atmel-isi: remove dependency of the soc-camera framework
  sama5d3 dts: enable atmel-isi

 .../devicetree/bindings/media/i2c/ov7670.txt   |   44 +
 MAINTAINERS|1 +
 arch/arm/boot/dts/at91-sama5d3_xplained.dts|   61 +-
 arch/arm/boot/dts/sama5d3.dtsi |4 +-
 drivers/media/i2c/ov7670.c |   92 +-
 drivers/media/platform/soc_camera/Kconfig  |3 +-
 drivers/media/platform/soc_camera/atmel-isi.c  | 1216 
 7 files changed, 913 insertions(+), 508 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov7670.txt

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


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

2016-08-16 Thread Markus Heiser

Am 17.08.2016 um 07:44 schrieb Markus Heiser :

> 
> @Daniel: I added you to this discussion. May you are interested in, 
> it is about the parse-headers functionality from Mauro.
> 
> Am 16.08.2016 um 20:22 schrieb Mauro Carvalho Chehab :
> 
>> Em Mon, 15 Aug 2016 10:21:07 +0200
>> Markus Heiser  escreveu:
>> 
>>> Am 14.08.2016 um 20:09 schrieb Jonathan Corbet :
> 
> ...
> 
 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.
>> 
>> After writing the PDF support, I'm starting to think that maybe we
>> should migrate the entire functionality to the Sphinx extension.
>> The rationale is that we won't need to be concerned about output
>> specific escape codes there.
> 
> What do you mean with "output specific escape codes"? This: 
> 
> 
> #
> # Add escape codes for special characters
> #
> $data =~ s,([\_\`\*\<\>\&:\/\|]),\\$1,g;
> 
> $data =~ s,DEPRECATED,**DEPRECATED**,g;
> 
> 
> will be resist, even if you implement it in python.
> 
> 
 - 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.
>> 
>> We use it to allow including an entire header file as-is at the
>> documentation, and cross-reference it with the documents.
>> 
>> IMO, this is very useful to document the ioctl UAPI. There, the most
>> important things to be documented are the ioctl themselves. We don't
>> have any way to document via kernel-doc (as they're #define macros).
>> 
>> Also, when documenting an ioctl, we want to document the structures
>> that are used (most media ioctls use a struct instead of a single value).
>> 
>> So, what we do is that we write a proper description for the ioctl and
>> everything related to it outside the source code. As we want to be
>> sure that everything in the header is documented, we use the
>> "parse-header.pl" (ok, this name really sucks) to create cross-references
>> between the header and the documentation itself.
>> 
>> So, it is actually a script that replaces all occurrences of typedefs,
>> defines, structs, functions, enums into references to the uAPI
>> documentation.
>> 
>> This is is somewhat equivalent to:
>>  .. code-block:: c
>> 
>> Or, even better, it resembles the Doxygen's \example directive:
>>  https://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdexample
>> 
>> With produces a parsed file, like this one:
>>  https://linuxtv.org/docs/libdvbv5/dvb-fe-tool_8c-example.html
>> 
>> Except that:
>> 
>> 1) It doesn't randomly painting the file;
>> 
>> 2) All places where the a typedef, define, struct, struct member,
>> function or enum exists are replaced by a cross-reference to the
>> documentation (except if explicitly defined to not do that, via a
>> configuration file).
>> 
>> That, plus the nitpick mode at Sphinx, allows us to check what
>> parts of the uAPI file aren't documented.
>> 
 - 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?
>> 
>> Maybe we could call it as: "include-c-code-block" or something similar.
> 
> Hmm, that's not any better, IMHO ... there is a 'parsed-literal' so, what's
> wrong with a 'parsed-header' directive or for my sake ' parse-c-header'.
> IMHO it is very unspecific what this directive does and it might be changed in
> the near future if someone (e.g. Daniel [1]) see more use cases then the one 
> yet.
> 
> [1] https://www.mail-archive.com/linux-media%40vger.kernel.org/msg101129.html
> 
> -- Markus --
> 

One more thought; parse-header and kernel_doc, are parsing C code.
But both implement their own C-parser ... may it is time to look
for a more general parser solution:

   * http://git.kernel.org/cgit/devel/sparse/sparse.git
   * https://github.com/eliben/pycparser

Only read the documentation of pycparser, sound promising to me.
With something like "parse_file" we could parse the headers

   * https://github.com/eliben/pycparser/blob/master/pycparser/__init__.py#L54

and with subclassing the "CGenerator" class and overwriting some visit-methods:

   * 
https://github.com/eliben/pycparser/blob/master/pycparser/c_generator.py#L12

we can produce the reST output. There is a small example parsing C to
an AST and back to C:

https://github.com/eliben/pycparser/blob/master/examples/c-to-c.py#L21

-- Markus--
To unsubscribe from t

[PATCH v10 1/3] [media] atmel-isc: add the Image Sensor Controller code

2016-08-16 Thread Songjun Wu
Add driver for the Image Sensor Controller. It manages
incoming data from a parallel based CMOS/CCD sensor.
It has an internal image processor, also integrates a
triple channel direct memory access controller master
interface.

Signed-off-by: Songjun Wu 
---

Changes in v10:
- If 's_power' api does not exist in the sensor driver,
  the function 'isc_open' will return a value of 0.

Changes in v9:
- Set the default format in fuction 'isc_async_complete'.
- Register the video device after everything is configured.

Changes in v8:
- Power on the sensor on the first open in function
  'isc_open'.
- Power off the sensor on the last release in function
  'isc_release'.
- Remove the switch of the pipeline.

Changes in v7:
- Add enum_framesizes and enum_frameintervals.
- Call s_stream(0) when stream start fail.
- Fill the device_caps field of struct video_device
  with V4L2_CAP_STREAMING and V4L2_CAP_VIDEO_CAPTURE.
- Initialize the dev of struct vb2_queue.
- Set field to FIELD_NONE if the pix field is not supported.
- Return the result directly when call g/s_parm of subdev.

Changes in v6: None
Changes in v5:
- Modify the macro definition and the related code.

Changes in v4:
- Modify the isc clock code since the dt is changed.

Changes in v3:
- Add pm runtime feature.
- Modify the isc clock code since the dt is changed.

Changes in v2:
- Add "depends on COMMON_CLK" and "VIDEO_V4L2_SUBDEV_API"
  in Kconfig file.
- Correct typos and coding style according to Laurent's remarks
- Delete the loop while in 'isc_clk_enable' function.
- Replace 'hsync_active', 'vsync_active' and 'pclk_sample'
  with 'pfe_cfg0' in struct isc_subdev_entity.
- Add the code to support VIDIOC_CREATE_BUFS in
  'isc_queue_setup' function.
- Invoke isc_config to configure register in
  'isc_start_streaming' function.
- Add the struct completion 'comp' to synchronize with
  the frame end interrupt in 'isc_stop_streaming' function.
- Check the return value of the clk_prepare_enable
  in 'isc_open' function.
- Set the default format in 'isc_open' function.
- Add an exit condition in the loop while in 'isc_config'.
- Delete the hardware setup operation in 'isc_set_format'.
- Refuse format modification during streaming
  in 'isc_s_fmt_vid_cap' function.
- Invoke v4l2_subdev_alloc_pad_config to allocate and
  initialize the pad config in 'isc_async_complete' function.
- Remove the '.owner  = THIS_MODULE,' in atmel_isc_driver.
- Replace the module_platform_driver_probe() with
  module_platform_driver().

 drivers/media/platform/Kconfig|1 +
 drivers/media/platform/Makefile   |2 +
 drivers/media/platform/atmel/Kconfig  |9 +
 drivers/media/platform/atmel/Makefile |1 +
 drivers/media/platform/atmel/atmel-isc-regs.h |  165 +++
 drivers/media/platform/atmel/atmel-isc.c  | 1514 +
 6 files changed, 1692 insertions(+)
 create mode 100644 drivers/media/platform/atmel/Kconfig
 create mode 100644 drivers/media/platform/atmel/Makefile
 create mode 100644 drivers/media/platform/atmel/atmel-isc-regs.h
 create mode 100644 drivers/media/platform/atmel/atmel-isc.c

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index f25344b..b23db17 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -111,6 +111,7 @@ source "drivers/media/platform/s5p-tv/Kconfig"
 source "drivers/media/platform/am437x/Kconfig"
 source "drivers/media/platform/xilinx/Kconfig"
 source "drivers/media/platform/rcar-vin/Kconfig"
+source "drivers/media/platform/atmel/Kconfig"
 
 config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 21771c1..37b6c75 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -58,6 +58,8 @@ obj-$(CONFIG_VIDEO_XILINX)+= xilinx/
 
 obj-$(CONFIG_VIDEO_RCAR_VIN)   += rcar-vin/
 
+obj-$(CONFIG_VIDEO_ATMEL_ISC)  += atmel/
+
 ccflags-y += -I$(srctree)/drivers/media/i2c
 
 obj-$(CONFIG_VIDEO_MEDIATEK_VPU)   += mtk-vpu/
diff --git a/drivers/media/platform/atmel/Kconfig 
b/drivers/media/platform/atmel/Kconfig
new file mode 100644
index 000..867dca2
--- /dev/null
+++ b/drivers/media/platform/atmel/Kconfig
@@ -0,0 +1,9 @@
+config VIDEO_ATMEL_ISC
+   tristate "ATMEL Image Sensor Controller (ISC) support"
+   depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+   depends on ARCH_AT91 || COMPILE_TEST
+   select VIDEOBUF2_DMA_CONTIG
+   select REGMAP_MMIO
+   help
+  This module makes the ATMEL Image Sensor Controller available
+  as a v4l2 device.
\ No newline at end of file
diff --git a/drivers/media/platform/atmel/Makefile 
b/drivers/media/platform/atmel/Makefile
new file mode 100644
index 000..9d7c999
--- /dev/null
+++ b/drivers/media/platform/atmel/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_VIDEO_ATMEL_ISC) += atme

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

2016-08-16 Thread Songjun Wu
Add the MAINTAINERS' entry for Microchip / Atmel Image Sensor Controller.

Signed-off-by: Songjun Wu 
---

Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 20bb1d0..21a6f6f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7733,6 +7733,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.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 v10 0/3] [media] atmel-isc: add driver for Atmel ISC

2016-08-16 Thread Songjun Wu
The Image Sensor Controller driver includes three parts.
1) Driver code to implement the ISC function.
2) Device tree binding documentation, it describes how
   to add the ISC in device tree.
3) Add an entry to MAINTAINERS for Atmel ISC

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

Driver Infoatmel_isc f0008000.isc: Format 0x not found
atmel_isc f0008000.isc: Format 0x not found

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

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

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

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK

Test input 0:

Stream using all formats:
test MMAP for Format BA81, Frame Size 640x480@60.00 Hz:
Stride 640, Field None: OK
test MMAP for Format YUYV, Frame Size 640x480@60.00 Hz:
Stride 1280, Field None: OK

Total: 45, Succeeded: 45, Failed: 0, Warnings: 0

Changes in v10:
- If 's_power' api does not exist in the sensor driver,
  the function 'isc_open' will return a value of 0.

Changes in v9:
- Set the default format in fuction 'isc_async_complete'.
- Register the video device after everything is configured.

Changes in v8:
- Power on the sensor on the first open in function
  'isc_open'.
- Power off the sensor on the last release in function
  'isc_release'.
- Remove the switch of the pipeline.

Changes in v7:
- Add enum_framesizes and enum_frameintervals.
- Call s_stream(0) when stream start fail.
- Fill the device_caps field of struct video_device
  with V4L2_CAP_STREAMING and V4L2_CAP_VIDEO_CAPTURE.
- Initialize the dev of struct vb2_queue.
- Set field to FIELD_NONE if the pix field is not supported.
- Return the result directly when call g/s_parm of subdev.

Changes in v6:
- Add "iscck" and "gck" to clock-names.

Changes in v5:
- Modify the macro definition and the related code.
- Add clock-output-names.

Changes in v4:
- Modify the isc clock code since the dt is changed.
- Remove the isc clock nod

[PATCH v10 2/3] [media] atmel-isc: DT binding for Image Sensor Controller driver

2016-08-16 Thread Songjun Wu
DT binding documentation for ISC driver.

Acked-by: Rob Herring 
Signed-off-by: Songjun Wu 
---

Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
- Add "iscck" and "gck" to clock-names.

Changes in v5:
- Add clock-output-names.

Changes in v4:
- Remove the isc clock nodes.

Changes in v3:
- Remove the 'atmel,sensor-preferred'.
- Modify the isc clock node according to the Rob's remarks.

Changes in v2:
- Remove the unit address of the endpoint.
- Add the unit address to the clock node.
- Avoid using underscores in node names.
- Drop the "0x" in the unit address of the i2c node.
- Modify the description of 'atmel,sensor-preferred'.
- Add the description for the ISC internal clock.

 .../devicetree/bindings/media/atmel-isc.txt| 65 ++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt

diff --git a/Documentation/devicetree/bindings/media/atmel-isc.txt 
b/Documentation/devicetree/bindings/media/atmel-isc.txt
new file mode 100644
index 000..bbe0e87c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/atmel-isc.txt
@@ -0,0 +1,65 @@
+Atmel Image Sensor Controller (ISC)
+--
+
+Required properties for ISC:
+- compatible
+   Must be "atmel,sama5d2-isc".
+- reg
+   Physical base address and length of the registers set for the device.
+- interrupts
+   Should contain IRQ line for the ISC.
+- clocks
+   List of clock specifiers, corresponding to entries in
+   the clock-names property;
+   Please refer to clock-bindings.txt.
+- clock-names
+   Required elements: "hclock", "iscck", "gck".
+- #clock-cells
+   Should be 0.
+- clock-output-names
+   Should be "isc-mck".
+- pinctrl-names, pinctrl-0
+   Please refer to pinctrl-bindings.txt.
+
+ISC supports a single port node with parallel bus. It should contain one
+'port' child node with child 'endpoint' node. Please refer to the bindings
+defined in Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+isc: isc@f0008000 {
+   compatible = "atmel,sama5d2-isc";
+   reg = <0xf0008000 0x4000>;
+   interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>;
+   clocks = <&isc_clk>, <&iscck>, <&isc_gclk>;
+   clock-names = "hclock", "iscck", "gck";
+   #clock-cells = <0>;
+   clock-output-names = "isc-mck";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit 
&pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
+
+   port {
+   isc_0: endpoint {
+   remote-endpoint = <&ov7740_0>;
+   hsync-active = <1>;
+   vsync-active = <0>;
+   pclk-sample = <1>;
+   };
+   };
+};
+
+i2c1: i2c@fc028000 {
+   ov7740: camera@21 {
+   compatible = "ovti,ov7740";
+   reg = <0x21>;
+   clocks = <&isc>;
+   clock-names = "xvclk";
+   assigned-clocks = <&isc>;
+   assigned-clock-rates = <2400>;
+
+   port {
+   ov7740_0: endpoint {
+   remote-endpoint = <&isc_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


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

2016-08-16 Thread Markus Heiser

@Daniel: I added you to this discussion. May you are interested in, 
it is about the parse-headers functionality from Mauro.

Am 16.08.2016 um 20:22 schrieb Mauro Carvalho Chehab :

> Em Mon, 15 Aug 2016 10:21:07 +0200
> Markus Heiser  escreveu:
> 
>> Am 14.08.2016 um 20:09 schrieb Jonathan Corbet :

...

>>> 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.
> 
> After writing the PDF support, I'm starting to think that maybe we
> should migrate the entire functionality to the Sphinx extension.
> The rationale is that we won't need to be concerned about output
> specific escape codes there.

What do you mean with "output specific escape codes"? This: 


#
# Add escape codes for special characters
#
$data =~ s,([\_\`\*\<\>\&:\/\|]),\\$1,g;

$data =~ s,DEPRECATED,**DEPRECATED**,g;


will be resist, even if you implement it in python.


>>> - 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.
> 
> We use it to allow including an entire header file as-is at the
> documentation, and cross-reference it with the documents.
> 
> IMO, this is very useful to document the ioctl UAPI. There, the most
> important things to be documented are the ioctl themselves. We don't
> have any way to document via kernel-doc (as they're #define macros).
> 
> Also, when documenting an ioctl, we want to document the structures
> that are used (most media ioctls use a struct instead of a single value).
> 
> So, what we do is that we write a proper description for the ioctl and
> everything related to it outside the source code. As we want to be
> sure that everything in the header is documented, we use the
> "parse-header.pl" (ok, this name really sucks) to create cross-references
> between the header and the documentation itself.
> 
> So, it is actually a script that replaces all occurrences of typedefs,
> defines, structs, functions, enums into references to the uAPI
> documentation.
> 
> This is is somewhat equivalent to:
>   .. code-block:: c
> 
> Or, even better, it resembles the Doxygen's \example directive:
>   https://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdexample
> 
> With produces a parsed file, like this one:
>   https://linuxtv.org/docs/libdvbv5/dvb-fe-tool_8c-example.html
> 
> Except that:
> 
> 1) It doesn't randomly painting the file;
> 
> 2) All places where the a typedef, define, struct, struct member,
> function or enum exists are replaced by a cross-reference to the
> documentation (except if explicitly defined to not do that, via a
> configuration file).
> 
> That, plus the nitpick mode at Sphinx, allows us to check what
> parts of the uAPI file aren't documented.
> 
>>> - 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?
> 
> Maybe we could call it as: "include-c-code-block" or something similar.

Hmm, that's not any better, IMHO ... there is a 'parsed-literal' so, what's
wrong with a 'parsed-header' directive or for my sake ' parse-c-header'.
IMHO it is very unspecific what this directive does and it might be changed in
the near future if someone (e.g. Daniel [1]) see more use cases then the one 
yet.

[1] https://www.mail-archive.com/linux-media%40vger.kernel.org/msg101129.html

-- Markus --

> Regards,
> Mauro

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


Re: [PATCH] dma-buf: fix kernel-doc warning and typos

2016-08-16 Thread Sumit Semwal
Hi Randy,

On 17 August 2016 at 05:01, Randy Dunlap  wrote:
> From: Randy Dunlap 
>
> Fix dma-buf kernel-doc warning and 2 minor typos in
> fence_array_create().
>
Thanks for your patch, I will queue it up!
> Fixes this warning:
> ..//drivers/dma-buf/fence-array.c:124: warning: No description found for 
> parameter 'signal_on_any'
>
> Signed-off-by: Randy Dunlap 
> Cc: Sumit Semwal 
> Cc: linux-media@vger.kernel.org
> Cc: dri-de...@lists.freedesktop.org
> Cc: linaro-mm-...@lists.linaro.org
> ---
>  drivers/dma-buf/fence-array.c |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> --- lnx-48-rc2.orig/drivers/dma-buf/fence-array.c
> +++ lnx-48-rc2/drivers/dma-buf/fence-array.c
> @@ -106,14 +106,14 @@ const struct fence_ops fence_array_ops =
>   * @fences:[in]array containing the fences
>   * @context:   [in]fence context to use
>   * @seqno: [in]sequence number to use
> - * @signal_on_any  [in]signal on any fence in the array
> + * @signal_on_any: [in]signal on any fence in the array
>   *
>   * Allocate a fence_array object and initialize the base fence with 
> fence_init().
>   * In case of error it returns NULL.
>   *
> - * The caller should allocte the fences array with num_fences size
> + * The caller should allocate the fences array with num_fences size
>   * and fill it with the fences it wants to add to the object. Ownership of 
> this
> - * array is take and fence_put() is used on each fence on release.
> + * array is taken and fence_put() is used on each fence on release.
>   *
>   * If @signal_on_any is true the fence array signals if any fence in the 
> array
>   * signals, otherwise it signals when all fences in the array signal.

Best,
Sumit.
--
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


cron job: media_tree daily build: WARNINGS

2016-08-16 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:   Wed Aug 17 04:00:17 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/Wednesday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Wednesday.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] dma-buf: fix kernel-doc warning and typos

2016-08-16 Thread Randy Dunlap
From: Randy Dunlap 

Fix dma-buf kernel-doc warning and 2 minor typos in
fence_array_create().

Fixes this warning:
..//drivers/dma-buf/fence-array.c:124: warning: No description found for 
parameter 'signal_on_any'

Signed-off-by: Randy Dunlap 
Cc: Sumit Semwal 
Cc: linux-media@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: linaro-mm-...@lists.linaro.org
---
 drivers/dma-buf/fence-array.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- lnx-48-rc2.orig/drivers/dma-buf/fence-array.c
+++ lnx-48-rc2/drivers/dma-buf/fence-array.c
@@ -106,14 +106,14 @@ const struct fence_ops fence_array_ops =
  * @fences:[in]array containing the fences
  * @context:   [in]fence context to use
  * @seqno: [in]sequence number to use
- * @signal_on_any  [in]signal on any fence in the array
+ * @signal_on_any: [in]signal on any fence in the array
  *
  * Allocate a fence_array object and initialize the base fence with 
fence_init().
  * In case of error it returns NULL.
  *
- * The caller should allocte the fences array with num_fences size
+ * The caller should allocate the fences array with num_fences size
  * and fill it with the fences it wants to add to the object. Ownership of this
- * array is take and fence_put() is used on each fence on release.
+ * array is taken and fence_put() is used on each fence on release.
  *
  * If @signal_on_any is true the fence array signals if any fence in the array
  * signals, otherwise it signals when all fences in the array signal.
--
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


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

2016-08-16 Thread Steve Preston
I realize this is a long shot but I was directed to this mailing list as one 
possibility  . 
 
I work with a group of amateur astronomers who use analog video cameras to 
record occultations ( www.occulations.org ).  Several observers have been using 
the StarTech SVID2USB2 class of analog capture devices (USB dongle) under 
Windows.  The StarTech devices are one of the few such devices which are 
readily available today. These StarTech devices seemed to be based on the empia 
28xx + SAA71xx chipset devices which have some support in the linux kernel.  
Unfortunately, we are having trouble with the StarTech devices in Linux.  Does 
anyone on this list know of anyone in the linxtv.org (or related) community 
that might be willing to help us modify a current driver to enable the StarTech 
device(s)?  Or, do you know of anyone who currently works with analog video 
capture hardware in linux who might be willing to provide other ideas?
 
Thanks in advance for any help you can provide,
Steve

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


Re: [PATCH] [media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_buffer_done()

2016-08-16 Thread Javier Martinez Canillas
Hello Sakari,

On 08/16/2016 05:13 PM, Sakari Ailus wrote:
> Hi Javier,
> 
> Javier Martinez Canillas wrote:
>> Hello Sakari,
>>
>> On 08/16/2016 04:47 PM, Sakari Ailus wrote:
>>> Hi Javier,
>>>
>>> Javier Martinez Canillas wrote:
 Hello Hans,

 Thanks a lot for your feedback.

 On 08/13/2016 09:47 AM, Hans Verkuil wrote:
> On 07/20/2016 08:22 PM, Javier Martinez Canillas wrote:
>> Currently the dma-buf is unmapped when the buffer is dequeued by 
>> userspace
>> but it's not used anymore after the driver finished processing the 
>> buffer.
>>
>> So instead of doing the dma-buf unmapping in __vb2_dqbuf(), it can be 
>> made
>> in vb2_buffer_done() after the driver notified that buf processing is 
>> done.
>>
>> Decoupling the buffer dequeue from the dma-buf unmapping has also the 
>> side
>> effect of making possible to add dma-buf fence support in the future 
>> since
>> the buffer could be dequeued even before the driver has finished using 
>> it.
>>
>> Signed-off-by: Javier Martinez Canillas 
>>
>> ---
>> Hello,
>>
>> I've tested this patch doing DMA buffer sharing between a
>> vivid input and output device with both v4l2-ctl and gst:
>>
>> $ v4l2-ctl -d0 -e1 --stream-dmabuf --stream-out-mmap
>> $ v4l2-ctl -d0 -e1 --stream-mmap --stream-out-dmabuf
>> $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! v4l2sink 
>> device=/dev/video1 io-mode=dmabuf-import
>>
>> And I didn't find any issues but more testing will be appreciated.
>>
>> Best regards,
>> Javier
>>
>>  drivers/media/v4l2-core/videobuf2-core.c | 34 
>> +---
>>  1 file changed, 22 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
>> b/drivers/media/v4l2-core/videobuf2-core.c
>> index 7128b09810be..973331efaf79 100644
>> --- a/drivers/media/v4l2-core/videobuf2-core.c
>> +++ b/drivers/media/v4l2-core/videobuf2-core.c
>> @@ -958,6 +958,22 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, 
>> unsigned int plane_no)
>>  EXPORT_SYMBOL_GPL(vb2_plane_cookie);
>>  
>>  /**
>> + * __vb2_unmap_dmabuf() - unmap dma-buf attached to buffer planes
>> + */
>> +static void __vb2_unmap_dmabuf(struct vb2_buffer *vb)
>> +{
>> +int i;
>> +
>> +for (i = 0; i < vb->num_planes; ++i) {
>> +if (!vb->planes[i].dbuf_mapped)
>> +continue;
>> +call_void_memop(vb, unmap_dmabuf,
>> +vb->planes[i].mem_priv);
>
> Does unmap_dmabuf work in interrupt context? Since vb2_buffer_done can be 
> called from
> an irq handler this is a concern.
>

 Good point, I believe it shouldn't be called from atomic context since both
 the dma_buf_vunmap() and dma_buf_unmap_attachment() functions can sleep.
  
> That said, vb2_buffer_done already calls call_void_memop(vb, finish, 
> vb->planes[plane].mem_priv);
> to sync buffers, and that can take a long time as well. So it is not a 
> good idea to
> have this in vb2_buffer_done.
>

 I see.

> What I would like to see is to have vb2 handle this finish() call and the 
> vb2_unmap_dmabuf
> in some workthread or equivalent.
>
> It would complicate matters somewhat in vb2, but it would simplify 
> drivers since these
> actions would not longer take place in interrupt context.
>
> I think this patch makes sense, but I would prefer that this is moved out 
> of the interrupt
> context.
>

 Ok, I can take a look to this and handle the finish() and unmap_dmabuf()
 out of interrupt context as you suggested.
>>>
>>> I have a patch doing the former which is a part of my cache management
>>> fix patchset:
>>>
>>> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=commitdiff;h=b57f937627abda158ada01a3297dbb0f0a57b515>
>>> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=shortlog;h=refs/heads/vb2-dc-noncoherent>
>>>
>>
>> Interesting, thanks for the links.
>>  
>>> There were a few drivers doing nasty things with memory that I couldn't
>>> quite fix back then. Just FYI.
>>>
>>
>> Did you mean that there were issues with moving finish mem op call to DQBUF?
>>
>> Do you recall what these drivers were or what were doing that caused 
>> problems?
> 
> Not any particular drivers --- the problem is that flushing the cache

Ah, you were explaining the rationale of the change, not that you had
issues after doing the mentioned change, sorry for my confusion.

> simply takes a lot of time, often milliseconds depending on the machine.
> There's also no reason to do it in interrupt context. It kills realtime
> performance, too.
>

Yes, I understand why calling finish() in vb2_buffer_done() is bad :)
 
>>
>> In a

Re: [PATCH] [media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_buffer_done()

2016-08-16 Thread Sakari Ailus
Hi Javier,

Javier Martinez Canillas wrote:
> Hello Sakari,
> 
> On 08/16/2016 04:47 PM, Sakari Ailus wrote:
>> Hi Javier,
>>
>> Javier Martinez Canillas wrote:
>>> Hello Hans,
>>>
>>> Thanks a lot for your feedback.
>>>
>>> On 08/13/2016 09:47 AM, Hans Verkuil wrote:
 On 07/20/2016 08:22 PM, Javier Martinez Canillas wrote:
> Currently the dma-buf is unmapped when the buffer is dequeued by userspace
> but it's not used anymore after the driver finished processing the buffer.
>
> So instead of doing the dma-buf unmapping in __vb2_dqbuf(), it can be made
> in vb2_buffer_done() after the driver notified that buf processing is 
> done.
>
> Decoupling the buffer dequeue from the dma-buf unmapping has also the side
> effect of making possible to add dma-buf fence support in the future since
> the buffer could be dequeued even before the driver has finished using it.
>
> Signed-off-by: Javier Martinez Canillas 
>
> ---
> Hello,
>
> I've tested this patch doing DMA buffer sharing between a
> vivid input and output device with both v4l2-ctl and gst:
>
> $ v4l2-ctl -d0 -e1 --stream-dmabuf --stream-out-mmap
> $ v4l2-ctl -d0 -e1 --stream-mmap --stream-out-dmabuf
> $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! v4l2sink 
> device=/dev/video1 io-mode=dmabuf-import
>
> And I didn't find any issues but more testing will be appreciated.
>
> Best regards,
> Javier
>
>  drivers/media/v4l2-core/videobuf2-core.c | 34 
> +---
>  1 file changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
> b/drivers/media/v4l2-core/videobuf2-core.c
> index 7128b09810be..973331efaf79 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -958,6 +958,22 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, 
> unsigned int plane_no)
>  EXPORT_SYMBOL_GPL(vb2_plane_cookie);
>  
>  /**
> + * __vb2_unmap_dmabuf() - unmap dma-buf attached to buffer planes
> + */
> +static void __vb2_unmap_dmabuf(struct vb2_buffer *vb)
> +{
> + int i;
> +
> + for (i = 0; i < vb->num_planes; ++i) {
> + if (!vb->planes[i].dbuf_mapped)
> + continue;
> + call_void_memop(vb, unmap_dmabuf,
> + vb->planes[i].mem_priv);

 Does unmap_dmabuf work in interrupt context? Since vb2_buffer_done can be 
 called from
 an irq handler this is a concern.

>>>
>>> Good point, I believe it shouldn't be called from atomic context since both
>>> the dma_buf_vunmap() and dma_buf_unmap_attachment() functions can sleep.
>>>  
 That said, vb2_buffer_done already calls call_void_memop(vb, finish, 
 vb->planes[plane].mem_priv);
 to sync buffers, and that can take a long time as well. So it is not a 
 good idea to
 have this in vb2_buffer_done.

>>>
>>> I see.
>>>
 What I would like to see is to have vb2 handle this finish() call and the 
 vb2_unmap_dmabuf
 in some workthread or equivalent.

 It would complicate matters somewhat in vb2, but it would simplify drivers 
 since these
 actions would not longer take place in interrupt context.

 I think this patch makes sense, but I would prefer that this is moved out 
 of the interrupt
 context.

>>>
>>> Ok, I can take a look to this and handle the finish() and unmap_dmabuf()
>>> out of interrupt context as you suggested.
>>
>> I have a patch doing the former which is a part of my cache management
>> fix patchset:
>>
>> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=commitdiff;h=b57f937627abda158ada01a3297dbb0f0a57b515>
>> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=shortlog;h=refs/heads/vb2-dc-noncoherent>
>>
> 
> Interesting, thanks for the links.
>  
>> There were a few drivers doing nasty things with memory that I couldn't
>> quite fix back then. Just FYI.
>>
> 
> Did you mean that there were issues with moving finish mem op call to DQBUF?
> 
> Do you recall what these drivers were or what were doing that caused problems?

Not any particular drivers --- the problem is that flushing the cache
simply takes a lot of time, often milliseconds depending on the machine.
There's also no reason to do it in interrupt context. It kills realtime
performance, too.

> 
> In any case, what Hans proposed AFAIU is not to change when the finish call
> happens but to split the vb2_buffer_done() function and defer part of it to
> a workqueue or kthread. I'll give a try to that approach probably tomorrow.

There's also the context of the user space process calling DQBUF, too.
Why not to use that one instead?

-- 
Sakari Ailus
sakari.ai...@iki.fi
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kerne

Re: [PATCH] [media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_buffer_done()

2016-08-16 Thread Javier Martinez Canillas
Hello Sakari,

On 08/16/2016 04:47 PM, Sakari Ailus wrote:
> Hi Javier,
> 
> Javier Martinez Canillas wrote:
>> Hello Hans,
>>
>> Thanks a lot for your feedback.
>>
>> On 08/13/2016 09:47 AM, Hans Verkuil wrote:
>>> On 07/20/2016 08:22 PM, Javier Martinez Canillas wrote:
 Currently the dma-buf is unmapped when the buffer is dequeued by userspace
 but it's not used anymore after the driver finished processing the buffer.

 So instead of doing the dma-buf unmapping in __vb2_dqbuf(), it can be made
 in vb2_buffer_done() after the driver notified that buf processing is done.

 Decoupling the buffer dequeue from the dma-buf unmapping has also the side
 effect of making possible to add dma-buf fence support in the future since
 the buffer could be dequeued even before the driver has finished using it.

 Signed-off-by: Javier Martinez Canillas 

 ---
 Hello,

 I've tested this patch doing DMA buffer sharing between a
 vivid input and output device with both v4l2-ctl and gst:

 $ v4l2-ctl -d0 -e1 --stream-dmabuf --stream-out-mmap
 $ v4l2-ctl -d0 -e1 --stream-mmap --stream-out-dmabuf
 $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! v4l2sink 
 device=/dev/video1 io-mode=dmabuf-import

 And I didn't find any issues but more testing will be appreciated.

 Best regards,
 Javier

  drivers/media/v4l2-core/videobuf2-core.c | 34 
 +---
  1 file changed, 22 insertions(+), 12 deletions(-)

 diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
 b/drivers/media/v4l2-core/videobuf2-core.c
 index 7128b09810be..973331efaf79 100644
 --- a/drivers/media/v4l2-core/videobuf2-core.c
 +++ b/drivers/media/v4l2-core/videobuf2-core.c
 @@ -958,6 +958,22 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, 
 unsigned int plane_no)
  EXPORT_SYMBOL_GPL(vb2_plane_cookie);
  
  /**
 + * __vb2_unmap_dmabuf() - unmap dma-buf attached to buffer planes
 + */
 +static void __vb2_unmap_dmabuf(struct vb2_buffer *vb)
 +{
 +  int i;
 +
 +  for (i = 0; i < vb->num_planes; ++i) {
 +  if (!vb->planes[i].dbuf_mapped)
 +  continue;
 +  call_void_memop(vb, unmap_dmabuf,
 +  vb->planes[i].mem_priv);
>>>
>>> Does unmap_dmabuf work in interrupt context? Since vb2_buffer_done can be 
>>> called from
>>> an irq handler this is a concern.
>>>
>>
>> Good point, I believe it shouldn't be called from atomic context since both
>> the dma_buf_vunmap() and dma_buf_unmap_attachment() functions can sleep.
>>  
>>> That said, vb2_buffer_done already calls call_void_memop(vb, finish, 
>>> vb->planes[plane].mem_priv);
>>> to sync buffers, and that can take a long time as well. So it is not a good 
>>> idea to
>>> have this in vb2_buffer_done.
>>>
>>
>> I see.
>>
>>> What I would like to see is to have vb2 handle this finish() call and the 
>>> vb2_unmap_dmabuf
>>> in some workthread or equivalent.
>>>
>>> It would complicate matters somewhat in vb2, but it would simplify drivers 
>>> since these
>>> actions would not longer take place in interrupt context.
>>>
>>> I think this patch makes sense, but I would prefer that this is moved out 
>>> of the interrupt
>>> context.
>>>
>>
>> Ok, I can take a look to this and handle the finish() and unmap_dmabuf()
>> out of interrupt context as you suggested.
> 
> I have a patch doing the former which is a part of my cache management
> fix patchset:
> 
> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=commitdiff;h=b57f937627abda158ada01a3297dbb0f0a57b515>
> http://git.retiisi.org.uk/?p=~sailus/linux.git;a=shortlog;h=refs/heads/vb2-dc-noncoherent>
>

Interesting, thanks for the links.
 
> There were a few drivers doing nasty things with memory that I couldn't
> quite fix back then. Just FYI.
> 

Did you mean that there were issues with moving finish mem op call to DQBUF?

Do you recall what these drivers were or what were doing that caused problems?

In any case, what Hans proposed AFAIU is not to change when the finish call
happens but to split the vb2_buffer_done() function and defer part of it to
a workqueue or kthread. I'll give a try to that approach probably tomorrow.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
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] [media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_buffer_done()

2016-08-16 Thread Sakari Ailus
Hi Javier,

Javier Martinez Canillas wrote:
> Hello Hans,
> 
> Thanks a lot for your feedback.
> 
> On 08/13/2016 09:47 AM, Hans Verkuil wrote:
>> On 07/20/2016 08:22 PM, Javier Martinez Canillas wrote:
>>> Currently the dma-buf is unmapped when the buffer is dequeued by userspace
>>> but it's not used anymore after the driver finished processing the buffer.
>>>
>>> So instead of doing the dma-buf unmapping in __vb2_dqbuf(), it can be made
>>> in vb2_buffer_done() after the driver notified that buf processing is done.
>>>
>>> Decoupling the buffer dequeue from the dma-buf unmapping has also the side
>>> effect of making possible to add dma-buf fence support in the future since
>>> the buffer could be dequeued even before the driver has finished using it.
>>>
>>> Signed-off-by: Javier Martinez Canillas 
>>>
>>> ---
>>> Hello,
>>>
>>> I've tested this patch doing DMA buffer sharing between a
>>> vivid input and output device with both v4l2-ctl and gst:
>>>
>>> $ v4l2-ctl -d0 -e1 --stream-dmabuf --stream-out-mmap
>>> $ v4l2-ctl -d0 -e1 --stream-mmap --stream-out-dmabuf
>>> $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! v4l2sink 
>>> device=/dev/video1 io-mode=dmabuf-import
>>>
>>> And I didn't find any issues but more testing will be appreciated.
>>>
>>> Best regards,
>>> Javier
>>>
>>>  drivers/media/v4l2-core/videobuf2-core.c | 34 
>>> +---
>>>  1 file changed, 22 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
>>> b/drivers/media/v4l2-core/videobuf2-core.c
>>> index 7128b09810be..973331efaf79 100644
>>> --- a/drivers/media/v4l2-core/videobuf2-core.c
>>> +++ b/drivers/media/v4l2-core/videobuf2-core.c
>>> @@ -958,6 +958,22 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned 
>>> int plane_no)
>>>  EXPORT_SYMBOL_GPL(vb2_plane_cookie);
>>>  
>>>  /**
>>> + * __vb2_unmap_dmabuf() - unmap dma-buf attached to buffer planes
>>> + */
>>> +static void __vb2_unmap_dmabuf(struct vb2_buffer *vb)
>>> +{
>>> +   int i;
>>> +
>>> +   for (i = 0; i < vb->num_planes; ++i) {
>>> +   if (!vb->planes[i].dbuf_mapped)
>>> +   continue;
>>> +   call_void_memop(vb, unmap_dmabuf,
>>> +   vb->planes[i].mem_priv);
>>
>> Does unmap_dmabuf work in interrupt context? Since vb2_buffer_done can be 
>> called from
>> an irq handler this is a concern.
>>
> 
> Good point, I believe it shouldn't be called from atomic context since both
> the dma_buf_vunmap() and dma_buf_unmap_attachment() functions can sleep.
>  
>> That said, vb2_buffer_done already calls call_void_memop(vb, finish, 
>> vb->planes[plane].mem_priv);
>> to sync buffers, and that can take a long time as well. So it is not a good 
>> idea to
>> have this in vb2_buffer_done.
>>
> 
> I see.
> 
>> What I would like to see is to have vb2 handle this finish() call and the 
>> vb2_unmap_dmabuf
>> in some workthread or equivalent.
>>
>> It would complicate matters somewhat in vb2, but it would simplify drivers 
>> since these
>> actions would not longer take place in interrupt context.
>>
>> I think this patch makes sense, but I would prefer that this is moved out of 
>> the interrupt
>> context.
>>
> 
> Ok, I can take a look to this and handle the finish() and unmap_dmabuf()
> out of interrupt context as you suggested.

I have a patch doing the former which is a part of my cache management
fix patchset:

http://git.retiisi.org.uk/?p=~sailus/linux.git;a=commitdiff;h=b57f937627abda158ada01a3297dbb0f0a57b515>
http://git.retiisi.org.uk/?p=~sailus/linux.git;a=shortlog;h=refs/heads/vb2-dc-noncoherent>

There were a few drivers doing nasty things with memory that I couldn't
quite fix back then. Just FYI.

-- 
Regards,

Sakari Ailus
sakari.ai...@iki.fi
--
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-16 Thread Mauro Carvalho Chehab
Em Mon, 15 Aug 2016 10:21:07 +0200
Markus Heiser  escreveu:

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

After writing the PDF support, I'm starting to think that maybe we
should migrate the entire functionality to the Sphinx extension.
The rationale is that we won't need to be concerned about output
specific escape codes there.

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

We use it to allow including an entire header file as-is at the
documentation, and cross-reference it with the documents.

IMO, this is very useful to document the ioctl UAPI. There, the most
important things to be documented are the ioctl themselves. We don't
have any way to document via kernel-doc (as they're #define macros).

Also, when documenting an ioctl, we want to document the structures
that are used (most media ioctls use a struct instead of a single value).

So, what we do is that we write a proper description for the ioctl and
everything related to it outside the source code. As we want to be
sure that everything in the header is documented, we use the
"parse-header.pl" (ok, this name really sucks) to create cross-references
between the header and the documentation itself.

So, it is actually a script that replaces all occurrences of typedefs,
defines, structs, functions, enums into references to the uAPI
documentation.

This is is somewhat equivalent to:
.. code-block:: c

Or, even better, it resembles the Doxygen's \example directive:
https://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdexample

With produces a parsed file, like this one:
https://linuxtv.org/docs/libdvbv5/dvb-fe-tool_8c-example.html

Except that:

1) It doesn't randomly painting the file;

2) All places where the a typedef, define, struct, struct member,
function or enum exists are replaced by a cross-reference to the
documentation (except if explicitly defined to not do that, via a
configuration file).

That, plus the nitpick mode at Sphinx, allows us to check what
parts of the uAPI file aren't documented.

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

Maybe we could call it as: "include-c-code-block" or something similar.

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


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

2016-08-16 Thread Mauro Carvalho Chehab
Em Tue, 16 Aug 2016 14:35:16 +0200
Markus Heiser  escreveu:

> Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab 
> :
> 
> ...
> > The only issue there was the name of the math extension, with is also
> > sphinx.ext.pngmath. On a plus side, I was also able to remove one of the
> > hacks, by applying the enclosed patch (this doesn't work on 1.4 yet - 
> > I suspect it requires some extra stuff to escape).
> > 
> > So, for me, we're pretty much safe using xelatex, as it works fine for
> > Sphinx 1.3 and 1.4 (and, with Sphinx 1.2, provided that the user asks to
> > continue the build, just like what's needed with pdflatex on such
> > version).
> > 
> > To make it generic, we'll need to patch conf.py to detect the Sphinx
> > version, and use the right math extension, depending on the version.
> > Also, as you proposed, Due to Sphinx version is 1.2, we'll need to use a
> > custom-made Makefile for tex.
> > 
> > As xelatex support was added for version 1.5, we don't need to care
> > about it.  
> 
> I haven't checked on which version which math-extension was
> replaced. But it is easy to detect the sphinx version in conf.py.
> Add these lines to conf.py::
> 
>   import sphinx
>   major, minor, patch = map(int, sphinx.__version__.split("."))
> 
> The "minor" is what you are looking for.
> 
>   if minor > 3:
>   extensions.append("sphinx.ext.imgmath")
>   else:
>   extensions.append("sphinx.ext.pngmath")

Worked, thanks!

Added on the patch series I submitted.

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


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

2016-08-16 Thread Mauro Carvalho Chehab
Em Tue, 16 Aug 2016 13:48:13 +0200
Markus Heiser  escreveu:

> Am 16.08.2016 um 13:03 schrieb Mauro Carvalho Chehab 
> :
> 
> > Em Tue, 16 Aug 2016 06:36:05 -0300
> > Mauro Carvalho Chehab  escreveu:
> > 
> > 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So,
> > I had to manually replace it to xelatex. One easy solution would be to
> > not use Make -C $BUILDDIR/latex, but to just call xelatex 
> > $BUILDDIR/$tex_name.  
> 
> I recommend to ship your own tex-Makefile, see:
> 
>   https://lkml.org/lkml/2016/8/10/114

That makes sense for me, but let the others review what we have so far.
We can later improve and use a makefile for tex. I would prefer to call
the version that will be copied to the output dir with a different name
(like Makefile.tex or Makefile.in), as I found really weird to have a
file called Makefile inside the Kernel tree that contains just a makefile
prototype.

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


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

2016-08-16 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 4/9] [media] docs-rst: better use the .. note:: tag

2016-08-16 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
 Description
 ===
 
-.. not

[PATCH 1/9] [media] pixfmt-nv12mt.rst: use PNG instead of GIF

2016-08-16 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&dGsPn{QY=Bb|r;(6+q+1bsx
zxvy`8-AZ)6z3Cv$DzebNmJoNG&VJ}9=Ei%vD-U3yExrFy-&D({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&#!
zZ2o(6K~22}jLiEO-~AJugyFU8Rq!!S$RJQc{tKru;GgjkKx^
zFd&lbg)hGK?p7)LCkp@qeX0;<>RU3>!h8W=eg6o&nE4(8Lhkxx8flHs7RsrkEkc^-X~TW61OE-h+0@5963qk?9WuDbC$zlK*#au5C*
zD7^%Y9A^IR@P6g`?lm+1UAyC0%O5K)1Eptk8flOMvr(_T6UzQ|!ub`Li=XY=jd?Fy
zzsv*}SJoRT^iEPbz9CSR>R!~+@%|b3CiB=5scaWqd0YZwBduRfHnEOJD<`ds=vt`@
zeULk`X^@`eESxaj_5qFpprApz!pV#Yqh{V-zud5;!cfY#{VvN;21&&*dK_lxwQS=+
ziKn#L6o;W2dSyL_s^*P@;0<8OtZscq2{U@#F5lP`yda|x8LVOKT5yNB52{bOZtUP$1Q7!Q+vgdTu|H9S$!C_Y|k6eM|{7L(qs&a9y!lH8$KYht*s
zdB3FxvecONvQarrk5td@Rjh6BatJqiJQZ$bsPpWT6V7Ylo?&DIF_&N1=BJiZ$6oP%
zZdB_r>>SnEGHX@sIdQyb%;**PicwdGuC4T`AN|5lI#Olt9yND}Ncbdfi1})?vD7K#
z1N>KFf}O11Omvp4_5j@U#Fv_kEIHkw5)9wCB^f)sM(s`-JjBc}voaUYxX8gtrqP!8Be^mPojpej9Pxfrk6fJ-Gg%2H%yFF&E(qV
zI@>pHuJyjEb5^X}(|8k&G2GLkt(BPaVpGp+l(!+;QpmQ}o?*W2G+0RaobVQuEze%)
z3UG`306VfGT7f(rwcgs~{Qh~pBRRlO@YHBs-w?L=Y;arWuky}%5=;^azquvIH*o=*
zsQiS2LGh4%yDO~Jt@9DQHJ}X>awdgTA}L#H>6nX`$g2WD4to?$A8`b0(d^~rw-5@d
zLH6q~{K2&*`1UU*bgGn?Xx^Y9IYtLz2DJ6^o|L+7M?-B^dEk@-eW*%z7^E<}3J%)$
zJrpIQY2tSA4%y)h`Kh(yc)_l3U^>((>&RtHDeOyrue4eiOrH80Aq_2QIUgju8)EmH
z9tf^vzW{5uLP@gPO9gK)bJB?Pnd&Sc3Uctpwby8(|-de8|dI~ZDJ4}ij
z;^wQqme2^??d-!|%xvb;9XmE$*v*1W$FZ{g^6v|5Xg&L9b94b~_X|DG$E8T`4+QHp
zp$)J$n)>?P&I9hKv}N$a{x-(7yg|1+SgtA#PEyJnpoSQ{Q}P}|V2~Sf!AS=xaGOz8
zN1C)dg|5kp(>VCifsAqDmK)F^-R{ubEBeo6ifzvR6d@A
zfm{|NR0~nPzz@brvSP1yYuepvZ&BuG776h#+R()pe)ez@b)6-jzTZcay
JfkA-P{{T*w8|nZ6

diff --git a/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png 
b/Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png
new file mode 100644
index 
..41401860fb737739658c354c0cb7ca12313a0265
GIT binary patch
literal 1920
zcmb7EX*ApU8vfCysc20nwM-SI6L*H2RD!CDUQKUQa@5*TTZ>exLB#Tpph&N!EvA&V
ziixV}W*4MJ?ORc4Ev2=UqGR7Rh+r}?^XY!L=iK|{eSXjTyw7{y^ZW3`*;tt$L?|Nw
z00&7#f*k--ijue2{ymbqnvq#3fxTXMOFRH2NwV7>FbP+`LbS64Anb1d+=u}{Bx&84
z27rkLVAdS~qci}N{5h4jCX!`_Hs{G^VzD?qJ)O;FGZ+lXuvlCNNdQ1~VleYcFC>=)z$sU{uFl=2oNQvoz2aq_uWJy=nM&Nr~9n*^+{GtH`F(~I`t*p*<4(l
zZE5)scWX-^7=HYy(Sbb9EgsFwUHdYgaoTuedb&F@yoKU6|CUb#pn`O+)`Hj(47E_)
zdt#zGm{5|T!EY~l1qA%p;o*h$c0S#EzWojMFmkf0awsF+QcbnZi~2UmKgG{4-_`l9
zKcm9NGJ(nDUbMdz67s_BQX1`AVo(t8g6%U8H)AEG=6c6Toels^o3}he(!Y@X`I>z;SvV_>B7iz*I>DJUL`=fpgtu$Uwfue$wXLV_pG`
zqp2k~`duk%u@om=bvK1x!&*pXKD^ADs}-MeF1Eo}cD#oS!1mTi%;|KVZD_cu7AzEeq)7+Fh{t;b?Y~7nmJ8kRoe2qX)|9JQ%
z)%pKuy!VjhcT6b66gIBj%Fm%GsG8%V2zBL)1g0hnee~iJon>D9

[PATCH 7/9] [media] pixfmt-packed-rgb.rst: rotate a big table

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

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 39b9c4a26f6e..64f5fb4170a9 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -306,6 +306,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


[PATCH 5/9] [media] pixfmt-007.rst: use Sphinx math:: expressions

2016-08-16 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/media/uapi/v4l/pixfmt-007.rst | 175 ++--
 1 file changed, 114 insertions(+), 61 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst 
b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 39753f6f7b83..8d4f1033663f 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' - 0.419G' - 0.081B')
 
 Y' is clamped to the range [0???1] and Cb and Cr are clamped to the range
 [-0.5???0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be
@@ -298,24 +314,30 @@ These chromaticities are identical to the Rec. 709 
colorspace.
 Transfer function. Note that negative values for L are only used by the
 Y'CbCr conversion.
 
-L' = -1.055(-L) :sup:`1/2.4` + 0.055 for L < -0.0031308
+.. math::
 
-L' = 12.92L for -0.0031308 ??? L ??? 0.0031308
+L' = -1.055(-L)^{\frac{1}{2.4} } + 0.055\text{, for }L < -0.0031308
 
-L' = 1.055L :sup:`1/2.4` - 0.055 for 0.0031308 < L ??? 1
+L' = 12.92L\text{, for }-0.0031308 \le L \le 0.0031308
+
+L' = 1.055L ^{\frac{1}{2.4} } - 0.055\text{, for }0.0031308 < L \le 1
 
 Inverse Transfer function:
 
-L = -((-L' + 0.055) / 1.055) :sup:`2.4` for L' < -0.04045
+.. math

[PATCH 3/9] [media] vidioc-enumstd.rst: remove bullets from sound carrier

2016-08-16 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 0/9] Fix some issues at the media documentation to allow PDF build

2016-08-16 Thread Mauro Carvalho Chehab
This patch series fix several issues with the media build.

The first 4 patches are actually some random fixups that were noticed
while fixing the PDF build;

The next patch makes usage of Sphinx math expressions, to improve
readability of some formulas at pixfmt-007.rst, related to color space
conversions;

The 6th patch removes code blocks from tables, as Sphinx LaTeX output
for those blocks are broken. As the code there is really trivial, it doesn't
hurt much to just convert them into literals.

The 7th and 8th patch are actually two examples about how to improve
table outputs with LaTeX/PDF. The problem is that LaTeX requires explicit
markups to adjust the columns size. Also, Sphinx, by default, produce
portrait, single-paged tables. Manual work will be needed to fix all tables
and make them appear.

The last patch restores the build of the media documentation.

Please notice that there are some non-fatal issues related to the media
header files converted by parse-headers.pl. Those don't happen on
Sphinx 1.3.x. So, I suspect that this is actually due to some bug at the
Sphinx 1.4.x output, but I didn't try to investigate, as just ignoring them
seems to be OK (at least, visually, the output looked good on my eyes).

This series require my previous 9-patch docs-next series, with fix
bugs related to LaTeX handling.


I'm pushing the entire stuff of both series on my development tree, at:
https://git.linuxtv.org//mchehab/experimental.git/log/?h=docs-next

The generated media PDF file is at:
https://mchehab.fedorapeople.org/media.pdf

Mauro Carvalho Chehab (9):
  [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
  [media] pixfmt-007.rst: use Sphinx math:: expressions
  [media] docs-rst: get rid of code-block inside tables
  [media] pixfmt-packed-rgb.rst: rotate a big table
  [media] vidioc-querycap.rst: Better format tables on PDF output
  docs-rst: add media documentation to PDF output

 Documentation/conf.py  |   5 +
 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-packed-rgb.rst |   9 +-
 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 +-
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst   |   4 +-
 .../media/uapi/v4l/vidioc-enum-dv-timings.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |  14 +-
 .../media/uapi/v4l/v

[PATCH 6/9] [media] docs-rst: get rid of code-block inside tables

2016-08-16 Thread Mauro Carvalho Chehab
There are two tables with a C code-block inside it. Unfortunately,
that causes LaTeX output to break. Yet, there's nothing special
there, so let's remove the code-block from them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst |  5 +
 Documentation/media/uapi/v4l/vidioc-querycap.rst | 12 +++-
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst 
b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
index 4715261631ab..13d5b509a829 100644
--- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
+++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst
@@ -105,11 +105,8 @@ one until ``EINVAL`` is returned.
 
-  :cspan:`2`
 
-
  .. _v4l2-fourcc:
- .. code-block:: c
-
- #define v4l2_fourcc(a,b,c,d) 
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+ ``#define v4l2_fourcc(a,b,c,d) 
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))``
 
  Several image formats are already defined by this specification in
  :ref:`pixfmt`.
diff --git a/Documentation/media/uapi/v4l/vidioc-querycap.rst 
b/Documentation/media/uapi/v4l/vidioc-querycap.rst
index b10fed313f99..f37fc3badcdf 100644
--- a/Documentation/media/uapi/v4l/vidioc-querycap.rst
+++ b/Documentation/media/uapi/v4l/vidioc-querycap.rst
@@ -117,17 +117,11 @@ specification the ioctl returns an ``EINVAL`` error code.
 
-  :cspan:`2`
 
+ ``#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))``
 
- .. code-block:: c
+ ``__u32 version = KERNEL_VERSION(0, 8, 1);``
 
- #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);
+ ``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 8/9] [media] vidioc-querycap.rst: Better format tables on PDF output

2016-08-16 Thread Mauro Carvalho Chehab
Both tables on this rst file were not shown right, as they miss
the proper tag (tabularcolumns) to specify the column widths
required for PDF and LaTeX output.

Also, the second table is too big to fit into one page. So,
it should use the longtable class to allow it to be split into
two pages.

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

diff --git a/Documentation/media/uapi/v4l/vidioc-querycap.rst 
b/Documentation/media/uapi/v4l/vidioc-querycap.rst
index f37fc3badcdf..05d86b2b87dd 100644
--- a/Documentation/media/uapi/v4l/vidioc-querycap.rst
+++ b/Documentation/media/uapi/v4l/vidioc-querycap.rst
@@ -43,11 +43,12 @@ specification the ioctl returns an ``EINVAL`` error code.
 
 .. _v4l2-capability:
 
+.. tabularcolumns:: |p{1.5cm}|p{2.5cm}|p{13cm}|
+
 .. flat-table:: struct v4l2_capability
 :header-rows:  0
 :stub-columns: 0
-:widths:   1 1 2
-
+:widths:   3 4 20
 
 -  .. row 1
 
@@ -121,7 +122,9 @@ specification the ioctl returns an ``EINVAL`` error code.
 
  ``__u32 version = KERNEL_VERSION(0, 8, 1);``
 
- ``printf ("Version: %u.%u.%u\\n", (version >> 16) & 0xFF, (version >> 
8) & 0xFF, version & 0xFF);``
+ ``printf ("Version: %u.%u.%u\\n",``
+
+ ``(version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);``
 
 -  .. row 6
 
@@ -169,12 +172,15 @@ specification the ioctl returns an ``EINVAL`` error code.
 
 .. _device-capabilities:
 
+.. tabularcolumns:: |p{6cm}|p{2.2cm}|p{8.8cm}|
+
+.. cssclass:: longtable
+
 .. flat-table:: Device Capabilities Flags
 :header-rows:  0
 :stub-columns: 0
 :widths:   3 1 4
 
-
 -  .. row 1
 
-  ``V4L2_CAP_VIDEO_CAPTURE``
-- 
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 9/9] docs-rst: add media documentation to PDF output

2016-08-16 Thread Mauro Carvalho Chehab
Now that the build of PDF output on media got fixed, re-add it
to the Sphinx PDF build.

Partially reverts 3eb6cd6834c3 ('Documentation: exclude
media documentation from pdf generation').

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 64f5fb4170a9..8058eb2b8340 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -320,6 +320,8 @@ latex_documents = [
  'The kernel development community', 'manual'),
 ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide',
  'The kernel development community', 'manual'),
+('media/index', 'media.tex', 'Linux Media Subsystem Documentation',
+ 'The kernel development community', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
-- 
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/9] docs-rst: remove a rst2pdf left over code

2016-08-16 Thread Mauro Carvalho Chehab
The usage of rst2pdf was replaced by pdflatex on a previous
patch. Remove the left-over code at conf.py.

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 5c06b018ad1d..2c60df7e5b79 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -31,13 +31,6 @@ from load_config import loadConfig
 # ones.
 extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
 
-# Gracefully handle missing rst2pdf.
-try:
-import rst2pdf
-extensions += ['rst2pdf.pdfbuilder']
-except ImportError:
-pass
-
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
-- 
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 8/9] docs-rst: Don't go to interactive mode on errors

2016-08-16 Thread Mauro Carvalho Chehab
When building for LaTeX, it stops and enters into interactive
mode on errors. Don't do that, as there are some non-fatal errors
on media books when using Sphinx 1.4.x that we don't know how fix
yet.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 16a3502c9e40..ba4efb1f68f3 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -72,7 +72,7 @@ ifeq ($(HAVE_PDFLATEX),0)
@echo "  SKIPSphinx $@ target."
 else # HAVE_PDFLATEX
@$(call loop_cmd,sphinx,latex,.,latex,.)
-   $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex
+   $(Q)$(MAKE) PDFLATEX=xelatex LATEXOPTS="-interaction=nonstopmode" -C 
$(BUILDDIR)/latex
 endif # HAVE_PDFLATEX
 
 epubdocs:
-- 
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 7/9] docs-rst: parse-heraders.pl: escape LaTeX characters

2016-08-16 Thread Mauro Carvalho Chehab
Let's escape the LaTeX characters, to avoid troubles when
outputing them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 34bd9e2630b0..74089b0da798 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -220,7 +220,7 @@ $data =~ s/\n\s+\n/\n\n/g;
 #
 # Add escape codes for special characters
 #
-$data =~ s,([\_\`\*\<\>\&:\/\|]),\\$1,g;
+$data =~ s,([\_\`\*\<\>\&:\/\|\%\$\#\{\}\~\^]),\\$1,g;
 
 $data =~ s,DEPRECATED,**DEPRECATED**,g;
 
-- 
2.7.4


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


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

2016-08-16 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 2c60df7e5b79..42175e87e425 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -246,16 +246,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 9/9] docs-rst: enable the Sphinx math extension

2016-08-16 Thread Mauro Carvalho Chehab
This extension will be used by the media books.

The name of the math image extension changed on Sphinx 1.4.x,
according with:

http://www.sphinx-doc.org/en/stable/ext/math.html#module-sphinx.ext.imgmath

Let's autodetect, to keep building with versions < 1.4.

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index ac5230fcda4d..39b9c4a26f6e 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -14,6 +14,11 @@
 
 import sys
 import os
+import sphinx
+
+# Get Sphinx version
+major, minor, patch = map(int, sphinx.__version__.split("."))
+
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
@@ -31,6 +36,12 @@ from load_config import loadConfig
 # ones.
 extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
 
+# The name of the math extension changed on Sphinx 1.4
+if minor > 3:
+extensions.append("sphinx.ext.imgmath")
+else:
+extensions.append("sphinx.ext.pngmath")
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
-- 
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/9] docs-rst: fix a breakage when building PDF documents

2016-08-16 Thread Mauro Carvalho Chehab
changeset 606b9ac81a63 ("doc-rst: generic way to build only sphinx
sub-folders") accidentally broke PDF generation by adding an extra
")". Remove it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/Makefile.sphinx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index ea0664cece12..fdef3a4bc8c7 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -71,7 +71,7 @@ ifeq ($(HAVE_PDFLATEX),0)
$(warning The 'pdflatex' command was not found. Make sure you have it 
installed and in PATH to produce PDF output.)
@echo "  SKIPSphinx $@ target."
 else # HAVE_PDFLATEX
-   @$(call loop_cmd,sphinx,latex,.,latex,.))
+   @$(call loop_cmd,sphinx,latex,.,latex,.)
$(Q)$(MAKE) -C $(BUILDDIR)/latex
 endif # HAVE_PDFLATEX
 
-- 
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/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 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 fdef3a4bc8c7..16a3502c9e40 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -29,7 +29,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
@@ -68,11 +68,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 loop_cmd,sphinx,latex,.,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 f91acc78e20b..e254198b1dbf 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -254,6 +254,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
@@ -281,6 +285,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 4/9] docs-rst: improve output for .. notes:: on LaTeX

2016-08-16 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 42175e87e425..f91acc78e20b 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -258,6 +258,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 0/9] Prepare Sphinx to build media PDF books

2016-08-16 Thread Mauro Carvalho Chehab
This patch series fix Sphinx to allow it to build the media documentation as a 
PDF
file.

The first patch is actually a bug fix: one of the previous patch broke 
compilation
for PDF as a hole, as it added an extra parenthesis to a function call.

The second patch just removes a left over code for rst2pdf.

The other patches change from "pdflatex" to "xelatex" and address several
issues that prevent building the media books.

Jon,

I think this patch series belong to docs-next. Feel free to merge them there, if
you agree. There's one extra patch that touches Documentation/conf.py,
re-adding the media book to the PDF build, but IMHO this one would be better
to be merged via the media tree, after the fixes inside the media documentation
to fix the build.

I'm sending the media-specific patches on a separate patch series, meant to
be merged via the media tree.

As on the previous experimental patch series, I'm pushing the entire stuff
on my development tree, at:
https://git.linuxtv.org//mchehab/experimental.git/log/?h=docs-next

The generated PDF file is at:
https://mchehab.fedorapeople.org/media.pdf

Please notice that lots of tables are broken. Fixing them would require manual
work, as we'll need to add tags to specify the column size via tabularcolumns,
long tables should use the cssclass:: longtable, and very wide tables will need
to be rotated and size-adjusted.

Anyway, at least *some* PDF support for media books are now possible.


Mauro Carvalho Chehab (9):
  docs-rst: fix a breakage when building PDF documents
  docs-rst: remove a rst2pdf left over code
  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
  docs-rst: better adjust margins and font size
  docs-rst: parse-heraders.pl: escape LaTeX characters
  docs-rst: Don't go to interactive mode on errors
  docs-rst: enable the Sphinx math extension

 Documentation/Makefile.sphinx |  8 ++---
 Documentation/conf.py | 66 +--
 Documentation/sphinx/parse-headers.pl |  2 +-
 3 files changed, 60 insertions(+), 16 deletions(-)

-- 
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 6/9] docs-rst: better adjust margins and font size

2016-08-16 Thread Mauro Carvalho Chehab
As we have big tables, reduce the left/right margins and decrease
the point size to 8pt. Visually, it is still good enough, and
now less tables are too big to be displayed.

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

diff --git a/Documentation/conf.py b/Documentation/conf.py
index e254198b1dbf..ac5230fcda4d 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -249,7 +249,7 @@ latex_elements = {
 'papersize': 'a4paper',
 
 # The font size ('10pt', '11pt' or '12pt').
-'pointsize': '10pt',
+'pointsize': '8pt',
 
 # Latex figure (float) alignment
 #'figure_align': 'htbp',
@@ -260,6 +260,9 @@ latex_elements = {
 
 # Additional stuff for the LaTeX preamble.
 'preamble': '''
+   % Adjust margins
+   \\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}
+
 % Allow generate some pages in landscape
 \\usepackage{lscape}
 
-- 
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 0/2] OV5647 sensor driver

2016-08-16 Thread Ramiro Oliveira
Hello,

Just adding some people in the CC list.

On 16-08-2016 16:26, Ramiro Oliveira wrote:
> Hello,
>
> This patch adds support for the Omnivision OV5647 sensor.
>
> At the moment it only supports 640x480 in Raw 8.
>
> Ramiro Oliveira (2):
>   Add OV5647 device tree documentation
>   Add support for Omnivision OV5647
>
>  .../devicetree/bindings/media/i2c/ov5647.txt   |  19 +
>  MAINTAINERS|   7 +
>  drivers/media/i2c/Kconfig  |  12 +
>  drivers/media/i2c/Makefile |   1 +
>  drivers/media/i2c/ov5647.c | 891 
> +
>  5 files changed, 930 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
>  create mode 100644 drivers/media/i2c/ov5647.c
>

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


Re: Submit media entity without media device

2016-08-16 Thread Ramiro Oliveira
Just adding some people to the CC list.


On 28-06-2016 13:00, Ramiro Oliveira wrote:
> Hi all,
>
> We at Synopsys have a media device driver and in that media device we have a
> media entity for our CSI-2 Host.
>
> At the moment we aren't ready to submit the entire media device, so I was
> wondering if it was possible to submit a media entity driver separately, 
> without
> the rest of the architecture, and if so where should we place it.
>
> Best Regards,
>
> Ramiro Oliveira
>
>

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


[RESEND PATCH] [media] vb2: Fix vb2_core_dqbuf() kernel-doc

2016-08-16 Thread Javier Martinez Canillas
The kernel-doc has the wrong function name and also the pindex
parameter is missing in the documentation.

Signed-off-by: Javier Martinez Canillas 

---

This patch was posted some weeks ago but I noticed that wasn't
picked by patchwork, so I'm resend it.

 drivers/media/v4l2-core/videobuf2-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index ca8ffeb56d72..1dbd7beb71f0 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1726,8 +1726,9 @@ static void __vb2_dqbuf(struct vb2_buffer *vb)
 }
 
 /**
- * vb2_dqbuf() - Dequeue a buffer to the userspace
+ * vb2_core_dqbuf() - Dequeue a buffer to the userspace
  * @q: videobuf2 queue
+ * @pindex:id number of the buffer
  * @pb:buffer structure passed from userspace to vidioc_dqbuf 
handler
  * in driver
  * @nonblocking: if true, this call will not sleep waiting for a buffer if no
-- 
2.5.5

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


Re: [PATCH] [media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_buffer_done()

2016-08-16 Thread Javier Martinez Canillas
Hello Hans,

Thanks a lot for your feedback.

On 08/13/2016 09:47 AM, Hans Verkuil wrote:
> On 07/20/2016 08:22 PM, Javier Martinez Canillas wrote:
>> Currently the dma-buf is unmapped when the buffer is dequeued by userspace
>> but it's not used anymore after the driver finished processing the buffer.
>>
>> So instead of doing the dma-buf unmapping in __vb2_dqbuf(), it can be made
>> in vb2_buffer_done() after the driver notified that buf processing is done.
>>
>> Decoupling the buffer dequeue from the dma-buf unmapping has also the side
>> effect of making possible to add dma-buf fence support in the future since
>> the buffer could be dequeued even before the driver has finished using it.
>>
>> Signed-off-by: Javier Martinez Canillas 
>>
>> ---
>> Hello,
>>
>> I've tested this patch doing DMA buffer sharing between a
>> vivid input and output device with both v4l2-ctl and gst:
>>
>> $ v4l2-ctl -d0 -e1 --stream-dmabuf --stream-out-mmap
>> $ v4l2-ctl -d0 -e1 --stream-mmap --stream-out-dmabuf
>> $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! v4l2sink 
>> device=/dev/video1 io-mode=dmabuf-import
>>
>> And I didn't find any issues but more testing will be appreciated.
>>
>> Best regards,
>> Javier
>>
>>  drivers/media/v4l2-core/videobuf2-core.c | 34 
>> +---
>>  1 file changed, 22 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
>> b/drivers/media/v4l2-core/videobuf2-core.c
>> index 7128b09810be..973331efaf79 100644
>> --- a/drivers/media/v4l2-core/videobuf2-core.c
>> +++ b/drivers/media/v4l2-core/videobuf2-core.c
>> @@ -958,6 +958,22 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned 
>> int plane_no)
>>  EXPORT_SYMBOL_GPL(vb2_plane_cookie);
>>  
>>  /**
>> + * __vb2_unmap_dmabuf() - unmap dma-buf attached to buffer planes
>> + */
>> +static void __vb2_unmap_dmabuf(struct vb2_buffer *vb)
>> +{
>> +int i;
>> +
>> +for (i = 0; i < vb->num_planes; ++i) {
>> +if (!vb->planes[i].dbuf_mapped)
>> +continue;
>> +call_void_memop(vb, unmap_dmabuf,
>> +vb->planes[i].mem_priv);
> 
> Does unmap_dmabuf work in interrupt context? Since vb2_buffer_done can be 
> called from
> an irq handler this is a concern.
>

Good point, I believe it shouldn't be called from atomic context since both
the dma_buf_vunmap() and dma_buf_unmap_attachment() functions can sleep.
 
> That said, vb2_buffer_done already calls call_void_memop(vb, finish, 
> vb->planes[plane].mem_priv);
> to sync buffers, and that can take a long time as well. So it is not a good 
> idea to
> have this in vb2_buffer_done.
>

I see.

> What I would like to see is to have vb2 handle this finish() call and the 
> vb2_unmap_dmabuf
> in some workthread or equivalent.
> 
> It would complicate matters somewhat in vb2, but it would simplify drivers 
> since these
> actions would not longer take place in interrupt context.
>
> I think this patch makes sense, but I would prefer that this is moved out of 
> the interrupt
> context.
>

Ok, I can take a look to this and handle the finish() and unmap_dmabuf()
out of interrupt context as you suggested.

> Regards,
> 
>   Hans
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
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 RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 Thread Markus Heiser

Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab :

...
> The only issue there was the name of the math extension, with is also
> sphinx.ext.pngmath. On a plus side, I was also able to remove one of the
> hacks, by applying the enclosed patch (this doesn't work on 1.4 yet - 
> I suspect it requires some extra stuff to escape).
> 
> So, for me, we're pretty much safe using xelatex, as it works fine for
> Sphinx 1.3 and 1.4 (and, with Sphinx 1.2, provided that the user asks to
> continue the build, just like what's needed with pdflatex on such
> version).
> 
> To make it generic, we'll need to patch conf.py to detect the Sphinx
> version, and use the right math extension, depending on the version.
> Also, as you proposed, Due to Sphinx version is 1.2, we'll need to use a
> custom-made Makefile for tex.
> 
> As xelatex support was added for version 1.5, we don't need to care
> about it.

I haven't checked on which version which math-extension was
replaced. But it is easy to detect the sphinx version in conf.py.
Add these lines to conf.py::

  import sphinx
  major, minor, patch = map(int, sphinx.__version__.split("."))

The "minor" is what you are looking for.

  if minor > 3:
  extensions.append("sphinx.ext.imgmath")
  else:
  extensions.append("sphinx.ext.pngmath")

-- 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 RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 Thread Mauro Carvalho Chehab
Em Tue, 16 Aug 2016 08:03:38 -0300
Mauro Carvalho Chehab  escreveu:

> Em Tue, 16 Aug 2016 06:36:05 -0300
> Mauro Carvalho Chehab  escreveu:

> Did some tests on Jessie. texlive required 219 packages there, 771MB.

...

> There are 2 issues there that are easy to solve, but would require some
> extra logic. I added a quick hack to make them build with xelatex.
> See enclosed. The issues are:
> 
> 1) the name of the math extension changed from sphinx.ext.pngmath to
> sphinx.ext.imgmath on Sphinx 1.4. I guess it should be possible to add
> some logic at conf.py to change the include depending on the Sphinx
> version;
> 
> 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So,
> I had to manually replace it to xelatex. One easy solution would be to
> not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name.

...

> I'll try to install Ubuntu Xenial on a LXC container and repeat the test
> there. Xenial seems to use Sphinx 1.3.6, according with:
>   http://packages.ubuntu.com/search?keywords=python-sphinx

On Ubuntu Xenial LXC container, I had to install:
texlive-xetex python3-sphinx python3-sphinx-rtd-theme ttf-dejavu make 
gcc python3-sphinx-rtd-theme

With actually installed 259 packages, 1,6 GB after install (about 800MB
of download).

The only issue there was the name of the math extension, with is also
sphinx.ext.pngmath. On a plus side, I was also able to remove one of the
hacks, by applying the enclosed patch (this doesn't work on 1.4 yet - 
I suspect it requires some extra stuff to escape).

So, for me, we're pretty much safe using xelatex, as it works fine for
Sphinx 1.3 and 1.4 (and, with Sphinx 1.2, provided that the user asks to
continue the build, just like what's needed with pdflatex on such
version).

To make it generic, we'll need to patch conf.py to detect the Sphinx
version, and use the right math extension, depending on the version.
Also, as you proposed, Due to Sphinx version is 1.2, we'll need to use a
custom-made Makefile for tex.

As xelatex support was added for version 1.5, we don't need to care
about it.

Jon,

What do you think? Let's move to xelatex?

Thanks,
Mauro

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 8aa4fffda860..aa7ff32be589 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -49,7 +49,6 @@ 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/conf.py b/Documentation/conf.py
index 2bc91fcc6d1f..0a32d6b493e8 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,7 +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 = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 
'kernel_include']
+extensions = ['sphinx.ext.pngmath', 'kernel-doc', 'rstFlatTable', 
'kernel_include']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 34bd9e2630b0..74089b0da798 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -220,7 +220,7 @@ $data =~ s/\n\s+\n/\n\n/g;
 #
 # Add escape codes for special characters
 #
-$data =~ s,([\_\`\*\<\>\&:\/\|]),\\$1,g;
+$data =~ s,([\_\`\*\<\>\&:\/\|\%\$\#\{\}\~\^]),\\$1,g;
 
 $data =~ s,DEPRECATED,**DEPRECATED**,g;
 

--
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 RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 Thread Markus Heiser

Am 16.08.2016 um 13:03 schrieb Mauro Carvalho Chehab :

> Em Tue, 16 Aug 2016 06:36:05 -0300
> Mauro Carvalho Chehab  escreveu:
> 
> 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So,
> I had to manually replace it to xelatex. One easy solution would be to
> not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name.

I recommend to ship your own tex-Makefile, see:

  https://lkml.org/lkml/2016/8/10/114

-- 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] media: v4l2-ctrls: append missing h264 profile string

2016-08-16 Thread Sakari Ailus
Hi, Stan!

How are you doing? :-)

On Tue, Aug 16, 2016 at 12:09:42PM +0300, Stanimir Varbanov wrote:
> This appends missing "Stereo High" h264 profile string. Without
> it the v4l2 compliance would crash kernel with NULL pointer
> dereference at:
> 
> [   26.882278] [] std_validate+0x378/0x42c
> [   26.886967] [] set_ctrl+0x8c/0x134
> [   26.892521] [] v4l2_s_ctrl+0x90/0xf4
> [   26.897555] [] v4l_s_ctrl+0x4c/0x110
> [   26.902503] [] __video_do_ioctl+0x240/0x2b4
> [   26.907625] [] video_usercopy+0x33c/0x46c
> [   26.913441] [] video_ioctl2+0x14/0x1c
> [   26.918822] [] v4l2_ioctl+0xe0/0x110
> [   26.924032] [] do_vfs_ioctl+0xb4/0x764
> [   26.929238] [] SyS_ioctl+0x84/0x98
> [   26.934707] [] __sys_trace_return+0x0/0x4
> 
> Signed-off-by: Stanimir Varbanov 
> ---
>  drivers/media/v4l2-core/v4l2-ctrls.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
> b/drivers/media/v4l2-core/v4l2-ctrls.c
> index f7abfad9ad23..adc2147fcff7 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -361,6 +361,7 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>   "Scalable Baseline",
>   "Scalable High",
>   "Scalable High Intra",
> + "Stereo High",
>   "Multiview High",
>   NULL,
>   };

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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 RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 Thread Mauro Carvalho Chehab
Em Tue, 16 Aug 2016 06:36:05 -0300
Mauro Carvalho Chehab  escreveu:

> Em Tue, 16 Aug 2016 10:27:34 +0200
> Markus Heiser  escreveu:
> 
> > Am 15.08.2016 um 23:21 schrieb 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.
> > 
> > Right, we should use the XeLaTeX engine. But ...
> > 
> > Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX.  
> 
> Yes, but official support for XeLaTeX was added for 1.5:
>   
> https://github.com/agda/agda/commit/a6a437316c9b9d998e6d6d0a6a654a63422a4212
> 
> And the change there was really simple: it just adds it to the generated
> Makefile.
> 
> > E.g. in its defaults it uses "inputenc" and other stuff which
> > is not a part of XeLaTeX.
> > 
> > * https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426
> > 
> > This patch removes the "inputenc", thats right, but I think over
> > short/long term we will see more errors related to LaTeX/XeLaTeX
> > distinction.   
> 
> Actually, I don't expect troubles at long term, as it is now officially
> supported.
> 
> > And we will see that some conversion will break, depending
> > on the sphinx version we use (There might be some non XeLateX friendly 
> > changes in the sphinx-versions, since it is not tested with XeLaTeX).  
> 
> Yeah, we need to double-check backward compatibility, and eventually
> disable it on older versions.
> 
> I can't easily test version 1.3.x anymore, as Fedora 24 upgraded to
> Sphinx 1.4.4. The book builds fine on both 1.4.4 and 1.4.5.
> 
> I'll install a Debian Jessie LXC container and double-check if the build
> is fine with Sphinx version 1.2.x and check the package requirements.

Did some tests on Jessie. texlive required 219 packages there, 771MB.
The packages I installed there are:

# 219 packages, 771MB - and includes some non-tex packages, that
# are not present on the minimal LXC container install
texlive-xetex

# 24 packages, 7289kB
python3-sphinx

# 2 packages, 373kB
python3-sphinx-rtd-theme

# Build environment: 19 packages
make gcc

# Fonts
ttf-dejavu

There are 2 issues there that are easy to solve, but would require some
extra logic. I added a quick hack to make them build with xelatex.
See enclosed. The issues are:

1) the name of the math extension changed from sphinx.ext.pngmath to
sphinx.ext.imgmath on Sphinx 1.4. I guess it should be possible to add
some logic at conf.py to change the include depending on the Sphinx
version;

2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So,
I had to manually replace it to xelatex. One easy solution would be to
not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name.

Also, documentation hits an error. using  or  makes it build, but
not sure what got missed there, as it has 1205 pages. I suspect that
only the index was broken.

The error happens during document output phase:

[1] [2] (./TheLinuxKernel.toc)
Adding blank page after the table of contents.
[1] [2] [1] [2]
Chapter 1.
[3] [4]
! Misplaced \omit.
\multispan ->\omit 
   \@multispan 
l.407 \hline\end{tabulary}

It resembles this error:
https://www.mail-archive.com/sphinx-dev@googlegroups.com/msg06083.html

So, I suspect it has nothing to do with xelatex, but it is, instead
some Spinx 1.2.x bug when generating cell span output in Latex.

It happened on this part of the LaTeX source code:

\begin{threeparttable}
\capstart\caption{table title}

\begin{tabulary}{\linewidth}{|L|L|L|L|}
\hline

head col 1
 & 
head col 2
 & 
head col 3
 & 
head col 4
\\
\hline
column 1
 & 
field 1.1
 &  \multicolumn{2}{l|}{
field 1.2 with autospan
}\\
\hline
column 2
 & 
field 2.1
 &  \multirow{2}{*}{ \multicolumn{2}{l|}{
  field 2.2 - 3.3
}}\\
\hline\phantomsection\label{kernel-documentation:last-row}
column 3
 &  & \\

\hline\end{tabulary}

\end{threeparttable}

\end{quote}

Btw, removing the media books and all latex options, using pdflatex
still doesn't build cleanly on 1.2.x:

Package inputenc Warning: inputenc package ignored with utf8 based engines.

)
! Undefined control sequence.
 \DeclareUnicodeCharacter 
 
l.5 \DeclareUnicodeCharacter
{00A0}{\nobreakspace}


Again, user has to use  or  to continue the build.

I'll try to install Ubuntu Xenial on a LXC container and repeat the test
there. Xenial seems to use Sphinx 1.3.6, according with:
http://packages.ubuntu.com/search?keywords=python-sphinx

Btw, as now both latest version of Ubuntu and Fedora uses Sphinx
1.4.x, perhaps we could raise the bar and just require Sphinx > 1.4.

Thanks,
Mauro

Quick hack to make it build on Sphinx 1.2.3

diff --git a/Documentation/Mak

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

2016-08-16 Thread Mauro Carvalho Chehab
Em Tue, 16 Aug 2016 10:27:34 +0200
Markus Heiser  escreveu:

> Am 15.08.2016 um 23:21 schrieb 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.  
> 
> Right, we should use the XeLaTeX engine. But ...
> 
> Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX.

Yes, but official support for XeLaTeX was added for 1.5:

https://github.com/agda/agda/commit/a6a437316c9b9d998e6d6d0a6a654a63422a4212

And the change there was really simple: it just adds it to the generated
Makefile.

> E.g. in its defaults it uses "inputenc" and other stuff which
> is not a part of XeLaTeX.
> 
> * https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426
> 
> This patch removes the "inputenc", thats right, but I think over
> short/long term we will see more errors related to LaTeX/XeLaTeX
> distinction. 

Actually, I don't expect troubles at long term, as it is now officially
supported.

> And we will see that some conversion will break, depending
> on the sphinx version we use (There might be some non XeLateX friendly 
> changes in the sphinx-versions, since it is not tested with XeLaTeX).

Yeah, we need to double-check backward compatibility, and eventually
disable it on older versions.

I can't easily test version 1.3.x anymore, as Fedora 24 upgraded to
Sphinx 1.4.4. The book builds fine on both 1.4.4 and 1.4.5.

I'll install a Debian Jessie LXC container and double-check if the build
is fine with Sphinx version 1.2.x and check the package requirements.

>Nevertheless, XeLaTeX is the right choice!
> 
> My Suggestion is, that you merge this patch on top of Jon's doc-next. 
> There, we have the sub-folders feature, with we can test book by book
> and improve our toolchain.
> 
> -- Markus --
> 
> 
> > 
> > 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  
> 



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


[PATCH] media: v4l2-ctrls: append missing h264 profile string

2016-08-16 Thread Stanimir Varbanov
This appends missing "Stereo High" h264 profile string. Without
it the v4l2 compliance would crash kernel with NULL pointer
dereference at:

[   26.882278] [] std_validate+0x378/0x42c
[   26.886967] [] set_ctrl+0x8c/0x134
[   26.892521] [] v4l2_s_ctrl+0x90/0xf4
[   26.897555] [] v4l_s_ctrl+0x4c/0x110
[   26.902503] [] __video_do_ioctl+0x240/0x2b4
[   26.907625] [] video_usercopy+0x33c/0x46c
[   26.913441] [] video_ioctl2+0x14/0x1c
[   26.918822] [] v4l2_ioctl+0xe0/0x110
[   26.924032] [] do_vfs_ioctl+0xb4/0x764
[   26.929238] [] SyS_ioctl+0x84/0x98
[   26.934707] [] __sys_trace_return+0x0/0x4

Signed-off-by: Stanimir Varbanov 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index f7abfad9ad23..adc2147fcff7 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -361,6 +361,7 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
"Scalable Baseline",
"Scalable High",
"Scalable High Intra",
+   "Stereo High",
"Multiview High",
NULL,
};
-- 
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 RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output

2016-08-16 Thread Markus Heiser
Am 15.08.2016 um 23:21 schrieb 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.

Right, we should use the XeLaTeX engine. But ...

Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX.
E.g. in its defaults it uses "inputenc" and other stuff which
is not a part of XeLaTeX.

* https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426

This patch removes the "inputenc", thats right, but I think over
short/long term we will see more errors related to LaTeX/XeLaTeX
distinction. And we will see that some conversion will break, depending
on the sphinx version we use (There might be some non XeLateX friendly 
changes in the sphinx-versions, since it is not tested with XeLaTeX).

   Nevertheless, XeLaTeX is the right choice!

My Suggestion is, that you merge this patch on top of Jon's doc-next. 
There, we have the sub-folders feature, with we can test book by book
and improve our toolchain.

-- Markus --


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

--
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/2] v4l-utils: fixed dvbv5 vdr format

2016-08-16 Thread Markus Heiser

Am 10.08.2016 um 11:52 schrieb Markus Heiser :

> The vdr format was broken, I got '(null)' entries
> 
> HD:11494:S1HC23I0M5N1O35:S:(null):22000:5101:5102,5103,5106,5108:0:0:10301:0:0:0:
> 0-:1:2--:3:4-:
> 
> refering to the VDR Wikis ...
> 
> * LinuxTV: http://www.linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf
> * german comunity Wiki: 
> http://www.vdr-wiki.de/wiki/index.php/Channels.conf#Parameter_ab_VDR-1.7.4
> 
> There is no field at position 4 / in between "Source" and "SRate" which
> might have a value. I suppose the '(null):' is the result of pointing
> to *nothing*.
> 
> An other mistake is the ending colon (":") at the line. It is not
> explicit specified but adding an collon to the end of an channel entry
> will prevent players (like mpv or mplayer) from parsing the line (they
> will ignore these lines).
> 
> At least: generating a channel list with
> 
>  dvbv5-scan --output-format=vdr ...
> 
> will result in the same defective channel entry, containing "(null):"
> and the leading collon ":".
> 

Hi,

please apply this patch or give me at least some feedback / thanks.

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