cron job: media_tree daily build: WARNINGS

2013-11-17 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 Nov 18 04:00:18 CET 2013
git branch: test
git hash:   80f93c7b0f4599ffbdac8d964ecd1162b8b618b9
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: 0.4.5-rc1
host hardware:  x86_64
host os:3.12-0.slh.2-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: 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.31.14-i686: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: 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: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12-i686: OK
linux-2.6.31.14-x86_64: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
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: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12-x86_64: OK
apps: WARNINGS
spec-git: OK
sparse version: 0.4.5-rc1
sparse: ERRORS

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/media.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: SAA7134 driver reports zero frame rate

2013-11-17 Thread Tim E. Real
On November 16, 2013 10:21:03 PM you wrote:
> On Sat, Nov 16, 2013 at 6:19 PM, Tim E. Real  wrote:
> > The SAA7134 driver causes libav to crash because the
> > 
> >  driver reports zero frame rate.
> > 
> > Thus it is virtually impossible to do any recording.
> 
> Step #1:  Open a bug against libav.  The app should return an error or
> not let you start streaming.  If it crashes (regardless of the
> underlying reason), they've got a bug in their library.
> 
> > About a year ago I debugged and found I had to do this,
> > 
> >  (but it was not enough, more fixes would be needed):
> > In libav/libavdevice/v4l2.c :
> > 
> > static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters
> > *ap)
> > {
> > ...
> > 
> > s1->streams[0]->codec->time_base.den = tpf->denominator;
> > s1->streams[0]->codec->time_base.num = tpf->numerator;
> > 
> > // By Tim. BUG: The saa7134 driver (at least) reports zero framerate,
> > //  causing abort in rescale. So just force it.
> > if(s1->streams[0]->codec->time_base.den == 0 ||
> > 
> > s1->streams[0]->codec->time_base.num == 0)
> > 
> > {
> > 
> >   s1->streams[0]->codec->time_base.num = 1;
> >   s1->streams[0]->codec->time_base.den = 30;
> > 
> > }
> > 
> > s->timeout = 100 +
> > 
> > av_rescale_q(1, s1->streams[0]->codec->time_base,
> > 
> > (AVRational){1, 1000});
> > 
> > return 0;
> > 
> > }
> > 
> > I looked at the SAA7134 module parameters but couldn't seem to
> > 
> >  find anything to help.
> > 
> > Does anyone know how to make the module work so it sets a proper
> > 
> >  frame rate, or if this problem been fixed recently?
> 
> Have you tried it with the latest kernel?  Many of the drivers have
> had fixes in the last year for V4L2 conformance, so it's possible this
> was already fixed.
> 
> I would recommend you try it with the latest kernel and see if it
> still happens.  If it does still occur, then somebody can dig into it
> (assuming they have time/energy/inclination).
> 
> I'm not arguing that you probably found a bug, but you'll have to do a
> bit more of the legwork to make sure it's still a real issue before
> somebody else gets involved.
> 
> Devin

Thanks, you're right I should test some more, it has been a year since.
Seem to have somewhat better luck with mencoder vs libav, at least 
 it doesn't crash. 
Possibly it's up to the app to tell the driver what frame rate to expect,
 so maybe I'm not supplying the right parameters in the first place...

Tim.
--
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 v5 13/17] [media] fsl-viu: adjust for OF based clock lookup

2013-11-17 Thread Gerhard Sittig
after device tree based clock lookup became available, the VIU driver
need no longer use the previous global "viu_clk" name, but should use
the "ipg" clock name specific to the OF node

Cc: Mauro Carvalho Chehab 
Cc: linux-media@vger.kernel.org
Signed-off-by: Gerhard Sittig 
---
 drivers/media/platform/fsl-viu.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index fe9898ca3c84..c1e84aeb2e25 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -1578,7 +1578,7 @@ static int viu_of_probe(struct platform_device *op)
}
 
/* enable VIU clock */
-   clk = devm_clk_get(&op->dev, "viu_clk");
+   clk = devm_clk_get(&op->dev, "ipg");
if (IS_ERR(clk)) {
dev_err(&op->dev, "failed to lookup the clock!\n");
ret = PTR_ERR(clk);
-- 
1.7.10.4

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


[PATCH v5 00/17] add COMMON_CLK support for PowerPC MPC512x

2013-11-17 Thread Gerhard Sittig
this series introduces support for the common clock framework (CCF,
COMMON_CLK Kconfig option) in the PowerPC based MPC512x platform, which
brings device tree based clock lookup as well

at subsystem maintainers:

this series was streamlined for conflict free application through the
subsystems' individual trees, and consists of the following phases
- peripheral driver cleanup (1/17) (not essential, in fact comments only
  and code which is a NOP)
- introduction of CCF support including migration workarounds and
  backwards compatibility, device tree updates (2/17 - 7/17)
  (nevertheless I suggest to take the .dts/.dtsi updates through the
  PowerPC tree, the extensions are straight forward and strictly are
  clock related, and complement the CCF platform support)
- peripheral driver adjustment to the CCF approach (8/17 - 16/17)
- removal of migration workarounds (17/17)

at device tree maintainers:

- the series does not introduce new bindings, but implements the
  existing clock binding (OF clock provider, DT based clock lookup) and
  so adjusts and extends DTS files
- the code is backwards compatible, and keeps working with device trees
  which don't contain clock related information


the series is based on v3.12, but I'll rebase against v3.13-rc1 (when
available) or any other subtree upon request

the series passes 'checkpatch.pl --strict' except for one warning which
cannot get resolved, since the  API dictates the
data type, "fixing" the checkpatch warning would break compilation

  WARNING: static const char * array should probably be static const char * 
