<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/staging/easycap, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>staging: Move media drivers to staging/media</title>
<updated>2011-11-03T09:59:03+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@redhat.com</email>
</author>
<published>2011-11-02T00:23:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4860c73804c6e7ef8e69f98958489bb2bea6f6d2'/>
<id>4860c73804c6e7ef8e69f98958489bb2bea6f6d2</id>
<content type='text'>
In practice, it is being hard to distinguish when a patch
should go to staging tree or to the media tree. Better
to distinguish it, by putting the media drivers at a
separate staging directory. Newer staging drivers that include
anything with "dvb*.h", "v4l2*.h" or "videodev2.h" should
go to the drivers/staging/media tree.

Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In practice, it is being hard to distinguish when a patch
should go to staging tree or to the media tree. Better
to distinguish it, by putting the media drivers at a
separate staging directory. Newer staging drivers that include
anything with "dvb*.h", "v4l2*.h" or "videodev2.h" should
go to the drivers/staging/media tree.

Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: kill timeval members of easycap struct</title>
<updated>2011-10-17T22:24:10+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2011-10-10T06:36:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b55e073e95804b022075e464b9cf82e269fd457a'/>
<id>b55e073e95804b022075e464b9cf82e269fd457a</id>
<content type='text'>
timeval[0-9] were not used or used in a ready only code
so we can remove them safely and so the code

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
timeval[0-9] were not used or used in a ready only code
so we can remove them safely and so the code

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>easycap: fix ntsc module parameter description</title>
<updated>2011-10-11T16:01:47+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2011-10-06T12:04:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=aa3e842d2c27acd3e73167eef5a347601639f2cb'/>
<id>aa3e842d2c27acd3e73167eef5a347601639f2cb</id>
<content type='text'>
Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Acked-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Acked-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: fix mismatch in easycap_poll() mutex lock-unlock</title>
<updated>2011-08-29T18:20:11+00:00</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2011-08-29T17:46:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=22f88fcf407933321d08c45520fbeffca70b05d1'/>
<id>22f88fcf407933321d08c45520fbeffca70b05d1</id>
<content type='text'>
In case if condition (kd != isdongle(peasycap)) becomes true,
easycap_poll() returns without releasing easycapdc60_dongle[kd].mutex_video.
The patch adds mutex_unlock() before that return.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Acked-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case if condition (kd != isdongle(peasycap)) becomes true,
easycap_poll() returns without releasing easycapdc60_dongle[kd].mutex_video.
The patch adds mutex_unlock() before that return.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Acked-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: Use memdup_user</title>
<updated>2011-08-23T22:22:58+00:00</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2011-08-13T09:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=71c9c2045cc88f2253603bb7634c2eb523f20dea'/>
<id>71c9c2045cc88f2253603bb7634c2eb523f20dea</id>
<content type='text'>
 Use kmemdup_user rather than duplicating its implementation
 This is a little bit restricted to reduce false positives

 The semantic patch that makes this output is available
 in scripts/coccinelle/api/memdup_user.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 Use kmemdup_user rather than duplicating its implementation
 This is a little bit restricted to reduce false positives

 The semantic patch that makes this output is available
 in scripts/coccinelle/api/memdup_user.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: remove oss support</title>
<updated>2011-07-08T21:02:26+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2011-07-07T17:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=73019286cddc8bba1773944a7b6b603137fd66ff'/>
<id>73019286cddc8bba1773944a7b6b603137fd66ff</id>
<content type='text'>
remove support for OSS. OSS is being deprecated
and it is just plain headache to support both alsa and oss.

Last I broke the compilation when OSS is enabled with the patch
cdaa898b5efcc598ab1004e8f913061dc7005091
staging/easycap: kill telltale logic

so this fixes also that issue.

Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
remove support for OSS. OSS is being deprecated
and it is just plain headache to support both alsa and oss.

Last I broke the compilation when OSS is enabled with the patch
cdaa898b5efcc598ab1004e8f913061dc7005091
staging/easycap: kill telltale logic

