Re: [PATCH] helene: fix memory leak when heleno_x_pon fails

2016-08-14 Thread Abylay Ospan
Hi Colin,

It's really possible memory leak here. thanks for fix.

Acked-by: Abylay Ospan 

2016-08-13 14:16 GMT-04:00 Colin King :
> From: Colin Ian King 
>
> The error return path of failed calls to heleno_x_pon leak
> memory because priv is not kfree'd.  Fix this by kfree'ing
> priv before returning.
>
> Signed-off-by: Colin Ian King 
> ---
>  drivers/media/dvb-frontends/helene.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/helene.c 
> b/drivers/media/dvb-frontends/helene.c
> index 97a8982..3d1cd5f 100644
> --- a/drivers/media/dvb-frontends/helene.c
> +++ b/drivers/media/dvb-frontends/helene.c
> @@ -987,8 +987,10 @@ struct dvb_frontend *helene_attach_s(struct dvb_frontend 
> *fe,
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 1);
>
> -   if (helene_x_pon(priv) != 0)
> +   if (helene_x_pon(priv) != 0) {
> +   kfree(priv);
> return NULL;
> +   }
>
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 0);
> @@ -1021,8 +1023,10 @@ struct dvb_frontend *helene_attach(struct dvb_frontend 
> *fe,
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 1);
>
> -   if (helene_x_pon(priv) != 0)
> +   if (helene_x_pon(priv) != 0) {
> +   kfree(priv);
> return NULL;
> +   }
>
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 0);
> --
> 2.8.1
>



-- 
Abylay Ospan,
NetUP Inc.
http://www.netup.tv
--
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


drivers/media/v4l2-core/videobuf2-dma-contig.c:486:2: error: implicit declaration of function 'dma_get_cache_alignment'

2016-08-14 Thread kbuild test robot
Hi Hans,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   329f4152911c276b074bec75a0443f88821afdb7
commit: c1023ba74fc77dc56dc317bd98f5060aab889ac1 [media] 
drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency
date:   5 weeks ago
config: m32r-allyesconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout c1023ba74fc77dc56dc317bd98f5060aab889ac1
# save the attached .config to linux build tree
make.cross ARCH=m32r 

All errors (new ones prefixed by >>):

   drivers/media/v4l2-core/videobuf2-dma-contig.c: In function 
'vb2_dc_get_userptr':
>> drivers/media/v4l2-core/videobuf2-dma-contig.c:486:2: error: implicit 
>> declaration of function 'dma_get_cache_alignment' 
>> [-Werror=implicit-function-declaration]
 unsigned long dma_align = dma_get_cache_alignment();
 ^
   cc1: some warnings being treated as errors

vim +/dma_get_cache_alignment +486 
drivers/media/v4l2-core/videobuf2-dma-contig.c

774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  470  {
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  471 /* really, we cannot do anything better at this point */
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  472 return (dma_addr_t)(pfn) << PAGE_SHIFT;
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  473  }
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  474  #endif
774d2301 drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2013-06-19  475  
36c0f8b3 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil
2016-04-15  476  static void *vb2_dc_get_userptr(struct device *dev, unsigned 
long vaddr,
cd474037 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil
2014-11-18  477 unsigned long size, enum dma_data_direction dma_dir)
1a758d4e drivers/media/video/videobuf2-dma-contig.c Pawel Osciak
2010-10-11  478  {
1a758d4e drivers/media/video/videobuf2-dma-contig.c Pawel Osciak
2010-10-11  479 struct vb2_dc_buf *buf;
fb639eb3 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara
2015-07-13  480 struct frame_vector *vec;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 
2012-06-14  481 unsigned long offset;
fb639eb3 drivers/media/v4l2-core/videobuf2-dma-contig.c Jan Kara
2015-07-13  482 int n_pages, i;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 
2012-06-14  483 int ret = 0;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 
2012-06-14  484 struct sg_table *sgt;
e15dab75 drivers/media/v4l2-core/videobuf2-dma-contig.c Tomasz Stanislawski 
2012-06-14  485 unsigned long contig_size;
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12 @486 unsigned long dma_align = dma_get_cache_alignment();
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil
2014-11-18  487 DEFINE_DMA_ATTRS(attrs);
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil
2014-11-18  488  
251a79f8 drivers/media/v4l2-core/videobuf2-dma-contig.c Hans Verkuil
2014-11-18  489 dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12  490  
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12  491 /* Only cache aligned DMA transfers are reliable */
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12  492 if (!IS_ALIGNED(vaddr | size, dma_align)) {
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12  493 pr_debug("user data must be aligned to %lu 
bytes\n", dma_align);
d81e870d drivers/media/v4l2-core/videobuf2-dma-contig.c Marek Szyprowski
2012-06-12  494 return ERR_PTR(-EINVAL);

:: The code at line 486 was first introduced by commit
:: d81e870d5afa1b0a95ea94c4052d3c7e973fae8c [media] v4l: vb2-dma-contig: 
fail if user ptr buffer is not correctly aligned

:: TO: Marek Szyprowski 
:: CC: Mauro Carvalho Chehab 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v3 02/14] media: mt9m111: prevent module removal while in use

2016-08-14 Thread Hans Verkuil
On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
> The mt9m111 can be a removable module : the only case where the module
> should be kept loaded is while it is used, ie. while an active
> transation is ongoing on it.
> 
> The notion of active transaction is mapped on the power state of the
> module : if powered on the removal is prohibited.

I don't really see the purpose of this patch: if this driver is loaded
by a platform driver (such as pxa_camera), then the module count should be
1 and it isn't possible to unload.

So you shouldn't need this patch. Am I missing something?

No other driver in drivers/media/i2c does something like this.

Regards,

Hans

> 
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/media/i2c/soc_camera/mt9m111.c | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/soc_camera/mt9m111.c 
> b/drivers/media/i2c/soc_camera/mt9m111.c
> index a7efaa5964d1..ea5b5e709402 100644
> --- a/drivers/media/i2c/soc_camera/mt9m111.c
> +++ b/drivers/media/i2c/soc_camera/mt9m111.c
> @@ -780,23 +780,33 @@ static int mt9m111_power_on(struct mt9m111 *mt9m111)
>   struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev);
>   int ret;
>  
> + if (!try_module_get(THIS_MODULE))
> + return -ENXIO;
> +
>   ret = v4l2_clk_enable(mt9m111->clk);
>   if (ret < 0)
> - return ret;
> + goto out_module_put;
>  
>   ret = mt9m111_resume(mt9m111);
>   if (ret < 0) {
>   dev_err(&client->dev, "Failed to resume the sensor: %d\n", ret);
> - v4l2_clk_disable(mt9m111->clk);
> + goto out_clk_disable;
>   }
>  
>   return ret;
> +
> +out_clk_disable:
> + v4l2_clk_disable(mt9m111->clk);
> +out_module_put:
> + module_put(THIS_MODULE);
> + return ret;
>  }
>  
>  static void mt9m111_power_off(struct mt9m111 *mt9m111)
>  {
>   mt9m111_suspend(mt9m111);
>   v4l2_clk_disable(mt9m111->clk);
> + module_put(THIS_MODULE);
>  }
>  
>  static int mt9m111_s_power(struct v4l2_subdev *sd, int on)
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 12/14] media: platform: pxa_camera: add debug register access

2016-08-14 Thread Hans Verkuil
On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
> Add pxa_camera registers access through advanced video debugging.
> 
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/media/platform/soc_camera/pxa_camera.c | 57 
> ++
>  1 file changed, 57 insertions(+)
> 
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
> b/drivers/media/platform/soc_camera/pxa_camera.c
> index 1e15734ae287..20340489e07e 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -1344,6 +1344,58 @@ static int pxa_camera_check_frame(u32 width, u32 
> height)
>   (width & 0x01);
>  }
>  
> +#ifdef CONFIG_VIDEO_ADV_DEBUG
> +static int pxac_vidioc_g_register(struct file *file, void *priv,
> +   struct v4l2_dbg_register *reg)
> +{
> + struct pxa_camera_dev *pcdev = video_drvdata(file);
> +
> + if (reg->reg > CIBR2)
> + return -ERANGE;
> +
> + reg->val = __raw_readl(pcdev->base + reg->reg);
> + reg->size = sizeof(__u32);
> + return 0;
> +}
> +
> +static int pxac_vidioc_s_register(struct file *file, void *priv,
> +   const struct v4l2_dbg_register *reg)
> +{
> + struct pxa_camera_dev *pcdev = video_drvdata(file);
> +
> + if (reg->reg > CIBR2)
> + return -ERANGE;
> + if (reg->size != sizeof(__u32))
> + return -EINVAL;
> + __raw_writel(reg->val, pcdev->base + reg->reg);
> + return 0;
> +}
> +
> +static int pxac_vidioc_g_chip_info(struct file *file, void *fh,
> +struct v4l2_dbg_chip_info *chip)
> +{
> + struct pxa_camera_dev *pcdev = video_drvdata(file);
> +
> + switch (chip->match.type) {
> + case V4L2_CHIP_MATCH_BRIDGE:
> + if (chip->match.addr > 0)
> + return -EINVAL;
> +
> + strlcpy(chip->name, "pxa-camera", sizeof(chip->name));
> + return 0;
> + case V4L2_CHIP_MATCH_SUBDEV:
> + if (chip->match.addr > 0)
> + return -EINVAL;
> +
> + strlcpy(chip->name, pcdev->sensor->name, sizeof(chip->name));
> + return 0;
> + default:
> + return -EINVAL;
> + }
> +}

You shouldn't need this g_chip_info function, it should be handled automatically
by the v4l2 core. Just drop it.

