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]
Message-ID: <56AA5069.4010402@osg.samsung.com>
Date:	Thu, 28 Jan 2016 10:31:21 -0700
From:	Shuah Khan <shuahkh@....samsung.com>
To:	Mauro Carvalho Chehab <mchehab@....samsung.com>
Cc:	tiwai@...e.com, clemens@...isch.de, hans.verkuil@...co.com,
	laurent.pinchart@...asonboard.com, sakari.ailus@...ux.intel.com,
	javier@....samsung.com, pawel@...iak.com, m.szyprowski@...sung.com,
	kyungmin.park@...sung.com, perex@...ex.cz, arnd@...db.de,
	dan.carpenter@...cle.com, tvboxspy@...il.com, crope@....fi,
	ruchandani.tina@...il.com, corbet@....net, chehabrafael@...il.com,
	k.kozlowski@...sung.com, stefanr@...6.in-berlin.de,
	inki.dae@...sung.com, jh1009.sung@...sung.com,
	elfring@...rs.sourceforge.net, prabhakar.csengg@...il.com,
	sw0312.kim@...sung.com, p.zabel@...gutronix.de,
	ricardo.ribalda@...il.com, labbott@...oraproject.org,
	pierre-louis.bossart@...ux.intel.com, ricard.wanderlof@...s.com,
	julian@...st.de, takamichiho@...il.com, dominic.sacre@....de,
	misterpib@...il.com, daniel@...que.org, gtmkramer@...all.nl,
	normalperson@...t.net, joe@...po.co.uk, linuxbugs@...tgam.net,
	johan@...ud.se, linux-kernel@...r.kernel.org,
	linux-media@...r.kernel.org, linux-api@...r.kernel.org,
	alsa-devel@...a-project.org, Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [PATCH 09/31] media: v4l2-core add v4l_vb2q_enable_media_tuner()
 helper

On 01/28/2016 08:29 AM, Mauro Carvalho Chehab wrote:
> Em Wed,  6 Jan 2016 13:26:58 -0700
> Shuah Khan <shuahkh@....samsung.com> escreveu:
> 
>> Add a new v4l_vb2q_enable_media_tuner() wrapper function
>> to be called from v4l2-core to enable the media tuner with
>> videobuf2 queue, when the calling frunction has the videobuf2
>> queue and doesn't have the struct video_device associated with
>> the queue handy as in the case of vb2_core_streamon(). This
>> function simply calls v4l_enable_media_tuner() passing in the
>> pointer to struct video_device.
>>
>> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
>> ---
>>  drivers/media/v4l2-core/v4l2-dev.c | 21 +++++++++++++++++++++
>>  include/media/v4l2-dev.h           |  1 +
>>  2 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
>> index f06da6e..9ef675a 100644
>> --- a/drivers/media/v4l2-core/v4l2-dev.c
>> +++ b/drivers/media/v4l2-core/v4l2-dev.c
>> @@ -30,6 +30,7 @@
>>  #include <media/v4l2-common.h>
>>  #include <media/v4l2-device.h>
>>  #include <media/v4l2-ioctl.h>
>> +#include <media/videobuf2-core.h>
>>  
>>  #define VIDEO_NUM_DEVICES	256
>>  #define VIDEO_NAME              "video4linux"
>> @@ -261,6 +262,26 @@ void v4l_disable_media_tuner(struct video_device *vdev)
>>  }
>>  EXPORT_SYMBOL_GPL(v4l_disable_media_tuner);
>>  
>> +/**
>> + * v4l_vb2q_enable_media_tuner - Wrapper for v4l_enable_media_tuner()
>> + * @q:         videobuf2 queue
>> + *
>> + * This function is intended to be called from v4l2-core
>> + * to enable the media tuner with videobuf2 queue, when
>> + * the calling frunction has the videobuf2 queue and doesn't
> 
> 	typo: function

ok thanks

> 
>> + * have the struct video_device associated with the
>> + * queue handy as in the case of vb2_core_streamon(). This
>> + * function simply calls v4l_enable_media_tuner() passing
>> + * in the pointer to struct video_device.
> 
> The hole description seems confusing. I'm not seeing the light
> about why this is needed.

Sorry if the description isn't clear. During videobuf2
work, owner field in struct vb2_queue is changed from
struct v4l2_fh * to void. Prior to this work, I could
call v4l_enable_media_tuner(). 

+               ret = v4l_enable_media_tuner(q->owner->vdev);
+               if (ret)
+                       return ret;

As you can see with the videobuf2, to be able to call
v4l_enable_media_tuner() from vb2_core_streamon(), I have
had to this wrapper to maintain the abstraction introduced
in videobuf2 work.

Hope this helps the need for this wrapper.

thanks,
-- Shuah
> 
>> + */
>> +int v4l_vb2q_enable_media_tuner(struct vb2_queue *q)
>> +{
>> +	struct v4l2_fh *fh = q->owner;
>> +
>> +	return v4l_enable_media_tuner(fh->vdev);
>> +}
>> +EXPORT_SYMBOL_GPL(v4l_vb2q_enable_media_tuner);
>> +
>>  /* Priority handling */
>>  
>>  static inline bool prio_is_valid(enum v4l2_priority prio)
>> diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
>> index 68999a3..1948097 100644
>> --- a/include/media/v4l2-dev.h
>> +++ b/include/media/v4l2-dev.h
>> @@ -179,6 +179,7 @@ struct video_device * __must_check video_device_alloc(void);
>>  
>>  int v4l_enable_media_tuner(struct video_device *vdev);
>>  void v4l_disable_media_tuner(struct video_device *vdev);
>> +int v4l_vb2q_enable_media_tuner(struct vb2_queue *q);
> 
> Documentation?
> 
>>  
>>  /* this release function frees the vdev pointer */
>>  void video_device_release(struct video_device *vdev);


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@....samsung.com | (970) 217-8978

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