const
  #420: FILE: arch/powerpc/platforms/512x/clock-commonclk.c:342:
  +static const char *parent_names_mux0[] = {

  total: 0 errors, 1 warnings, 0 checks, 834 lines checked

checkpatch appears to choke on the NODE_CHK() macro in the backwards
compat patch, while I cannot see why since it groks the FOR_NODES() and
NODE_PREP() macros

  Use of uninitialized value $c in pattern match (m//) at 
./scripts/checkpatch.pl line 3280.
  Use of uninitialized value in substr at ./scripts/checkpatch.pl line 3287.
  Use of uninitialized value $s in substr at ./scripts/checkpatch.pl line 3287.


the series has been build tested (each step on PowerPC 512x, 52xx, 5xxx
multi platform, 83xx, 85xx, 86xx, and on ARM v6/v7), run tested (each
step on 512x, the switch to CCF on 52xx), and tested for backwards
compatibility (each step on 512x with a v3.11 dtb)


changes in v5:
- extend comments in the PCI driver cleanup (probe() vs setup_arch()
  discussion, no code change); all other peripheral driver cleanup from
  v4 was taken into mainline
- concentrate migration support in a separate routine for improved
  maintainability
- fix the oscillator frequency lookup ('osc' reference) in the CCF
  platform support code which creates the clock tree
- add backwards compatibility with device trees that lack clock specs,
  concentrate compat support in a separate routine for improved
  maintainability, add it in a separate patch for easier review
- consistent use of the 'ipg' name in DTS files for the register access
  clock item of peripherals
- switch from PPC_CLOCK to COMMON_CLK at the same time for 512x and 52xx
  (keep multi-platform setups operational), in a separate patch
- move removal of migration support to the very end of the series, it's
  no longer intertwined with peripheral driver adjustment
- SPI and UART: get 'mclk' and 'ipg' clock items in a more consistent
  order (less obfuscation in the diff)
- add/adjust Cc: and Acked-By: entries, rework commit messages and
  comments where appropriate

changes in v4:
- remove explicit devm_clk_put() calls as these will occur implicitly
  upon device release (01/31, 02/31, 03/31, 04/31, 05/31, 06/31, 08/31,
  09/31, 27/31)
- split the PSC (SPI, UART) and MSCAN (CAN) related MCLK subtrees into
  separate 'ipg'/'bdlc' gated clock items for register access as well as
  the 'mclk' clock subtrees that apply to bitrates -- this eliminates
  the need for "shared gates" and further reduces clock pre-enable
  workarounds (11/31, 15/31, 17/31, 18/31, 20/31, 21/31, 22/31, 27/31)
- further adjust the CAN clock driver, fix an incomplete error code path
  in the network device open callback (11/31), only enable the bitrate
  clock when the network device is open (27/31)
- remove debug output in the clock tree setup when introducing the
  platform's clock driver, there already is CONFIG_COMMON_CLK_DEBUG to
  retrieve more complete information (17/31)
- remove an "enums don't work here" comment in the dt-bindings header
  file (15/31)
- reword and update commit messages (body and/or subject) where
  appropriate (03/31, 04/31, 05/31, 06/31, 08/31, 09/31, 11/31, 12/31,
  17/31, 20/31, 21/31, 22/31, 27/31, 28/31, 30/31, 31/31)
- add 'Reviewed-By' attributes which were received for v3

changes in v3:
- rebase the series against v3.11-rc2
- re-ordered the series to first address all general clock handling
  concerns in existing drivers, befo

[PATCH RFC 3/7] v4l2: add signed 8-bit pixel format for SDR

2013-11-17 Thread Antti Palosaari
It is 8-bit unsigned data, byte after byte. Used for streaming SDR
I/Q data from ADC.

V4L2_PIX_FMT_SDR_S8, v4l fourcc "DS08".

Signed-off-by: Antti Palosaari 
---
 include/uapi/linux/videodev2.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index ba2a173..35b5731 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -434,6 +434,7 @@ struct v4l2_pix_format {
 /* SDR */
 #define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
-- 
1.8.4.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


[PATCH RFC 7/7] msi3101: move format 252 conversion to libv4lconvert

2013-11-17 Thread Antti Palosaari
Move format 252 conversion to libv4lconvert as a fourcc "DS14".
It is 14-bit sample pairs packed to 4 bytes.

Signed-off-by: Antti Palosaari 
---
 drivers/staging/media/msi3101/sdr-msi3101.c | 64 +++--
 include/uapi/linux/videodev2.h  |  1 +
 2 files changed, 24 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c 
b/drivers/staging/media/msi3101/sdr-msi3101.c
index cc96fdd..c278fa6 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -402,6 +402,9 @@ static struct msi3101_format formats[] = {
}, {
.name   = "I/Q 12-bit signed",
.pixelformat= V4L2_PIX_FMT_SDR_S12,
+   }, {
+   .name   = "I/Q 14-bit signed",
+   .pixelformat= V4L2_PIX_FMT_SDR_S14,
},
 };
 
@@ -435,7 +438,7 @@ struct msi3101_state {
unsigned int vb_full; /* vb is full and packets dropped */
 
struct urb *urbs[MAX_ISO_BUFS];
-   int (*convert_stream) (struct msi3101_state *s, u32 *dst, u8 *src,
+   int (*convert_stream) (struct msi3101_state *s, u8 *dst, u8 *src,
unsigned int src_len);
 
/* Controls */
@@ -705,40 +708,21 @@ static int msi3101_convert_stream_336(struct 
msi3101_state *s, u8 *dst,
 }
 
 /*
- * Converts signed 14-bit integer into 32-bit IEEE floating point
- * representation.
+ * +===
+ * |   00-1023 | USB packet type '252'
+ * +===
+ * |   00-  03 | sequence number of first sample in that USB packet
+ * +---
+ * |   04-  15 | garbage
+ * +---
+ * |   16-1023 | samples
+ * +---
+ * signed 14-bit sample
  */
-static u32 msi3101_convert_sample_252(struct msi3101_state *s, u16 x)
-{
-   u32 msb, exponent, fraction, sign;
-
-   /* Zero is special */
-   if (!x)
-   return 0;
-
-   /* Negative / positive value */
-   if (x & (1 << 13)) {
-   x = -x;
-   x &= 0x1fff; /* result is 13 bit ... + sign */
-   sign = 1 << 31;
-   } else {
-   sign = 0 << 31;
-   }
-
-   /* Get location of the most significant bit */
-   msb = __fls(x);
-
-   fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
-   exponent = (127 + msb) << I2F_FRAC_BITS;
-
-   return (fraction + exponent) | sign;
-}
-
-static int msi3101_convert_stream_252(struct msi3101_state *s, u32 *dst,
+static int msi3101_convert_stream_252(struct msi3101_state *s, u8 *dst,
u8 *src, unsigned int src_len)
 {
-   int i, j, i_max, dst_len = 0;
-   u16 sample[2];
+   int i, i_max, dst_len = 0;
u32 sample_num[3];
 
/* There could be 1-3 1024 bytes URB frames */
@@ -759,17 +743,12 @@ static int msi3101_convert_stream_252(struct 
msi3101_state *s, u32 *dst,
 */
dev_dbg_ratelimited(&s->udev->dev, "%*ph\n", 12, &src[4]);
 
+   /* 252 x I+Q samples */
src += 16;
-   for (j = 0; j < 1008; j += 4) {
-   sample[0] = src[j + 0] >> 0 | src[j + 1] << 8;
-   sample[1] = src[j + 2] >> 0 | src[j + 3] << 8;
-
-   *dst++ = msi3101_convert_sample_252(s, sample[0]);
-   *dst++ = msi3101_convert_sample_252(s, sample[1]);
-   }
-   /* 252 x I+Q 32bit float samples */
-   dst_len += 252 * 2 * 4;
+   memcpy(dst, src, 1008);
src += 1008;
+   dst += 1008;
+   dst_len += 1008;
}
 
/* calculate samping rate and output it in 10 seconds intervals */
@@ -1159,6 +1138,9 @@ static int msi3101_set_usb_adc(struct msi3101_state *s)
} else if (s->pixelformat == V4L2_PIX_FMT_SDR_S12) {
s->convert_stream = msi3101_convert_stream_336;
reg7 = 0x8507;
+   } else if (s->pixelformat == V4L2_PIX_FMT_SDR_S14) {
+   s->convert_stream = msi3101_convert_stream_252;
+   reg7 = 0x9407;
}
 
/*
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 80b17d9..b8ee9048 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -437,6 +437,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
 #define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
+#define V4L2_PIX_FMT_

[PATCH RFC 6/7] msi3101: move format 336 conversion to libv4lconvert

2013-11-17 Thread Antti Palosaari
Move format 384 conversion to libv4lconvert as a fourcc "DS12".
It is 12-bit sample pairs packed to 3 bytes.

msi3101: move format 336 conversion 336 to libv4l

Signed-off-by: Antti Palosaari 
---
 drivers/staging/media/msi3101/sdr-msi3101.c | 65 ++---
 include/uapi/linux/videodev2.h  |  1 +
 2 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c 
b/drivers/staging/media/msi3101/sdr-msi3101.c
index 32ff3ff..cc96fdd 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -396,10 +396,12 @@ static struct msi3101_format formats[] = {
{
.name   = "I/Q 8-bit signed",
.pixelformat= V4L2_PIX_FMT_SDR_S8,
-   },
-   {
+   }, {
.name   = "I/Q 10+2-bit signed",
.pixelformat= V4L2_PIX_FMT_SDR_MSI2500_384,
+   }, {
+   .name   = "I/Q 12-bit signed",
+   .pixelformat= V4L2_PIX_FMT_SDR_S12,
},
 };
 
@@ -640,40 +642,21 @@ static int msi3101_convert_stream_384(struct 
msi3101_state *s, u8 *dst,
 }
 
 /*
- * Converts signed 12-bit integer into 32-bit IEEE floating point
- * representation.
+ * +===
+ * |   00-1023 | USB packet type '336'
+ * +===
+ * |   00-  03 | sequence number of first sample in that USB packet
+ * +---
+ * |   04-  15 | garbage
+ * +---
+ * |   16-1023 | samples
+ * +---
+ * signed 12-bit sample
  */
-static u32 msi3101_convert_sample_336(struct msi3101_state *s, u16 x)
-{
-   u32 msb, exponent, fraction, sign;
-
-   /* Zero is special */
-   if (!x)
-   return 0;
-
-   /* Negative / positive value */
-   if (x & (1 << 11)) {
-   x = -x;
-   x &= 0x7ff; /* result is 11 bit ... + sign */
-   sign = 1 << 31;
-   } else {
-   sign = 0 << 31;
-   }
-
-   /* Get location of the most significant bit */
-   msb = __fls(x);
-
-   fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
-   exponent = (127 + msb) << I2F_FRAC_BITS;
-
-   return (fraction + exponent) | sign;
-}
-
-static int msi3101_convert_stream_336(struct msi3101_state *s, u32 *dst,
+static int msi3101_convert_stream_336(struct msi3101_state *s, u8 *dst,
u8 *src, unsigned int src_len)
 {
-   int i, j, i_max, dst_len = 0;
-   u16 sample[2];
+   int i, i_max, dst_len = 0;
u32 sample_num[3];
 
/* There could be 1-3 1024 bytes URB frames */
@@ -694,17 +677,12 @@ static int msi3101_convert_stream_336(struct 
msi3101_state *s, u32 *dst,
 */
dev_dbg_ratelimited(&s->udev->dev, "%*ph\n", 12, &src[4]);
 
+   /* 336 x I+Q samples */
src += 16;
-   for (j = 0; j < 1008; j += 3) {
-   sample[0] = (src[j + 0] & 0xff) >> 0 | (src[j + 1] & 
0x0f) << 8;
-   sample[1] = (src[j + 1] & 0xf0) >> 4 | (src[j + 2] & 
0xff) << 4;
-
-   *dst++ = msi3101_convert_sample_336(s, sample[0]);
-   *dst++ = msi3101_convert_sample_336(s, sample[1]);
-   }
-   /* 336 x I+Q 32bit float samples */
-   dst_len += 336 * 2 * 4;
+   memcpy(dst, src, 1008);
src += 1008;
+   dst += 1008;
+   dst_len += 1008;
}
 
/* calculate samping rate and output it in 10 seconds intervals */
@@ -1178,6 +1156,9 @@ static int msi3101_set_usb_adc(struct msi3101_state *s)
} else if (s->pixelformat == V4L2_PIX_FMT_SDR_MSI2500_384) {
s->convert_stream = msi3101_convert_stream_384;
reg7 = 0xa507;
+   } else if (s->pixelformat == V4L2_PIX_FMT_SDR_S12) {
+   s->convert_stream = msi3101_convert_stream_336;
+   reg7 = 0x8507;
}
 
/*
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index ce1acea..80b17d9 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -436,6 +436,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
+#define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
-- 
1.8.4.2

[PATCH RFC 2/7] rtl2832_sdr: implement FMT IOCTLs

2013-11-17 Thread Antti Palosaari
VIDIOC_ENUM_FMT, VIDIOC_G_FMT, VIDIOC_S_FMT and VIDIOC_TRY_FMT.
Return stream according to FMT.

Signed-off-by: Antti Palosaari 
---
 drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c | 125 ++-
 1 file changed, 75 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c 
b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
index 2c84654..159b087 100644
--- a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
+++ b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
@@ -289,56 +289,10 @@ leave:
return buf;
 }
 
-/*
- * Integer to 32-bit IEEE floating point representation routine is taken
- * from Radeon R600 driver (drivers/gpu/drm/radeon/r600_blit_kms.c).
- *
- * TODO: Currently we do conversion here in Kernel, but in future that will
- * be moved to the libv4l2 library as video format conversions are.
- */
-#define I2F_FRAC_BITS  23
-#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1)
-
-/*
- * Converts signed 8-bit integer into 32-bit IEEE floating point
- * representation.
- */
-static u32 rtl2832_sdr_convert_sample(struct rtl2832_sdr_state *s, u16 x)
-{
-   u32 msb, exponent, fraction, sign;
-
-   /* Zero is special */
-   if (!x)
-   return 0;
-
-   /* Negative / positive value */
-   if (x & (1 << 7)) {
-   x = -x;
-   x &= 0x7f; /* result is 7 bit ... + sign */
-   sign = 1 << 31;
-   } else {
-   sign = 0 << 31;
-   }
-
-   /* Get location of the most significant bit */
-   msb = __fls(x);
-
-   fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
-   exponent = (127 + msb) << I2F_FRAC_BITS;
-
-   return (fraction + exponent) | sign;
-}
-
 static unsigned int rtl2832_sdr_convert_stream(struct rtl2832_sdr_state *s,
-   u32 *dst, const u8 *src, unsigned int src_len)
+   u8 *dst, const u8 *src, unsigned int src_len)
 {
-   unsigned int i, dst_len = 0;
-
-   for (i = 0; i < src_len; i++)
-   *dst++ = rtl2832_sdr_convert_sample(s, src[i]);
-
-   /* 8-bit to 32-bit IEEE floating point */
-   dst_len = src_len * 4;
+   memcpy(dst, src, src_len);
 
/* calculate samping rate and output it in 10 seconds intervals */
if ((s->jiffies + msecs_to_jiffies(1)) <= jiffies) {
@@ -356,7 +310,7 @@ static unsigned int rtl2832_sdr_convert_stream(struct 
rtl2832_sdr_state *s,
/* total number of I+Q pairs */
s->sample += src_len / 2;
 
-   return dst_len;
+   return src_len;
 }
 
 /*
@@ -589,7 +543,6 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh,
usb_make_path(s->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
V4L2_CAP_READWRITE;
-   cap->device_caps = V4L2_CAP_TUNER;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
@@ -1012,9 +965,81 @@ static int vidioc_s_frequency(struct file *file, void 
*priv,
f->frequency * 625UL / 10UL);
 }
 
+static int rtl2832_sdr_enum_fmt_vid_cap(struct file *file, void *priv,
+   struct v4l2_fmtdesc *f)
+{
+   struct rtl2832_sdr_state *s = video_drvdata(file);
+   dev_dbg(&s->udev->dev, "%s:\n", __func__);
+
+   if (f->index > 0)
+   return -EINVAL;
+
+   f->flags = 0;
+   strcpy(f->description, "I/Q 8-bit unsigned");
+   f->pixelformat = V4L2_PIX_FMT_SDR_U8;
+
+   return 0;
+}
+
+static int rtl2832_sdr_g_fmt_vid_cap(struct file *file, void *priv,
+   struct v4l2_format *f)
+{
+   struct rtl2832_sdr_state *s = video_drvdata(file);
+   dev_dbg(&s->udev->dev, "%s:\n", __func__);
+
+   if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+   return -EINVAL;
+
+   memset(&f->fmt.pix, 0, sizeof(f->fmt.pix));
+   f->fmt.pix.pixelformat = V4L2_PIX_FMT_SDR_U8;
+
+   return 0;
+}
+
+static int rtl2832_sdr_s_fmt_vid_cap(struct file *file, void *priv,
+   struct v4l2_format *f)
+{
+   struct rtl2832_sdr_state *s = video_drvdata(file);
+   struct vb2_queue *q = &s->vb_queue;
+   dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
+   (char *)&f->fmt.pix.pixelformat);
+
+   if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+   return -EINVAL;
+
+   if (vb2_is_busy(q))
+   return -EBUSY;
+
+   memset(&f->fmt.pix, 0, sizeof(f->fmt.pix));
+   f->fmt.pix.pixelformat = V4L2_PIX_FMT_SDR_U8;
+
+   return 0;
+}
+
+static int rtl2832_sdr_try_fmt_vid_cap(struct file *file, void *priv,
+   struct v4l2_format *f)
+{
+   struct rtl2832_sdr_state *s = video_drvdata(file);
+   dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
+   (char *)&f->fmt.pix.pixelformat);
+
+   if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+   retu

[PATCH RFC 4/7] msi3101: implement FMT IOCTLs

2013-11-17 Thread Antti Palosaari
VIDIOC_ENUM_FMT, VIDIOC_G_FMT, VIDIOC_S_FMT and VIDIOC_TRY_FMT.

Implement 8-bit signed stream (type '504' samples per USB packet)
using FMT.

Signed-off-by: Antti Palosaari 
---
 drivers/staging/media/msi3101/sdr-msi3101.c | 165 +---
 1 file changed, 123 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c 
b/drivers/staging/media/msi3101/sdr-msi3101.c
index 7715c85..82386a8 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -385,6 +385,22 @@ static const struct msi3101_gain msi3101_gain_lut_1000[] = 
{
 #define MSI3101_CID_TUNER_IF  ((V4L2_CID_USER_BASE | 0xf000) + 12)
 #define MSI3101_CID_TUNER_GAIN((V4L2_CID_USER_BASE | 0xf000) + 13)
 
+/* stream formats */
+struct msi3101_format {
+   char*name;
+   u32 pixelformat;
+};
+
+/* format descriptions for capture and preview */
+static struct msi3101_format formats[] = {
+   {
+   .name   = "I/Q 8-bit signed",
+   .pixelformat= V4L2_PIX_FMT_SDR_S8,
+   },
+};
+
+static const int NUM_FORMATS = sizeof(formats) / sizeof(struct msi3101_format);
+
 /* intermediate buffers with raw data from the USB device */
 struct msi3101_frame_buf {
struct vb2_buffer vb;   /* common v4l buffer stuff -- must be first */
@@ -407,6 +423,8 @@ struct msi3101_state {
/* Pointer to our usb_device, will be NULL after unplug */
struct usb_device *udev; /* Both mutexes most be hold when setting! */
 
+   u32 pixelformat;
+
unsigned int isoc_errors; /* number of contiguous ISOC errors */
unsigned int vb_full; /* vb is full and packets dropped */
 
@@ -445,7 +463,6 @@ leave:
spin_unlock_irqrestore(&s->queued_bufs_lock, flags);
return buf;
 }
-
 /*
  * +===
  * |   00-1023 | USB packet type '384'
@@ -502,40 +519,22 @@ leave:
 #define I2F_MASK ((1 << I2F_FRAC_BITS) - 1)
 
 /*
- * Converts signed 8-bit integer into 32-bit IEEE floating point
- * representation.
+ * +===
+ * |   00-1023 | USB packet type '504'
+ * +===
+ * |   00-  03 | sequence number of first sample in that USB packet
+ * +---
+ * |   04-  15 | garbage
+ * +---
+ * |   16-1023 | samples
+ * +---
+ * signed 8-bit sample
+ * 504 * 2 = 1008 samples
  */
-static u32 msi3101_convert_sample_504(struct msi3101_state *s, u16 x)
-{
-   u32 msb, exponent, fraction, sign;
-
-   /* Zero is special */
-   if (!x)
-   return 0;
-
-   /* Negative / positive value */
-   if (x & (1 << 7)) {
-   x = -x;
-   x &= 0x7f; /* result is 7 bit ... + sign */
-   sign = 1 << 31;
-   } else {
-   sign = 0 << 31;
-   }
-
-   /* Get location of the most significant bit */
-   msb = __fls(x);
-
-   fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
-   exponent = (127 + msb) << I2F_FRAC_BITS;
-
-   return (fraction + exponent) | sign;
-}
-
-static int msi3101_convert_stream_504(struct msi3101_state *s, u32 *dst,
+static int msi3101_convert_stream_504(struct msi3101_state *s, u8 *dst,
u8 *src, unsigned int src_len)
 {
-   int i, j, i_max, dst_len = 0;
-   u16 sample[2];
+   int i, i_max, dst_len = 0;
u32 sample_num[3];
 
/* There could be 1-3 1024 bytes URB frames */
@@ -556,17 +555,12 @@ static int msi3101_convert_stream_504(struct 
msi3101_state *s, u32 *dst,
 */
dev_dbg_ratelimited(&s->udev->dev, "%*ph\n", 12, &src[4]);
 
+   /* 504 x I+Q samples */
src += 16;
-   for (j = 0; j < 1008; j += 2) {
-   sample[0] = src[j + 0];
-   sample[1] = src[j + 1];
-
-   *dst++ = msi3101_convert_sample_504(s, sample[0]);
-   *dst++ = msi3101_convert_sample_504(s, sample[1]);
-   }
-   /* 504 x I+Q 32bit float samples */
-   dst_len += 504 * 2 * 4;
+   memcpy(dst, src, 1008);
src += 1008;
+   dst += 1008;
+   dst_len += 1008;
}
 
/* calculate samping rate and output it in 10 seconds intervals */
@@ -1114,7 +1108,6 @@ static int msi3101_querycap(struct file *file, void *fh,
usb_make_path(s->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
V4L2_CAP_READWRITE;
-   cap->devi

[PATCH RFC 5/7] msi3101: move format 384 conversion to libv4lconvert

2013-11-17 Thread Antti Palosaari
Move format 384 conversion to libv4lconvert as a fourcc "M384".

Signed-off-by: Antti Palosaari 
---
 drivers/staging/media/msi3101/sdr-msi3101.c | 162 ++--
 include/uapi/linux/videodev2.h  |   1 +
 2 files changed, 57 insertions(+), 106 deletions(-)

diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c 
b/drivers/staging/media/msi3101/sdr-msi3101.c
index 82386a8..32ff3ff 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -397,6 +397,10 @@ static struct msi3101_format formats[] = {
.name   = "I/Q 8-bit signed",
.pixelformat= V4L2_PIX_FMT_SDR_S8,
},
+   {
+   .name   = "I/Q 10+2-bit signed",
+   .pixelformat= V4L2_PIX_FMT_SDR_MSI2500_384,
+   },
 };
 
 static const int NUM_FORMATS = sizeof(formats) / sizeof(struct msi3101_format);
@@ -463,50 +467,6 @@ leave:
spin_unlock_irqrestore(&s->queued_bufs_lock, flags);
return buf;
 }
-/*
- * +===
- * |   00-1023 | USB packet type '384'
- * +===
- * |   00-  03 | sequence number of first sample in that USB packet
- * +---
- * |   04-  15 | garbage
- * +---
- * |   16- 175 | samples
- * +---
- * |  176- 179 | control bits for previous samples
- * +---
- * |  180- 339 | samples
- * +---
- * |  340- 343 | control bits for previous samples
- * +---
- * |  344- 503 | samples
- * +---
- * |  504- 507 | control bits for previous samples
- * +---
- * |  508- 667 | samples
- * +---
- * |  668- 671 | control bits for previous samples
- * +---
- * |  672- 831 | samples
- * +---
- * |  832- 835 | control bits for previous samples
- * +---
- * |  836- 995 | samples
- * +---
- * |  996- 999 | control bits for previous samples
- * +---
- * | 1000-1023 | garbage
- * +---
- *
- * Bytes 4 - 7 could have some meaning?
- *
- * Control bits for previous samples is 32-bit field, containing 16 x 2-bit
- * numbers. This results one 2-bit number for 8 samples. It is likely used for
- * for bit shifting sample by given bits, increasing actual sampling 
resolution.
- * Number 2 (0b10) was never seen.
- *
- * 6 * 16 * 2 * 4 = 768 samples. 768 * 4 = 3072 bytes
- */
 
 /*
  * Integer to 32-bit IEEE floating point representation routine is taken
@@ -583,48 +543,53 @@ static int msi3101_convert_stream_504(struct 
msi3101_state *s, u8 *dst,
 }
 
 /*
- * Converts signed ~10+2-bit integer into 32-bit IEEE floating point
- * representation.
+ * +===
+ * |   00-1023 | USB packet type '384'
+ * +===
+ * |   00-  03 | sequence number of first sample in that USB packet
+ * +---
+ * |   04-  15 | garbage
+ * +---
+ * |   16- 175 | samples
+ * +---
+ * |  176- 179 | control bits for previous samples
+ * +---
+ * |  180- 339 | samples
+ * +---
+ * |  340- 343 | control bits for previous samples
+ * +---
+ * |  344- 503 | samples
+ * +---
+ * |  504- 507 | control bits for previous samples
+ * +---
+ * |  508- 667 | samples
+ * +-

[PATCH RFC 1/7] v4l2: add two pixel format for SDR

2013-11-17 Thread Antti Palosaari
These are used for converting / streaming I/Q data from SDR.
* float 32-bit
* unsigned 8-bit

Signed-off-by: Antti Palosaari 
---
 include/uapi/linux/videodev2.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 437f1b0..ba2a173 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -431,6 +431,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SE401  v4l2_fourcc('S', '4', '0', '1') /* se401 
janggu compressed rgb */
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 
interleaved UYVY/JPEG */
 
+/* SDR */
+#define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
+#define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+
 /*
  * F O R M A T   E N U M E R A T I O N
  */
-- 
1.8.4.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


[PATCH RFC 2/6] v4l2: add sdr-fetch test app

2013-11-17 Thread Antti Palosaari
That simple app reads data from SDR device using libv4l2 and writes
it in float format to standard output. Stream is converted to
complex float format by libv4l.

sdr-fetch is based of v4l2grab v4l2 test app.

Signed-off-by: Antti Palosaari 
---
 contrib/test/Makefile.am |   6 +-
 contrib/test/sdr_fetch.c | 221 +++
 2 files changed, 226 insertions(+), 1 deletion(-)
 create mode 100644 contrib/test/sdr_fetch.c

diff --git a/contrib/test/Makefile.am b/contrib/test/Makefile.am
index 80c7665..3332b63 100644
--- a/contrib/test/Makefile.am
+++ b/contrib/test/Makefile.am
@@ -7,7 +7,8 @@ noinst_PROGRAMS = \
v4l2grab\
driver-test \
stress-buffer   \
-   capture-example
+   capture-example \
+   sdr-fetch
 
 if HAVE_X11
 noinst_PROGRAMS += pixfmt-test
@@ -45,6 +46,9 @@ stress_buffer_SOURCES = stress-buffer.c
 
 capture_example_SOURCES = capture-example.c
 
+sdr_fetch_SOURCES = sdr_fetch.c
+sdr_fetch_LDADD = ../../lib/libv4l2/libv4l2.la 
../../lib/libv4lconvert/libv4lconvert.la
+
 ioctl-test.c: ioctl-test.h
 
 sync-with-kernel:
diff --git a/contrib/test/sdr_fetch.c b/contrib/test/sdr_fetch.c
new file mode 100644
index 000..477d11e
--- /dev/null
+++ b/contrib/test/sdr_fetch.c
@@ -0,0 +1,221 @@
+/*
+ * SDR fetch
+ *
+ * Copyright (C) 2013 Antti Palosaari 
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License along
+ *with this program; if not, write to the Free Software Foundation, Inc.,
+ *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../../lib/include/libv4l2.h"
+
+/* signal handler to stop app */
+static int running;
+
+void signal_handler(int sig)
+{
+   running = 0;
+   return;
+}
+
+#define CLEAR(x) memset(&(x), 0, sizeof(x))
+
+struct buffer {
+   void *start;
+   size_t length;
+};
+
+static void xioctl(int fh, unsigned long int request, void *arg)
+{
+   int ret;
+
+   do {
+   ret = v4l2_ioctl(fh, request, arg);
+   } while (ret == -1 && ((errno == EINTR) || (errno == EAGAIN)));
+   if (ret == -1) {
+   fprintf(stderr, "error %d, %s\n", errno, strerror(errno));
+   exit(EXIT_FAILURE);
+   }
+}
+
+static int stream(char *dev_name)
+{
+   struct v4l2_format fmt;
+   struct v4l2_buffer buf;
+   struct v4l2_requestbuffers req;
+   enum v4l2_buf_type type;
+   struct buffer *buffers;
+   struct timeval tv;
+   fd_set fds;
+   int ret, i, buffers_count, fd = -1;
+
+   fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0);
+   if (fd < 0) {
+   perror("Cannot open device");
+   exit(EXIT_FAILURE);
+   }
+
+   /* ask float format from libv4l2 */
+   CLEAR(fmt);
+   fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SDR_FLOAT;
+   xioctl(fd, VIDIOC_S_FMT, &fmt);
+   if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_SDR_FLOAT) {
+   perror("Libv4l didn't accept FLOAT format");
+   exit(EXIT_FAILURE);
+   }
+
+   /* request buffers */
+   CLEAR(req);
+   req.count = 8;
+   req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   req.memory = V4L2_MEMORY_MMAP;
+   xioctl(fd, VIDIOC_REQBUFS, &req);
+
+   buffers = calloc(req.count, sizeof(*buffers));
+
+   /* v4l2_mmap buffers */
+   for (buffers_count = 0; buffers_count < req.count; buffers_count++) {
+   CLEAR(buf);
+   buf.type= V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   buf.memory  = V4L2_MEMORY_MMAP;
+   buf.index   = buffers_count;
+   xioctl(fd, VIDIOC_QUERYBUF, &buf);
+
+   buffers[buffers_count].length = buf.length;
+   buffers[buffers_count].start = v4l2_mmap(NULL, buf.length,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ fd, buf.m.offset);
+
+   if (buffers[buffers_count].start == MAP_FAILED) {
+   perror("mmap");
+   exit(EXIT_FAILURE);
+   }
+   }
+
+   /* enqueue all memory mapped buffers */
+   for (i = 0; i < buffers_count; i++) {
+   CLEAR(buf);

[PATCH RFC 1/6] libv4lconvert: SDR conversion from U8 to FLOAT

2013-11-17 Thread Antti Palosaari
Convert unsigned 8 to float 32 [-1 to +1], which is commonly
used format for baseband signals by SDR applications.

Some implementation changes done as suggested by Hans Verkuil,
Hans de Goede and Andy Walls.

Cc: Hans Verkuil 
Cc: Hans de Goede 
Cc: Andy Walls 
Signed-off-by: Antti Palosaari 
---
 contrib/freebsd/include/linux/videodev2.h |  4 ++
 include/linux/videodev2.h |  4 ++
 lib/libv4lconvert/libv4lconvert.c | 77 +++
 3 files changed, 85 insertions(+)

diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index 1fcfaeb..05cc19b 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -465,6 +465,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SE401  v4l2_fourcc('S', '4', '0', '1') /* se401 
janggu compressed rgb */
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 
interleaved UYVY/JPEG */
 
+/* SDR */
+#define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
+#define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+
 /*
  * F O R M A T   E N U M E R A T I O N
  */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 437f1b0..ba2a173 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -431,6 +431,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SE401  v4l2_fourcc('S', '4', '0', '1') /* se401 
janggu compressed rgb */
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 
interleaved UYVY/JPEG */
 
+/* SDR */
+#define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
+#define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+
 /*
  * F O R M A T   E N U M E R A T I O N
  */
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index e2afc27..b7cc0e1 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -266,6 +266,10 @@ int v4lconvert_supported_dst_format(unsigned int 
pixelformat)
 {
int i;
 
+   /* only supported SDR destination format */
+   if (pixelformat == V4L2_PIX_FMT_SDR_FLOAT)
+   return 1;
+
for (i = 0; i < ARRAY_SIZE(supported_dst_pixfmts); i++)
if (supported_dst_pixfmts[i].fmt == pixelformat)
break;
@@ -435,6 +439,32 @@ static int v4lconvert_do_try_format_uvc(struct 
v4lconvert_data *data,
return 0;
 }
 
+static int v4lconvert_do_try_format_sdr(struct v4lconvert_data *data,
+   struct v4l2_format *dest_fmt, struct v4l2_format *src_fmt)
+{
+   int i;
+   struct v4l2_format try_fmt;
+   static const unsigned int supported_src_pixfmts_sdr[] = {
+   V4L2_PIX_FMT_SDR_FLOAT,
+   V4L2_PIX_FMT_SDR_U8,
+   };
+
+   for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts_sdr); i++) {
+   try_fmt = *dest_fmt;
+   try_fmt.fmt.pix.pixelformat = supported_src_pixfmts_sdr[i];
+   if (data->dev_ops->ioctl(data->dev_ops_priv, data->fd,
+   VIDIOC_TRY_FMT, &try_fmt))
+   continue;
+
+   if (try_fmt.fmt.pix.pixelformat != supported_src_pixfmts_sdr[i])
+   continue;
+   }
+
+   *src_fmt = try_fmt;
+
+   return 0;
+}
+
 static int v4lconvert_do_try_format(struct v4lconvert_data *data,
struct v4l2_format *dest_fmt, struct v4l2_format *src_fmt)
 {
@@ -445,6 +475,8 @@ static int v4lconvert_do_try_format(struct v4lconvert_data 
*data,
 
if (data->flags & V4LCONVERT_IS_UVC)
return v4lconvert_do_try_format_uvc(data, dest_fmt, src_fmt);
+   else if (dest_fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_SDR_FLOAT)
+   return v4lconvert_do_try_format_sdr(data, dest_fmt, src_fmt);
 
for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts); i++) {
/* is this format supported? */
@@ -1293,6 +1325,43 @@ static int v4lconvert_convert_pixfmt(struct 
v4lconvert_data *data,
return result;
 }
 
+/* SDR format conversions */
+static int v4lconvert_convert_sdr(struct v4lconvert_data *data,
+   unsigned char *src, int src_size,
+   unsigned char *dest, int dest_size,
+   struct v4l2_format *fmt, unsigned int dest_pix_fmt)
+{
+   int i, dest_needed;
+   unsigned int src_pix_fmt = fmt->fmt.pix.pixelformat;
+   float *fptr = (float *) dest;
+
+   switch (src_pix_fmt) {
+   case V4L2_PIX_FMT_SDR_U8:
+   /* 8-bit unsigned to 32-bit float */
+   dest_needed = src_size * sizeof(float);
+   if (dest_size < dest_needed)
+   goto err_buf_too_small;
+
+   for (i = 0; i < src_size; i++)
+   *fptr++ = (*src++ - 127.5f) / 127.5f;
+  

[PATCH RFC 6/6] libv4lconvert: SDR conversion from S14 to FLOAT

2013-11-17 Thread Antti Palosaari
It is 14-bit sample packed to 2 bytes. fourcc "DS14".

Signed-off-by: Antti Palosaari 
---
 contrib/freebsd/include/linux/videodev2.h |  1 +
 include/linux/videodev2.h |  1 +
 lib/libv4lconvert/libv4lconvert.c | 23 +++
 3 files changed, 25 insertions(+)

diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index c2f6a71..7ad5ef5 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -471,6 +471,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
 #define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
+#define V4L2_PIX_FMT_SDR_S14 v4l2_fourcc('D', 'S', '1', '4') /* signed 
14-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 80b17d9..b8ee904 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -437,6 +437,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
 #define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
+#define V4L2_PIX_FMT_SDR_S14 v4l2_fourcc('D', 'S', '1', '4') /* signed 
14-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index ccb9c0f..f58ffdc 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -450,6 +450,7 @@ static int v4lconvert_do_try_format_sdr(struct 
v4lconvert_data *data,
V4L2_PIX_FMT_SDR_S8,
V4L2_PIX_FMT_SDR_MSI2500_384,
V4L2_PIX_FMT_SDR_S12,
+   V4L2_PIX_FMT_SDR_S14,
};
 
for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts_sdr); i++) {
@@ -1429,6 +1430,28 @@ static int v4lconvert_convert_sdr(struct v4lconvert_data 
*data,
*fptr++ = (sample[1] + 0.5f) / 2047.5f;
}
break;
+   case V4L2_PIX_FMT_SDR_S14:
+   /* 14-bit signed to 32-bit float */
+   dest_needed = src_size / 4 * 2 * sizeof(float);
+   if (dest_size < dest_needed)
+   goto err_buf_too_small;
+
+   for (i = 0; i < src_size; i += 4) {
+   uint32_t usample[2];
+   int sample[2];
+
+   usample[0] = src[i + 0] >> 0 | src[i + 1] << 8;
+   usample[1] = src[i + 2] >> 0 | src[i + 3] << 8;
+
+   /* Sign extension from 14-bit */
+   struct {signed int x:14; } s;
+   sample[0] = s.x = usample[0];
+   sample[1] = s.x = usample[1];
+
+   *fptr++ = (sample[0] + 0.5f) / 8192.5f;
+   *fptr++ = (sample[1] + 0.5f) / 8192.5f;
+   }
+   break;
default:
V4LCONVERT_ERR("Unknown src format in conversion\n");
errno = EINVAL;
-- 
1.8.4.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


[PATCH RFC 5/6] libv4lconvert: SDR conversion from packed S12 to FLOAT

2013-11-17 Thread Antti Palosaari
It is 12-bit sample pairs packed to 3 bytes. fourcc "DS12".

Signed-off-by: Antti Palosaari 
---
 contrib/freebsd/include/linux/videodev2.h |  1 +
 include/linux/videodev2.h |  1 +
 lib/libv4lconvert/libv4lconvert.c | 23 +++
 3 files changed, 25 insertions(+)

diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index 7d87b01..c2f6a71 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -470,6 +470,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
+#define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ce1acea..80b17d9 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -436,6 +436,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 #define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
+#define V4L2_PIX_FMT_SDR_S12 v4l2_fourcc('D', 'S', '1', '2') /* signed 
12-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index 88e056f..ccb9c0f 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -449,6 +449,7 @@ static int v4lconvert_do_try_format_sdr(struct 
v4lconvert_data *data,
V4L2_PIX_FMT_SDR_U8,
V4L2_PIX_FMT_SDR_S8,
V4L2_PIX_FMT_SDR_MSI2500_384,
+   V4L2_PIX_FMT_SDR_S12,
};
 
for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts_sdr); i++) {
@@ -1406,6 +1407,28 @@ static int v4lconvert_convert_sdr(struct v4lconvert_data 
*data,
src += 4; /* control bits */
}
break;
+   case V4L2_PIX_FMT_SDR_S12:
+   /* 12-bit signed to 32-bit float */
+   dest_needed = src_size / 3 * 2 * sizeof(float);
+   if (dest_size < dest_needed)
+   goto err_buf_too_small;
+
+   for (i = 0; i < src_size; i += 3) {
+   uint32_t usample[2];
+   int sample[2];
+
+   usample[0] = (src[i + 0] & 0xff) >> 0 | (src[i + 1] & 
0x0f) << 8;
+   usample[1] = (src[i + 1] & 0xf0) >> 4 | (src[i + 2] & 
0xff) << 4;
+
+   /* Sign extension from 12-bit */
+   struct {signed int x:12; } s;
+   sample[0] = s.x = usample[0];
+   sample[1] = s.x = usample[1];
+
+   *fptr++ = (sample[0] + 0.5f) / 2047.5f;
+   *fptr++ = (sample[1] + 0.5f) / 2047.5f;
+   }
+   break;
default:
V4LCONVERT_ERR("Unknown src format in conversion\n");
errno = EINVAL;
-- 
1.8.4.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


[PATCH RFC 3/6] libv4lconvert: SDR conversion from S8 to FLOAT

2013-11-17 Thread Antti Palosaari
SDR I/Q data conversion from signed 8-bit to [-1 to +1] float.

Signed-off-by: Antti Palosaari 
---
 contrib/freebsd/include/linux/videodev2.h |  1 +
 include/linux/videodev2.h |  1 +
 lib/libv4lconvert/libv4lconvert.c | 12 
 3 files changed, 14 insertions(+)

diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index 05cc19b..d433a45 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -468,6 +468,7 @@ struct v4l2_pix_format {
 /* SDR */
 #define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ba2a173..35b5731 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -434,6 +434,7 @@ struct v4l2_pix_format {
 /* SDR */
 #define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
+#define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index b7cc0e1..421a8f1 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -447,6 +447,7 @@ static int v4lconvert_do_try_format_sdr(struct 
v4lconvert_data *data,
static const unsigned int supported_src_pixfmts_sdr[] = {
V4L2_PIX_FMT_SDR_FLOAT,
V4L2_PIX_FMT_SDR_U8,
+   V4L2_PIX_FMT_SDR_S8,
};
 
for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts_sdr); i++) {
@@ -1334,6 +1335,7 @@ static int v4lconvert_convert_sdr(struct v4lconvert_data 
*data,
int i, dest_needed;
unsigned int src_pix_fmt = fmt->fmt.pix.pixelformat;
float *fptr = (float *) dest;
+   int8_t *s8ptr;
 
switch (src_pix_fmt) {
case V4L2_PIX_FMT_SDR_U8:
@@ -1345,6 +1347,16 @@ static int v4lconvert_convert_sdr(struct v4lconvert_data 
*data,
for (i = 0; i < src_size; i++)
*fptr++ = (*src++ - 127.5f) / 127.5f;
break;
+   case V4L2_PIX_FMT_SDR_S8:
+   s8ptr = (int8_t *) src;
+   /* 8-bit signed to 32-bit float */
+   dest_needed = src_size * sizeof(float);
+   if (dest_size < dest_needed)
+   goto err_buf_too_small;
+
+   for (i = 0; i < src_size; i++)
+   *fptr++ = (*s8ptr++ + 0.5f) / 127.5f;
+   break;
default:
V4LCONVERT_ERR("Unknown src format in conversion\n");
errno = EINVAL;
-- 
1.8.4.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


[PATCH RFC 4/6] libv4lconvert: SDR conversion from MSi2500 format 384 to FLOAT

2013-11-17 Thread Antti Palosaari
It is one Mirics MSi2500 (MSi3101) USB ADC specific source format.

Signed-off-by: Antti Palosaari 
---
 contrib/freebsd/include/linux/videodev2.h |  1 +
 include/linux/videodev2.h |  1 +
 lib/libv4lconvert/libv4lconvert.c | 49 +++
 3 files changed, 51 insertions(+)

diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index d433a45..7d87b01 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -469,6 +469,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
+#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 35b5731..ce1acea 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -435,6 +435,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SDR_FLOAT  v4l2_fourcc('D', 'F', '3', '2') /* float 
32-bit */
 #define V4L2_PIX_FMT_SDR_U8 v4l2_fourcc('D', 'U', '0', '8') /* unsigned 
8-bit */
 #define V4L2_PIX_FMT_SDR_S8 v4l2_fourcc('D', 'S', '0', '8') /* signed 
8-bit */
+#define V4L2_PIX_FMT_SDR_MSI2500_384 v4l2_fourcc('M', '3', '8', '4') /* Mirics 
MSi2500 format 384 */
 
 /*
  * F O R M A T   E N U M E R A T I O N
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index 421a8f1..88e056f 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -448,6 +448,7 @@ static int v4lconvert_do_try_format_sdr(struct 
v4lconvert_data *data,
V4L2_PIX_FMT_SDR_FLOAT,
V4L2_PIX_FMT_SDR_U8,
V4L2_PIX_FMT_SDR_S8,
+   V4L2_PIX_FMT_SDR_MSI2500_384,
};
 
for (i = 0; i < ARRAY_SIZE(supported_src_pixfmts_sdr); i++) {
@@ -1357,6 +1358,54 @@ static int v4lconvert_convert_sdr(struct v4lconvert_data 
*data,
for (i = 0; i < src_size; i++)
*fptr++ = (*s8ptr++ + 0.5f) / 127.5f;
break;
+   case V4L2_PIX_FMT_SDR_MSI2500_384:
+   /* Mirics MSi2500 format 384 */
+   dest_needed = src_size / 164 * 128 * sizeof(float);
+   if (dest_size < dest_needed)
+   goto err_buf_too_small;
+
+   for (i = 0; i < (src_size / 164); i++) {
+   uint32_t bits;
+   int j, k;
+   bits = src[160 + 3] << 24 | src[160 + 2] << 16 | 
src[160 + 1] << 8 | src[160 + 0] << 0;
+
+   for (j = 0; j < 16; j++) {
+   unsigned int shift;
+   shift = (bits >> (2 * j)) & 0x3;
+   if (shift == 3)
+   shift = 2;
+
+   for (k = 0; k < 10; k += 5) {
+   uint32_t usample[4];
+   int ssample[4];
+
+   usample[0] = (src[k + 0] & 0xff) >> 0 | 
(src[k + 1] & 0x03) << 8;
+   usample[1] = (src[k + 1] & 0xfc) >> 2 | 
(src[k + 2] & 0x0f) << 6;
+   usample[2] = (src[k + 2] & 0xf0) >> 4 | 
(src[k + 3] & 0x3f) << 4;
+   usample[3] = (src[k + 3] & 0xc0) >> 6 | 
(src[k + 4] & 0xff) << 2;
+
+   /* Sign extension from 10-bit */
+   struct {signed int x:10; } s;
+   ssample[0] = s.x = usample[0];
+   ssample[1] = s.x = usample[1];
+   ssample[2] = s.x = usample[2];
+   ssample[3] = s.x = usample[3];
+
+   ssample[0] <<= shift;
+   ssample[1] <<= shift;
+   ssample[2] <<= shift;
+   ssample[3] <<= shift;
+
+   *fptr++ = (ssample[0] + 0.5f) / 2047.5f;
+   *fptr++ = (ssample[1] + 0.5f) / 2047.5f;
+   *fptr++ = (ssample[2] + 0.5f) / 2047.5f;
+   *fptr++ = (ssample[3] + 0.5f) / 2047.5f;
+   }
+   src += 10; /* samples */
+   }
+   src += 4; /* control bits */
+   }
+   break;
default:
V4LCONVE

[PATCH RFC 0/6] SDR API libV4L stream conversion

2013-11-17 Thread Antti Palosaari
That patch set contains libv4lconvert conversion for all SDR formats
I have currently available.

Also simple test app to stream data from device to standard output.

Seems to works very well. CPU usage is something like 13% when 2MSps
sampling rate is used, which goes very much from the runtime float
conversion. Using pre-calculated LUTs will reduce CPU usage very much,
but lets that kind of optimizations be another issue.

Antti Palosaari (6):
  libv4lconvert: SDR conversion from U8 to FLOAT
  v4l2: add sdr-fetch test app
  libv4lconvert: SDR conversion from S8 to FLOAT
  libv4lconvert: SDR conversion from MSi2500 format 384 to FLOAT
  libv4lconvert: SDR conversion from packed S12 to FLOAT
  libv4lconvert: SDR conversion from S14 to FLOAT

 contrib/freebsd/include/linux/videodev2.h |   8 ++
 contrib/test/Makefile.am  |   6 +-
 contrib/test/sdr_fetch.c  | 221 ++
 include/linux/videodev2.h |   8 ++
 lib/libv4lconvert/libv4lconvert.c | 184 +
 5 files changed, 426 insertions(+), 1 deletion(-)
 create mode 100644 contrib/test/sdr_fetch.c

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


ddbridge module fails to load

2013-11-17 Thread Martin Herrman
Hi,

Since about a year I'm a happy user of the experimental driver for my
cine c2 v6.

I have just tried to use the latest code. It compiles without issues
(kernel 3.11 with gentoo and ck patches), but doesn't load:

ddbridge: Unknown symbol dvb_usercopy (err 0)

I reviewed the updates:

http://linuxtv.org/hg/~endriss/media_build_experimental

and noticed that there have been updates to the drivers I use lately.
Which is good news!

Unfortunately, the updates cause the above issue. I tried this revision:

http://linuxtv.org/hg/~endriss/media_build_experimental/rev/8c5bb9101f84

and now ddbridge loads perfectly and I can watch tv again.

Just wanted to let you know, in case you need any of my help to fix
this, please feel free to ask.  Note however that I'm certainly not a
developer, nor a experienced packager.

Regards,

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


[no subject]

2013-11-17 Thread Martin Herrman
subscribe linux-media
--
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


усмотреть свет во любых окрасках

2013-11-17 Thread atbox
практика может перевоплотиться несравнимо симпатичней. http://captur.in/YLkA
N‹ЇВцьrИ›yњшšиbВXЌЖЧЇvи^–)оК{.nЧ+‰ЗЅŠ{Б™чbj)э…
цшw*jgЌБЈЖ‰šŽŠнЂj/ъфzЙо–Šр2Šо™Јш­к&Ђ)пЁЋaЖкўјЎGЋщhЎцj:+v‰ЈŠwш†йЅ

[GIT PULL FIXES for 3.13] 1 small gspca and 2 small radio-shark fixes

2013-11-17 Thread Hans de Goede

Hi Mauro,

Please pull from my tree for 3 small fixes for 3.13 :

The following changes since commit 80f93c7b0f4599ffbdac8d964ecd1162b8b618b9:

  [media] media: st-rc: Add ST remote control driver (2013-10-31 08:20:08 -0200)

are available in the git repository at:

  git://linuxtv.org/hgoede/gspca.git media-for_v3.13

for you to fetch changes up to 118696e21f90ab2d011e38b45b007655204782d9:

  radio-shark2: Mark shark_resume_leds() inline to kill compiler warning 
(2013-11-17 14:48:29 +0100)


Geert Uytterhoeven (1):
  radio-shark: Mark shark_resume_leds() inline to kill compiler warning

Hans de Goede (1):
  radio-shark2: Mark shark_resume_leds() inline to kill compiler warning

Ondrej Zary (1):
  gspca-stk1135: Add delay after configuring clock

 drivers/media/radio/radio-shark.c  | 2 +-
 drivers/media/radio/radio-shark2.c | 2 +-
 drivers/media/usb/gspca/stk1135.c  | 3 +++
 3 files changed, 5 insertions(+), 2 deletions(-)

Thanks & 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] radio-shark2: Mark shark_resume_leds() inline to kill compiler warning

2013-11-17 Thread Hans de Goede
This mirrors the patch to the radio-shark driver by Geert Uytterhoeven.

If SHARK_USE_LEDS=1, but CONFIG_PM=n:

drivers/media/radio/radio-shark2.c:240: warning: ‘shark_resume_leds’ defined 
but not used

Instead of making the #ifdef logic even more complicated (there are already
two definitions of shark_resume_leds()), mark shark_resume_leds() inline to
kill the compiler warning. shark_resume_leds() is small and it has only one
caller.

Cc: Geert Uytterhoeven 
Signed-off-by: Hans de Goede 
---
 drivers/media/radio/radio-shark2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-shark2.c 
b/drivers/media/radio/radio-shark2.c
index 9fb6697..8654e0d 100644
--- a/drivers/media/radio/radio-shark2.c
+++ b/drivers/media/radio/radio-shark2.c
@@ -237,7 +237,7 @@ static void shark_unregister_leds(struct shark_device 
*shark)
cancel_work_sync(&shark->led_work);
 }
 
-static void shark_resume_leds(struct shark_device *shark)
+static inline void shark_resume_leds(struct shark_device *shark)
 {
int i;
 
-- 
1.8.4.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] [media] radio-shark: Mark shark_resume_leds() inline to kill compiler warning

2013-11-17 Thread Hans de Goede

Hi,

On 10/28/2013 01:16 PM, Geert Uytterhoeven wrote:

If SHARK_USE_LEDS=1, but CONFIG_PM=n:

drivers/media/radio/radio-shark.c:275: warning: ‘shark_resume_leds’ defined but 
not used

Instead of making the #ifdef logic even more complicated (there are already
two definitions of shark_resume_leds()), mark shark_resume_leds() inline to
kill the compiler warning. shark_resume_leds() is small and it has only one
caller.

Signed-off-by: Geert Uytterhoeven 
---
{cris,m68k,parisc,sparc,xtensa}-all{mod,yes}config

  drivers/media/radio/radio-shark.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-shark.c 
b/drivers/media/radio/radio-shark.c
index b91477212413..050b3bb96fec 100644
--- a/drivers/media/radio/radio-shark.c
+++ b/drivers/media/radio/radio-shark.c
@@ -271,7 +271,7 @@ static void shark_unregister_leds(struct shark_device 
*shark)
cancel_work_sync(&shark->led_work);
  }

-static void shark_resume_leds(struct shark_device *shark)
+static inline void shark_resume_leds(struct shark_device *shark)
  {
if (test_bit(BLUE_IS_PULSE, &shark->brightness_new))
set_bit(BLUE_PULSE_LED, &shark->brightness_new);



Thanks for the patch. I've added this to my tree for 3.13 .

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] gspca-stk1135: Add delay after configuring clock

2013-11-17 Thread Hans de Goede

Hi,

On 11/03/2013 01:09 AM, Ondrej Zary wrote:

Add a small delay at the end of configure_clock() to allow sensor to initialize.
This is needed by Asus VX2S laptop webcam to detect sensor type properly (the 
already-supported MT9M112).

Signed-off-by: Ondrej Zary 
---
  drivers/media/usb/gspca/stk1135.c |3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/media/usb/gspca/stk1135.c 
b/drivers/media/usb/gspca/stk1135.c
index 8add2f7..d8a813c 100644
--- a/drivers/media/usb/gspca/stk1135.c
+++ b/drivers/media/usb/gspca/stk1135.c
@@ -361,6 +361,9 @@ static void stk1135_configure_clock(struct gspca_dev 
*gspca_dev)

/* set serial interface clock divider (30MHz/0x1f*16+2) = 60240 kHz) */
reg_w(gspca_dev, STK1135_REG_SICTL + 2, 0x1f);
+
+   /* wait a while for sensor to catch up */
+   udelay(1000);
  }

  static void stk1135_camera_disable(struct gspca_dev *gspca_dev)



Thanks for the patch. I've added this to my tree for 3.13 .

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: staging: media: Use dev_err() instead of pr_err()

2013-11-17 Thread Mauro Carvalho Chehab
Em Fri, 15 Nov 2013 15:29:39 +0900
Greg Kroah-Hartman  escreveu:

> On Thu, Nov 14, 2013 at 11:08:14AM -0200, Mauro Carvalho Chehab wrote:
> > Hi,
> > 
> > I'm not sure how this patch got applied upstream:
> > 
> > commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812
> > Author: Dulshani Gunawardhana 
> > Date:   Sun Oct 20 22:58:28 2013 +0530
> > 
> > staging:media: Use dev_dbg() instead of pr_debug()
> > 
> > Use dev_dbg() instead of pr_debug() in go7007-usb.c.
> > 
> > Signed-off-by: Dulshani Gunawardhana 
> > 
> > Reviewed-by: Josh Triplett 
> > Signed-off-by: Greg Kroah-Hartman 
> > 
> > But, from the custody chain, it seems it was not C/C to linux-media ML,
> > doesn't have the driver maintainer's ack[1] and didn't went via my tree.
> 
> It came in through my tree as part of the OPW intern application
> process.

Ah, OK.

I don't mind if you apply those directly, but what makes me a little
worried is that at least the final version of the patchset should be
c/c to driver/subsystem maintainers for their review and for them to 
know that the patch will be merged via some other tree, as it might
be causing conflicts with their trees.

> And yes, sorry, it's broken, I have some follow-on patches to fix this,
> but you are right, it should just be reverted for now, very sorry about
> that.

No problem.

> Do you want to do that, or should I?

I prefer if you could do it, as I'm still waiting the merge from my tree,
and I don't want to cascade another pull request before the original
pull requests get handled. In any case, they won't conflict with this,
as I don't have any patch for this driver on my tree for 3.13.

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