> +
> +#endif
> +
>  static int pxac_vidioc_enum_fmt_vid_cap(struct file *filp, void  *priv,
>   struct v4l2_fmtdesc *f)
>  {
> @@ -1594,6 +1646,11 @@ static const struct v4l2_ioctl_ops 
> pxa_camera_ioctl_ops = {
>   .vidioc_expbuf  = vb2_ioctl_expbuf,
>   .vidioc_streamon= vb2_ioctl_streamon,
>   .vidioc_streamoff   = vb2_ioctl_streamoff,
> +#ifdef CONFIG_VIDEO_ADV_DEBUG
> + .vidioc_g_register  = pxac_vidioc_g_register,
> + .vidioc_s_register  = pxac_vidioc_s_register,
> + .vidioc_g_chip_info = pxac_vidioc_g_chip_info,
> +#endif
>  };
>  
>  static struct v4l2_clk_ops pxa_camera_mclk_ops = {
> 

Regards,

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


Re: [PATCH v3 10/14] media: platform: pxa_camera: remove set_crop

2016-08-14 Thread Hans Verkuil
On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
> This is to be seen as a regression as the set_crop function is
> removed. This is a temporary situation in the v4l2 porting, and will
> have to be added later.

This is a bit confusing, since in the next patch you say in the commit log:

 - the s_crop() call was removed, judged not working
   (see what happens soc_camera_s_crop() when get_crop() == NULL)

So the set_crop removal isn't temporary after all? It isn't added back in
this patch series.

Note that I am OK with removing set_crop if it never worked reliably, but
then the commit log of this patch should be updated to reflect that.

Regards,

Hans

> 
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/media/platform/soc_camera/pxa_camera.c | 76 
> --
>  1 file changed, 76 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
> b/drivers/media/platform/soc_camera/pxa_camera.c
> index 8a65f126d091..7a810eb32cc0 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -1297,81 +1297,6 @@ static int pxa_camera_check_frame(u32 width, u32 
> height)
>   (width & 0x01);
>  }
>  
> -static int pxa_camera_set_crop(struct soc_camera_device *icd,
> -const struct v4l2_crop *a)
> -{
> - const struct v4l2_rect *rect = &a->c;
> - struct device *dev = icd->parent;
> - struct soc_camera_host *ici = to_soc_camera_host(dev);
> - struct pxa_camera_dev *pcdev = ici->priv;
> - struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> - struct soc_camera_sense sense = {
> - .master_clock = pcdev->mclk,
> - .pixel_clock_max = pcdev->ciclk / 4,
> - };
> - struct v4l2_subdev_format fmt = {
> - .which = V4L2_SUBDEV_FORMAT_ACTIVE,
> - };
> - struct v4l2_mbus_framefmt *mf = &fmt.format;
> - struct pxa_cam *cam = icd->host_priv;
> - u32 fourcc = icd->current_fmt->host_fmt->fourcc;
> - int ret;
> -
> - /* If PCLK is used to latch data from the sensor, check sense */
> - if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
> - icd->sense = &sense;
> -
> - ret = sensor_call(pcdev, video, s_crop, a);
> -
> - icd->sense = NULL;
> -
> - if (ret < 0) {
> - dev_warn(pcdev_to_dev(pcdev), "Failed to crop to %ux%u@%u:%u\n",
> -  rect->width, rect->height, rect->left, rect->top);
> - return ret;
> - }
> -
> - ret = sensor_call(pcdev, pad, get_fmt, NULL, &fmt);
> - if (ret < 0)
> - return ret;
> -
> - if (pxa_camera_check_frame(mf->width, mf->height)) {
> - /*
> -  * Camera cropping produced a frame beyond our capabilities.
> -  * FIXME: just extract a subframe, that we can process.
> -  */
> - v4l_bound_align_image(&mf->width, 48, 2048, 1,
> - &mf->height, 32, 2048, 0,
> - fourcc == V4L2_PIX_FMT_YUV422P ? 4 : 0);
> - ret = sensor_call(pcdev, pad, set_fmt, NULL, &fmt);
> - if (ret < 0)
> - return ret;
> -
> - if (pxa_camera_check_frame(mf->width, mf->height)) {
> - dev_warn(pcdev_to_dev(pcdev),
> -  "Inconsistent state. Use S_FMT to repair\n");
> - return -EINVAL;
> - }
> - }
> -
> - if (sense.flags & SOCAM_SENSE_PCLK_CHANGED) {
> - if (sense.pixel_clock > sense.pixel_clock_max) {
> - dev_err(pcdev_to_dev(pcdev),
> - "pixel clock %lu set by the camera too high!",
> - sense.pixel_clock);
> - return -EIO;
> - }
> - recalculate_fifo_timeout(pcdev, sense.pixel_clock);
> - }
> -
> - icd->user_width = mf->width;
> - icd->user_height= mf->height;
> -
> - pxa_camera_setup_cicr(icd, cam->flags, fourcc);
> -
> - return ret;
> -}
> -
>  static int pxa_camera_set_fmt(struct soc_camera_device *icd,
> struct v4l2_format *f)
>  {
> @@ -1584,7 +1509,6 @@ static struct soc_camera_host_ops 
> pxa_soc_camera_host_ops = {
>   .remove = pxa_camera_remove_device,
>   .clock_start= pxa_camera_clock_start,
>   .clock_stop = pxa_camera_clock_stop,
> - .set_crop   = pxa_camera_set_crop,
>   .get_formats= pxa_camera_get_formats,
>   .put_formats= pxa_camera_put_formats,
>   .set_fmt= pxa_camera_set_fmt,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 11/14] media: platform: pxa_camera: make a standalone v4l2 device

2016-08-14 Thread Hans Verkuil
On 08/08/2016 09:30 PM, Robert Jarzmik wrote:



> +static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier,
> +  struct v4l2_subdev *subdev,
> +  struct v4l2_async_subdev *asd)
> +{
> + int err;
> + struct v4l2_device *v4l2_dev = notifier->v4l2_dev;
> + struct pxa_camera_dev *pcdev = v4l2_dev_to_pcdev(v4l2_dev);
> + struct video_device *vdev = &pcdev->vdev;
> + struct v4l2_pix_format *pix = &pcdev->current_pix;
> + struct v4l2_subdev_format format = {
> + .which = V4L2_SUBDEV_FORMAT_ACTIVE,
> + };
> + struct v4l2_mbus_framefmt *mf = &format.format;
> +
> + dev_info(pcdev_to_dev(pcdev), "%s(): trying to bind a device\n",
> +  __func__);
> + mutex_lock(&pcdev->mlock);
> + *vdev = pxa_camera_videodev_template;
> + vdev->v4l2_dev = v4l2_dev;
> + vdev->lock = &pcdev->mlock;
> + pcdev->sensor = subdev;
> + pcdev->vdev.queue = &pcdev->vb2_vq;
> + pcdev->vdev.v4l2_dev = &pcdev->v4l2_dev;

You're missing this line here:

pcdev->vdev.ctrl_handler = subdev->ctrl_handler;

This ensures that the sensor's controls are exposed to the video device node.

> + video_set_drvdata(&pcdev->vdev, pcdev);
> +
> + v4l2_disable_ioctl(vdev, VIDIOC_G_STD);
> + v4l2_disable_ioctl(vdev, VIDIOC_S_STD);

Since you don't implement vidioc_g/s_std these two lines can be removed.

> +
> + err = pxa_camera_build_formats(pcdev);
> + if (err) {
> + dev_err(pcdev_to_dev(pcdev), "building formats failed: %d\n",
> + err);
> + goto out;
> + }
> +
> + pcdev->current_fmt = pcdev->user_formats;
> + pix->field = V4L2_FIELD_NONE;
> + pix->width = DEFAULT_WIDTH;
> + pix->height = DEFAULT_HEIGHT;
> + pix->bytesperline =
> + soc_mbus_bytes_per_line(pix->width,
> + pcdev->current_fmt->host_fmt);
> + pix->sizeimage =
> + soc_mbus_image_size(pcdev->current_fmt->host_fmt,
> + pix->bytesperline, pix->height);
> + pix->pixelformat = pcdev->current_fmt->host_fmt->fourcc;
> + v4l2_fill_mbus_format(mf, pix, pcdev->current_fmt->code);
> + err = sensor_call(pcdev, pad, set_fmt, NULL, &format);
> + if (err)
> + goto out;
> +
> + v4l2_fill_pix_format(pix, mf);
> + pr_info("%s(): colorspace=0x%x pixfmt=0x%x\n",
> + __func__, pix->colorspace, pix->pixelformat);
> +
> + err = pxa_camera_init_videobuf2(pcdev);
> + if (err)
> + goto out;
> +
> + err = video_register_device(&pcdev->vdev, VFL_TYPE_GRABBER, -1);
> + if (err) {
> + v4l2_err(v4l2_dev, "register video device failed: %d\n", err);
> + pcdev->sensor = NULL;
> + } else {
> + dev_info(pcdev_to_dev(pcdev),
> +  "PXA Camera driver attached to camera %s\n",
> +  subdev->name);
> + subdev->owner = v4l2_dev->dev->driver->owner;
> + }
> +out:
> + mutex_unlock(&pcdev->mlock);
> + return err;
> +}

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


cron job: media_tree daily build: WARNINGS

2016-08-14 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:   Sun Aug 14 04:00:18 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/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.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


Re: [PATCH v3 00/14] pxa_camera transition to v4l2 standalone device

2016-08-14 Thread Hans Verkuil
On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
> Hi Hans,
> 
> We're leaving the domain of the RFC to a proper submission.
> 
> This is very alike to what you reviewed earlier, the code is very close, and :
>  - the split between patches is done to better isolate cleanups from real code
>  - start_streaming() was implemented
>  - your remarks have been taken into account (please double-check if you're
>happy with it)
>  - v4l2-compliance -f and v4l2-compliance -s were run without any error, and 
> 6 warnings
>   warn: v4l2-test-formats.cpp(713): TRY_FMT cannot handle an invalid 
> pixelformat.
>   warn: v4l2-test-formats.cpp(714): This may or may not be a problem. For 
> more information see:
>   warn: v4l2-test-formats.cpp(715): 
> http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
>  - soc_camera is not touched anymore
>  - the driver is still functional from a capture point of view as before
>   (ie. taking a real picture)
>  
> I'm still relying on soc_mediabus, hence the not-so-nice Makefile diff hunk.
> 
> The only architecture which will have its deconfigs impacted is pxa, under my
> maintainance, and once the review is finished and you have a landing cycle 
> I'll
> complete with a simple serie on the pxa side (defconfig + platform data).
> 
> I've also put the whole serie here if you want to fetch and review from git 
> directly :
>  - git fetch https://github.com/rjarzmik/linux.git work/v4l2
> 
> Happy review.

As you can see from my replies I only have a few small review comments 
remaining.

Can you fix it and post a v4 (rebased to the latest kernel)? Please also add the
v4l2-compliance -f output to the cover letter.

Unless I see something new I plan to make a pull request of v4 for 4.9.

I hope to post my conversion of the atmel-isi driver soon, and that might give
you some ideas on how to get rid of the soc-mbus stuff in a follow-up patch.

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


[PATCH] tw5864: add missing HAS_DMA dependency

2016-08-14 Thread Hans Verkuil
Fix this warning:

warning: (VIDEO_TW5864 && VIDEO_MEDIATEK_VCODEC) selects VIDEOBUF2_DMA_CONTIG 
which has unmet direct dependencies (MEDIA_SUPPORT && HAS_DMA)

This driver depends on HAS_DMA.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/tw5864/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/tw5864/Kconfig b/drivers/media/pci/tw5864/Kconfig
index 760fb11..87c8f32 100644
--- a/drivers/media/pci/tw5864/Kconfig
+++ b/drivers/media/pci/tw5864/Kconfig
@@ -1,6 +1,7 @@
 config VIDEO_TW5864
tristate "Techwell TW5864 video/audio grabber and encoder"
depends on VIDEO_DEV && PCI && VIDEO_V4L2
+   depends on HAS_DMA
select VIDEOBUF2_DMA_CONTIG
---help---
  Support for boards based on Techwell TW5864 chip which provides
-- 
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


[GIT PULL FOR v4.9] New tw5864 driver (v2)

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

Regards,

Hans

Change since v2: fix Kconfig dependency.

The following changes since commit b6aa39228966e0d3f0bc3306be1892f87792903a:

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

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git tw5864

for you to fetch changes up to 5984370475abcaca7bca8aa3b207ce4f7a397951:

  tw5864: add missing HAS_DMA dependency (2016-08-14 11:37:29 +0200)


Andrey Utkin (1):
  pci: Add tw5864 driver

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

 MAINTAINERS |8 +
 drivers/media/pci/Kconfig   |1 +
 drivers/media/pci/Makefile  |1 +
 drivers/media/pci/tw5864/Kconfig|   12 +
 drivers/media/pci/tw5864/Makefile   |3 +
 drivers/media/pci/tw5864/tw5864-core.c  |  359 ++
 drivers/media/pci/tw5864/tw5864-h264.c  |  259 
 drivers/media/pci/tw5864/tw5864-reg.h   | 2133 
+++
 drivers/media/pci/tw5864/tw5864-util.c  |   37 ++
 drivers/media/pci/tw5864/tw5864-video.c | 1514 
++
 drivers/media/pci/tw5864/tw5864.h   |  205 ++
 11 files changed, 4532 insertions(+)
 create mode 100644 drivers/media/pci/tw5864/Kconfig
 create mode 100644 drivers/media/pci/tw5864/Makefile
 create mode 100644 drivers/media/pci/tw5864/tw5864-core.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-h264.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-reg.h
 create mode 100644 drivers/media/pci/tw5864/tw5864-util.c
 create mode 100644 drivers/media/pci/tw5864/tw5864-video.c
 create mode 100644 drivers/media/pci/tw5864/tw5864.h
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] for v4.8 mtk-vcodec: add HAS_DMA dependency

