Re: [GIT PULL FOR v3.19] uvcvideo changes

2014-11-24 Thread Laurent Pinchart
Hi Mauro,

On Tuesday 11 November 2014 08:56:26 Mauro Carvalho Chehab wrote:
 Em Fri, 07 Nov 2014 08:16:28 +0200 Laurent Pinchart escreveu:
  Hi Mauro,
  
  The following changes since commit 
4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
[media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
  
  are available in the git repository at:
git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
 
 It seems that there's something weird with this URL... remotes

git isn't playing nicely :-/

I've pushed the changes to the uvc/next branch on 
git://linuxtv.org/pinchartl/media.git, up to commit a1bee5f9f606. 
http://git.linuxtv.org/cgit.cgi/pinchartl/media.git/commit/?h=uvc/next 
confirms that everything is in order.

However, running

git request-pull local-linuxtv-master media remotes/media/uvc/next

with the media remote pointing to git://linuxtv.org/pinchartl/media.git 
generates

--
warn: No match for commit a1bee5f9f606f89ff30171658a82bf532cca7f3d found at 
git://linuxtv.org/pinchartl/media.git
warn: Are you sure you pushed 'remotes/media/uvc/next' there?
The following changes since commit 4895cc47a072dcb32d3300d0a46a251a8c6db5f1:

  [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)

are available in the git repository at:

  git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next

for you to fetch changes up to a1bee5f9f606f89ff30171658a82bf532cca7f3d:

  uvcvideo: Return all buffers to vb2 at stream stop and start failure 
(2014-11-07 08:13:21 +0200)
--

For some reason git can't find the remote branch (hence the warning) and thus 
generates the URL line incorrectly.

I've tried upgrading from git 2.0.4 to git 2.1.3 but the problem is still 
present. Creating a local branch named uvc/next fixes the problem. I wonder if 
I'm doing something really stupid or if it's a git bug.

Can you pull from

git://linuxtv.org/pinchartl/media.git uvc/next

? I haven't updated the branch since I've sent the last pull request.

-- 
Regards,

Laurent Pinchart

--
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 0/6] add device_caps support to querycap

2014-11-24 Thread Hans Verkuil
This patch series adds missing device_caps support to the VIDIOC_QUERYCAP
implementations of drivers that are missing this.

After this series there are still 6 drivers left to do, but those need a
bit more thought.

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 4/6] media/radio: fix querycap

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Querycap should set the device_caps field.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/radio/radio-wl1273.c  | 4 +++-
 drivers/media/radio/wl128x/fmdrv_v4l2.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/radio-wl1273.c 
b/drivers/media/radio/radio-wl1273.c
index 9cf6731..284f789 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1279,10 +1279,12 @@ static int wl1273_fm_vidioc_querycap(struct file *file, 
void *priv,
strlcpy(capability-bus_info, radio-bus_type,
sizeof(capability-bus_info));
 
-   capability-capabilities = V4L2_CAP_HW_FREQ_SEEK |
+   capability-device_caps = V4L2_CAP_HW_FREQ_SEEK |
V4L2_CAP_TUNER | V4L2_CAP_RADIO | V4L2_CAP_AUDIO |
V4L2_CAP_RDS_CAPTURE | V4L2_CAP_MODULATOR |
V4L2_CAP_RDS_OUTPUT;
+   capability-capabilities = capability-device_caps |
+   V4L2_CAP_DEVICE_CAPS;
 
return 0;
 }
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c 
b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index b55012c..a5bd3f6 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -198,10 +198,12 @@ static int fm_v4l2_vidioc_querycap(struct file *file, 
void *priv,
strlcpy(capability-card, FM_DRV_CARD_SHORT_NAME,
sizeof(capability-card));
sprintf(capability-bus_info, UART);
-   capability-capabilities = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_TUNER |
+   capability-device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_TUNER |
V4L2_CAP_RADIO | V4L2_CAP_MODULATOR |
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE |
V4L2_CAP_RDS_CAPTURE;
+   capability-capabilities = capability-device_caps |
+   V4L2_CAP_DEVICE_CAPS;
 
return 0;
 }
-- 
2.1.3

--
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 5/6] media/platform: fix querycap

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Scott Jiang scott.jiang.li...@gmail.com
Cc: Gerhard Sittig g...@denx.de
Cc: Jonathan Corbet cor...@lwn.net
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
---
 drivers/media/platform/blackfin/bfin_capture.c  | 3 ++-
 drivers/media/platform/fsl-viu.c| 3 ++-
 drivers/media/platform/marvell-ccic/mcam-core.c | 4 ++--
 drivers/media/platform/mx2_emmaprp.c| 9 ++---
 drivers/media/platform/omap/omap_vout.c | 3 ++-
 drivers/media/platform/sh_vou.c | 3 ++-
 drivers/media/platform/via-camera.c | 4 ++--
 drivers/media/platform/vino.c   | 6 ++
 8 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/media/platform/blackfin/bfin_capture.c 