so this fixes also that issue.

Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: remove unused macro MICROSECONDS</title>
<updated>2011-07-08T21:02:25+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2011-07-07T17:45:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=808a3b5f9b1deb7e449765192a0315e2da904553'/>
<id>808a3b5f9b1deb7e449765192a0315e2da904553</id>
<content type='text'>
Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: kill telltale logic</title>
<updated>2011-07-06T02:47:46+00:00</updated>
<author>
<name>Tomas Winkler</name>
<email>tomas.winkler@intel.com</email>
</author>
<published>2011-07-05T18:07:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cdaa898b5efcc598ab1004e8f913061dc7005091'/>
<id>cdaa898b5efcc598ab1004e8f913061dc7005091</id>
<content type='text'>
This reason for this feature was

'some versions of the videodev module overwrite the data which has
been written by the call to usb_set_intfdata() in easycap_usb_probe(),
replacing it with a pointer to the embedded v4l2_device structure.
to detect this, the string in the easycap.telltale[] buffer is checked.'

The upstream version of v4l2_device_register sets driver data
only when it wasn't already set, therefore this is not needed

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reason for this feature was

'some versions of the videodev module overwrite the data which has
been written by the call to usb_set_intfdata() in easycap_usb_probe(),
replacing it with a pointer to the embedded v4l2_device structure.
to detect this, the string in the easycap.telltale[] buffer is checked.'

The upstream version of v4l2_device_register sets driver data
only when it wasn't already set, therefore this is not needed

Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unneeded version.h includes (and add where needed) for drivers/staging/easycap/</title>
<updated>2011-07-05T17:39:39+00:00</updated>
<author>
<name>Jesper Juhl</name>
<email>jj@chaosbits.net</email>
</author>
<published>2011-06-23T22:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0de7586a11890b9fbf1cfc119adf2ba59841f41e'/>
<id>0de7586a11890b9fbf1cfc119adf2ba59841f41e</id>
<content type='text'>
It was pointed out by 'make versioncheck' that linux/version.h was not
always being included where needed and sometimes included needlessly
in drivers/staging/easycap/.
This patch fixes up the includes.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was pointed out by 'make versioncheck' that linux/version.h was not
always being included where needed and sometimes included needlessly
in drivers/staging/easycap/.
This patch fixes up the includes.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging/easycap: Fix bytesperline calculation</title>
<updated>2011-07-05T17:26:16+00:00</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2011-06-13T12:18:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=378af483331d429bff3318e69f4ff5534f92c750'/>
<id>378af483331d429bff3318e69f4ff5534f92c750</id>
<content type='text'>
As described above fillin_formats()

"""
    /*
     *  THE 16-BIT easycap_format.mask HAS MEANING:
     *    (least significant) BIT  0:     0 =&gt; PAL, 25 FPS;   1 =&gt; NTSC, 30 FPS
     *                        BITS 2-4:   RESERVED FOR DIFFERENTIATING STANDARDS
     *                        BITS 5-7:   NUMBER OF BYTES PER PIXEL
     *                        BIT  8:     0 =&gt; NATIVE BYTE ORDER;  1 =&gt; SWAPPED
     *                        BITS 9-10:  RESERVED FOR OTHER BYTE PERMUTATIONS
     *                        BIT 11:     0 =&gt; UNDECIMATED;    1 =&gt; DECIMATED
     *                        BIT 12:     0 =&gt; OFFER FRAMES;   1 =&gt; OFFER FIELDS
     *                        BIT 13:     0 =&gt; FULL FRAMERATE; 1 =&gt; REDUCED
     *     (most significant) BITS 14-15: RESERVED FOR OTHER FIELD/FRAME OPTIONS
     *  IT FOLLOWS THAT:
     *     bytesperpixel IS         ((0x00E0 &amp; easycap_format.mask) &gt;&gt; 5)
     *     byteswaporder IS true IF (0 != (0x0100 &amp; easycap_format.mask))
     *
     *     decimatepixel IS true IF (0 != (0x0800 &amp; easycap_format.mask))
     *
     *       offerfields IS true IF (0 != (0x1000 &amp; easycap_format.mask))
     */
"""

bytes-per-pixel is stored in bits 5-7 of calculated mask.

But when calculating bytes-per-line we were extracting wrong value
instead of bytes-per-pixel, which was usually 2 times bigger -- e.g. for
PAL YUV 422 I was getting ((mask3 &amp; 0x00F0) &gt;&gt; 4) = 4 bytes instead of 2.