2016-08-14 Thread Hans Verkuil
This fixes this kbuild test robot error:

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   329f4152911c276b074bec75a0443f88821afdb7
commit: c1023ba74fc77dc56dc317bd98f5060aab889ac1 [media] 
drivers/media/platform/Kconfig: fix VIDEO_MEDIATEK_VCODEC dependency
date:   5 weeks ago
config: m32r-allyesconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout c1023ba74fc77dc56dc317bd98f5060aab889ac1
# save the attached .config to linux build tree
make.cross ARCH=m32r

All errors (new ones prefixed by >>):

   drivers/media/v4l2-core/videobuf2-dma-contig.c: In function 
'vb2_dc_get_userptr':
>> >> drivers/media/v4l2-core/videobuf2-dma-contig.c:486:2: error: implicit 
>> >> declaration of function 'dma_get_cache_alignment' 
>> >> [-Werror=implicit-function-declaration]
 unsigned long dma_align = dma_get_cache_alignment();
 ^
   cc1: some warnings being treated as errors

This driver depends on HAS_DMA for dma_get_cache_alignment().

Signed-off-by: Hans Verkuil 
---
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index f25344b..552b635 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -169,7 +169,7 @@ config VIDEO_MEDIATEK_VPU
 config VIDEO_MEDIATEK_VCODEC
tristate "Mediatek Video Codec driver"
depends on MTK_IOMMU || COMPILE_TEST
-   depends on VIDEO_DEV && VIDEO_V4L2
+   depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
depends on ARCH_MEDIATEK || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
--
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 for v4.8] cec: ignore messages when log_addr_mask == 0

2016-08-14 Thread Hans Verkuil
Most CEC adapters will still receive broadcast messages, even if no logical
addresses are claimed. But those messages should only be passed on for
monitoring purposes, but not for processing by either kernel or userspace
if userspace didn't call CEC_ADAP_S_LOG_ADDRS first.

So if adap->log_addrs.log_addr_mask is 0, then just return before passing
the received message on to the processing code.

Signed-off-by: Hans Verkuil 
---
 drivers/staging/media/cec/cec-adap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index ae0d1ee..43caddf 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -851,6 +851,9 @@ void cec_received_msg(struct cec_adapter *adap, struct 
cec_msg *msg)
if (!valid_la || msg->len <= 1)
return;

