lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jul 2016 14:48:00 +0300
From:	Andrey Utkin <andrey_utkin@...tmail.com>
To:	Hans Verkuil <hverkuil@...all.nl>
Cc:	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Bluecherry Maintainers <maintainers@...echerrydvr.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Kalle Valo <kvalo@...eaurora.org>,
	Joe Perches <joe@...ches.com>, Jiri Slaby <jslaby@...e.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Guenter Roeck <linux@...ck-us.net>,
	Kozlov Sergey <serjk@...up.ru>,
	Ezequiel Garcia <ezequiel@...guardiasur.com.ar>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Krzysztof HaƂasa <khalasa@...p.pl>,
	linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
	devel@...verdev.osuosl.org, linux-pci@...r.kernel.org,
	kernel-mentors@...enic.com,
	Andrey Utkin <andrey.utkin@...p.bluecherry.net>
Subject: Re: [PATCH v3] Add tw5864 driver

Thanks for review Hans!

On Mon, Jul 11, 2016 at 07:58:38AM +0200, Hans Verkuil wrote:
> > +" v4l2-ctl --device $dev --set-ctrl=video_gop_size=1; done\n"
> 
> Replace $dev by /dev/videoX
> 
> Wouldn't it make more sense to default to this? And show the warning only if
> P-frames are enabled?

I believe it's better to leave P-frames on by default. All-I-frames
stream has huge bitrate. And the pixels artifacts is not very strong,
it's 0 - 10 bad pixels on picture at same time in our dev environment,
and probably up to 50 bad pixels max in other environments I know of.

> > +	dma_sync_single_for_cpu(&dev->pci->dev, cur_frame->vlc.dma_addr,
> > +				H264_VLC_BUF_SIZE, DMA_FROM_DEVICE);
> > +	dma_sync_single_for_cpu(&dev->pci->dev, cur_frame->mv.dma_addr,
> > +				H264_MV_BUF_SIZE, DMA_FROM_DEVICE);
> 
> This is almost certainly the wrong place. This should probably happen in the
> tasklet. The tasklet runs after the isr, so by the time the tasklet runs
> you've already called dma_sync_single_for_device.

Thanks, moved to tasklet subroutine tw5864_handle_frame().

I didn't seem to me like dma_sync_single_for_* can take long time or be
otherwise bad to be done from interrupt context.

> > +static int tw5864_querycap(struct file *file, void *priv,
> > +			   struct v4l2_capability *cap)
> > +{
> > +	struct tw5864_input *input = video_drvdata(file);
> > +
> > +	strcpy(cap->driver, "tw5864");
> > +	snprintf(cap->card, sizeof(cap->card), "TW5864 Encoder %d",
> > +		 input->nr);
> > +	sprintf(cap->bus_info, "PCI:%s", pci_name(input->root->pci));
> > +	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
> > +		V4L2_CAP_STREAMING;
> > +	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> 
> This line can be dropped, the core will fill in the capabilities field for you.

No, removing this line causes v4l2-compliance failures and also ffmpeg fails to
play the device.

Required ioctls:
                fail: v4l2-compliance.cpp(550): dcaps & ~caps
        test VIDIOC_QUERYCAP: FAIL

Allow for multiple opens:
        test second video open: OK
                fail: v4l2-compliance.cpp(550): dcaps & ~caps
        test VIDIOC_QUERYCAP: FAIL

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