The error here is that even in comments there is a line saying

     *     bytesperpixel IS         ((0x00E0 &amp; easycap_format.mask) &gt;&gt; 5)

but we were using
                                    ((0x00F0 &amp; easycap_format.mask) &gt;&gt; 4)

With 2 times bigger bytesperpixel and automatically bytesperline, the
video was shown halfheight'ed, which is understandable if we look at
video-memory layout:

    &lt;------- bytesperline --------&gt;
    &lt;- real bpl -&gt;

    x0----------y0  x1-----------y1
    x2----------y2  x3-----------y3

    xn----------yn  xn-----------yn
    &lt;garbage&gt;

for each line, we should display width pixels, then move to next line
with bytesperline, and oops, if bytesperline = 2*real-bytesperlin, we'll
skip one line and move to next-next line, and so only half lines will be
shown.

Initially I've debugged the problem with my video application[1], but
I've checked that after this patch both rawv (mine app) and tvtime work
correctly.

[1] http://repo.or.cz/w/rawv.git

P.S. why at all we use those mask/shifts? Why not use bitfields?

Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Acked-by:  Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As described above fillin_formats()

"""
    /*
     *  THE 16-BIT easycap_format.mask HAS MEANING:
     *    (least significant) BIT  0:     0 =&gt; PAL, 25 FPS;   1 =&gt; NTSC, 30 FPS
     *                        BITS 2-4:   RESERVED FOR DIFFERENTIATING STANDARDS
     *                        BITS 5-7:   NUMBER OF BYTES PER PIXEL
     *                        BIT  8:     0 =&gt; NATIVE BYTE ORDER;  1 =&gt; SWAPPED
     *                        BITS 9-10:  RESERVED FOR OTHER BYTE PERMUTATIONS
     *                        BIT 11:     0 =&gt; UNDECIMATED;    1 =&gt; DECIMATED
     *                        BIT 12:     0 =&gt; OFFER FRAMES;   1 =&gt; OFFER FIELDS
     *                        BIT 13:     0 =&gt; FULL FRAMERATE; 1 =&gt; REDUCED
     *     (most significant) BITS 14-15: RESERVED FOR OTHER FIELD/FRAME OPTIONS
     *  IT FOLLOWS THAT:
     *     bytesperpixel IS         ((0x00E0 &amp; easycap_format.mask) &gt;&gt; 5)
     *     byteswaporder IS true IF (0 != (0x0100 &amp; easycap_format.mask))
     *
     *     decimatepixel IS true IF (0 != (0x0800 &amp; easycap_format.mask))
     *
     *       offerfields IS true IF (0 != (0x1000 &amp; easycap_format.mask))
     */
"""

bytes-per-pixel is stored in bits 5-7 of calculated mask.

But when calculating bytes-per-line we were extracting wrong value
instead of bytes-per-pixel, which was usually 2 times bigger -- e.g. for
PAL YUV 422 I was getting ((mask3 &amp; 0x00F0) &gt;&gt; 4) = 4 bytes instead of 2.

The error here is that even in comments there is a line saying

     *     bytesperpixel IS         ((0x00E0 &amp; easycap_format.mask) &gt;&gt; 5)

but we were using
                                    ((0x00F0 &amp; easycap_format.mask) &gt;&gt; 4)

With 2 times bigger bytesperpixel and automatically bytesperline, the
video was shown halfheight'ed, which is understandable if we look at
video-memory layout:

    &lt;------- bytesperline --------&gt;
    &lt;- real bpl -&gt;

    x0----------y0  x1-----------y1
    x2----------y2  x3-----------y3

    xn----------yn  xn-----------yn
    &lt;garbage&gt;

for each line, we should display width pixels, then move to next line
with bytesperline, and oops, if bytesperline = 2*real-bytesperlin, we'll
skip one line and move to next-next line, and so only half lines will be
shown.

Initially I've debugged the problem with my video application[1], but
I've checked that after this patch both rawv (mine app) and tvtime work
correctly.

[1] http://repo.or.cz/w/rawv.git

P.S. why at all we use those mask/shifts? Why not use bitfields?

Cc: Mike Thomas &lt;rmthomas@sciolus.org&gt;
Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Acked-by:  Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