b/drivers/media/platform/blackfin/bfin_capture.c
index b3345b3..431c33d 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -841,7 +841,8 @@ static int bcap_querycap(struct file *file, void  *priv,
 {
struct bcap_device *bcap_dev = video_drvdata(file);
 
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
strlcpy(cap-driver, CAPTURE_DRV_NAME, sizeof(cap-driver));
strlcpy(cap-bus_info, Blackfin Platform, sizeof(cap-bus_info));
strlcpy(cap-card, bcap_dev-cfg-card_name, sizeof(cap-card));
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index d5dc198..8afee3c 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -604,10 +604,11 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
strcpy(cap-driver, viu);
strcpy(cap-card, viu);
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE |
+   cap-device_caps =  V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_READWRITE;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c 
b/drivers/media/platform/marvell-ccic/mcam-core.c
index f0eeb6c..5ef9579 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1413,9 +1413,9 @@ static int mcam_vidioc_querycap(struct file *file, void 
*priv,
 {
strcpy(cap-driver, marvell_ccic);
strcpy(cap-card, marvell_ccic);
-   cap-version = 1;
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE |
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/platform/mx2_emmaprp.c 
b/drivers/media/platform/mx2_emmaprp.c
index 4971ff2..f923d1b 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -402,13 +402,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
strncpy(cap-driver, MEM2MEM_NAME, sizeof(cap-driver) - 1);
strncpy(cap-card, MEM2MEM_NAME, sizeof(cap-card) - 1);
-   /*
-* This is only a mem-to-mem video device. The capture and output
-* device capability flags are left only for backward compatibility
-* and are scheduled for removal.
-*/
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
-   V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/platform/omap/omap_vout.c 
b/drivers/media/platform/omap/omap_vout.c
index 64ab6fb..d39e2b4 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -1054,8 +1054,9 @@ static int vidioc_querycap(struct file *file, void *fh,
strlcpy(cap-driver, VOUT_NAME, sizeof(cap-driver));
strlcpy(cap-card, vout-vfd-name, sizeof(cap-card));
cap-bus_info[0] = '\0';
-   cap-capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
+   cap-device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
 
return 0;
 }
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 0476696..154ef0b 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -396,7 +396,8 @@ static int sh_vou_querycap(struct 

[PATCH 2/6] staging/media: fix querycap

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 drivers/staging/media/bcm2048/radio-bcm2048.c   | 5 +++--
 drivers/staging/media/davinci_vpfe/vpfe_video.c | 8 
 drivers/staging/media/dt3155v4l/dt3155v4l.c | 5 ++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index bdc6854..60a57b2 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2327,9 +2327,10 @@ static int bcm2048_vidioc_querycap(struct file *file, 
void *priv,
strlcpy(capability-card, BCM2048_DRIVER_CARD,
sizeof(capability-card));
snprintf(capability-bus_info, 32, I2C: 0x%X, bdev-client-addr);
-   capability-version = BCM2048_DRIVER_VERSION;
-   capability-capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
+   capability-device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
V4L2_CAP_HW_FREQ_SEEK;
+   capability-capabilities = capability-device_caps |
+   V4L2_CAP_DEVICE_CAPS;
 
return 0;
 }
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c 
b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 6f9171c..06d48d5 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -600,11 +600,11 @@ static int vpfe_querycap(struct file *file, void  *priv,
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_querycap\n);
 
if (video-type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
else
-   cap-capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-   cap-device_caps = cap-capabilities;
-   cap-version = VPFE_CAPTURE_VERSION_CODE;
+   cap-device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
+   V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
strlcpy(cap-driver, CAPTURE_DRV_NAME, sizeof(cap-driver));
strlcpy(cap-bus_info, VPFE, sizeof(cap-bus_info));
strlcpy(cap-card, vpfe_dev-cfg-card_name, sizeof(cap-card));
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c 
b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index 4058022..293ffda 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -512,10 +512,9 @@ dt3155_ioc_querycap(struct file *filp, void *p, struct 
v4l2_capability *cap)
strcpy(cap-driver, DT3155_NAME);
strcpy(cap-card, DT3155_NAME  frame grabber);
sprintf(cap-bus_info, PCI:%s, pci_name(pd-pdev));
-   cap-version =
-  KERNEL_VERSION(DT3155_VER_MAJ, DT3155_VER_MIN, DT3155_VER_EXT);
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE |
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE |
DT3155_CAPTURE_METHOD;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
-- 
2.1.3

--
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 1/6] cx18: add device_caps support

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This was missing in this driver, so add this functionality.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Andy Walls awa...@md.metrocast.net
---
 drivers/media/pci/cx18/cx18-cards.h   | 3 ++-
 drivers/media/pci/cx18/cx18-driver.h  | 1 +
 drivers/media/pci/cx18/cx18-ioctl.c   | 7 ---
 drivers/media/pci/cx18/cx18-streams.c | 9 +
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/media/pci/cx18/cx18-cards.h 
b/drivers/media/pci/cx18/cx18-cards.h
index add7391..f6b921f 100644
--- a/drivers/media/pci/cx18/cx18-cards.h
+++ b/drivers/media/pci/cx18/cx18-cards.h
@@ -57,7 +57,8 @@
 /* V4L2 capability aliases */
 #define CX18_CAP_ENCODER (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | \
  V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | \
- V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE)
+ V4L2_CAP_STREAMING | V4L2_CAP_VBI_CAPTURE | \
+ V4L2_CAP_SLICED_VBI_CAPTURE)
 
 struct cx18_card_video_input {
u8  video_type; /* video input type */
diff --git a/drivers/media/pci/cx18/cx18-driver.h 
b/drivers/media/pci/cx18/cx18-driver.h
index 57f4688..dcfd7a1 100644
--- a/drivers/media/pci/cx18/cx18-driver.h
+++ b/drivers/media/pci/cx18/cx18-driver.h
@@ -379,6 +379,7 @@ struct cx18_stream {
const char *name;   /* name of the stream */
int type;   /* stream type */
u32 handle; /* task handle */
+   u32 v4l2_dev_caps;  /* device capabilities */
unsigned int mdl_base_idx;
 
u32 id;
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c 
b/drivers/media/pci/cx18/cx18-ioctl.c
index 71963db..b8e4b68 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -393,15 +393,16 @@ static int cx18_querycap(struct file *file, void *fh,
struct v4l2_capability *vcap)
 {
struct cx18_open_id *id = fh2id(fh);
+   struct cx18_stream *s = video_drvdata(file);
struct cx18 *cx = id-cx;
 
strlcpy(vcap-driver, CX18_DRIVER_NAME, sizeof(vcap-driver));
strlcpy(vcap-card, cx-card_name, sizeof(vcap-card));
snprintf(vcap-bus_info, sizeof(vcap-bus_info),
 PCI:%s, pci_name(cx-pci_dev));
-   vcap-capabilities = cx-v4l2_cap;  /* capabilities */
-   if (id-type == CX18_ENC_STREAM_TYPE_YUV)
-   vcap-capabilities |= V4L2_CAP_STREAMING;
+   vcap-capabilities = cx-v4l2_cap;  /* capabilities */
+   vcap-device_caps = s-v4l2_dev_caps;   /* device capabilities */
+   vcap-capabilities |= V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/pci/cx18/cx18-streams.c 
b/drivers/media/pci/cx18/cx18-streams.c
index f3541b5..369445f 100644
--- a/drivers/media/pci/cx18/cx18-streams.c
+++ b/drivers/media/pci/cx18/cx18-streams.c
@@ -58,11 +58,14 @@ static struct {
int vfl_type;
int num_offset;
int dma;
+   u32 caps;
 } cx18_stream_info[] = {
{   /* CX18_ENC_STREAM_TYPE_MPG */
encoder MPEG,
VFL_TYPE_GRABBER, 0,
PCI_DMA_FROMDEVICE,
+   V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
+   V4L2_CAP_AUDIO | V4L2_CAP_TUNER
},
{   /* CX18_ENC_STREAM_TYPE_TS */
TS,
@@ -73,11 +76,15 @@ static struct {
encoder YUV,
VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET,
PCI_DMA_FROMDEVICE,
+   V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
+   V4L2_CAP_STREAMING | V4L2_CAP_AUDIO | V4L2_CAP_TUNER
},
{   /* CX18_ENC_STREAM_TYPE_VBI */
encoder VBI,
VFL_TYPE_VBI, 0,
PCI_DMA_FROMDEVICE,
+   V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE |
+   V4L2_CAP_READWRITE | V4L2_CAP_TUNER
},
{   /* CX18_ENC_STREAM_TYPE_PCM */
encoder PCM audio,
@@ -93,6 +100,7 @@ static struct {
encoder radio,
VFL_TYPE_RADIO, 0,
PCI_DMA_NONE,
+   V4L2_CAP_RADIO | V4L2_CAP_TUNER
},
 };
 
@@ -260,6 +268,7 @@ static void cx18_stream_init(struct cx18 *cx, int type)
s-handle = CX18_INVALID_TASK_HANDLE;
 
s-dma = cx18_stream_info[type].dma;
+   s-v4l2_dev_caps = cx18_stream_info[type].caps;
s-buffers = cx-stream_buffers[type];
s-buf_size = cx-stream_buf_size[type];
INIT_LIST_HEAD(s-buf_pool);
-- 
2.1.3

--
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 3/6] media/usb,pci: fix querycap

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/pci/meye/meye.c | 3 ---
 drivers/media/pci/zoran/zoran_driver.c| 5 +++--
 drivers/media/usb/usbvision/usbvision-video.c | 3 ++-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index aeae547..9d9f90c 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1031,9 +1031,6 @@ static int vidioc_querycap(struct file *file, void *fh,
strcpy(cap-card, meye);
sprintf(cap-bus_info, PCI:%s, pci_name(meye.mchip_dev));
 
-   cap-version = (MEYE_DRIVER_MAJORVERSION  8) +
-  MEYE_DRIVER_MINORVERSION;
-
cap-device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING;
cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
diff --git a/drivers/media/pci/zoran/zoran_driver.c 
b/drivers/media/pci/zoran/zoran_driver.c
index 099d5fb..2b25d31 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -1528,8 +1528,9 @@ static int zoran_querycap(struct file *file, void *__fh, 
struct v4l2_capability
strncpy(cap-driver, zoran, sizeof(cap-driver)-1);
snprintf(cap-bus_info, sizeof(cap-bus_info), PCI:%s,
 pci_name(zr-pci_dev));
-   cap-capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE |
-   V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_VIDEO_OVERLAY;
+   cap-device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE |
+  V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_VIDEO_OVERLAY;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/usb/usbvision/usbvision-video.c 
b/drivers/media/usb/usbvision/usbvision-video.c
index 9bfa041..693d5f4 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -509,11 +509,12 @@ static int vidioc_querycap(struct file *file, void  *priv,
usbvision_device_data[usbvision-dev_model].model_string,
sizeof(vc-card));
usb_make_path(usbvision-dev, vc-bus_info, sizeof(vc-bus_info));
-   vc-capabilities = V4L2_CAP_VIDEO_CAPTURE |
+   vc-device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_AUDIO |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING |
(usbvision-have_tuner ? V4L2_CAP_TUNER : 0);
+   vc-capabilities = vc-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
-- 
2.1.3

--
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 6/6] media/platform: fix querycap

2014-11-24 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

In addition, remove the CAPTURE and OUTPUT caps for M2M devices. These
were already slated for removal, so it's time to do so.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Cc: Lad, Prabhakar prabhakar.cse...@gmail.com
Cc: Kamil Debski k.deb...@samsung.com
Cc: Jacek Anaszewski j.anaszew...@samsung.com
---
 drivers/media/platform/davinci/vpbe_display.c |  1 -
 drivers/media/platform/davinci/vpfe_capture.c |  4 ++--
 drivers/media/platform/s5p-g2d/g2d.c  | 10 ++
 drivers/media/platform/s5p-jpeg/jpeg-core.c   |  9 ++---
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c  |  6 ++
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c  |  6 ++
 6 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index 78b9ffe..21a5a56 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -639,7 +639,6 @@ static int vpbe_display_querycap(struct file *file, void  
*priv,
struct vpbe_layer *layer = video_drvdata(file);
struct vpbe_device *vpbe_dev = layer-disp_dev-vpbe_dev;
 
-   cap-version = VPBE_DISPLAY_VERSION_CODE;
cap-device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
snprintf(cap-driver, sizeof(cap-driver), %s,
diff --git a/drivers/media/platform/davinci/vpfe_capture.c 
b/drivers/media/platform/davinci/vpfe_capture.c
index 3d0e3ae..271c460 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -930,8 +930,8 @@ static int vpfe_querycap(struct file *file, void  *priv,
 
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_querycap\n);
 
-   cap-version = VPFE_CAPTURE_VERSION_CODE;
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
strlcpy(cap-driver, CAPTURE_DRV_NAME, sizeof(cap-driver));
strlcpy(cap-bus_info, VPFE, sizeof(cap-bus_info));
strlcpy(cap-card, vpfe_dev-cfg-card_name, sizeof(cap-card));
diff --git a/drivers/media/platform/s5p-g2d/g2d.c 
b/drivers/media/platform/s5p-g2d/g2d.c
index d79e214..51e4edc 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -297,14 +297,8 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap-driver, G2D_NAME, sizeof(cap-driver) - 1);
strncpy(cap-card, G2D_NAME, sizeof(cap-card) - 1);
cap-bus_info[0] = 0;
-   cap-version = KERNEL_VERSION(1, 0, 0);
-   /*
-* This is only a mem-to-mem video device. The capture and output
-* device capability flags are left only for backward compatibility
-* and are scheduled for removal.
-*/
-   cap-capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
-   V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+   cap-device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 6fcc7f0..d6f75b1 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1001,13 +1001,8 @@ static int s5p_jpeg_querycap(struct file *file, void 
*priv,
sizeof(cap-card));
}
cap-bus_info[0] = 0;
-   /*
-* This is only a mem-to-mem video device. The capture and output
-* device capability flags are left only for backward compatibility
-* and are scheduled for removal.
-*/
-   cap-capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M |
-   V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+   cap-device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
+   cap-capabilities = cap-device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
 }
 
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 74bcec8..c6c3452 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -269,15 +269,13 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap-driver, dev-plat_dev-name, sizeof(cap-driver) - 1);
strncpy(cap-card, dev-plat_dev-name, sizeof(cap-card) - 1);
cap-bus_info[0] = 0;
-   cap-version = KERNEL_VERSION(1, 0, 0);
/*
 * This is only a mem-to-mem video device. The capture and output
 * device capability flags are left only for 

bttv:The output of card name is truncated to 32 characters

2014-11-24 Thread triniton adam
When use struct v4l2_capability to get out card name in bttv the
output of card name is truncated to 32 characters.
I use this code to get card name:

char *v4l2_get_name(char *device)
{
struct v4l2_capability caps;

if ((fd = open(device, O_RDONLY))  0)
goto err;

if (ioctl(fd, VIDIOC_QUERYCAP, caps)  0) {
perror(VIDIOC_QUERYCAP);
goto err;
}
close(fd);

return strndup((char *)caps.card, sizeof(caps.card));

err:
if (fd = 0)
close(dev-fd);
fd = -1;

return NULL;
}

print truncated card name output (example for card=165):

BT878 video (Kworld V-Stream XP

instade of full card name:

Kworld V-Stream Xpert TV PVR878

I here same way to get full card name?
--
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: [GIT PULL FOR v3.19] uvcvideo changes

2014-11-24 Thread Mauro Carvalho Chehab
Em Mon, 24 Nov 2014 11:06:49 +0200
Laurent Pinchart laurent.pinch...@ideasonboard.com escreveu:

 Hi Mauro,
 
 On Tuesday 11 November 2014 08:56:26 Mauro Carvalho Chehab wrote:
  Em Fri, 07 Nov 2014 08:16:28 +0200 Laurent Pinchart escreveu:
   Hi Mauro,
   
   The following changes since commit 
 4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
 [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
   
   are available in the git repository at:
 git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
  
  It seems that there's something weird with this URL... remotes
 
 git isn't playing nicely :-/
 
 I've pushed the changes to the uvc/next branch on 
 git://linuxtv.org/pinchartl/media.git, up to commit a1bee5f9f606. 
 http://git.linuxtv.org/cgit.cgi/pinchartl/media.git/commit/?h=uvc/next 
 confirms that everything is in order.
 
 However, running
 
 git request-pull local-linuxtv-master media remotes/media/uvc/next

Seriously? Do you want git to change remotes? I don't think you can
do that. The remotes branches are to track something remote, e. g.
the references there should be already at the remote tree.

You should, instead, create a local branch and push it upstream.

 
 with the media remote pointing to git://linuxtv.org/pinchartl/media.git 
 generates
 
 --
 warn: No match for commit a1bee5f9f606f89ff30171658a82bf532cca7f3d found at 
 git://linuxtv.org/pinchartl/media.git
 warn: Are you sure you pushed 'remotes/media/uvc/next' there?
 The following changes since commit 4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
 
   [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
 
 are available in the git repository at:
 
   git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
 
 for you to fetch changes up to a1bee5f9f606f89ff30171658a82bf532cca7f3d:
 
   uvcvideo: Return all buffers to vb2 at stream stop and start failure 
 (2014-11-07 08:13:21 +0200)
 --
 
 For some reason git can't find the remote branch (hence the warning) and thus 
 generates the URL line incorrectly.
 
 I've tried upgrading from git 2.0.4 to git 2.1.3 but the problem is still 
 present. Creating a local branch named uvc/next fixes the problem. 

Yes, that's the right thing to do. Only modify local branches.

Git considers that the branches under remotes/* will be handled by
it. If you ever do a git remote update. You'll see that git will override
all references that are on a remote branch and you'll loose your work!

I think that even git revlog won't help you to recover the missing heads,
as it won't track branches under remotes/*.

 I wonder if 
 I'm doing something really stupid or if it's a git bug.

Well, git is right. You should not use remotes/foo for the branches
you're modifying. Such namespace is reserved for git to be able to
track the upstream branches.

 
 Can you pull from
 
 git://linuxtv.org/pinchartl/media.git uvc/next

Sure, I'll do it along this week.
 
 ? I haven't updated the branch since I've sent the last pull request.
 

Regards,
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


v4l-utils: possible ir-keytable bug

2014-11-24 Thread Olli Salonen
Hi all,

I've got an issue with ir-keytable when I try to use the -d parameter
to choose the device.

I've got one device:

olli@dl160:~$ sudo ir-keytable -v
Found device /sys/class/rc/rc0/
Input sysfs node is /sys/class/rc/rc0/input18/
Event sysfs node is /sys/class/rc/rc0/input18/event2/
Parsing uevent /sys/class/rc/rc0/input18/event2/uevent
/sys/class/rc/rc0/input18/event2/uevent uevent MAJOR=13
/sys/class/rc/rc0/input18/event2/uevent uevent MINOR=66
/sys/class/rc/rc0/input18/event2/uevent uevent DEVNAME=input/event2
Parsing uevent /sys/class/rc/rc0/uevent
/sys/class/rc/rc0/uevent uevent NAME=rc-terratec-slim-2
/sys/class/rc/rc0/uevent uevent DRV_NAME=em28xx
input device is /dev/input/event2
/sys/class/rc/rc0/protocols protocol rc-5 (disabled)
/sys/class/rc/rc0/protocols protocol nec (enabled)
/sys/class/rc/rc0/protocols protocol rc-6 (disabled)
Found /sys/class/rc/rc0/ (/dev/input/event2) with:
Driver em28xx, table rc-terratec-slim-2
Supported protocols: NEC RC-5 RC-6
Enabled protocols: NEC
Name: em28xx IR (em28178 #0)
bus: 3, vendor/product: eb1a:8179, version: 0x0001
Repeat delay = 500 ms, repeat period = 125 ms

But when I try to change the protocol using the -d parameter, I get an error:

olli@dl160:~$ sudo ir-keytable -v -p RC-6 -d /dev/input/event2
Opening /dev/input/event2
Input Protocol version: 0x00010001
Invalid protocols selected
Couldn't change the IR protocols

However, if instead of -d I use -s it works fine:

olli@dl160:~$ sudo ir-keytable -v -p RC-6 -s rc0
Found device /sys/class/rc/rc0/
Input sysfs node is /sys/class/rc/rc0/input18/
Event sysfs node is /sys/class/rc/rc0/input18/event2/
Parsing uevent /sys/class/rc/rc0/input18/event2/uevent
/sys/class/rc/rc0/input18/event2/uevent uevent MAJOR=13
/sys/class/rc/rc0/input18/event2/uevent uevent MINOR=66
/sys/class/rc/rc0/input18/event2/uevent uevent DEVNAME=input/event2
Parsing uevent /sys/class/rc/rc0/uevent
/sys/class/rc/rc0/uevent uevent NAME=rc-terratec-slim-2
/sys/class/rc/rc0/uevent uevent DRV_NAME=em28xx
input device is /dev/input/event2
/sys/class/rc/rc0/protocols protocol rc-5 (disabled)
/sys/class/rc/rc0/protocols protocol nec (enabled)
/sys/class/rc/rc0/protocols protocol rc-6 (disabled)
Opening /dev/input/event2
Input Protocol version: 0x00010001
Protocols changed to RC-6

Am I doing something daft or is there an issue?

Cheers,
-olli
--
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 2/3] v4l2-ctrl: move function prototypes from common.h to ctrls.h

2014-11-24 Thread Sakari Ailus
On Sun, Nov 23, 2014 at 01:39:54PM +0100, Hans Verkuil wrote:
 From: Hans Verkuil hans.verk...@cisco.com
 
 For some unknown reason several control prototypes where in v4l2-common.c
 instead of in v4l2-ctrls.h. Move them and document them.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Nice one!

For the set:

Acked-by: Sakari Ailus sakari.ai...@linux.intel.com

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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: [GIT PULL FOR v3.19] uvcvideo changes

2014-11-24 Thread Laurent Pinchart
Hi Mauro,

On Monday 24 November 2014 08:12:11 Mauro Carvalho Chehab wrote:
 Em Mon, 24 Nov 2014 11:06:49 +0200 Laurent Pinchart escreveu:
  On Tuesday 11 November 2014 08:56:26 Mauro Carvalho Chehab wrote:
   Em Fri, 07 Nov 2014 08:16:28 +0200 Laurent Pinchart escreveu:
Hi Mauro,

The following changes since commit
  
  4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
  [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)

are available in the git repository at:
  git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
   
   It seems that there's something weird with this URL... remotes
  
  git isn't playing nicely :-/
  
  I've pushed the changes to the uvc/next branch on
  git://linuxtv.org/pinchartl/media.git, up to commit a1bee5f9f606.
  http://git.linuxtv.org/cgit.cgi/pinchartl/media.git/commit/?h=uvc/next
  confirms that everything is in order.
  
  However, running
  
  git request-pull local-linuxtv-master media remotes/media/uvc/next
 
 Seriously? Do you want git to change remotes? I don't think you can
 do that. The remotes branches are to track something remote, e. g.
 the references there should be already at the remote tree.

I don't want git to change remotes, I want git to react to what is in the 
remote tree.

For historical reasons my local branch is named uvcvideo/next, while the 
remote branch is named uvc/next. They both point to the same commit. Before 
upgrading to git v2.0.4 running

git request-pull local-linuxtv-master media remotes/media/uvc/next

would not incorrectly warn that the commit ID isn't available remotely (as it 
is available) and would produce the git URL

git://linuxtv.org/pinchartl/media.git uvc/next

 You should, instead, create a local branch and push it upstream.

I've done that, the problem is that the local and remote branches have 
different names.

I should of course have read the latest git-request-pull man page and run

git request-pull local-linuxtv-master media uvcvideo/next:uvc/next

That works fine.

  with the media remote pointing to git://linuxtv.org/pinchartl/media.git
  generates
  
  --
  warn: No match for commit a1bee5f9f606f89ff30171658a82bf532cca7f3d found
  at git://linuxtv.org/pinchartl/media.git
  warn: Are you sure you pushed 'remotes/media/uvc/next' there?
  
  The following changes since commit 
4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
[media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
  
  are available in the git repository at:
git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
  
  for you to fetch changes up to a1bee5f9f606f89ff30171658a82bf532cca7f3d:
uvcvideo: Return all buffers to vb2 at stream stop and start failure
  
  (2014-11-07 08:13:21 +0200)
  --
  
  For some reason git can't find the remote branch (hence the warning) and
  thus generates the URL line incorrectly.
  
  I've tried upgrading from git 2.0.4 to git 2.1.3 but the problem is still
  present. Creating a local branch named uvc/next fixes the problem.
 
 Yes, that's the right thing to do. Only modify local branches.
 
 Git considers that the branches under remotes/* will be handled by
 it. If you ever do a git remote update. You'll see that git will override
 all references that are on a remote branch and you'll loose your work!
 
 I think that even git revlog won't help you to recover the missing heads,
 as it won't track branches under remotes/*.
 
  I wonder if I'm doing something really stupid or if it's a git bug.
 
 Well, git is right. You should not use remotes/foo for the branches
 you're modifying. Such namespace is reserved for git to be able to
 track the upstream branches.

  Can you pull from
  
  git://linuxtv.org/pinchartl/media.git uvc/next
 
 Sure, I'll do it along this week.

Thank you.

  ? I haven't updated the branch since I've sent the last pull request.

-- 
Regards,

Laurent Pinchart

--
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: [REVIEW PATCH v2.1 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target

2014-11-24 Thread Hans Verkuil
On 11/18/14 22:08, Sakari Ailus wrote:
 The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
 sensor's pixel array.
 
 Signed-off-by: Sakari Ailus sakari.ai...@iki.fi

For the whole patch series:

Acked-by: Hans Verkuil hans.verk...@cisco.com

Thanks!

Once this is mainlined, can you update v4l2-ctl so it supports this
new target?

Regards,

Hans

 ---
 since v2:
 - Add a note on s_selection support for native selection target on mem2mem
   devices only.
 - Reverse the order or left and top fields, i.e. make it the same as in
   struct v4l2_rect.
 
  Documentation/DocBook/media/v4l/selections-common.xml |   16 
  include/uapi/linux/v4l2-common.h  |2 ++
  2 files changed, 18 insertions(+)
 
 diff --git a/Documentation/DocBook/media/v4l/selections-common.xml 
 b/Documentation/DocBook/media/v4l/selections-common.xml
 index 7502f78..d6d56fb 100644
 --- a/Documentation/DocBook/media/v4l/selections-common.xml
 +++ b/Documentation/DocBook/media/v4l/selections-common.xml
 @@ -63,6 +63,22 @@
   entryYes/entry
 /row
 row
 + entryconstantV4L2_SEL_TGT_NATIVE_SIZE/constant/entry
 + entry0x0003/entry
 + entryThe native size of the device, e.g. a sensor's
 + pixel array. structfieldleft/structfield and
 + structfieldtop/structfield fields are zero for this
 + target. Setting the native size will generally only make
 + sense for memory to memory devices where the software can
 + create a canvas of a given size in which for example a
 + video frame can be composed. In that case
 + V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
 + of that canvas.
 + /entry
 + entryYes/entry
 + entryYes/entry
 +   /row
 +   row
   entryconstantV4L2_SEL_TGT_COMPOSE/constant/entry
   entry0x0100/entry
   entryCompose rectangle. Used to configure scaling
 diff --git a/include/uapi/linux/v4l2-common.h 
 b/include/uapi/linux/v4l2-common.h
 index 2f6f8ca..1527398 100644
 --- a/include/uapi/linux/v4l2-common.h
 +++ b/include/uapi/linux/v4l2-common.h
 @@ -43,6 +43,8 @@
  #define V4L2_SEL_TGT_CROP_DEFAULT0x0001
  /* Cropping bounds */
  #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
 +/* Native frame size */
 +#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
  /* Current composing area */
  #define V4L2_SEL_TGT_COMPOSE 0x0100
  /* Default composing area */
 

--
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] [media] omap24xx/tcm825x: remove pointless Makefile entry

2014-11-24 Thread Paul Bolle
The deprecated omap2 camera drivers were recently removed. Both the
Kconfig symbol VIDEO_TCM825X and the drivers/staging/media/omap24xx
directory are gone. So the Makefile entry that references both is now
pointless. Remove it too.

Signed-off-by: Paul Bolle pebo...@tiscali.nl
---
Tested by grepping the tree.

Triggered by commit db85a0403be4 ([media] omap24xx/tcm825x: remove
deprecated omap2 camera drivers.), which is included in next-20141124.
What happened is that it removed only one of the two Makefile entries
for omap24xx.

 drivers/staging/media/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 97bfef97f838..30fb352fc4a9 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -4,7 +4,6 @@ obj-$(CONFIG_LIRC_STAGING)  += lirc/
 obj-$(CONFIG_VIDEO_DT3155) += dt3155v4l/
 obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
 obj-$(CONFIG_VIDEO_OMAP4)  += omap4iss/
-obj-$(CONFIG_VIDEO_TCM825X) += omap24xx/
 obj-$(CONFIG_DVB_MN88472)   += mn88472/
 obj-$(CONFIG_DVB_MN88473)   += mn88473/
 
-- 
1.9.3

--
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: [GIT PULL FOR v3.19] uvcvideo changes

2014-11-24 Thread Mauro Carvalho Chehab
Em Mon, 24 Nov 2014 12:41:10 +0200
Laurent Pinchart laurent.pinch...@ideasonboard.com escreveu:

 Hi Mauro,
 
 On Monday 24 November 2014 08:12:11 Mauro Carvalho Chehab wrote:
  Em Mon, 24 Nov 2014 11:06:49 +0200 Laurent Pinchart escreveu:
   On Tuesday 11 November 2014 08:56:26 Mauro Carvalho Chehab wrote:
Em Fri, 07 Nov 2014 08:16:28 +0200 Laurent Pinchart escreveu:
 Hi Mauro,
 
 The following changes since commit
   
   4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
   [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
 
 are available in the git repository at:
   git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next

It seems that there's something weird with this URL... remotes
   
   git isn't playing nicely :-/
   
   I've pushed the changes to the uvc/next branch on
   git://linuxtv.org/pinchartl/media.git, up to commit a1bee5f9f606.
   http://git.linuxtv.org/cgit.cgi/pinchartl/media.git/commit/?h=uvc/next
   confirms that everything is in order.
   
   However, running
   
   git request-pull local-linuxtv-master media remotes/media/uvc/next
  
  Seriously? Do you want git to change remotes? I don't think you can
  do that. The remotes branches are to track something remote, e. g.
  the references there should be already at the remote tree.
 
 I don't want git to change remotes, I want git to react to what is in the 
 remote tree.
 
 For historical reasons my local branch is named uvcvideo/next, while the 
 remote branch is named uvc/next. They both point to the same commit. Before 
 upgrading to git v2.0.4 running
 
   git request-pull local-linuxtv-master media remotes/media/uvc/next
 
 would not incorrectly warn that the commit ID isn't available remotely (as it 
 is available) and would produce the git URL
 
   git://linuxtv.org/pinchartl/media.git uvc/next

The right syntax would be to use, instead:
git request-pull git://linuxtv.org/pinchartl/media.git uvcvideo/next
 
  You should, instead, create a local branch and push it upstream.
 
 I've done that, the problem is that the local and remote branches have 
 different names.

No problem. Git request-pull would automatically detect the remote branch
that has the changeset associated with the local branch that you're 
requesting to pull. It probably uses the push config at your .git/config.

The names I use on my local repository also don't match the ones at the
public repository.

 I should of course have read the latest git-request-pull man page and run
 
   git request-pull local-linuxtv-master media uvcvideo/next:uvc/next
 
 That works fine.

Yeah, you could force it, but no need if your .git/config has already a
push line like the above.

 
   with the media remote pointing to git://linuxtv.org/pinchartl/media.git
   generates
   
   --
   warn: No match for commit a1bee5f9f606f89ff30171658a82bf532cca7f3d found
   at git://linuxtv.org/pinchartl/media.git
   warn: Are you sure you pushed 'remotes/media/uvc/next' there?
   
   The following changes since commit 
 4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
 [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
   
   are available in the git repository at:
 git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
   
   for you to fetch changes up to a1bee5f9f606f89ff30171658a82bf532cca7f3d:
 uvcvideo: Return all buffers to vb2 at stream stop and start failure
   
   (2014-11-07 08:13:21 +0200)
   --
   
   For some reason git can't find the remote branch (hence the warning) and
   thus generates the URL line incorrectly.
   
   I've tried upgrading from git 2.0.4 to git 2.1.3 but the problem is still
   present. Creating a local branch named uvc/next fixes the problem.
  
  Yes, that's the right thing to do. Only modify local branches.
  
  Git considers that the branches under remotes/* will be handled by
  it. If you ever do a git remote update. You'll see that git will override
  all references that are on a remote branch and you'll loose your work!
  
  I think that even git revlog won't help you to recover the missing heads,
  as it won't track branches under remotes/*.
  
   I wonder if I'm doing something really stupid or if it's a git bug.
  
  Well, git is right. You should not use remotes/foo for the branches
  you're modifying. Such namespace is reserved for git to be able to
  track the upstream branches.
 
   Can you pull from
   
   git://linuxtv.org/pinchartl/media.git uvc/next
  
  Sure, I'll do it along this week.
 
 Thank you.
 
   ? I haven't updated the branch since I've sent the last pull request.
 
--
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] omap24xx/tcm825x: remove pointless Makefile entry

2014-11-24 Thread Hans Verkuil
I found the same thing and it is already part of my pull request
to Mauro.

I'm setting this patch as Obsoleted in patchwork.

It's unclear what happened. My original patch definitely removed both
Makefile lines.

Regards,

Hans

On 11/24/14 11:53, Paul Bolle wrote:
 The deprecated omap2 camera drivers were recently removed. Both the
 Kconfig symbol VIDEO_TCM825X and the drivers/staging/media/omap24xx
 directory are gone. So the Makefile entry that references both is now
 pointless. Remove it too.
 
 Signed-off-by: Paul Bolle pebo...@tiscali.nl
 ---
 Tested by grepping the tree.
 
 Triggered by commit db85a0403be4 ([media] omap24xx/tcm825x: remove
 deprecated omap2 camera drivers.), which is included in next-20141124.
 What happened is that it removed only one of the two Makefile entries
 for omap24xx.
 
  drivers/staging/media/Makefile | 1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
 index 97bfef97f838..30fb352fc4a9 100644
 --- a/drivers/staging/media/Makefile
 +++ b/drivers/staging/media/Makefile
 @@ -4,7 +4,6 @@ obj-$(CONFIG_LIRC_STAGING)+= lirc/
  obj-$(CONFIG_VIDEO_DT3155)   += dt3155v4l/
  obj-$(CONFIG_VIDEO_DM365_VPFE)   += davinci_vpfe/
  obj-$(CONFIG_VIDEO_OMAP4)+= omap4iss/
 -obj-$(CONFIG_VIDEO_TCM825X) += omap24xx/
  obj-$(CONFIG_DVB_MN88472)   += mn88472/
  obj-$(CONFIG_DVB_MN88473)   += mn88473/
  
 
--
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: [GIT PULL FOR v3.19] uvcvideo changes

2014-11-24 Thread Laurent Pinchart
Hi Mauro,

On Monday 24 November 2014 08:59:23 Mauro Carvalho Chehab wrote:
 Em Mon, 24 Nov 2014 12:41:10 +0200 Laurent Pinchart escreveu:
  On Monday 24 November 2014 08:12:11 Mauro Carvalho Chehab wrote:
  Em Mon, 24 Nov 2014 11:06:49 +0200 Laurent Pinchart escreveu:
  On Tuesday 11 November 2014 08:56:26 Mauro Carvalho Chehab wrote:
  Em Fri, 07 Nov 2014 08:16:28 +0200 Laurent Pinchart escreveu:
  Hi Mauro,
  
  The following changes since commit
  4895cc47a072dcb32d3300d0a46a251a8c6db5f1:
[media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)
  
  are available in the git repository at:
git://linuxtv.org/pinchartl/media.git remotes/media/uvc/next
  
  It seems that there's something weird with this URL... remotes
  
  git isn't playing nicely :-/
  
  I've pushed the changes to the uvc/next branch on
  git://linuxtv.org/pinchartl/media.git, up to commit a1bee5f9f606.
  http://git.linuxtv.org/cgit.cgi/pinchartl/media.git/commit/?h=uvc/next
  confirms that everything is in order.
  
  However, running
  
  git request-pull local-linuxtv-master media remotes/media/uvc/next
  
  Seriously? Do you want git to change remotes? I don't think you can
  do that. The remotes branches are to track something remote, e. g.
  the references there should be already at the remote tree.
  
  I don't want git to change remotes, I want git to react to what is in the
  remote tree.
  
  For historical reasons my local branch is named uvcvideo/next, while the
  remote branch is named uvc/next. They both point to the same commit.
  Before upgrading to git v2.0.4 running
  
  git request-pull local-linuxtv-master media remotes/media/uvc/next
  
  would not incorrectly warn that the commit ID isn't available remotely (as
  it is available) and would produce the git URL
  
  git://linuxtv.org/pinchartl/media.git uvc/next
 
 The right syntax would be to use, instead:
   git request-pull git://linuxtv.org/pinchartl/media.git uvcvideo/next

That produces

warn: No match for commit a1bee5f9f606f89ff30171658a82bf532cca7f3d found at 
media
warn: Are you sure you pushed 'uvcvideo/next' there?
The following changes since commit 4895cc47a072dcb32d3300d0a46a251a8c6db5f1:

  [media] s5p-mfc: fix sparse error (2014-11-05 08:29:27 -0200)

are available in the git repository at:

  git://linuxtv.org/pinchartl/media.git uvcvideo/next

for you to fetch changes up to a1bee5f9f606f89ff30171658a82bf532cca7f3d:

  uvcvideo: Return all buffers to vb2 at stream stop and start failure 
(2014-11-07 08:13:21 +0200)

  You should, instead, create a local branch and push it upstream.
  
  I've done that, the problem is that the local and remote branches have
  different names.
 
 No problem. Git request-pull would automatically detect the remote branch
 that has the changeset associated with the local branch that you're
 requesting to pull. It probably uses the push config at your .git/config.

It seems like it did before I upgraded to 2.0.4, but not anymore.

 The names I use on my local repository also don't match the ones at the
 public repository.
 
  I should of course have read the latest git-request-pull man page and run
  
  git request-pull local-linuxtv-master media uvcvideo/next:uvc/next
  
  That works fine.
 
 Yeah, you could force it, but no need if your .git/config has already a
 push line like the above.

[snip]

-- 
Regards,

Laurent Pinchart

--
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] omap24xx/tcm825x: remove pointless Makefile entry

2014-11-24 Thread Paul Bolle
On Mon, 2014-11-24 at 12:08 +0100, Hans Verkuil wrote:
 I found the same thing and it is already part of my pull request
 to Mauro.

Either way, this trivial issue will be solved.

Thanks,


Paul Bolle

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


[PATCHv7.1 06/12] vb2-dma-sg: move dma_(un)map_sg here

2014-11-24 Thread Hans Verkuil
Change since REVIEWv7:

- set buf-dev in get_userptr. Pawel's remark that get_device() wasn't
  required in get_userptr led me to remove the buf-dev assignment
  altogether, leaving me with a NULL buf-dev pointer. Obviously that
  won't work and it should still be assigned to the device in the
  allocation context. Otherwise this patch is unchanged.

This moves dma_(un)map_sg to the get_userptr/put_userptr and alloc/put
memops of videobuf2-dma-sg.c and adds dma_sync_sg_for_device/cpu to the
prepare/finish memops.

Now that vb2-dma-sg will sync the buffers for you in the prepare/finish
memops we can drop that from the drivers that use dma-sg.

For the solo6x10 driver that was a bit more involved because it needs to
copy JPEG or MPEG headers to the buffer before returning it to userspace,
and that cannot be done in the old place since the buffer there is still
setup for DMA access, not for CPU access. However, the buf_finish
op is the ideal place to do this. By the time buf_finish is called
the buffer is available for CPU access, so copying to the buffer is fine.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
Acked-by: Pawel Osciak pa...@osciak.com
---
 drivers/media/pci/cx23885/cx23885-417.c |  3 --
 drivers/media/pci/cx23885/cx23885-core.c|  5 ---
 drivers/media/pci/cx23885/cx23885-dvb.c |  3 --
 drivers/media/pci/cx23885/cx23885-vbi.c |  9 -
 drivers/media/pci/cx23885/cx23885-video.c   |  9 -
 drivers/media/pci/saa7134/saa7134-empress.c |  1 -
 drivers/media/pci/saa7134/saa7134-ts.c  | 16 
 drivers/media/pci/saa7134/saa7134-vbi.c | 15 
 drivers/media/pci/saa7134/saa7134-video.c   | 15 
 drivers/media/pci/saa7134/saa7134.h |  1 -
 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c  | 50 +++--
 drivers/media/pci/tw68/tw68-video.c |  8 
 drivers/media/platform/marvell-ccic/mcam-core.c | 18 +
 drivers/media/v4l2-core/videobuf2-dma-sg.c  | 41 
 14 files changed, 64 insertions(+), 130 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-417.c 
b/drivers/media/pci/cx23885/cx23885-417.c
index d72a3ec..e4901a5 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1167,11 +1167,8 @@ static void buffer_finish(struct vb2_buffer *vb)
struct cx23885_dev *dev = vb-vb2_queue-drv_priv;
struct cx23885_buffer *buf = container_of(vb,
struct cx23885_buffer, vb);
-   struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
cx23885_free_buffer(dev, buf);
-
-   dma_unmap_sg(dev-pci-dev, sgt-sgl, sgt-nents, DMA_FROM_DEVICE);
 }
 
 static void buffer_queue(struct vb2_buffer *vb)
diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
b/drivers/media/pci/cx23885/cx23885-core.c
index d452b5c..d07b04a 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -1453,17 +1453,12 @@ int cx23885_buf_prepare(struct cx23885_buffer *buf, 
struct cx23885_tsport *port)
struct cx23885_dev *dev = port-dev;
int size = port-ts_packet_size * port-ts_packet_count;
struct sg_table *sgt = vb2_dma_sg_plane_desc(buf-vb, 0);
-   int rc;
 
dprintk(1, %s: %p\n, __func__, buf);
if (vb2_plane_size(buf-vb, 0)  size)
return -EINVAL;
vb2_set_plane_payload(buf-vb, 0, size);
 
-   rc = dma_map_sg(dev-pci-dev, sgt-sgl, sgt-nents, DMA_FROM_DEVICE);
-   if (!rc)
-   return -EIO;
-
cx23885_risc_databuffer(dev-pci, buf-risc,
sgt-sgl,
port-ts_packet_size, port-ts_packet_count, 0);
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index 44fafba..c47d182 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -123,11 +123,8 @@ static void buffer_finish(struct vb2_buffer *vb)
struct cx23885_dev *dev = port-dev;
struct cx23885_buffer *buf = container_of(vb,
struct cx23885_buffer, vb);
-   struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
 
cx23885_free_buffer(dev, buf);
-
-   dma_unmap_sg(dev-pci-dev, sgt-sgl, sgt-nents, DMA_FROM_DEVICE);
 }
 
 static void buffer_queue(struct vb2_buffer *vb)
diff --git a/drivers/media/pci/cx23885/cx23885-vbi.c 
b/drivers/media/pci/cx23885/cx23885-vbi.c
index 1d339a6..d362d38 100644
--- a/drivers/media/pci/cx23885/cx23885-vbi.c
+++ b/drivers/media/pci/cx23885/cx23885-vbi.c
@@ -143,7 +143,6 @@ static int buffer_prepare(struct vb2_buffer *vb)
struct cx23885_buffer, vb);
struct sg_table *sgt = vb2_dma_sg_plane_desc(vb, 0);
unsigned lines = VBI_PAL_LINE_COUNT;
-   int ret;
 
if (dev-tvnorm  V4L2_STD_525_60)
lines = VBI_NTSC_LINE_COUNT;
@@ -152,10 +151,6 @@ static int 

[GIT PULL FOR v3.19] vb2: improvements

2014-11-24 Thread Hans Verkuil
Repost due to a dumb bug that was introduced in vb2_dma_sg_get_userptr and
which is now fixed.

- Add allocation context to dma-sg and have vb2 do the dma mapping instead of
  the driver. This makes it consistent with the way dma-contig behaves and
  simplifies drivers.
- Add support for DMABUF import to dma-sg.
- Add support for DMABUF export to dma-sg and dma-vmalloc.
- Clarify (and fix) when buffers can safely be written to by the cpu.

After this patch series DMABUF is available for all v4l2_memory variants.

Regards,

Hans

The following changes since commit 5937a784c3e5fe8fd1e201f42a2b1ece6c36a6c0:

  [media] staging: media: bcm2048: fix coding style error (2014-11-21 16:50:37 
-0200)

are available in the git repository at:

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

for you to fetch changes up to a123fbe2efb83a5944bbf024feaf8bab00c111fa:

  vb2: use dma_map_sg_attrs to prevent unnecessary sync (2014-11-24 12:50:53 
+0100)


Hans Verkuil (12):
  videobuf2-core.h: improve documentation
  vb2: replace 'write' by 'dma_dir'
  vb2: add dma_dir to the alloc memop.
  vb2: don't free alloc context if it is ERR_PTR
  vb2-dma-sg: add allocation context to dma-sg
  vb2-dma-sg: move dma_(un)map_sg here
  vb2-dma-sg: add dmabuf import support
  vb2-dma-sg: add support for dmabuf exports
  vb2-vmalloc: add support for dmabuf exports
  vivid: enable vb2_expbuf support.
  vim2m: support expbuf
  vb2: use dma_map_sg_attrs to prevent unnecessary sync

 drivers/media/pci/cx23885/cx23885-417.c |   4 +-
 drivers/media/pci/cx23885/cx23885-core.c|  15 ++-
 drivers/media/pci/cx23885/cx23885-dvb.c |   4 +-
 drivers/media/pci/cx23885/cx23885-vbi.c |  10 +-
 drivers/media/pci/cx23885/cx23885-video.c   |  10 +-
 drivers/media/pci/cx23885/cx23885.h |   1 +
 drivers/media/pci/saa7134/saa7134-core.c|  18 ++-
 drivers/media/pci/saa7134/saa7134-empress.c |   1 -
 drivers/media/pci/saa7134/saa7134-ts.c  |  17 +--
 drivers/media/pci/saa7134/saa7134-vbi.c |  16 +--
 drivers/media/pci/saa7134/saa7134-video.c   |  16 +--
 drivers/media/pci/saa7134/saa7134.h |   2 +-
 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c  |  60 +-
 drivers/media/pci/solo6x10/solo6x10.h   |   1 +
 drivers/media/pci/tw68/tw68-core.c  |  15 ++-
 drivers/media/pci/tw68/tw68-video.c |   9 +-
 drivers/media/pci/tw68/tw68.h   |   1 +
 drivers/media/platform/marvell-ccic/mcam-core.c |  31 +++--
 drivers/media/platform/marvell-ccic/mcam-core.h |   1 +
 drivers/media/platform/vim2m.c  |   1 +
 drivers/media/platform/vivid/vivid-core.c   |   2 +-
 drivers/media/v4l2-core/videobuf2-core.c|  14 ++-
 drivers/media/v4l2-core/videobuf2-dma-contig.c  |  71 
 drivers/media/v4l2-core/videobuf2-dma-sg.c  | 425 
---
 drivers/media/v4l2-core/videobuf2-vmalloc.c | 191 
--
 include/media/videobuf2-core.h  |  42 ---
 include/media/videobuf2-dma-sg.h|   3 +
 27 files changed, 766 insertions(+), 215 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] omap: Fix typo HAS_MMU

2014-11-24 Thread Paul Bolle
Commit 38a073116525 ([media] omap: be sure that MMU is there for
COMPILE_TEST) added a dependency on HAS_MMU. There's no Kconfig symbol
HAS_MMU. Use MMU instead.

Signed-off-by: Paul Bolle pebo...@tiscali.nl
---
0) Perhaps it would have been better to add a line or two explaining why
MMU is now a separate dependency, as Mauro suggested.

Commit 38a073116525 tells us that COMPILE_TEST fail[s] on (some) archs
without MMU. It doesn't tell on which architectures nor how it fails.
And I was unable to figure that out myself so I decided to stay silent
on that aspect of this patch.

1) A Fixes: line seems not worth the trouble here.

2) Tested on top of next-20141124 by doing, in short:
cp arch/x86/configs/x86_64_defconfig .config
echo CONFIG_COMPILE_TEST=y  .config
echo CONFIG_MEDIA_SUPPORT=y  .config
echo CONFIG_MEDIA_CAMERA_SUPPORT=y  .config
echo CONFIG_V4L_PLATFORM_DRIVERS=y  .config
echo CONFIG_VIDEO_OMAP2_VOUT=[ym]  .config
yes  | make oldconfig

both before and after applying this patch and diffing the before and
after .config. Only with this patch I see CONFIG_VIDEO_OMAP2_VOUT=[ym]
appear in the .config.

3) Actually, I've wasted quite a bit of time cobbling together a script
to test commits locally. The test(s) I want to run is (are) saved in a
git note for that commit. The script parses this note and runs the
test(s).

Have I been reinventing the wheel?

 drivers/media/platform/omap/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap/Kconfig 
b/drivers/media/platform/omap/Kconfig
index 05de442d24e4..8f27cdadf8b8 100644
--- a/drivers/media/platform/omap/Kconfig
+++ b/drivers/media/platform/omap/Kconfig
@@ -3,7 +3,8 @@ config VIDEO_OMAP2_VOUT_VRFB
 
 config VIDEO_OMAP2_VOUT
tristate OMAP2/OMAP3 V4L2-Display driver
-   depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST  HAS_MMU)
+   depends on MMU
+   depends on ARCH_OMAP2 || ARCH_OMAP3 || COMPILE_TEST
select VIDEOBUF_GEN
select VIDEOBUF_DMA_CONTIG
select OMAP2_DSS if HAS_IOMEM  ARCH_OMAP2PLUS
-- 
1.9.3

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


[GIT PULL] si2157 si2168 cxusb em28xx

2014-11-24 Thread Antti Palosaari

The following changes since commit 5937a784c3e5fe8fd1e201f42a2b1ece6c36a6c0:

  [media] staging: media: bcm2048: fix coding style error (2014-11-21 
16:50:37 -0200)


are available in the git repository at:

  git://linuxtv.org/anttip/media_tree.git silabs

for you to fetch changes up to d5036ca91a48ca0841d4f9075952f705e4cac58e:

  cxusb: Geniatech T230 support. (2014-11-24 12:44:59 +0200)


CrazyCat (3):
  si2157: Si2148 support.
  si2168: TS clock inversion control.
  cxusb: Geniatech T230 support.

Olli Salonen (3):
  si2157: Add support for Si2146-A10
  em28xx: Add support for Terratec Cinergy T2 Stick HD
  si2157: make checkpatch.pl happy (remove break after goto)

 drivers/media/dvb-core/dvb-usb-ids.h  |   1 +
 drivers/media/dvb-frontends/si2168.c  |   7 +--
 drivers/media/dvb-frontends/si2168.h  |   4 
 drivers/media/dvb-frontends/si2168_priv.h |   1 +
 drivers/media/tuners/si2157.c |  32 


 drivers/media/tuners/si2157.h |   2 +-
 drivers/media/tuners/si2157_priv.h|   8 ++--
 drivers/media/usb/dvb-usb/cxusb.c | 127 
+++
 drivers/media/usb/em28xx/em28xx-cards.c   |  27 
+++
 drivers/media/usb/em28xx/em28xx-dvb.c |  59 
+++

 drivers/media/usb/em28xx/em28xx.h |   1 +
 11 files changed, 256 insertions(+), 13 deletions(-)

--
http://palosaari.fi/
--
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 4/4] si2157: Add support for Si2148-A20

2014-11-24 Thread Antti Palosaari

Moikka!
I decided apply old crazyCat version, even I originally asked that 
firmware change! If I ever will ran problem with Si2148 / Si2158 
firmware difference, I know who to blame ;p


That patch could be dropped.
PULL request already sent.

regards
Antti

On 11/24/2014 08:57 AM, Olli Salonen wrote:

The Silicon Labs Si2148 tuner works as the Si2158, but does not contain analog 
tuner. A firmware is required for the tuner. Currently the Si2158-A20 firmware 
will work for Si2148-A20 as well, but as there are no guarantees that that will 
be the case in future, a unique file name is used for the firmware.

The datasheet is available on manufacturer's website:
http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2148-short.pdf

Signed-off-by: Olli Salonen olli.salo...@iki.fi


--
http://palosaari.fi/
--
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


Connecting ADV76xx to CSI via SFMC

2014-11-24 Thread Jean-Michel Hautbois
Hi,

I am working on using the CSI bus of i.MX6 with a adv7611 chip.
I started to work with Steve Longerbeam's tree, and here is the
current tree I am using :
https://github.com/Vodalys/linux-2.6-imx/tree/mx6-camera-staging-v2-vbx

This is a WiP tree, and not intended to be complete right now.
But at least, it should be possible to get a picture.
I will try to be as complete and synthetic as possible...

Right now, I am configuring the ADV7611 in 16-Bit SDR ITU-R BT.656
4:2:2 Mode 0 (Table 73 in Appendix C of the Reference Manual).
This means that I have pins [15:8] = [Y7..Y0] and [7:0]=[Cb7,Cr7..Cb0,Cr0].
On my board, thanks to a FPGA, pin 15 is connected to
MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 and pin 0 to
MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04.

In the source code, I am asking for a  4:2:2 YUYV packed format.

Then, when starting the board, I am doing the following :
$ v4l2-ctl -d2
--set-fmt-video=width=1280,height=720,pixelformat=YUYV,field=none,bytesperline=2560
-i3
$ v4l2-ctl -d2 --set-dv-bt-timings index=4 -i3
$   [   69.360256] adv7611 1-004c: -Chip status-
   [   69.365652] adv7611 1-004c: Chip power: on
   [   69.370446] adv7611 1-004c: EDID enabled port A: No, B: No, C: No, D: No
   [   69.378110] adv7611 1-004c: CEC: disabled
   [   69.382132] adv7611 1-004c: -Signal status-
   [   69.387722] adv7611 1-004c: Cable detected (+5V power) port A:
No, B: No, C: No, D: No
   [   69.396344] adv7611 1-004c: TMDS signal detected: false
   [   69.402245] adv7611 1-004c: TMDS signal locked: false
   [   69.408015] adv7611 1-004c: SSPD locked: true
   [   69.413047] adv7611 1-004c: STDI locked: false
   [   69.417529] adv7611 1-004c: CP locked: true
   [   69.422402] adv7611 1-004c: CP free run: on
   [   69.429013] adv7611 1-004c: Prim-mode = 0x5, video std = 0x13,
v_freq = 0x1
   [   69.436022] adv7611 1-004c: -Video Timings-
   [   69.441594] adv7611 1-004c: STDI: not locked
   [   69.449212] adv7611 1-004c: No video detected
   [   69.453587] adv7611 1-004c: Configured format: 1280x720p50 (1980x750)
   [   69.460066] adv7611 1-004c: horizontal: fp = 440, +sync = 40, bp = 220
   [   69.466637] adv7611 1-004c: vertical: fp = 5, +sync = 5, bp = 20
   [   69.472653] adv7611 1-004c: pixelclock: 7425
   [   69.477300] adv7611 1-004c: flags (0x0):
   [   69.481233] adv7611 1-004c: standards (0x1): CEA
   [   69.490112] adv7604 1-0020: -Chip status-

I keep the ADV7611 running in Free mode, which produces a blue frame,
with Y=0x23 and Cr=0x72, Cb=0xD4.

Now, I try to capture a frame :
$ v4l2-ctl -d2 --stream-mmap --stream-to x.raw --stream-count=1

I don't get anything, and here is the dmesg :
[  187.191644] imx-ipuv3 240.ipu: CSI_SENS_CONF = 0x4920
[  187.191849] imx-ipuv3 240.ipu: CSI_ACT_FRM_SIZE = 0x02CF04FF
[  187.200454] ipu_cpmem_set_image: resolution: 1280x720 stride: 2560
[  187.200472] ipu_ch_param_write_field 0 125 13
[  187.200486] ipu_ch_param_write_field 0 138 12
[  187.200498] ipu_ch_param_write_field 1 102 14
[  187.200510] ipu_ch_param_write_field 0 107 3
[  187.200521] ipu_ch_param_write_field 1 85 4
[  187.200532] ipu_ch_param_write_field 1 78 7
[  187.200543] ipu_ch_param_write_field 1 0 29
[  187.200554] ipu_ch_param_write_field 1 29 29
[  187.200566] ipu_ch_param_write_field 1 78 7
[  187.200586] ipu_ch_param_write_field 1 93 2
[  187.201077] mx6-camera-encoder: Enable CSI
[  187.205206] imx-ipuv3 240.ipu: ch 0 word 0 -  
 E0001800 000B3C9F
[  187.205226] imx-ipuv3 240.ipu: ch 0 word 1 - 09E6 013D4000
0103C000 00027FC0 
[  187.205240] ipu_ch_param_read_field 1 85 4
[  187.205254] imx-ipuv3 240.ipu: PFS 0x8,
[  187.205265] ipu_ch_param_read_field 0 107 3
[  187.205278] imx-ipuv3 240.ipu: BPP 0x3,
[  187.205289] ipu_ch_param_read_field 1 78 7
[  187.205302] imx-ipuv3 240.ipu: NPB 0xf
[  187.205313] ipu_ch_param_read_field 0 125 13
[  187.205326] imx-ipuv3 240.ipu: FW 1279,
[  187.205337] ipu_ch_param_read_field 0 138 12
[  187.205350] imx-ipuv3 240.ipu: FH 719,
[  187.205361] ipu_ch_param_read_field 1 0 29
[  187.205374] imx-ipuv3 240.ipu: EBA0 0x4f30
[  187.205385] ipu_ch_param_read_field 1 29 29
[  187.205398] imx-ipuv3 240.ipu: EBA1 0x4f50
[  187.205409] ipu_ch_param_read_field 1 102 14
[  187.205422] imx-ipuv3 240.ipu: Stride 2559
[  187.205433] ipu_ch_param_read_field 0 113 1
[  187.205445] imx-ipuv3 240.ipu: scan_order 0
[  187.205456] ipu_ch_param_read_field 1 128 14
[  187.205469] imx-ipuv3 240.ipu: uv_stride 0
[  187.205480] ipu_ch_param_read_field 0 46 22
[  187.205492] imx-ipuv3 240.ipu: u_offset 0x0
[  187.205541] ipu_ch_param_read_field 0 68 22
[  187.205557] imx-ipuv3 240.ipu: v_offset 0x0
[  187.205568] ipu_ch_param_read_field 1 116 3
[  187.205581] imx-ipuv3 240.ipu: Width0 0+1,
[  187.205592] ipu_ch_param_read_field 1 119 3
[  187.205604] imx-ipuv3 240.ipu: Width1 0+1,
[  187.205615] ipu_ch_param_read_field 1 122 3
[ 

Re: [PATCH 4/4] si2157: Add support for Si2148-A20

2014-11-24 Thread Olli Salonen
Moro Antti,

Allright, possibly there won't be new firmware for the previous
generation 2148/2158 anyway, who knows. Thanks for the reviews!

Cheers,
-olli

On 24 November 2014 at 15:39, Antti Palosaari cr...@iki.fi wrote:
 Moikka!
 I decided apply old crazyCat version, even I originally asked that firmware
 change! If I ever will ran problem with Si2148 / Si2158 firmware difference,
 I know who to blame ;p

 That patch could be dropped.
 PULL request already sent.

 regards
 Antti

 On 11/24/2014 08:57 AM, Olli Salonen wrote:

 The Silicon Labs Si2148 tuner works as the Si2158, but does not contain
 analog tuner. A firmware is required for the tuner. Currently the Si2158-A20
 firmware will work for Si2148-A20 as well, but as there are no guarantees
 that that will be the case in future, a unique file name is used for the
 firmware.

 The datasheet is available on manufacturer's website:
 http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2148-short.pdf

 Signed-off-by: Olli Salonen olli.salo...@iki.fi


 --
 http://palosaari.fi/
--
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 for v3.18] media: use sg = sg_next(sg) instead of sg++

2014-11-24 Thread Mauro Carvalho Chehab
Em Fri, 21 Nov 2014 10:20:56 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 Several drivers (mostly copy-and-paste) still used sg++ instead of
 sg = sg_next(sg). Fix them since sg++ won't work if contiguous scatter
 entries where combined into one larger entry.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: sta...@vger.kernel.org  # for v3.7 and up
 ---
  drivers/media/pci/bt8xx/bttv-risc.c  | 12 ++--
  drivers/media/pci/cx23885/cx23885-core.c |  6 +++---
  drivers/media/pci/cx25821/cx25821-core.c | 12 ++--
  drivers/media/pci/cx88/cx88-core.c   |  6 +++---
  drivers/media/pci/ivtv/ivtv-udma.c   |  2 +-
  5 files changed, 19 insertions(+), 19 deletions(-)
 
 diff --git a/drivers/media/pci/bt8xx/bttv-risc.c 
 b/drivers/media/pci/bt8xx/bttv-risc.c
 index 82cc47d..4d3f05a 100644
 --- a/drivers/media/pci/bt8xx/bttv-risc.c
 +++ b/drivers/media/pci/bt8xx/bttv-risc.c
 @@ -84,7 +84,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
 *risc,
   continue;
   while (offset  offset = sg_dma_len(sg)) {
   offset -= sg_dma_len(sg);
 - sg++;
 + sg = sg_next(sg);
   }
   if (bpl = sg_dma_len(sg)-offset) {
   /* fits into current chunk */
 @@ -100,13 +100,13 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
 *risc,
   *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
   todo -= (sg_dma_len(sg)-offset);
   offset = 0;
 - sg++;
 + sg = sg_next(sg);
   while (todo  sg_dma_len(sg)) {
   *(rp++)=cpu_to_le32(BT848_RISC_WRITE|
   sg_dma_len(sg));
   *(rp++)=cpu_to_le32(sg_dma_address(sg));
   todo -= sg_dma_len(sg);
 - sg++;
 + sg = sg_next(sg);
   }
   *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|
   todo);
 @@ -187,15 +187,15 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem 
 *risc,
   /* go to next sg entry if needed */
   while (yoffset  yoffset = sg_dma_len(ysg)) {
   yoffset -= sg_dma_len(ysg);
 - ysg++;
 + ysg = sg_next(ysg);
   }
   while (uoffset  uoffset = sg_dma_len(usg)) {
   uoffset -= sg_dma_len(usg);
 - usg++;
 + usg = sg_next(usg);
   }
   while (voffset  voffset = sg_dma_len(vsg)) {
   voffset -= sg_dma_len(vsg);
 - vsg++;
 + vsg = sg_next(vsg);
   }
  
   /* calculate max number of bytes we can write */
 diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
 b/drivers/media/pci/cx23885/cx23885-core.c
 index 331edda..3bd386c 100644
 --- a/drivers/media/pci/cx23885/cx23885-core.c
 +++ b/drivers/media/pci/cx23885/cx23885-core.c
 @@ -1078,7 +1078,7 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
 scatterlist *sglist,
   for (line = 0; line  lines; line++) {
   while (offset  offset = sg_dma_len(sg)) {
   offset -= sg_dma_len(sg);
 - sg++;
 + sg = sg_next(sg);
   }
  
   if (lpi  line  0  !(line % lpi))
 @@ -1101,14 +1101,14 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
 scatterlist *sglist,
   *(rp++) = cpu_to_le32(0); /* bits 63-32 */
   todo -= (sg_dma_len(sg)-offset);
   offset = 0;
 - sg++;
 + sg = sg_next(sg);
   while (todo  sg_dma_len(sg)) {
   *(rp++) = cpu_to_le32(RISC_WRITE|
   sg_dma_len(sg));
   *(rp++) = cpu_to_le32(sg_dma_address(sg));
   *(rp++) = cpu_to_le32(0); /* bits 63-32 */
   todo -= sg_dma_len(sg);
 - sg++;
 + sg = sg_next(sg);
   }
   *(rp++) = cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
   *(rp++) = cpu_to_le32(sg_dma_address(sg));
 diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
 b/drivers/media/pci/cx25821/cx25821-core.c
 index e81173c..389fffd 100644
 --- a/drivers/media/pci/cx25821/cx25821-core.c
 +++ b/drivers/media/pci/cx25821/cx25821-core.c
 @@ -996,7 +996,7 @@ static __le32 

Re: [PATCH for v3.18] media: use sg = sg_next(sg) instead of sg++

2014-11-24 Thread Hans Verkuil
On 11/24/2014 07:24 PM, Mauro Carvalho Chehab wrote:
 Em Fri, 21 Nov 2014 10:20:56 +0100
 Hans Verkuil hverk...@xs4all.nl escreveu:
 
 Several drivers (mostly copy-and-paste) still used sg++ instead of
 sg = sg_next(sg). Fix them since sg++ won't work if contiguous scatter
 entries where combined into one larger entry.

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: sta...@vger.kernel.org  # for v3.7 and up
 ---
  drivers/media/pci/bt8xx/bttv-risc.c  | 12 ++--
  drivers/media/pci/cx23885/cx23885-core.c |  6 +++---
  drivers/media/pci/cx25821/cx25821-core.c | 12 ++--
  drivers/media/pci/cx88/cx88-core.c   |  6 +++---
  drivers/media/pci/ivtv/ivtv-udma.c   |  2 +-
  5 files changed, 19 insertions(+), 19 deletions(-)

 diff --git a/drivers/media/pci/bt8xx/bttv-risc.c 
 b/drivers/media/pci/bt8xx/bttv-risc.c
 index 82cc47d..4d3f05a 100644
 --- a/drivers/media/pci/bt8xx/bttv-risc.c
 +++ b/drivers/media/pci/bt8xx/bttv-risc.c
 @@ -84,7 +84,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
 *risc,
  continue;
  while (offset  offset = sg_dma_len(sg)) {
  offset -= sg_dma_len(sg);
 -sg++;
 +sg = sg_next(sg);
  }
  if (bpl = sg_dma_len(sg)-offset) {
  /* fits into current chunk */
 @@ -100,13 +100,13 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
 *risc,
  *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
  todo -= (sg_dma_len(sg)-offset);
  offset = 0;
 -sg++;
 +sg = sg_next(sg);
  while (todo  sg_dma_len(sg)) {
  *(rp++)=cpu_to_le32(BT848_RISC_WRITE|
  sg_dma_len(sg));
  *(rp++)=cpu_to_le32(sg_dma_address(sg));
  todo -= sg_dma_len(sg);
 -sg++;
 +sg = sg_next(sg);
  }
  *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|
  todo);
 @@ -187,15 +187,15 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem 
 *risc,
  /* go to next sg entry if needed */
  while (yoffset  yoffset = sg_dma_len(ysg)) {
  yoffset -= sg_dma_len(ysg);
 -ysg++;
 +ysg = sg_next(ysg);
  }
  while (uoffset  uoffset = sg_dma_len(usg)) {
  uoffset -= sg_dma_len(usg);
 -usg++;
 +usg = sg_next(usg);
  }
  while (voffset  voffset = sg_dma_len(vsg)) {
  voffset -= sg_dma_len(vsg);
 -vsg++;
 +vsg = sg_next(vsg);
  }
  
  /* calculate max number of bytes we can write */
 diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
 b/drivers/media/pci/cx23885/cx23885-core.c
 index 331edda..3bd386c 100644
 --- a/drivers/media/pci/cx23885/cx23885-core.c
 +++ b/drivers/media/pci/cx23885/cx23885-core.c
 @@ -1078,7 +1078,7 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
 scatterlist *sglist,
  for (line = 0; line  lines; line++) {
  while (offset  offset = sg_dma_len(sg)) {
  offset -= sg_dma_len(sg);
 -sg++;
 +sg = sg_next(sg);
  }
  
  if (lpi  line  0  !(line % lpi))
 @@ -1101,14 +1101,14 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
 scatterlist *sglist,
  *(rp++) = cpu_to_le32(0); /* bits 63-32 */
  todo -= (sg_dma_len(sg)-offset);
  offset = 0;
 -sg++;
 +sg = sg_next(sg);
  while (todo  sg_dma_len(sg)) {
  *(rp++) = cpu_to_le32(RISC_WRITE|
  sg_dma_len(sg));
  *(rp++) = cpu_to_le32(sg_dma_address(sg));
  *(rp++) = cpu_to_le32(0); /* bits 63-32 */
  todo -= sg_dma_len(sg);
 -sg++;
 +sg = sg_next(sg);
  }
  *(rp++) = cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
  *(rp++) = cpu_to_le32(sg_dma_address(sg));
 diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
 b/drivers/media/pci/cx25821/cx25821-core.c
 index e81173c..389fffd 100644
 --- a/drivers/media/pci/cx25821/cx25821-core.c
 +++ b/drivers/media/pci/cx25821/cx25821-core.c
 @@ -996,7 +996,7 @@ static __le32 

Re: [PATCH for v3.18] media: use sg = sg_next(sg) instead of sg++

2014-11-24 Thread Mauro Carvalho Chehab
Em Mon, 24 Nov 2014 19:37:48 +0100
Hans Verkuil hverk...@xs4all.nl escreveu:

 On 11/24/2014 07:24 PM, Mauro Carvalho Chehab wrote:
  Em Fri, 21 Nov 2014 10:20:56 +0100
  Hans Verkuil hverk...@xs4all.nl escreveu:
  
  Several drivers (mostly copy-and-paste) still used sg++ instead of
  sg = sg_next(sg). Fix them since sg++ won't work if contiguous scatter
  entries where combined into one larger entry.
 
  Signed-off-by: Hans Verkuil hans.verk...@cisco.com
  Cc: sta...@vger.kernel.org  # for v3.7 and up
  ---
   drivers/media/pci/bt8xx/bttv-risc.c  | 12 ++--
   drivers/media/pci/cx23885/cx23885-core.c |  6 +++---
   drivers/media/pci/cx25821/cx25821-core.c | 12 ++--
   drivers/media/pci/cx88/cx88-core.c   |  6 +++---
   drivers/media/pci/ivtv/ivtv-udma.c   |  2 +-
   5 files changed, 19 insertions(+), 19 deletions(-)
 
  diff --git a/drivers/media/pci/bt8xx/bttv-risc.c 
  b/drivers/media/pci/bt8xx/bttv-risc.c
  index 82cc47d..4d3f05a 100644
  --- a/drivers/media/pci/bt8xx/bttv-risc.c
  +++ b/drivers/media/pci/bt8xx/bttv-risc.c
  @@ -84,7 +84,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
  *risc,
 continue;
 while (offset  offset = sg_dma_len(sg)) {
 offset -= sg_dma_len(sg);
  -  sg++;
  +  sg = sg_next(sg);
 }
 if (bpl = sg_dma_len(sg)-offset) {
 /* fits into current chunk */
  @@ -100,13 +100,13 @@ bttv_risc_packed(struct bttv *btv, struct 
  btcx_riscmem *risc,
 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
 todo -= (sg_dma_len(sg)-offset);
 offset = 0;
  -  sg++;
  +  sg = sg_next(sg);
 while (todo  sg_dma_len(sg)) {
 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|
 sg_dma_len(sg));
 *(rp++)=cpu_to_le32(sg_dma_address(sg));
 todo -= sg_dma_len(sg);
  -  sg++;
  +  sg = sg_next(sg);
 }
 *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|
 todo);
  @@ -187,15 +187,15 @@ bttv_risc_planar(struct bttv *btv, struct 
  btcx_riscmem *risc,
 /* go to next sg entry if needed */
 while (yoffset  yoffset = sg_dma_len(ysg)) {
 yoffset -= sg_dma_len(ysg);
  -  ysg++;
  +  ysg = sg_next(ysg);
 }
 while (uoffset  uoffset = sg_dma_len(usg)) {
 uoffset -= sg_dma_len(usg);
  -  usg++;
  +  usg = sg_next(usg);
 }
 while (voffset  voffset = sg_dma_len(vsg)) {
 voffset -= sg_dma_len(vsg);
  -  vsg++;
  +  vsg = sg_next(vsg);
 }
   
 /* calculate max number of bytes we can write */
  diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
  b/drivers/media/pci/cx23885/cx23885-core.c
  index 331edda..3bd386c 100644
  --- a/drivers/media/pci/cx23885/cx23885-core.c
  +++ b/drivers/media/pci/cx23885/cx23885-core.c
  @@ -1078,7 +1078,7 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
  scatterlist *sglist,
 for (line = 0; line  lines; line++) {
 while (offset  offset = sg_dma_len(sg)) {
 offset -= sg_dma_len(sg);
  -  sg++;
  +  sg = sg_next(sg);
 }
   
 if (lpi  line  0  !(line % lpi))
  @@ -1101,14 +1101,14 @@ static __le32 *cx23885_risc_field(__le32 *rp, 
  struct scatterlist *sglist,
 *(rp++) = cpu_to_le32(0); /* bits 63-32 */
 todo -= (sg_dma_len(sg)-offset);
 offset = 0;
  -  sg++;
  +  sg = sg_next(sg);
 while (todo  sg_dma_len(sg)) {
 *(rp++) = cpu_to_le32(RISC_WRITE|
 sg_dma_len(sg));
 *(rp++) = cpu_to_le32(sg_dma_address(sg));
 *(rp++) = cpu_to_le32(0); /* bits 63-32 */
 todo -= sg_dma_len(sg);
  -  sg++;
  +  sg = sg_next(sg);
 }
 *(rp++) = cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
 *(rp++) = cpu_to_le32(sg_dma_address(sg));
  diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
  b/drivers/media/pci/cx25821/cx25821-core.c
  index e81173c..389fffd 100644
  --- a/drivers/media/pci/cx25821/cx25821-core.c
  +++ 

Re: [PATCH for v3.18] media: use sg = sg_next(sg) instead of sg++

2014-11-24 Thread Hans Verkuil
On 11/24/2014 07:51 PM, Mauro Carvalho Chehab wrote:
 Em Mon, 24 Nov 2014 19:37:48 +0100
 Hans Verkuil hverk...@xs4all.nl escreveu:
 
 On 11/24/2014 07:24 PM, Mauro Carvalho Chehab wrote:
 Em Fri, 21 Nov 2014 10:20:56 +0100
 Hans Verkuil hverk...@xs4all.nl escreveu:

 Several drivers (mostly copy-and-paste) still used sg++ instead of
 sg = sg_next(sg). Fix them since sg++ won't work if contiguous scatter
 entries where combined into one larger entry.

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: sta...@vger.kernel.org  # for v3.7 and up
 ---
  drivers/media/pci/bt8xx/bttv-risc.c  | 12 ++--
  drivers/media/pci/cx23885/cx23885-core.c |  6 +++---
  drivers/media/pci/cx25821/cx25821-core.c | 12 ++--
  drivers/media/pci/cx88/cx88-core.c   |  6 +++---
  drivers/media/pci/ivtv/ivtv-udma.c   |  2 +-
  5 files changed, 19 insertions(+), 19 deletions(-)

 diff --git a/drivers/media/pci/bt8xx/bttv-risc.c 
 b/drivers/media/pci/bt8xx/bttv-risc.c
 index 82cc47d..4d3f05a 100644
 --- a/drivers/media/pci/bt8xx/bttv-risc.c
 +++ b/drivers/media/pci/bt8xx/bttv-risc.c
 @@ -84,7 +84,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem 
 *risc,
continue;
while (offset  offset = sg_dma_len(sg)) {
offset -= sg_dma_len(sg);
 -  sg++;
 +  sg = sg_next(sg);
}
if (bpl = sg_dma_len(sg)-offset) {
/* fits into current chunk */
 @@ -100,13 +100,13 @@ bttv_risc_packed(struct bttv *btv, struct 
 btcx_riscmem *risc,
*(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
todo -= (sg_dma_len(sg)-offset);
offset = 0;
 -  sg++;
 +  sg = sg_next(sg);
while (todo  sg_dma_len(sg)) {
*(rp++)=cpu_to_le32(BT848_RISC_WRITE|
sg_dma_len(sg));
*(rp++)=cpu_to_le32(sg_dma_address(sg));
todo -= sg_dma_len(sg);
 -  sg++;
 +  sg = sg_next(sg);
}
*(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|
todo);
 @@ -187,15 +187,15 @@ bttv_risc_planar(struct bttv *btv, struct 
 btcx_riscmem *risc,
/* go to next sg entry if needed */
while (yoffset  yoffset = sg_dma_len(ysg)) {
yoffset -= sg_dma_len(ysg);
 -  ysg++;
 +  ysg = sg_next(ysg);
}
while (uoffset  uoffset = sg_dma_len(usg)) {
uoffset -= sg_dma_len(usg);
 -  usg++;
 +  usg = sg_next(usg);
}
while (voffset  voffset = sg_dma_len(vsg)) {
voffset -= sg_dma_len(vsg);
 -  vsg++;
 +  vsg = sg_next(vsg);
}
  
/* calculate max number of bytes we can write */
 diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
 b/drivers/media/pci/cx23885/cx23885-core.c
 index 331edda..3bd386c 100644
 --- a/drivers/media/pci/cx23885/cx23885-core.c
 +++ b/drivers/media/pci/cx23885/cx23885-core.c
 @@ -1078,7 +1078,7 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct 
 scatterlist *sglist,
for (line = 0; line  lines; line++) {
while (offset  offset = sg_dma_len(sg)) {
offset -= sg_dma_len(sg);
 -  sg++;
 +  sg = sg_next(sg);
}
  
if (lpi  line  0  !(line % lpi))
 @@ -1101,14 +1101,14 @@ static __le32 *cx23885_risc_field(__le32 *rp, 
 struct scatterlist *sglist,
*(rp++) = cpu_to_le32(0); /* bits 63-32 */
todo -= (sg_dma_len(sg)-offset);
offset = 0;
 -  sg++;
 +  sg = sg_next(sg);
while (todo  sg_dma_len(sg)) {
*(rp++) = cpu_to_le32(RISC_WRITE|
sg_dma_len(sg));
*(rp++) = cpu_to_le32(sg_dma_address(sg));
*(rp++) = cpu_to_le32(0); /* bits 63-32 */
todo -= sg_dma_len(sg);
 -  sg++;
 +  sg = sg_next(sg);
}
*(rp++) = cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
*(rp++) = cpu_to_le32(sg_dma_address(sg));
 diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
 b/drivers/media/pci/cx25821/cx25821-core.c
 index e81173c..389fffd 100644
 --- a/drivers/media/pci/cx25821/cx25821-core.c
 +++ b/drivers/media/pci/cx25821/cx25821-core.c
 @@ -996,7 +996,7 @@ static __le32 

[PATCH 1/1] [media] Siano: Deletion of an unnecessary check before the function call rc_unregister_device

2014-11-24 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net
Date: Mon, 24 Nov 2014 22:32:30 +0100

The rc_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring elfr...@users.sourceforge.net
---
 drivers/media/common/siano/smsir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/common/siano/smsir.c 
b/drivers/media/common/siano/smsir.c
index 273043e..35d0e88 100644
--- a/drivers/media/common/siano/smsir.c
+++ b/drivers/media/common/siano/smsir.c
@@ -107,8 +107,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
 
 void sms_ir_exit(struct smscore_device_t *coredev)
 {
-   if (coredev-ir.dev)
-   rc_unregister_device(coredev-ir.dev);
+   rc_unregister_device(coredev-ir.dev);
 
sms_log();
 }
-- 
2.1.3

--
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: [REVIEW PATCH v2.1 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target

2014-11-24 Thread Sakari Ailus
Hi Hans,

On Mon, Nov 24, 2014 at 11:49:01AM +0100, Hans Verkuil wrote:
 On 11/18/14 22:08, Sakari Ailus wrote:
  The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
  sensor's pixel array.
  
  Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
 
 For the whole patch series:
 
 Acked-by: Hans Verkuil hans.verk...@cisco.com
 
 Thanks!
 
 Once this is mainlined, can you update v4l2-ctl so it supports this
 new target?

Sure! I'll do the same to media-ctl.

-- 
Cheers,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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 3/9] clk: sunxi: Add prcm mod0 clock driver

2014-11-24 Thread Maxime Ripard
On Fri, Nov 21, 2014 at 10:13:10AM +0100, Hans de Goede wrote:
 Hi,
 
 On 11/21/2014 09:49 AM, Maxime Ripard wrote:
  Hi,
  
  On Thu, Nov 20, 2014 at 04:55:22PM +0100, Hans de Goede wrote:
  Add a driver for mod0 clocks found in the prcm. Currently there is only
  one mod0 clocks in the prcm, the ir clock.
 
  Signed-off-by: Hans de Goede hdego...@redhat.com
  ---
   Documentation/devicetree/bindings/clock/sunxi.txt |  1 +
   drivers/clk/sunxi/Makefile|  2 +-
   drivers/clk/sunxi/clk-sun6i-prcm-mod0.c   | 63 
  +++
   drivers/mfd/sun6i-prcm.c  | 14 +
   4 files changed, 79 insertions(+), 1 deletion(-)
   create mode 100644 drivers/clk/sunxi/clk-sun6i-prcm-mod0.c
 
  diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt 
  b/Documentation/devicetree/bindings/clock/sunxi.txt
  index ed116df..342c75a 100644
  --- a/Documentation/devicetree/bindings/clock/sunxi.txt
  +++ b/Documentation/devicetree/bindings/clock/sunxi.txt
  @@ -56,6 +56,7 @@ Required properties:
 allwinner,sun4i-a10-usb-clk - for usb gates + resets on A10 / A20
 allwinner,sun5i-a13-usb-clk - for usb gates + resets on A13
 allwinner,sun6i-a31-usb-clk - for usb gates + resets on A31
  +  allwinner,sun6i-a31-ir-clk - for the ir clock on A31
   
   Required properties for all clocks:
   - reg : shall be the control register address for the clock.
  diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
  index 7ddc2b5..daf8b1c 100644
  --- a/drivers/clk/sunxi/Makefile
  +++ b/drivers/clk/sunxi/Makefile
  @@ -10,4 +10,4 @@ obj-y += clk-sun8i-mbus.o
   
   obj-$(CONFIG_MFD_SUN6I_PRCM) += \
 clk-sun6i-ar100.o clk-sun6i-apb0.o clk-sun6i-apb0-gates.o \
  -  clk-sun8i-apb0.o
  +  clk-sun8i-apb0.o clk-sun6i-prcm-mod0.o
  diff --git a/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c 
  b/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c
  new file mode 100644
  index 000..e80f18e
  --- /dev/null
  +++ b/drivers/clk/sunxi/clk-sun6i-prcm-mod0.c
  @@ -0,0 +1,63 @@
  +/*
  + * Allwinner A31 PRCM mod0 clock driver
  + *
  + * Copyright (C) 2014 Hans de Goede hdego...@redhat.com
  + *
  + * 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.
  + */
  +
  +#include linux/clk-provider.h
  +#include linux/clkdev.h
  +#include linux/module.h
  +#include linux/of_address.h
  +#include linux/platform_device.h
  +
  +#include clk-factors.h
  +#include clk-mod0.h
  +
  +static const struct of_device_id sun6i_a31_prcm_mod0_clk_dt_ids[] = {
  +  { .compatible = allwinner,sun6i-a31-ir-clk },
  +  { /* sentinel */ }
  +};
  +
  +static DEFINE_SPINLOCK(sun6i_prcm_mod0_lock);
  +
  +static int sun6i_a31_prcm_mod0_clk_probe(struct platform_device *pdev)
  +{
  +  struct device_node *np = pdev-dev.of_node;
  +  struct resource *r;
  +  void __iomem *reg;
  +
  +  if (!np)
  +  return -ENODEV;
  +
  +  r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  +  reg = devm_ioremap_resource(pdev-dev, r);
  +  if (IS_ERR(reg))
  +  return PTR_ERR(reg);
  +
  +  sunxi_factors_register(np, sun4i_a10_mod0_data,
  + sun6i_prcm_mod0_lock, reg);
  +  return 0;
  +}
  +
  +static struct platform_driver sun6i_a31_prcm_mod0_clk_driver = {
  +  .driver = {
  +  .name = sun6i-a31-prcm-mod0-clk,
  +  .of_match_table = sun6i_a31_prcm_mod0_clk_dt_ids,
  +  },
  +  .probe = sun6i_a31_prcm_mod0_clk_probe,
  +};
  +module_platform_driver(sun6i_a31_prcm_mod0_clk_driver);
  +
  +MODULE_DESCRIPTION(Allwinner A31 PRCM mod0 clock driver);
  +MODULE_AUTHOR(Hans de Goede hdego...@redhat.com);
  +MODULE_LICENSE(GPL);
  
  I don't think this is the right approach, mainly for two reasons: the
  compatible shouldn't change, and you're basically duplicating code
  there.
  
  I understand that you need the new compatible in order to avoid a
  double probing: one by CLK_OF_DECLARE, and one by the usual mechanism,
  and that also implies the second reason.
 
 Not only for that, we need a new compatible also because the mfd framework
 needs a separate compatible per sub-node as that is how it finds nodes
 to attach to the platform devices, so we need a new compatible anyways,
 with your make the mod0 clock driver a platform driver solution we could
 use:

We have a single mod0 clock in there, so no, not really.

Plus, that seems like a bogus limitation from MFD, and it really
shouldn't work that way.

   compatible = allwinner,sun6i-a31-ir-clk, 
 allwinner,sun4i-a10-mod0-clk;
 
 To work 

cron job: media_tree daily build: OK

2014-11-24 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:   Tue Nov 25 04:00:16 CET 2014
git branch: test
git hash:   5937a784c3e5fe8fd1e201f42a2b1ece6c36a6c0
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-35-gc1c3f96
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:3.17-3.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.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.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-i686: OK
linux-3.18-rc1-i686: 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.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16-x86_64: OK
linux-3.17-x86_64: OK
linux-3.18-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.log

Full logs are available here:

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


RFID Mifare 1k chip cards

2014-11-24 Thread Jane
Hello Dear,

It's Inam from Meihe Company in China, www.chinanfccard.com 

We make plastic cardstagsRFID cardcontact chip ic cardswristbandcard inlay 
for 14 years. Especially in Mifare card, it is our best selling and competitive 
product.

If you have any inquiries,welcome to contact me for price comparison first.

Free samples are available.
ThanksBest Regards
Inam

Skype: inam314
Tel;18898763154
Email: i...@mhgyjs.com