+   if (adap->log_addrs.log_addr_mask == 0)
+   return;
+
/*
 * Process the message on the protocol level. If is_reply is true,
 * then cec_receive_notify() won't pass on the reply to the listener(s)
-- 
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


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

2016-08-14 Thread Hans Verkuil
Hi Mauro,

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

It fixes some dubious locking code, two typos in cec-funcs.h, a missing reply
for the Record On/Off messages, improves the documentation, adds a TODO line,
adds a flag to explicitly allow fallback to Unregistered and prevents
broadcast messages from being processed when they should be ignored.

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

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

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

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

Regards,

Hans

Note: this supersedes my previous "cec fixes and updates" pull request.

The following changes since commit b6aa39228966e0d3f0bc3306be1892f87792903a:

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

are available in the git repository at:

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

for you to fetch changes up to 68373dd7572958e5b8ada02845899577b2c9772d:

  pulse8-cec: fix error handling (2016-08-14 12:06:08 +0200)


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

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


[PATCHv2 for v4.8] cec: add CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK flag

2016-08-14 Thread Hans Verkuil
Currently if none of the requested logical addresses can be claimed, the
framework will fall back to the Unregistered logical address.

Add a flag to enable this explicitly. By default it will just go back to
the unconfigured state.

Usually Unregistered is not something you want since the functionality is
very limited. Unless the application has support for this, it will fail
to work correctly. So require that the application explicitly requests
this.

Signed-off-by: Hans Verkuil 
---
Change since v2: the flag test should be done before the configure label,
otherwise it would also be performed when explicitly requesting the unregistered
'LA'.
---
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 21 -
 drivers/staging/media/cec/cec-adap.c|  4 
 drivers/staging/media/cec/cec-api.c |  2 +-
 include/linux/cec.h |  5 -
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index 04ee900..201d483 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -144,7 +144,7 @@ logical address types are already defined will return with 
error ``EBUSY``.

-  ``flags``

-   -  Flags. No flags are defined yet, so set this to 0.
+   -  Flags. See :ref:`cec-log-addrs-flags` for a list of available flags.

 -  .. row 7

@@ -201,6 +201,25 @@ logical address types are already defined will return with 
error ``EBUSY``.
   give the CEC framework more information about the device type, even
   though the framework won't use it directly in the CEC message.

+.. _cec-log-addrs-flags:
+
+.. flat-table:: Flags for struct cec_log_addrs
+:header-rows:  0
+:stub-columns: 0
+:widths:   3 1 4
+
+
+-  .. _`CEC-LOG-ADDRS-FL-ALLOW-UNREG-FALLBACK`:
+
+   -  ``CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK``
+
+   -  1
+
+   -  By default if no logical address of the requested type can be 
claimed, then
+ it will go back to the unconfigured state. If this flag is set, then 
it will
+ fallback to the Unregistered logical address. Note that if the 
Unregistered
+ logical address was explicitly requested, then this flag has no 
effect.
+
 .. _cec-versions:

 .. flat-table:: CEC Versions
diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index 9dcb784..2458a6c 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -1047,6 +1047,10 @@ static int cec_config_thread_func(void *arg)
dprintk(1, "could not claim LA %d\n", i);
}

+   if (adap->log_addrs.log_addr_mask == 0 &&
+   !(las->flags & CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK))
+   goto unconfigure;
+
 configured:
if (adap->log_addrs.log_addr_mask == 0) {
/* Fall back to unregistered */
diff --git a/drivers/staging/media/cec/cec-api.c 
b/drivers/staging/media/cec/cec-api.c
index 4e2696a..6f58ee8 100644
--- a/drivers/staging/media/cec/cec-api.c
+++ b/drivers/staging/media/cec/cec-api.c
@@ -162,7 +162,7 @@ static long cec_adap_s_log_addrs(struct cec_adapter *adap, 
struct cec_fh *fh,
return -ENOTTY;
if (copy_from_user(&log_addrs, parg, sizeof(log_addrs)))
return -EFAULT;
-   log_addrs.flags = 0;
+   log_addrs.flags &= CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK;
mutex_lock(&adap->lock);
if (!adap->is_configuring &&
(!log_addrs.num_log_addrs || !adap->is_configured) &&
diff --git a/include/linux/cec.h b/include/linux/cec.h
index b3e2289..851968e 100644
--- a/include/linux/cec.h
+++ b/include/linux/cec.h
@@ -364,7 +364,7 @@ struct cec_caps {
  * @num_log_addrs: how many logical addresses should be claimed. Set by the
  * caller.
  * @vendor_id: the vendor ID of the device. Set by the caller.
- * @flags: set to 0.
+ * @flags: flags.
  * @osd_name: the OSD name of the device. Set by the caller.
  * @primary_device_type: the primary device type for each logical address.
  * Set by the caller.
@@ -389,6 +389,9 @@ struct cec_log_addrs {
__u8 features[CEC_MAX_LOG_ADDRS][12];
 };

+/* Allow a fallback to unregistered */
+#define CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK  (1 << 0)
+
 /* Events */

 /* Event that occurs when the adapter state changes */
-- 
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] vcodec: mediatek: bug fix and code refine for mt8173 v4l2 Encoder

2016-08-14 Thread Hans Verkuil
On 08/12/2016 04:35 PM, Tiffany Lin wrote:
> This patch include fixs:
> 1. Remove unused include in mtk_vcodec_drv.h
> 2. Fix visible_height larger than coded_height issue in s_fmt_out
> 3. Add timestamp and timecode copy
> 4. Fix mtk_vcodec_vdec_release should be called after v4l2_m2m_ctx_release
> 5. Remove unused define MTK_INST_WORK_THREAD_ABORT_DONE
> 6. Add support V4L2_MPEG_VIDEO_H264_LEVEL_4_2
> 4. Refine  venc_h264_if.c and venc_vp8_if.c

I would prefer it if this can be split up into separate patches, one for each 
fix.

Also, should this be merged for v4.8 or can this wait for 4.9? When you split it
up you can use [PATCH for v4.8] as prefix for those patches that should go to 
v4.8.

Regards,

Hans

> 
> Signed-off-by: Tiffany Lin 
> ---
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |1 -
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   42 
> 
>  .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |6 ++-
>  .../media/platform/mtk-vcodec/mtk_vcodec_intr.h|1 -
>  .../media/platform/mtk-vcodec/mtk_vcodec_util.c|   11 ++---
>  .../media/platform/mtk-vcodec/venc/venc_h264_if.c  |   16 
>  .../media/platform/mtk-vcodec/venc/venc_vp8_if.c   |   16 
>  7 files changed, 52 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h 
> b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> index 94f0a42..3a8e695 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> @@ -23,7 +23,6 @@
>  #include 
>  #include 
>  
> -#include "mtk_vcodec_util.h"
>  
>  #define MTK_VCODEC_DRV_NAME  "mtk_vcodec_drv"
>  #define MTK_VCODEC_ENC_NAME  "mtk-vcodec-enc"
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
> b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> index 0a895e0..34fd89c 100644
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> @@ -487,7 +487,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void 
> *priv,
>   struct mtk_q_data *q_data;
>   int ret, i;
>   struct mtk_video_fmt *fmt;
> - unsigned int pitch_w_div16;
>   struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
>  
>   vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
> @@ -530,15 +529,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void 
> *priv,
>   q_data->coded_width = f->fmt.pix_mp.width;
>   q_data->coded_height = f->fmt.pix_mp.height;
>  
> - pitch_w_div16 = DIV_ROUND_UP(q_data->visible_width, 16);
> - if (pitch_w_div16 % 8 != 0) {
> - /* Adjust returned width/height, so application could correctly
> -  * allocate hw required memory
> -  */
> - q_data->visible_height += 32;
> - vidioc_try_fmt(f, q_data->fmt);
> - }
> -
>   q_data->field = f->fmt.pix_mp.field;
>   ctx->colorspace = f->fmt.pix_mp.colorspace;
>   ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
> @@ -945,7 +935,8 @@ static int mtk_venc_encode_header(void *priv)
>  {
>   struct mtk_vcodec_ctx *ctx = priv;
>   int ret;
> - struct vb2_buffer *dst_buf;
> + struct vb2_buffer *src_buf, *dst_buf;
> + struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
>   struct mtk_vcodec_mem bs_buf;
>   struct venc_done_result enc_result;
>  
> @@ -978,6 +969,15 @@ static int mtk_venc_encode_header(void *priv)
>   mtk_v4l2_err("venc_if_encode failed=%d", ret);
>   return -EINVAL;
>   }
> + src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
> + if (src_buf) {
> + src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
> + dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
> + dst_buf->timestamp = src_buf->timestamp;
> + dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
> + } else {
> + mtk_v4l2_err("No timestamp for the header buffer.");
> + }
>  
>   ctx->state = MTK_STATE_HEADER;
>   dst_buf->planes[0].bytesused = enc_result.bs_size;
> @@ -1070,7 +1070,7 @@ static void mtk_venc_worker(struct work_struct *work)
>   struct mtk_vcodec_mem bs_buf;
>   struct venc_done_result enc_result;
>   int ret, i;
> - struct vb2_v4l2_buffer *vb2_v4l2;
> + struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
>  
>   /* check dst_buf, dst_buf may be removed in device_run
>* to stored encdoe header so we need check dst_buf and
> @@ -1110,9 +1110,14 @@ static void mtk_venc_worker(struct work_struct *work)
>   ret = venc_if_encode(ctx, VENC_START_OPT_ENCODE_FRAME,
>&frm_buf, &bs_buf, &enc_result);
>  
> - vb2_v4l2 = container_of(dst_buf, struct vb2_v4l2_buffer, vb2_buf);
> + src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
> + dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
> +
> + dst_buf->timestamp = s

[PATCH for v4.8] cec: set unclaimed addresses to CEC_LOG_ADDR_INVALID

2016-08-14 Thread Hans Verkuil
Up to 4 logical addresses can be claimed. Make sure that any
unclaimed logical addresses are set to CEC_LOG_ADDR_INVALID as
per the documentation.

Take special care in the unregistered case: when falling back to
unregistered num_log_addrs may be > 1, so mark those as invalid.

Signed-off-by: Hans Verkuil 
---
 drivers/staging/media/cec/cec-adap.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index f1297af..e980ac9 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -1059,6 +1059,8 @@ configured:
/* Fall back to unregistered */
las->log_addr[0] = CEC_LOG_ADDR_UNREGISTERED;
las->log_addr_mask = 1 << las->log_addr[0];
+   for (i = 1; i < las->num_log_addrs; i++)
+   las->log_addr[i] = CEC_LOG_ADDR_INVALID;
}
adap->is_configured = true;
adap->is_configuring = false;
@@ -1077,6 +1079,8 @@ configured:
cec_report_features(adap, i);
cec_report_phys_addr(adap, i);
}
+   for (i = las->num_log_addrs; i < CEC_MAX_LOG_ADDRS; i++)
+   las->log_addr[i] = CEC_LOG_ADDR_INVALID;
mutex_lock(&adap->lock);
adap->kthread_config = NULL;
mutex_unlock(&adap->lock);
-- 
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


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

2016-08-14 Thread Hans Verkuil
Hi Mauro,

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

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

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

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

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

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

Regards,

Hans

Repost, fixing a bug in the "cec: add CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK 
flag"
patch and adding "cec: set unclaimed addresses to CEC_LOG_ADDR_INVALID".

The following changes since commit b6aa39228966e0d3f0bc3306be1892f87792903a:

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

are available in the git repository at:

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

for you to fetch changes up to 83f921bdf1783e52b346afa43a50eb0453431dbf:

  pulse8-cec: fix error handling (2016-08-14 13:34:44 +0200)


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

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


[PATCH] helene: fix memory leak when heleno_x_pon fails

2016-08-14 Thread Colin King
From: Colin Ian King 

The error return path of failed calls to heleno_x_pon leak
memory because priv is not kfree'd.  Fix this by kfree'ing
priv before returning.

Signed-off-by: Colin Ian King 
---
 drivers/media/dvb-frontends/helene.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/helene.c 
b/drivers/media/dvb-frontends/helene.c
index 97a8982..3d1cd5f 100644
--- a/drivers/media/dvb-frontends/helene.c
+++ b/drivers/media/dvb-frontends/helene.c
@@ -987,8 +987,10 @@ struct dvb_frontend *helene_attach_s(struct dvb_frontend 
*fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
 
-   if (helene_x_pon(priv) != 0)
+   if (helene_x_pon(priv) != 0) {
+   kfree(priv);
return NULL;
+   }
 
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
@@ -1021,8 +1023,10 @@ struct dvb_frontend *helene_attach(struct dvb_frontend 
*fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
 
-   if (helene_x_pon(priv) != 0)
+   if (helene_x_pon(priv) != 0) {
+   kfree(priv);
return NULL;
+   }
 
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 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


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

2016-08-14 Thread Hans Verkuil
Convert the old ascii CEC kapi documentation to sphinx documentation.

No textual changes, just an initial conversion.

Signed-off-by: Hans Verkuil 
---
 Documentation/{cec.txt => media/kapi/cec-core.rst} | 202 -
 Documentation/media/media_kapi.rst |   1 +
 MAINTAINERS|   4 +-
 3 files changed, 119 insertions(+), 88 deletions(-)
 rename Documentation/{cec.txt => media/kapi/cec-core.rst} (53%)

diff --git a/Documentation/cec.txt b/Documentation/media/kapi/cec-core.rst
similarity index 53%
rename from Documentation/cec.txt
rename to Documentation/media/kapi/cec-core.rst
index 75155fe..b776a59 100644
--- a/Documentation/cec.txt
+++ b/Documentation/media/kapi/cec-core.rst
@@ -1,5 +1,5 @@
 CEC Kernel Support
-==
+--

 The CEC framework provides a unified kernel interface for use with HDMI CEC
 hardware. It is designed to handle a multiple types of hardware (receivers,
@@ -10,7 +10,7 @@ feature into the kernel's remote control framework.


 The CEC Protocol
-
+

 The CEC protocol enables consumer electronic devices to communicate with each
 other through the HDMI connection. The protocol uses logical addresses in the
@@ -28,62 +28,65 @@ http://www.microprocessor.org/HDMISpecification13a.pdf


 The Kernel Interface
-
+

 CEC Adapter

+^^^

 The struct cec_adapter represents the CEC adapter hardware. It is created by
 calling cec_allocate_adapter() and deleted by calling cec_delete_adapter():

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

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

-ops: adapter operations which are called by the CEC framework and that you
-have to implement.
-
-priv: will be stored in adap->priv and can be used by the adapter ops.
-
-name: the name of the CEC adapter. Note: this name will be copied.
+- ``ops``: adapter operations which are called by the CEC framework and that 
you
+  have to implement.
+- ``priv``: will be stored in ``adap->priv`` and can be used by the adapter 
ops.
+- ``name``: the name of the CEC adapter. Note: this name will be copied.
+- ``caps``: capabilities of the CEC adapter. These capabilities determine the
+  capabilities of the hardware and which parts are to be handled
+  by userspace and which parts are handled by kernelspace. The
+  capabilities are returned by ``CEC_ADAP_G_CAPS``.
+- ``available_las``: the number of simultaneous logical addresses that this
+  adapter can handle. Must be 1 <= ``available_las`` <= ``CEC_MAX_LOG_ADDRS``.
+- ``parent``: the parent device.

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

-available_las: the number of simultaneous logical addresses that this
-   adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
+To register the ``/dev/cecX`` device node and the remote control device (if
+``CEC_CAP_RC`` is set) you call:

-parent: the parent device.
+..  code-block:: c

-
-To register the /dev/cecX device node and the remote control device (if
-CEC_CAP_RC is set) you call:
-
-int cec_register_adapter(struct cec_adapter *adap);
+int cec_register_adapter(struct cec_adapter *adap);

 To unregister the devices call:

-void cec_unregister_adapter(struct cec_adapter *adap);
+..  code-block:: c
+
+void cec_unregister_adapter(struct cec_adapter *adap);

-Note: if cec_register_adapter() fails, then call cec_delete_adapter() to
-clean up. But if cec_register_adapter() succeeded, then only call
-cec_unregister_adapter() to clean up, never cec_delete_adapter(). The
+Note: if ``cec_register_adapter()`` fails, then call ``cec_delete_adapter()`` 
to
+clean up. But if ``cec_register_adapter()`` succeeded, then only call
+``cec_unregister_adapter()`` to clean up, never ``cec_delete_adapter()``. The
 unregister function will delete the adapter automatically once the last user
-of that /dev/cecX device has closed its file handle.
+of that ``/dev/cecX`` device has closed its file handle.


 Implementing the Low-Level CEC Adapter
---
+~~

 The following low-level adapter operations have to be implemented in
 your driver:

-struct cec_adap_ops {
+..  code-block:: c
+
+struct cec_adap_ops {
/* Low-level callbacks */
int (*adap_enable)(struct cec_adapter *adap, bo

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

2016-08-14 Thread 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, but stopped at parse-header.
At this point, I have a few requests.  These are in approximate order of
decreasing importance, but they're all important, I think.

- The new directive could really use some ... documentation.  Preferably in
  kernel-documentation.rst with the rest.  What is parse-header, how does
  it differ from kernel-doc, why might a kernel developer doing
  documentation want (or not want) to use it?  That's all pretty obscure
  now.  If we want others to jump onto this little bandwagon of ours, we
  need to make sure it's all really clear.

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

- Can we please try to get the coding style a bit more in line with both
  kernel and Python community norms?  I suspect some people will get grumpy
  if they see this code.  In particular:

- Please try to stick to the 80-column limit when possible.  Python
  makes that a bit harder than C does, and please don't put in
  ridiculous line breaks that make the code worse.  But sticking a bit
  closer to the rule would be good.

- The "#" lines around function/class
  definition lines or other comments are not helpful, please avoid
  them.  Instead, placing a real comment with actual informative text
  above the function/class would be a good thing.  (I could live with
  Python docstrings if you prefer, though I will confess I prefer
  ordinary comments).

- No commas at the beginning of continuation lines, please; that would
  get you yelled at in C code.  If you need to break a function call
  (or whatever), please put the commas at the end of the line as is
  done elsewhere.

  Sorry to poke at nits here, but we want others in the kernel community to
  be able to look at this code, and that will be easier if we stick closer
  to the usual rules.

Thanks,

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


Re: [PATCH] doc-rst: customize RTD theme, drop padding of inline literal

2016-08-14 Thread Jonathan Corbet
On Fri, 5 Aug 2016 11:27:07 +0200
Hans Verkuil  wrote:

> On 08/05/2016 11:19 AM, Markus Heiser wrote:
> > From: Markus Heiser 
> > 
> > Remove the distracting (left/right) padding of inline literals. (HTML
> > ). Requested and discussed in [1].
> > 
> > [1] http://www.spinics.net/lists/linux-media/msg103991.html
> > 
> > Signed-off-by: Markus Heiser   
> 
> Acked-by: Hans Verkuil 
> 
> Thank you! Thank you! Thank you!
> 
> So much better!

Agreed, this one was really needed.  Applied to the 4.8-fixes branch,
thanks.

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


Re: [PATCH v3 10/14] media: platform: pxa_camera: remove set_crop

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

> On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
>> This is to be seen as a regression as the set_crop function is
>> removed. This is a temporary situation in the v4l2 porting, and will
>> have to be added later.
>
> This is a bit confusing, since in the next patch you say in the commit log:
>
>  - the s_crop() call was removed, judged not working
>(see what happens soc_camera_s_crop() when get_crop() == NULL)
>
> So the set_crop removal isn't temporary after all? It isn't added back in
> this patch series.
>
> Note that I am OK with removing set_crop if it never worked reliably, but
> then the commit log of this patch should be updated to reflect that.
Well, it's temporary in the sense "I have not added it back yet, but I commit to
add it back within 2 or 3 kernel cycles"

As for the confusion, I think the pxa_camera + mt9m111 set_crop() was not
working, but I didn't say that another camera host + mt9m111 didn't work. I
think set_crop() is not working because pxa_camera lacks code, but that doesn't
prevent mt9m111 to have a set_crop() sensor working implementation.

That's why I say I'm probably adding a regression, and commit to remove it soon
...

Cheers.

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


Re: [PATCH v3 11/14] media: platform: pxa_camera: make a standalone v4l2 device

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

> On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
>
>> +pcdev->sensor = subdev;
>> +pcdev->vdev.queue = &pcdev->vb2_vq;
>> +pcdev->vdev.v4l2_dev = &pcdev->v4l2_dev;
>
> You're missing this line here:
>
>   pcdev->vdev.ctrl_handler = subdev->ctrl_handler;
>
> This ensures that the sensor's controls are exposed to the video device node.
Okay, I'm on it, for v4.

>> +video_set_drvdata(&pcdev->vdev, pcdev);
>> +
>> +v4l2_disable_ioctl(vdev, VIDIOC_G_STD);
>> +v4l2_disable_ioctl(vdev, VIDIOC_S_STD);
>
> Since you don't implement vidioc_g/s_std these two lines can be removed.
Okay, for v4.

Cheers.

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


Re: [PATCH v3 12/14] media: platform: pxa_camera: add debug register access

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

> On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
>> Add pxa_camera registers access through advanced video debugging.
>> +static int pxac_vidioc_g_chip_info(struct file *file, void *fh,
>> +   struct v4l2_dbg_chip_info *chip)
>
> You shouldn't need this g_chip_info function, it should be handled 
> automatically
> by the v4l2 core. Just drop it.
Okay, let me try and rerun v4l-compliance to be sure I'm covered, and stage it
afterwards for v4.

Cheers.

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


Re: [PATCH v3 02/14] media: mt9m111: prevent module removal while in use

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

> On 08/08/2016 09:30 PM, Robert Jarzmik wrote:
>> The mt9m111 can be a removable module : the only case where the module
>> should be kept loaded is while it is used, ie. while an active
>> transation is ongoing on it.
>> 
>> The notion of active transaction is mapped on the power state of the
>> module : if powered on the removal is prohibited.
>
> I don't really see the purpose of this patch: if this driver is loaded
> by a platform driver (such as pxa_camera), then the module count should be
> 1 and it isn't possible to unload.
>
> So you shouldn't need this patch. Am I missing something?
Well, what you are missing is ugly and twisted.

With the current patchset, pxa_camera doesn't acquire the module (see
pxa_camera_sensor_bound()). That is the ugly part.

The reason behind is that if it acquires it, it's totally impossible to rmmod
either pxa_camera or mt9m111 because of the cross-dependency I wasn't able to
solve up to now.

The dependency chain goes as follows :
 - pxa_camera should +1 refcount mt9m111 in pxa_camera_sensor_bound()
 - mt9m111 should +1 refcount pxa_camera through the MCLK get_clock()
   Without MCLK, mt9m111 is not clocked, and no I2C is available, hence no
   control and a total loss of context

The purpose of this patch was the mt9m111 aquired a +1 refcount on pxa_camera so
that pxa_camera is prevented from removal while a transfer is underway, and
while the mt9m111 has the MCLK refcount acquired.

I perfectly know this is suboptimal, but I didn't find a way yet to solve
this. I was thinking to use pxac_fops_camera_open() to refcount +1 mt9m111
module and pxac_fops_camera_release() to refcound -1 mt9m111. But that didn't
work because in order for mt9m111 to probe, the I2C has to be functional, and
therefore the MCLK has to be provided.

> No other driver in drivers/media/i2c does something like this.
Yeah, I would bet either no other driver has the crossed dependency or they can
never be rmmoded.

Let me see how I can drop this patch and still prevent a kernel panic upon an
rmmod of either mt9m111 or pxa_camera.

Cheers.

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


[PATCH v2] Documentation: add support for V4L touch devices

2016-08-14 Thread Nick Dyer
[v2: Fix minor issues and document V4L2_INPUT_TYPE_TOUCH and V4L2_CAP_TOUCH]

Signed-off-by: Nick Dyer 
---
 Documentation/media/uapi/mediactl/media-types.rst |  24 +++--
 Documentation/media/uapi/v4l/dev-touch.rst|  56 +++
 Documentation/media/uapi/v4l/devices.rst  |   1 +
 Documentation/media/uapi/v4l/pixfmt-tch-td08.rst  |  80 
 Documentation/media/uapi/v4l/pixfmt-tch-td16.rst  | 111 ++
 Documentation/media/uapi/v4l/pixfmt-tch-tu08.rst  |  78 +++
 Documentation/media/uapi/v4l/pixfmt-tch-tu16.rst  | 110 +
 Documentation/media/uapi/v4l/pixfmt.rst   |   1 +
 Documentation/media/uapi/v4l/tch-formats.rst  |  18 
 Documentation/media/uapi/v4l/vidioc-enuminput.rst |   8 ++
 Documentation/media/uapi/v4l/vidioc-querycap.rst  |   8 ++
 11 files changed, 488 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/media/uapi/v4l/dev-touch.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-td08.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-td16.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-tu08.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-tch-tu16.rst
 create mode 100644 Documentation/media/uapi/v4l/tch-formats.rst

diff --git a/Documentation/media/uapi/mediactl/media-types.rst 
b/Documentation/media/uapi/mediactl/media-types.rst
index c77717b..0265edc 100644
--- a/Documentation/media/uapi/mediactl/media-types.rst
+++ b/Documentation/media/uapi/mediactl/media-types.rst
@@ -429,6 +429,16 @@ Types and flags used to represent the media graph elements
 
 -  .. row 11
 
+   ..  _MEDIA-INTF-T-V4L-TOUCH:
+
+   -  ``MEDIA_INTF_T_V4L_TOUCH``
+
+   -  Device node interface for Touch device (V4L)
+
+   -  typically, /dev/v4l-touch?
+
+-  .. row 12
+
..  _MEDIA-INTF-T-ALSA-PCM-CAPTURE:
 
-  ``MEDIA_INTF_T_ALSA_PCM_CAPTURE``
@@ -437,7 +447,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/pcmC?D?c
 
--  .. row 12
+-  .. row 13
 
..  _MEDIA-INTF-T-ALSA-PCM-PLAYBACK:
 
@@ -447,7 +457,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/pcmC?D?p
 
--  .. row 13
+-  .. row 14
 
..  _MEDIA-INTF-T-ALSA-CONTROL:
 
@@ -457,7 +467,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/controlC?
 
--  .. row 14
+-  .. row 15
 
..  _MEDIA-INTF-T-ALSA-COMPRESS:
 
@@ -467,7 +477,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/compr?
 
--  .. row 15
+-  .. row 16
 
..  _MEDIA-INTF-T-ALSA-RAWMIDI:
 
@@ -477,7 +487,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/midi?
 
--  .. row 16
+-  .. row 17
 
..  _MEDIA-INTF-T-ALSA-HWDEP:
 
@@ -487,7 +497,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/hwC?D?
 
--  .. row 17
+-  .. row 18
 
..  _MEDIA-INTF-T-ALSA-SEQUENCER:
 
@@ -497,7 +507,7 @@ Types and flags used to represent the media graph elements
 
-  typically, /dev/snd/seq
 
--  .. row 18
+-  .. row 19
 
..  _MEDIA-INTF-T-ALSA-TIMER:
 
diff --git a/Documentation/media/uapi/v4l/dev-touch.rst 
b/Documentation/media/uapi/v4l/dev-touch.rst
new file mode 100644
index 000..1f4e752
--- /dev/null
+++ b/Documentation/media/uapi/v4l/dev-touch.rst
@@ -0,0 +1,56 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _touch:
+
+*
+Touch Devices
+*
+
+Touch devices are accessed through character device special files named
+``/dev/v4l-touch0`` to ``/dev/v4l-touch255`` with major number 81 and
+dynamically allocated minor numbers 0 to 255.
+
+Overview
+
+
+Sensors may be Optical, or Projected Capacitive touch (PCT).
+
+Processing is required to analyse the raw data and produce input events. In
+some systems, this may be performed on the ASIC and the raw data is purely a
+side-channel for diagnostics or tuning. In other systems, the ASIC is a simple
+analogue front end device which delivers touch data at high rate, and any touch
+processing must be done on the host.
+
+For capacitive touch sensing, the touchscreen is composed of an array of
+horizontal and vertical conductors (alternatively called rows/columns, X/Y
+lines, or tx/rx). Mutual Capacitance measured is at the nodes where the
+conductors cross. Alternatively, Self Capacitance measures the signal from each
+column and row independently.
+
+A touch input may be determined by comparing the raw capacitance measurement to
+a no-touch reference (or "baseline") measurement:
+
+Delta = Raw - Reference
+
+The reference measurement takes account of variations in the capacitance across
+the touch sensor matrix, for example manufacturing irregularities,
+environmental or edge ef

[PATCH] media/i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 14 Aug 2016 22:20:26 +0200

The field "owner" is set by core. Thus delete an extra initialisation.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring 
---
 drivers/media/i2c/ad9389b.c  | 1 -
 drivers/media/i2c/adv7183.c  | 1 -
 drivers/media/i2c/adv7393.c  | 1 -
 drivers/media/i2c/cs3308.c   | 1 -
 drivers/media/i2c/s5k4ecgx.c | 1 -
 drivers/media/i2c/s5k6a3.c   | 1 -
 drivers/media/i2c/ths8200.c  | 1 -
 drivers/media/i2c/tlv320aic23b.c | 1 -
 drivers/media/i2c/tvp514x.c  | 1 -
 drivers/media/i2c/tvp7002.c  | 1 -
 drivers/media/i2c/vs6624.c   | 1 -
 11 files changed, 11 deletions(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 0462f46..5a932e4 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -1231,7 +1231,6 @@ MODULE_DEVICE_TABLE(i2c, ad9389b_id);
 
 static struct i2c_driver ad9389b_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = "ad9389b",
},
.probe = ad9389b_probe,
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index 2bec737..04eecda 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -644,7 +644,6 @@ MODULE_DEVICE_TABLE(i2c, adv7183_id);
 
 static struct i2c_driver adv7183_driver = {
.driver = {
-   .owner  = THIS_MODULE,
.name   = "adv7183",
},
.probe  = adv7183_probe,
diff --git a/drivers/media/i2c/adv7393.c b/drivers/media/i2c/adv7393.c
index 76d9874..f19ad4e 100644
--- a/drivers/media/i2c/adv7393.c
+++ b/drivers/media/i2c/adv7393.c
@@ -456,7 +456,6 @@ MODULE_DEVICE_TABLE(i2c, adv7393_id);
 
 static struct i2c_driver adv7393_driver = {
.driver = {
-   .owner  = THIS_MODULE,
.name   = "adv7393",
},
.probe  = adv7393_probe,
diff --git a/drivers/media/i2c/cs3308.c b/drivers/media/i2c/cs3308.c
index d28b4f3..7da5f69 100644
--- a/drivers/media/i2c/cs3308.c
+++ b/drivers/media/i2c/cs3308.c
@@ -127,7 +127,6 @@ MODULE_DEVICE_TABLE(i2c, cs3308_id);
 
 static struct i2c_driver cs3308_driver = {
.driver = {
-   .owner  = THIS_MODULE,
.name   = "cs3308",
},
.probe  = cs3308_probe,
diff --git a/drivers/media/i2c/s5k4ecgx.c b/drivers/media/i2c/s5k4ecgx.c
index 8a0f22d..6ebcf25 100644
--- a/drivers/media/i2c/s5k4ecgx.c
+++ b/drivers/media/i2c/s5k4ecgx.c
@@ -1019,7 +1019,6 @@ MODULE_DEVICE_TABLE(i2c, s5k4ecgx_id);
 
 static struct i2c_driver v4l2_i2c_driver = {
.driver = {
-   .owner  = THIS_MODULE,
.name = S5K4ECGX_DRIVER_NAME,
},
.probe = s5k4ecgx_probe,
diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c
index cbe4711..b1ecb44 100644
--- a/drivers/media/i2c/s5k6a3.c
+++ b/drivers/media/i2c/s5k6a3.c
@@ -376,7 +376,6 @@ static struct i2c_driver s5k6a3_driver = {
.driver = {
.of_match_table = of_match_ptr(s5k6a3_of_match),
.name   = S5K6A3_DRV_NAME,
-   .owner  = THIS_MODULE,
},
.probe  = s5k6a3_probe,
.remove = s5k6a3_remove,
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 73fc42b..42340e3 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -499,7 +499,6 @@ MODULE_DEVICE_TABLE(of, ths8200_of_match);
 
 static struct i2c_driver ths8200_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = "ths8200",
.of_match_table = of_match_ptr(ths8200_of_match),
},
diff --git a/drivers/media/i2c/tlv320aic23b.c b/drivers/media/i2c/tlv320aic23b.c
index 0370dd8..2e06c06 100644
--- a/drivers/media/i2c/tlv320aic23b.c
+++ b/drivers/media/i2c/tlv320aic23b.c
@@ -210,7 +210,6 @@ MODULE_DEVICE_TABLE(i2c, tlv320aic23b_id);
 
 static struct i2c_driver tlv320aic23b_driver = {
.driver = {
-   .owner  = THIS_MODULE,
.name   = "tlv320aic23b",
},
.probe  = tlv320aic23b_probe,
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 7cdd948..7cf749f 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -1233,7 +1233,6 @@ MODULE_DEVICE_TABLE(of, tvp514x_of_match);
 static struct i2c_driver tvp514x_driver = {
.driver = {
.of_match_table = of_match_ptr(tvp514x_of_match),
-   .owner = THIS_MODULE,
.name = TVP514X_MODULE_NAME,
},
.probe = tvp514x_probe,
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 4df640c..3dc3341 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -1086,7 +1086,6 @@ MODULE_DEVICE_TABLE(of, tvp7002_of_match);
 static struct i2c_driver tvp7002_driver = {
 

ERROR: "bad_dma_ops" [drivers/media/platform/mtk-vpu/mtk-vpu.ko] undefined!

2016-08-14 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   118253a593bd1c57de2d1193df1ccffe1abe745b
commit: 3003a180ef6b9462f32a89884ef2332d2a1c [media] VPU: mediatek: support 
Mediatek VPU
date:   5 weeks ago
config: m32r-allmodconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 3003a180ef6b9462f32a89884ef2332d2a1c
# save the attached .config to linux build tree
make.cross ARCH=m32r 

All errors (new ones prefixed by >>):

   ERROR: "bad_dma_ops" [sound/soc/atmel/snd-soc-atmel-pcm-pdc.ko] undefined!
   ERROR: "bad_dma_ops" [sound/core/snd-pcm.ko] undefined!
   ERROR: "dma_common_mmap" [sound/core/snd-pcm.ko] undefined!
   ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
   ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
>> ERROR: "bad_dma_ops" [drivers/media/platform/mtk-vpu/mtk-vpu.ko] undefined!
   ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined!
   ERROR: "__ucmpdi2" [drivers/md/bcache/bcache.ko] undefined!
   ERROR: "__ucmpdi2" [drivers/iio/imu/inv_mpu6050/inv-mpu6050.ko] undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH v6] vcodec: mediatek: Add g/s_selection support for V4L2 Encoder

2016-08-14 Thread Tiffany Lin
This patch add g/s_selection for MT8173 V4L2 Encoder.
Only output queue support g/s_selection to configure crop.
The top/left of active rectangle should always be (0,0)

Signed-off-by: Tiffany Lin 
---
v6:
- remove unused err variable from s_selection
v5:
- remove visible_height change to a separate patch
v4:
- do not return -ERANGE and just select a rectangle that works with the
  hardware and is closest to the requested rectangle
- refine v3 note about remove visible_height modification in s_fmt_out
v3:
- add v4l2_s_selection to check constraint flags
- remove visible_height modification in s_fmt_out, it will make v4l2-compliance
  test Cropping fail becuase visible_height larger than coded_height.
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   66 
 1 file changed, 66 insertions(+)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 3ed3f2d..b1f0acb 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -631,6 +631,69 @@ static int vidioc_try_fmt_vid_out_mplane(struct file 
*file, void *priv,
return vidioc_try_fmt(f, fmt);
 }
 
+static int vidioc_venc_g_selection(struct file *file, void *priv,
+struct v4l2_selection *s)
+{
+   struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
+   struct mtk_q_data *q_data;
+
+   if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+   return -EINVAL;
+
+   q_data = mtk_venc_get_q_data(ctx, s->type);
+   if (!q_data)
+   return -EINVAL;
+
+   switch (s->target) {
+   case V4L2_SEL_TGT_CROP_DEFAULT:
+   case V4L2_SEL_TGT_CROP_BOUNDS:
+   s->r.top = 0;
+   s->r.left = 0;
+   s->r.width = q_data->coded_width;
+   s->r.height = q_data->coded_height;
+   break;
+   case V4L2_SEL_TGT_CROP:
+   s->r.top = 0;
+   s->r.left = 0;
+   s->r.width = q_data->visible_width;
+   s->r.height = q_data->visible_height;
+   break;
+   default:
+   return -EINVAL;
+   }
+
+   return 0;
+}
+
+static int vidioc_venc_s_selection(struct file *file, void *priv,
+struct v4l2_selection *s)
+{
+   struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
+   struct mtk_q_data *q_data;
+
+   if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+   return -EINVAL;
+
+   q_data = mtk_venc_get_q_data(ctx, s->type);
+   if (!q_data)
+   return -EINVAL;
+
+   switch (s->target) {
+   case V4L2_SEL_TGT_CROP:
+   /* Only support crop from (0,0) */
+   s->r.top = 0;
+   s->r.left = 0;
+   s->r.width = min(s->r.width, q_data->coded_width);
+   s->r.height = min(s->r.height, q_data->coded_height);
+   q_data->visible_width = s->r.width;
+   q_data->visible_height = s->r.height;
+   break;
+   default:
+   return -EINVAL;
+   }
+   return 0;
+}
+
 static int vidioc_venc_qbuf(struct file *file, void *priv,
struct v4l2_buffer *buf)
 {
@@ -689,6 +752,9 @@ const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = {
 
.vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs,
.vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf,
+
+   .vidioc_g_selection = vidioc_venc_g_selection,
+   .vidioc_s_selection = vidioc_venc_s_selection,
 };
 
 static int vb2ops_venc_queue_setup(struct vb2_queue *vq,
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek:code refine for v4l2 Encoder driver

2016-08-14 Thread Tiffany Lin
This patch remove unused header and define from haeder files

Signed-off-by: Tiffany Lin 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |1 -
 .../media/platform/mtk-vcodec/mtk_vcodec_intr.h|1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
index 94f0a42..3a8e695 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
@@ -23,7 +23,6 @@
 #include 
 #include 
 
-#include "mtk_vcodec_util.h"
 
 #define MTK_VCODEC_DRV_NAME"mtk_vcodec_drv"
 #define MTK_VCODEC_ENC_NAME"mtk-vcodec-enc"
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h
index 33e890f..1213185 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h
@@ -16,7 +16,6 @@
 #define _MTK_VCODEC_INTR_H_
 
 #define MTK_INST_IRQ_RECEIVED  0x1
-#define MTK_INST_WORK_THREAD_ABORT_DONE0x2
 
 struct mtk_vcodec_ctx;
 
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek: Fix fops_vcodec_release flow for V4L2 Encoder

2016-08-14 Thread Tiffany Lin
This patch fix that mtk_vcodec_venc_release should be called after 
v4l2_m2m_ctx_release

Signed-off-by: Tiffany Lin 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |7 ++-
 .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |6 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index b1f0acb..a145130 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -1354,5 +1354,10 @@ int mtk_venc_lock(struct mtk_vcodec_ctx *ctx)
 
 void mtk_vcodec_enc_release(struct mtk_vcodec_ctx *ctx)
 {
-   venc_if_deinit(ctx);
+   int ret = venc_if_deinit(ctx);
+
+   if (ret)
+   mtk_v4l2_err("venc_if_deinit failed=%d", ret);
+
+   ctx->state = MTK_STATE_FREE;
 }
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index c7806ec..5cd2151 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -218,11 +218,15 @@ static int fops_vcodec_release(struct file *file)
mtk_v4l2_debug(1, "[%d] encoder", ctx->id);
mutex_lock(&dev->dev_mutex);
 
+   /*
+* Call v4l2_m2m_ctx_release to make sure the worker thread is not
+* running after venc_if_deinit.
+*/
+   v4l2_m2m_ctx_release(ctx->m2m_ctx);
mtk_vcodec_enc_release(ctx);
v4l2_fh_del(&ctx->fh);
v4l2_fh_exit(&ctx->fh);
v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
-   v4l2_m2m_ctx_release(ctx->m2m_ctx);
 
list_del_init(&ctx->list);
dev->num_instances--;
-- 
1.7.9.5

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


cron job: media_tree daily build: WARNINGS

2016-08-14 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:   Mon Aug 15 04:00:18 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/Monday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Monday.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 for v4.8] vcodec:mediatek: Fix visible_height larger than coded_height issue in s_fmt_out

2016-08-14 Thread Tiffany Lin
The original code add extra 32 line to visible_height.
It is incorrect, 32 line should be add to coded_height.
The purpose is that user space could calcuate real buffer size needed by using
coded_width * coded_height.
But this method will make v4l2-compliance test fail, since g_fmt != s_fmt(g_fmt)
So remove extend visible_height or coded_height, user space should just
use sizeimage to get real buffer size needed

Signed-off-by: Tiffany Lin 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index a145130..cd36c9e 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -487,7 +487,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void 
*priv,
struct mtk_q_data *q_data;
int ret, i;
struct mtk_video_fmt *fmt;
-   unsigned int pitch_w_div16;
struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
 
vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
@@ -530,15 +529,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, void 
*priv,
q_data->coded_width = f->fmt.pix_mp.width;
q_data->coded_height = f->fmt.pix_mp.height;
 
-   pitch_w_div16 = DIV_ROUND_UP(q_data->visible_width, 16);
-   if (pitch_w_div16 % 8 != 0) {
-   /* Adjust returned width/height, so application could correctly
-* allocate hw required memory
-*/
-   q_data->visible_height += 32;
-   vidioc_try_fmt(f, q_data->fmt);
-   }
-
q_data->field = f->fmt.pix_mp.field;
ctx->colorspace = f->fmt.pix_mp.colorspace;
ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek: Add timestamp and timecode copy for V4L2 Encoder

2016-08-14 Thread Tiffany Lin
This patch add copying timestamp and timecode from src buffer to dst buffer

Signed-off-by: Tiffany Lin 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   23 
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index cd36c9e..7bef7ba 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -934,7 +934,8 @@ static int mtk_venc_encode_header(void *priv)
 {
struct mtk_vcodec_ctx *ctx = priv;
int ret;
-   struct vb2_buffer *dst_buf;
+   struct vb2_buffer *src_buf, *dst_buf;
+   struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
struct mtk_vcodec_mem bs_buf;
struct venc_done_result enc_result;
 
@@ -967,6 +968,15 @@ static int mtk_venc_encode_header(void *priv)
mtk_v4l2_err("venc_if_encode failed=%d", ret);
return -EINVAL;
}
+   src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
+   if (src_buf) {
+   src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
+   dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
+   dst_buf->timestamp = src_buf->timestamp;
+   dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
+   } else {
+   mtk_v4l2_err("No timestamp for the header buffer.");
+   }
 
ctx->state = MTK_STATE_HEADER;
dst_buf->planes[0].bytesused = enc_result.bs_size;
@@ -1059,7 +1069,7 @@ static void mtk_venc_worker(struct work_struct *work)
struct mtk_vcodec_mem bs_buf;
struct venc_done_result enc_result;
int ret, i;
-   struct vb2_v4l2_buffer *vb2_v4l2;
+   struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
 
/* check dst_buf, dst_buf may be removed in device_run
 * to stored encdoe header so we need check dst_buf and
@@ -1099,9 +1109,14 @@ static void mtk_venc_worker(struct work_struct *work)
ret = venc_if_encode(ctx, VENC_START_OPT_ENCODE_FRAME,
 &frm_buf, &bs_buf, &enc_result);
 
-   vb2_v4l2 = container_of(dst_buf, struct vb2_v4l2_buffer, vb2_buf);
+   src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
+   dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
+
+   dst_buf->timestamp = src_buf->timestamp;
+   dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
+
if (enc_result.is_key_frm)
-   vb2_v4l2->flags |= V4L2_BUF_FLAG_KEYFRAME;
+   dst_vb2_v4l2->flags |= V4L2_BUF_FLAG_KEYFRAME;
 
if (ret) {
v4l2_m2m_buf_done(to_vb2_v4l2_buffer(src_buf),
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek: change H264 profile default to profile high

2016-08-14 Thread Tiffany Lin
This patch change default H264 profile from V4L2_MPEG_VIDEO_H264_PROFILE_MAIN
to V4L2_MPEG_VIDEO_H264_PROFILE_HIGH

Signed-off-by: Tiffany Lin 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 7bef7ba..284c1a7 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -1288,7 +1288,7 @@ int mtk_vcodec_enc_ctrls_setup(struct mtk_vcodec_ctx *ctx)
0, V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE);
v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_PROFILE,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
-   0, V4L2_MPEG_VIDEO_H264_PROFILE_MAIN);
+   0, V4L2_MPEG_VIDEO_H264_PROFILE_HIGH);
v4l2_ctrl_new_std_menu(handler, ops, V4L2_CID_MPEG_VIDEO_H264_LEVEL,
V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
0, V4L2_MPEG_VIDEO_H264_LEVEL_4_0);
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek: Refine H264 encoder driver

2016-08-14 Thread Tiffany Lin
This patch :
1. remove field and function that unused anymore
2. add support V4L2_MPEG_VIDEO_H264_LEVEL_4_2

Signed-off-by: Tiffany Lin 
---
 .../media/platform/mtk-vcodec/venc/venc_h264_if.c  |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c 
b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
index 9a60052..63d4be4 100644
--- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
@@ -61,6 +61,8 @@ enum venc_h264_bs_mode {
 
 /*
  * struct venc_h264_vpu_config - Structure for h264 encoder configuration
+ *   AP-W/R : AP is writer/reader on this item
+ *   VPU-W/R: VPU is write/reader on this item
  * @input_fourcc: input fourcc
  * @bitrate: target bitrate (in bps)
  * @pic_w: picture width. Picture size is visible stream resolution, in pixels,
@@ -94,13 +96,13 @@ struct venc_h264_vpu_config {
 
 /*
  * struct venc_h264_vpu_buf - Structure for buffer information
- * @align: buffer alignment (in bytes)
+ *AP-W/R : AP is writer/reader on this item
+ *VPU-W/R: VPU is write/reader on this item
  * @iova: IO virtual address
  * @vpua: VPU side memory addr which is used by RC_CODE
  * @size: buffer size (in bytes)
  */
 struct venc_h264_vpu_buf {
-   u32 align;
u32 iova;
u32 vpua;
u32 size;
@@ -108,6 +110,8 @@ struct venc_h264_vpu_buf {
 
 /*
  * struct venc_h264_vsi - Structure for VPU driver control and info share
+ *AP-W/R : AP is writer/reader on this item
+ *VPU-W/R: VPU is write/reader on this item
  * This structure is allocated in VPU side and shared to AP side.
  * @config: h264 encoder configuration
  * @work_bufs: working buffer information in VPU side
@@ -150,12 +154,6 @@ struct venc_h264_inst {
struct mtk_vcodec_ctx *ctx;
 };
 
-static inline void h264_write_reg(struct venc_h264_inst *inst, u32 addr,
- u32 val)
-{
-   writel(val, inst->hw_base + addr);
-}
-
 static inline u32 h264_read_reg(struct venc_h264_inst *inst, u32 addr)
 {
return readl(inst->hw_base + addr);
@@ -214,6 +212,8 @@ static unsigned int h264_get_level(struct venc_h264_inst 
*inst,
return 40;
case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
return 41;
+   case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
+   return 42;
default:
mtk_vcodec_debug(inst, "unsupported level %d", level);
return 31;
-- 
1.7.9.5

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


[PATCH for v4.8] vcodec:mediatek: Refine VP8 encoder driver

2016-08-14 Thread Tiffany Lin
This patch remove field and function that unused anymore

Signed-off-by: Tiffany Lin 
---
 .../media/platform/mtk-vcodec/venc/venc_vp8_if.c   |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c 
b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
index 60bbcd2..6d97584 100644
--- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
@@ -56,6 +56,8 @@ enum venc_vp8_vpu_work_buf {
 
 /*
  * struct venc_vp8_vpu_config - Structure for vp8 encoder configuration
+ *  AP-W/R : AP is writer/reader on this item
+ *  VPU-W/R: VPU is write/reader on this item
  * @input_fourcc: input fourcc
  * @bitrate: target bitrate (in bps)
  * @pic_w: picture width. Picture size is visible stream resolution, in pixels,
@@ -83,14 +85,14 @@ struct venc_vp8_vpu_config {
 };
 
 /*
- * struct venc_vp8_vpu_buf -Structure for buffer information
- * @align: buffer alignment (in bytes)
+ * struct venc_vp8_vpu_buf - Structure for buffer information
+ *   AP-W/R : AP is writer/reader on this item
+ *   VPU-W/R: VPU is write/reader on this item
  * @iova: IO virtual address
  * @vpua: VPU side memory addr which is used by RC_CODE
  * @size: buffer size (in bytes)
  */
 struct venc_vp8_vpu_buf {
-   u32 align;
u32 iova;
u32 vpua;
u32 size;
@@ -98,6 +100,8 @@ struct venc_vp8_vpu_buf {
 
 /*
  * struct venc_vp8_vsi - Structure for VPU driver control and info share
+ *   AP-W/R : AP is writer/reader on this item
+ *   VPU-W/R: VPU is write/reader on this item
  * This structure is allocated in VPU side and shared to AP side.
  * @config: vp8 encoder configuration
  * @work_bufs: working buffer information in VPU side
@@ -138,12 +142,6 @@ struct venc_vp8_inst {
struct mtk_vcodec_ctx *ctx;
 };
 
-static inline void vp8_enc_write_reg(struct venc_vp8_inst *inst, u32 addr,
-u32 val)
-{
-   writel(val, inst->hw_base + addr);
-}
-
 static inline u32 vp8_enc_read_reg(struct venc_vp8_inst *inst, u32 addr)
 {
return readl(inst->hw_base + addr);
-- 
1.7.9.5

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


Re: [PATCH] vcodec: mediatek: bug fix and code refine for mt8173 v4l2 Encoder

2016-08-14 Thread Tiffany Lin
Hi Hans,

On Sun, 2016-08-14 at 13:40 +0200, Hans Verkuil wrote:
> On 08/12/2016 04:35 PM, Tiffany Lin wrote:
> > This patch include fixs:
> > 1. Remove unused include in mtk_vcodec_drv.h
> > 2. Fix visible_height larger than coded_height issue in s_fmt_out
> > 3. Add timestamp and timecode copy
> > 4. Fix mtk_vcodec_vdec_release should be called after 
> > v4l2_m2m_ctx_release
> > 5. Remove unused define MTK_INST_WORK_THREAD_ABORT_DONE
> > 6. Add support V4L2_MPEG_VIDEO_H264_LEVEL_4_2
> > 4. Refine  venc_h264_if.c and venc_vp8_if.c
> 
> I would prefer it if this can be split up into separate patches, one for each 
> fix.
> 
> Also, should this be merged for v4.8 or can this wait for 4.9? When you split 
> it
> up you can use [PATCH for v4.8] as prefix for those patches that should go to 
> v4.8.
> 
I split up this patch into separate patches and resent them.
Please note there is dependency between these patches.

best regards,
Tiffany


> Regards,
> 
>   Hans
> 
> > 
> > Signed-off-by: Tiffany Lin 
> > ---
> >  drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |1 -
> >  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   42 
> > 
> >  .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |6 ++-
> >  .../media/platform/mtk-vcodec/mtk_vcodec_intr.h|1 -
> >  .../media/platform/mtk-vcodec/mtk_vcodec_util.c|   11 ++---
> >  .../media/platform/mtk-vcodec/venc/venc_h264_if.c  |   16 
> >  .../media/platform/mtk-vcodec/venc/venc_vp8_if.c   |   16 
> >  7 files changed, 52 insertions(+), 41 deletions(-)
> > 
> > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h 
> > b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> > index 94f0a42..3a8e695 100644
> > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
> > @@ -23,7 +23,6 @@
> >  #include 
> >  #include 
> >  
> > -#include "mtk_vcodec_util.h"
> >  
> >  #define MTK_VCODEC_DRV_NAME"mtk_vcodec_drv"
> >  #define MTK_VCODEC_ENC_NAME"mtk-vcodec-enc"
> > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c 
> > b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > index 0a895e0..34fd89c 100644
> > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > @@ -487,7 +487,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, 
> > void *priv,
> > struct mtk_q_data *q_data;
> > int ret, i;
> > struct mtk_video_fmt *fmt;
> > -   unsigned int pitch_w_div16;
> > struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
> >  
> > vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
> > @@ -530,15 +529,6 @@ static int vidioc_venc_s_fmt_out(struct file *file, 
> > void *priv,
> > q_data->coded_width = f->fmt.pix_mp.width;
> > q_data->coded_height = f->fmt.pix_mp.height;
> >  
> > -   pitch_w_div16 = DIV_ROUND_UP(q_data->visible_width, 16);
> > -   if (pitch_w_div16 % 8 != 0) {
> > -   /* Adjust returned width/height, so application could correctly
> > -* allocate hw required memory
> > -*/
> > -   q_data->visible_height += 32;
> > -   vidioc_try_fmt(f, q_data->fmt);
> > -   }
> > -
> > q_data->field = f->fmt.pix_mp.field;
> > ctx->colorspace = f->fmt.pix_mp.colorspace;
> > ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
> > @@ -945,7 +935,8 @@ static int mtk_venc_encode_header(void *priv)
> >  {
> > struct mtk_vcodec_ctx *ctx = priv;
> > int ret;
> > -   struct vb2_buffer *dst_buf;
> > +   struct vb2_buffer *src_buf, *dst_buf;
> > +   struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
> > struct mtk_vcodec_mem bs_buf;
> > struct venc_done_result enc_result;
> >  
> > @@ -978,6 +969,15 @@ static int mtk_venc_encode_header(void *priv)
> > mtk_v4l2_err("venc_if_encode failed=%d", ret);
> > return -EINVAL;
> > }
> > +   src_buf = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
> > +   if (src_buf) {
> > +   src_vb2_v4l2 = to_vb2_v4l2_buffer(src_buf);
> > +   dst_vb2_v4l2 = to_vb2_v4l2_buffer(dst_buf);
> > +   dst_buf->timestamp = src_buf->timestamp;
> > +   dst_vb2_v4l2->timecode = src_vb2_v4l2->timecode;
> > +   } else {
> > +   mtk_v4l2_err("No timestamp for the header buffer.");
> > +   }
> >  
> > ctx->state = MTK_STATE_HEADER;
> > dst_buf->planes[0].bytesused = enc_result.bs_size;
> > @@ -1070,7 +1070,7 @@ static void mtk_venc_worker(struct work_struct *work)
> > struct mtk_vcodec_mem bs_buf;
> > struct venc_done_result enc_result;
> > int ret, i;
> > -   struct vb2_v4l2_buffer *vb2_v4l2;
> > +   struct vb2_v4l2_buffer *dst_vb2_v4l2, *src_vb2_v4l2;
> >  
> > /* check dst_buf, dst_buf may be removed in device_run
> >  * to stored encdoe header so we need check dst_buf and
> > @@ -1110,9 +1110,14 @@ static void mtk_venc_worker(struct wor

[PATCH] [media] radio-si470x-i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Mon, 15 Aug 2016 07:01:56 +0200

The field "owner" is set by core. Thus delete an extra initialisation.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring 
---
 drivers/media/radio/si470x/radio-si470x-i2c.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c 
b/drivers/media/radio/si470x/radio-si470x-i2c.c
index 471d6a8..ee0470a 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -509,7 +509,6 @@ static SIMPLE_DEV_PM_OPS(si470x_i2c_pm, si470x_i2c_suspend, 
si470x_i2c_resume);
 static struct i2c_driver si470x_i2c_driver = {
.driver = {
.name   = "si470x",
-   .owner  = THIS_MODULE,
 #ifdef CONFIG_PM_SLEEP
.pm = &si470x_i2c_pm,
 #endif
-- 
2.9.2

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


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

2016-08-14 Thread Wu, Songjun



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

One quick question:

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

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

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

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

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

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

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

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

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

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

Test input 0:

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


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


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

Should I add the v4l2 controls and test again?


Regards,

Hans


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