[PATCH 1/1] smipcie: SMI pcie bridge driver for DVBSky S950 V3 dvb-s/s2 cards

2014-10-08 Thread Nibble Max
There is a new PCIe bridge chip(from SMI) used in DVBSky V3 seris cards, 
include S950 V3 and S952 V3 cards.
SMI pcie bridge chip is PCIe 1.1 compliant, supports MSI feature.
Main interface blocks:
1>Two DVB transport stream input ports(ts0,ts1).
2>Two I2C master bus(i2c0, i2c1).
3>IR controller.
4>reset pins and other GPIOs.

DVBSky S950 V3 card has a single channel of dvb-s/s2.
1>Frontend: tuner: M88TS2022, demod: M88DS3103
2>PCIe bridge: SMI PCIe
The current driver does not support SMI IR function.

Signed-off-by: Max nibble 
---
 drivers/media/pci/Kconfig   |   1 +
 drivers/media/pci/Makefile  |   3 +-
 drivers/media/pci/smipcie/Kconfig   |  11 +
 drivers/media/pci/smipcie/Makefile  |   3 +
 drivers/media/pci/smipcie/smipcie.c | 943 
 drivers/media/pci/smipcie/smipcie.h | 299 
 6 files changed, 1259 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/Kconfig b/drivers/media/pci/Kconfig
index f8cec8e..218144a 100644
--- a/drivers/media/pci/Kconfig
+++ b/drivers/media/pci/Kconfig
@@ -46,6 +46,7 @@ source "drivers/media/pci/pt3/Kconfig"
 source "drivers/media/pci/mantis/Kconfig"
 source "drivers/media/pci/ngene/Kconfig"
 source "drivers/media/pci/ddbridge/Kconfig"
+source "drivers/media/pci/smipcie/Kconfig"
 endif
 
 endif #MEDIA_PCI_SUPPORT
diff --git a/drivers/media/pci/Makefile b/drivers/media/pci/Makefile
index a12926e..0baf0d2 100644
--- a/drivers/media/pci/Makefile
+++ b/drivers/media/pci/Makefile
@@ -11,7 +11,8 @@ obj-y+=   ttpci/  \
mantis/ \
ngene/  \
ddbridge/   \
-   saa7146/
+   saa7146/\
+   smipcie/
 
 obj-$(CONFIG_VIDEO_IVTV) += ivtv/
 obj-$(CONFIG_VIDEO_ZORAN) += zoran/
diff --git a/drivers/media/pci/smipcie/Kconfig 
b/drivers/media/pci/smipcie/Kconfig
new file mode 100644
index 000..78b76ca
--- /dev/null
+++ b/drivers/media/pci/smipcie/Kconfig
@@ -0,0 +1,11 @@
+config DVB_SMIPCIE
+   tristate "SMI PCIe DVBSky cards"
+   depends on DVB_CORE && PCI && I2C
+   select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT
+   help
+ Support for cards with SMI PCIe bridge:
+ - DVBSky S950 V3
+
+ Say Y or M if you own such a device and want to use it.
+ If unsure say N.
diff --git a/drivers/media/pci/smipcie/Makefile 
b/drivers/media/pci/smipcie/Makefile
new file mode 100644
index 000..20af47a
--- /dev/null
+++ b/drivers/media/pci/smipcie/Makefile
@@ -0,0 +1,3 @@
+obj-$(CONFIG_DVB_SMIPCIE) += smipcie.o
+
+ccflags-y += -Idrivers/media/dvb-core/ -Idrivers/media/dvb-frontends
diff --git a/drivers/media/pci/smipcie/smipcie.c 
b/drivers/media/pci/smipcie/smipcie.c
new file mode 100644
index 000..3522da4
--- /dev/null
+++ b/drivers/media/pci/smipcie/smipcie.c
@@ -0,0 +1,943 @@
+/*
+ * SMI PCIe driver for DVBSky cards.
+ *
+ * Copyright (C) 2014 Max nibble 
+ *
+ *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 "smipcie.h"
+#include "m88ds3103.h"
+#include "m88ts2022.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
+static int smi_hw_init(struct smi_dev *dev)
+{
+   u32 port_mux, port_ctrl, int_stat;
+
+   /* set port mux.*/
+   port_mux = smi_read(MUX_MODE_CTRL);
+   port_mux &= ~(rbPaMSMask);
+   port_mux |= rbPaMSDtvNoGpio;
+   port_mux &= ~(rbPbMSMask);
+   port_mux |= rbPbMSDtvNoGpio;
+   port_mux &= ~(0x0f);
+   port_mux |= 0x5;
+   smi_write(MUX_MODE_CTRL, port_mux);
+
+   /* set DTV register.*/
+   /* Port A */
+   port_ctrl = smi_read(VIDEO_CTRL_STATUS_A);
+   port_ctrl &= ~0x01;
+   smi_write(VIDEO_CTRL_STATUS_A, port_ctrl);
+   port_ctrl = smi_read(MPEG2_CTRL_A);
+   port_ctrl &= ~0x40;
+   port_ctrl |= 0x80;
+   smi_write(MPEG2_CTRL_A, port_ctrl);
+   /* Port B */
+   port_ctrl = smi_read(VIDEO_CTRL_STATUS_B);
+   port_ctrl &= ~0x01;
+   smi_write(VIDEO_CTRL_STATUS_B, port_ctrl);
+   port_ctrl = smi_read(MPEG2_CTRL_B);
+   port_ctrl &= ~0x40;
+   port_ctrl |= 0x80;
+   smi_write(MPEG2_CTRL_B, port_ctrl);
+
+   /* disable and clear interrupt.*/
+   smi_write(MSI_INT_ENA_CLR, ALL_INT);
+   int_stat = smi_read(MSI_INT_STATUS);
+   smi_write(MSI_INT_STATUS_CLR, int_stat);
+
+   /* reset demod.*/
+   smi_clear(PERIPHERAL_CTRL, 0x0303);
+   msleep(50);

[PATCH/RFC 1/1] Add a libv4l plugin for Exynos4 camera

2014-10-08 Thread Jacek Anaszewski
The plugin provides support for the media device on Exynos4 SoC.
Added is also a media device configuration file parser.
The media configuration file is used for conveying information
about media device links that need to be established as well
as V4L2 user control ioctls redirection to a particular
sub-device.

The plugin performs single plane <-> multi plane API conversion,
video pipeline linking and takes care of automatic data format
negotiation for the whole pipeline, after intercepting
VIDIOC_S_FMT or VIDIOC_TRY_FMT ioctls.

Signed-off-by: Jacek Anaszewski 
Acked-by: Kyungmin Park 
Cc: Mauro Carvalho Chehab 
Cc: Hans Verkuil 
---
 configure.ac   |1 +
 lib/Makefile.am|5 +-
 lib/libv4l-exynos4-camera/Makefile.am  |7 +
 .../libv4l-devconfig-parser.h  |  145 ++
 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c  | 2486 
 5 files changed, 2642 insertions(+), 2 deletions(-)
 create mode 100644 lib/libv4l-exynos4-camera/Makefile.am
 create mode 100644 lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
 create mode 100644 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c

diff --git a/configure.ac b/configure.ac
index c9b0524..ae653b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@ AC_CONFIG_FILES([Makefile
lib/libdvbv5/Makefile
lib/libv4l2rds/Makefile
lib/libv4l-mplane/Makefile
+   lib/libv4l-exynos4-camera/Makefile
 
utils/Makefile
utils/libv4l2util/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3a0e19c..29455ab 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -3,9 +3,10 @@ SUBDIRS = \
libv4l2 \
libv4l1 \
libv4l2rds \
-   libv4l-mplane
+   libv4l-mplane \
+   libv4l-exynos4-camera
 
 if LINUX_OS
 SUBDIRS += \
libdvbv5
-endif
\ No newline at end of file
+endif
diff --git a/lib/libv4l-exynos4-camera/Makefile.am 
b/lib/libv4l-exynos4-camera/Makefile.am
new file mode 100644
index 000..3552ec8
--- /dev/null
+++ b/lib/libv4l-exynos4-camera/Makefile.am
@@ -0,0 +1,7 @@
+if WITH_V4L_PLUGINS
+libv4l2plugin_LTLIBRARIES = libv4l-exynos4-camera.la
+endif
+
+libv4l_exynos4_camera_la_SOURCES = libv4l-exynos4-camera.c
+libv4l_exynos4_camera_la_CPPFLAGS = -fvisibility=hidden -std=gnu99
+libv4l_exynos4_camera_la_LDFLAGS = -avoid-version -module -shared 
-export-dynamic -lpthread
diff --git a/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h 
b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
new file mode 100644
index 000..c56a469
--- /dev/null
+++ b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
@@ -0,0 +1,145 @@
+/*
+ * Parser of media device configuration file.
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Author: Jacek Anaszewski 
+ *
+ * The configuration file has to comply with following format:
+ *
+ * Link description entry format:
+ *
+ * link {
+ * source_entity: 
+ * source_pad: 
+ * sink_entity: 
+ * sink_pad: 
+ * }
+ *
+ * The V4L2 control group format:
+ *
+ * v4l2-controls {
+ * : 
+ * : 
+ * ...
+ * : 
+ * }
+ *
+ * Example:
+ *
+ * link {
+ * source_entity: s5p-mipi-csis.0
+ * source_pad: 1
+ * sink_entity: FIMC.0
+ * sink_pad: 0
+ * }
+ *
+ * v4l2-controls {
+ * Color Effects: S5C73M3
+ * Saturation: S5C73M3
+ * }
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
+ * Lesser General Public License for more details.
+ */
+
+#ifndef LIBV4L_DEVCONFIG_PARSER_H
+   #define LIBV4L_DEVCONFIG_PARSER_H
+
+#include 
+
+#ifdef DEBUG
+#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)\
+   printf("[%s:%d] [%s] " format " \n", __FILE__, __LINE__, __func__, 
##ARG)
+#else
+#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)
+#endif
+
+#define V4L2_DEVCFG_PARSER_ERR(format, ARG...)\
+   fprintf(stderr, "Libv4l device config parser: "format "\n", ##ARG)
+
+#define V4L2_DEVCFG_PARSER_LOG(format, ARG...)\
+   fprintf(stdout, "Libv4l device config parser: "format "\n", ##ARG)
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+/*
+ * struct libv4l_media_link_conf - media entity link configuration
+ * @source_entity: source entity of the link
+ * @source_pad:source pad id
+ * @sink_entity:   sink entity of the link
+ * @sink_pad:  sink pad id
+ * @next:  pointer to the next data structure in the list
+ */
+struct libv4l_media_link_conf {
+   char *source_entity;
+  

[PATCH 2/3] exynos4-is: Add support for asynchronous sub-devices power on

2014-10-08 Thread Jacek Anaszewski
From: Sylwester Nawrocki 

Schedule sub-devices power up in separate thread to speed up video device
open and to allow some ioctls, like VIDIOC_REQBUFS to be run in parallel.

We synchronize with completion of the power up sequence before starting
streaming on subdevices, as they require to be powered up before being
starting streaming.

Signed-off-by: Sylwester Nawrocki 
Acked-by: Kyungmin Park 
---
 drivers/media/platform/exynos4-is/media-dev.c |   19 +++
 include/media/exynos-fimc.h   |2 ++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/media-dev.c 
b/drivers/media/platform/exynos4-is/media-dev.c
index 344718d..c867c46 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -10,6 +10,7 @@
  * or (at your option) any later version.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -186,6 +187,13 @@ error:
return ret;
 }
 
+static void __fimc_pipeline_power_async(void *data, async_cookie_t cookie)
+{
+   struct fimc_pipeline *p = data;
+
+   WARN_ON(fimc_pipeline_s_power(p, true) < 0);
+}
+
 /**
  * __fimc_pipeline_open - update the pipeline information, enable power
  *of all pipeline subdevs and the sensor clock
@@ -219,14 +227,13 @@ static int __fimc_pipeline_open(struct 
exynos_media_pipeline *ep,
return ret;
}
 
-   ret = fimc_pipeline_s_power(p, 1);
-   if (!ret)
-   return 0;
+   async_schedule_domain(__fimc_pipeline_power_async, p,
+   &ep->async_domain);
 
if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP])
clk_disable_unprepare(fmd->wbclk[CLK_IDX_WB_B]);
 
-   return ret;
+   return 0;
 }
 
 /**
@@ -275,6 +282,9 @@ static int __fimc_pipeline_s_stream(struct 
exynos_media_pipeline *ep, bool on)
if (p->subdevs[IDX_SENSOR] == NULL)
return -ENODEV;
 
+   /* Wait until all devices in the chain are powered up */
+   async_synchronize_full_domain(&ep->async_domain);
+
for (i = 0; i < IDX_MAX; i++) {
unsigned int idx = seq[on][i];
 
@@ -309,6 +319,7 @@ static struct exynos_media_pipeline 
*fimc_md_pipeline_create(
return NULL;
 
list_add_tail(&p->list, &fmd->pipelines);
+   async_domain_init_exclusive(&p->ep.async_domain);
 
p->ep.ops = &fimc_pipeline_ops;
return &p->ep;
diff --git a/include/media/exynos-fimc.h b/include/media/exynos-fimc.h
index aa44660..ed779de 100644
--- a/include/media/exynos-fimc.h
+++ b/include/media/exynos-fimc.h
@@ -12,6 +12,7 @@
 #ifndef S5P_FIMC_H_
 #define S5P_FIMC_H_
 
+#include 
 #include 
 #include 
 #include 
@@ -146,6 +147,7 @@ struct exynos_video_entity {
 struct exynos_media_pipeline {
struct media_pipeline mp;
const struct exynos_media_pipeline_ops *ops;
+   struct async_domain async_domain;
 };
 
 static inline struct exynos_video_entity *vdev_to_exynos_video_entity(
-- 
1.7.9.5

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


[PATCH/RFC 0/1] Libv4l: Add a plugin for the Exynos4 camera

2014-10-08 Thread Jacek Anaszewski
This patch adds a plugin for the Exynos4 camera. I wanted to split
at least the parser part to the separate module but encountered
some problems with autotools configuration and therefore I'd like
to ask for an instruction on how to adjust the Makefile.am files
to achieve this.
I also think that the helper functions for discovering device topology
and setting the links are reusable and should be put to the separate
module. I'm wondering what would be the most suitable place.

The plugin was tested on linux-next-20130927 with patches for
exynos4-is that fix failing open when a sensor sub-device is not
linked. This patch series is being submitted in the separate
thread.

The plugin expects a configuration file:
/var/lib/libv4l/exynos4_capture_conf

Exemplary configuration file:

>>

link {
source_entity: s5p-mipi-csis.0
source_pad: 1
sink_entity: FIMC.0
sink_pad: 0
}

v4l2-controls {
Color Effects: S5C73M3
Saturation: S5C73M3
}

<<

With this settings the plugin can be tested on the exynos4412-trats2 board
using following gstreamer pipeline:

gst-launch-0.10 v4l2src device=/dev/video1 ! 
video/x-raw-rgb,width=960,height=720,format=\(fourcc\)RGBP ! ffmpegcolorspace ! 
fbdevsink

In order to avoid fbdevsink element failure the fix [1]
for exynos-drm driver is required.

ffmpegcolorspace element shouldn't be normally required but format
negotiation error is reported by gstreamer without it.
I am investigating the issue.

Thanks,
Jacek Anaszewski

[1] http://www.spinics.net/lists/dri-devel/msg66494.html

Jacek Anaszewski (1):
  Add a libv4l plugin for Exynos4 camera

 configure.ac   |1 +
 lib/Makefile.am|5 +-
 lib/libv4l-exynos4-camera/Makefile.am  |7 +
 .../libv4l-devconfig-parser.h  |  145 ++
 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c  | 2486 
 5 files changed, 2642 insertions(+), 2 deletions(-)
 create mode 100644 lib/libv4l-exynos4-camera/Makefile.am
 create mode 100644 lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
 create mode 100644 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c

-- 
1.7.9.5

--
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/3] exynos4-is: Open shouldn't fail when sensor entity is not linked

2014-10-08 Thread Jacek Anaszewski
In order to allow for automatic media device entities linking
from the level of libv4l plugin the open system call shouldn't
fail, as the libv4l plugins can begin their job not until it
succeeds.
This patch allows for leaving the  pipeline not linked on
open and postpones verifying it to the moment when streamon
callback is called.

Signed-off-by: Jacek Anaszewski 
Acked-by: Kyungmin Park 
---
 drivers/media/platform/exynos4-is/media-dev.c |   45 ++---
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/media-dev.c 
b/drivers/media/platform/exynos4-is/media-dev.c
index c867c46..3732663 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -217,7 +217,7 @@ static int __fimc_pipeline_open(struct 
exynos_media_pipeline *ep,
fimc_pipeline_prepare(p, me);
 
sd = p->subdevs[IDX_SENSOR];
-   if (sd == NULL)
+   if (sd == NULL && !fmd->user_subdev_api)
return -EINVAL;
 
/* Disable PXLASYNC clock if this pipeline includes FIMC-IS */
@@ -277,10 +277,46 @@ static int __fimc_pipeline_s_stream(struct 
exynos_media_pipeline *ep, bool on)
{ IDX_CSIS, IDX_FLITE, IDX_FIMC, IDX_SENSOR, IDX_IS_ISP },
};
struct fimc_pipeline *p = to_fimc_pipeline(ep);
-   int i, ret = 0;
+   struct fimc_md *fmd = 
entity_to_fimc_mdev(&p->subdevs[IDX_CSIS]->entity);
+   enum fimc_subdev_index sd_id;
+   int i = 0, ret = 0;
 
-   if (p->subdevs[IDX_SENSOR] == NULL)
-   return -ENODEV;
+   /*
+* Sensor might not be discovered upon device open
+* due to not linked pipeline. User space is expected to
+* link the pipeline prior calling VIDIOC_STREAMON ioctl,
+* when in user_subdev_api mode.
+*/
+   while (p->subdevs[IDX_SENSOR] == NULL) {
+   /*
+* Sensor must be already discovered if
+* we are in non user_subdev_api mode.
+*/
+   if (!fmd->user_subdev_api) {
+   return -ENODEV;
+   } else if (i++ == 0) {
+   /* Determine which entity is last in the pipeline */
+   if (p->subdevs[IDX_FIMC])
+   sd_id = IDX_FIMC;
+   else if (p->subdevs[IDX_IS_ISP])
+   sd_id = IDX_IS_ISP;
+   else if (p->subdevs[IDX_FLITE])
+   sd_id = IDX_FLITE;
+   else
+   return -ENODEV;
+
+   ret = __fimc_pipeline_open(ep,
+   &p->subdevs[sd_id]->entity,
+   true);
+   if (ret < 0)
+   return ret;
+
+   if (p->subdevs[IDX_SENSOR] == NULL)
+   return -ENODEV;
+   } else {
+   return -ENODEV;
+   }
+   }
 
/* Wait until all devices in the chain are powered up */
async_synchronize_full_domain(&ep->async_domain);
@@ -293,6 +329,7 @@ static int __fimc_pipeline_s_stream(struct 
exynos_media_pipeline *ep, bool on)
if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV)
goto error;
}
+
return 0;
 error:
for (; i >= 0; i--) {
-- 
1.7.9.5

--
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/3] async: Add async_domain_init_exclusive() helper

2014-10-08 Thread Jacek Anaszewski
From: Sylwester Nawrocki 

Add a helper to allow initialization of struct async_domain at runtime.

Signed-off-by: Sylwester Nawrocki 
Acked-by: Kyungmin Park 
---
 include/linux/async.h |6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/async.h b/include/linux/async.h
index 6b0226b..807e40b 100644
--- a/include/linux/async.h
+++ b/include/linux/async.h
@@ -37,6 +37,12 @@ struct async_domain {
struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), 
\
  .registered = 0 }
 
+static inline void async_domain_init_exclusive(struct async_domain *domain)
+{
+   INIT_LIST_HEAD(&domain->pending);
+   domain->registered = 0;
+}
+
 extern async_cookie_t async_schedule(async_func_t func, void *data);
 extern async_cookie_t async_schedule_domain(async_func_t func, void *data,
struct async_domain *domain);
-- 
1.7.9.5

--
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: Intermittent Logitech C510 problems (with kernel OOPSes)

2014-10-08 Thread Laurent Pinchart
Hi Artem,

On Tuesday 07 October 2014 11:48:48 Artem S. Tashkinov wrote:
> Hi,
> 
> I posted a bug report almost a year ago and since it's got zero
> attention so far I'm writing to this mailing list.

I've CC'ed the linux-media mailing list, as it wasn't in the recipients list 
of your e-mail.

> My problem is that video capturing doesn't work on Logitech C510 webcam
> in some cases.
> 
> Mind that audio input always works.
> 
> Video capturing is guaranteed not to work after I reboot from Windows 7.
> 
> In rare cases it doesn't work when I cold boot straight into Linux.
> 
> When I try to capture - either there's no signal and capturing fails to
> initiate or I get a black screen (a LED on the webcam doesn't turn on in
> both cases).
> 
> If I rmmod ehci_hcd and then modprobe ehci_hcd and uvcvideo, then
> everything starts working again.
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=67551

The kernel log warning message is caused by an issue I'm aware of. I'll try to 
fix it ASAP, but due to attending conferences next week I might get a bit 
delayed.

-- 
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 v2 14/14] [media] s5p-mfc: Don't change the image size to smaller than the request.

2014-10-08 Thread Kamil Debski
Hi,

This patch seems complicated and I do not understand your motives.

Could you explain what is the problem with the current aligning of the
values?
Is this a hardware problem? Which MFC version does it affect?
Is it a software problem? If so, maybe the user space application should
take extra care on what value it passes/receives to try_fmt?

> From: Kiran AVND [mailto:avnd.ki...@samsung.com]
> Sent: Friday, September 26, 2014 6:52 AM
> To: linux-media@vger.kernel.org
> Cc: k.deb...@samsung.com; wuchen...@chromium.org; posc...@chromium.org;
> aru...@samsung.com; i...@chromium.org; prathyus...@samsung.com;
> arun...@samsung.com; ki...@chromium.org
> Subject: [PATCH v2 14/14] [media] s5p-mfc: Don't change the image size
> to smaller than the request.
> 
> From: Wu-Cheng Li 
> 
> Use the requested size as the minimum bound, unless it's less than the
> required hardware minimum. The bound align function will align to the
> closest value but we do not want to adjust below the requested size.

This patch does also change the alignment. This is not mentioned in the
commit
message (!). It was 2, now it enforces 16. Could you justify this?
If I remember correctly having even number was enough for MFC v5 encoder
to work properly.

> Signed-off-by: Wu-Cheng Li 
> Signed-off-by: Kiran AVND 
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c |   13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 407dc63..7b48180 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -1056,6 +1056,7 @@ static int vidioc_try_fmt(struct file *file, void
> *priv, struct v4l2_format *f)
>   struct s5p_mfc_dev *dev = video_drvdata(file);
>   struct s5p_mfc_fmt *fmt;
>   struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
> + u32 min_w, min_h;
> 
>   if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
>   fmt = find_format(f, MFC_FMT_ENC);
> @@ -1090,8 +1091,16 @@ static int vidioc_try_fmt(struct file *file,
> void *priv, struct v4l2_format *f)
>   return -EINVAL;
>   }
> 
> - v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1,
> - &pix_fmt_mp->height, 4, 1080, 1, 0);
> + /*
> +  * Use the requested size as the minimum bound, unless it's
> less
> +  * than the required hardware minimum. The bound align
> function
> +  * will align to the closest value but we do not want to
> adjust
> +  * below the requested size.

Other drivers use v4l2_bound_align and user space apps can cope with
the driver returning a value that is below the requested value.

> +  */
> + min_w = min(max(16u, pix_fmt_mp->width), 1920u);
> + min_h = min(max(16u, pix_fmt_mp->height), 1088u);
> + v4l_bound_align_image(&pix_fmt_mp->width, min_w, 1920, 4,
> + &pix_fmt_mp->height, min_h, 1088, 4, 0);
>   } else {
>   mfc_err("invalid buf type\n");
>   return -EINVAL;
> --
> 1.7.9.5


Best wishes,
-- 
Kamil Debski
Samsung R&D Institute Poland

--
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 v2 07/14] [media] s5p-mfc: Don't crash the kernel if the watchdog kicks in.

2014-10-08 Thread Kamil Debski
Hi,

This patch does not apply to the current media tree.

commit cf3167cf1e969b17671a4d3d956d22718a8ceb85)
Author: Antti Palosaari 
Date:   Fri Sep 26 22:45:36 2014 -0300

[media] pt3: fix DTV FE I2C driver load error paths

Best wishes,
-- 
Kamil Debski
Samsung R&D Institute Poland


> -Original Message-
> From: Kiran AVND [mailto:avnd.ki...@samsung.com]
> Sent: Friday, September 26, 2014 6:52 AM
> To: linux-media@vger.kernel.org
> Cc: k.deb...@samsung.com; wuchen...@chromium.org; posc...@chromium.org;
> aru...@samsung.com; i...@chromium.org; prathyus...@samsung.com;
> arun...@samsung.com; ki...@chromium.org
> Subject: [PATCH v2 07/14] [media] s5p-mfc: Don't crash the kernel if
> the watchdog kicks in.
> 
> From: Pawel Osciak 
> 
> If the software watchdog kicks in, the watchdog worker is not
> synchronized with hardware interrupts and does not block other
> instances. It's possible for it to clear the hw_lock, making other
> instances trigger a BUG() on hw_lock checks. Since it's not fatal to
> clear the hw_lock to zero twice, just WARN in those cases for now. We
> should not explode, as firmware will return errors as needed for other
> instances after it's reloaded, or they will time out.
> 
> A clean fix should involve killing other instances when watchdog kicks
> in, but requires a major redesign of locking in the driver.
> 
> Signed-off-by: Pawel Osciak 
> Signed-off-by: Kiran AVND 
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc.c |   25 +++---
> ---
>  1 file changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 3fc2f8a..8d5da0c 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -337,8 +337,7 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx
> *ctx,
>   ctx->state = MFCINST_RES_CHANGE_INIT;
>   s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
>   wake_up_ctx(ctx, reason, err);
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   return;
> @@ -410,8 +409,7 @@ leave_handle_frame:
>   clear_work_bit(ctx);
>   s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
>   wake_up_ctx(ctx, reason, err);
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
>   /* if suspending, wake up device and do not try_run again*/
>   if (test_bit(0, &dev->enter_suspend))
> @@ -458,8 +456,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev
> *dev,
>   break;
>   }
>   }
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
>   s5p_mfc_clock_off();
>   wake_up_dev(dev, reason, err);
> @@ -513,8 +510,7 @@ static void s5p_mfc_handle_seq_done(struct
> s5p_mfc_ctx *ctx,
>   }
>   s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
>   clear_work_bit(ctx);
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   wake_up_ctx(ctx, reason, err);
> @@ -552,19 +548,13 @@ static void s5p_mfc_handle_init_buffers(struct
> s5p_mfc_ctx *ctx,
>   } else {
>   ctx->dpb_flush_flag = 0;
>   }
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> -
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
> -
>   wake_up(&ctx->queue);
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   } else {
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> -
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
> -
>   wake_up(&ctx->queue);
>   }
>  }
> @@ -638,8 +628,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv)
>   mfc_err("post_frame_start() failed\n");
>   s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
>   wake_up_ctx(ctx, reason, err);
> - if (test_and_clear_bit(0, &dev->hw_lock) == 0)
> - BUG();
> + WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
>   s5p_mfc_clock_off();
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
> 

RE: [PATCH v2 13/14] [media] s5p-mfc: fix a race in interrupt flags handling

2014-10-08 Thread Kamil Debski
Hi,

This patch does not apply to the current media tree.

commit cf3167cf1e969b17671a4d3d956d22718a8ceb85)
Author: Antti Palosaari 
Date:   Fri Sep 26 22:45:36 2014 -0300

[media] pt3: fix DTV FE I2C driver load error paths

Best wishes,
-- 
Kamil Debski
Samsung R&D Institute Poland

> -Original Message-
> From: Kiran AVND [mailto:avnd.ki...@samsung.com]
> Sent: Friday, September 26, 2014 6:52 AM
> To: linux-media@vger.kernel.org
> Cc: k.deb...@samsung.com; wuchen...@chromium.org; posc...@chromium.org;
> aru...@samsung.com; i...@chromium.org; prathyus...@samsung.com;
> arun...@samsung.com; ki...@chromium.org
> Subject: [PATCH v2 13/14] [media] s5p-mfc: fix a race in interrupt
> flags handling
> 
> From: Pawel Osciak 
> 
> Interrupt result flags have to be cleared before a hardware job is run.
> Otherwise, if they are cleared asynchronously, we may end up clearing
> them after the interrupt for which we wanted to wait has already
> arrived, thus overwriting the job results that we intended to wait for.
> 
> To prevent this, clear the flags only under hw_lock and before running
> a hardware job.
> 
> Signed-off-by: Pawel Osciak 
> Signed-off-by: Kiran AVND 
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c   |2 --
>  drivers/media/platform/s5p-mfc/s5p_mfc_dec.c|3 ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c|1 -
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |   13 ++---
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c |   12 ++--
>  5 files changed, 4 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
> index 565a6ed..ca0a5cd 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
> @@ -468,7 +468,6 @@ int s5p_mfc_open_mfc_inst(struct s5p_mfc_dev *dev,
> struct s5p_mfc_ctx *ctx)
>   }
> 
>   set_work_bit_irqsave(ctx);
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   if (s5p_mfc_wait_for_done_ctx(ctx,
>   S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET, 0)) { @@ -494,7 +493,6
> @@ void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct
> s5p_mfc_ctx *ctx)  {
>   ctx->state = MFCINST_RETURN_INST;
>   set_work_bit_irqsave(ctx);
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   /* Wait until instance is returned or timeout occurred */
>   if (s5p_mfc_wait_for_done_ctx(ctx,
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> index 301d74f..7eef03a 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> @@ -350,7 +350,6 @@ static int vidioc_g_fmt(struct file *file, void
> *priv, struct v4l2_format *f)
>   MFCINST_RES_CHANGE_END)) {
>   /* If the MFC is parsing the header,
>* so wait until it is finished */
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_wait_for_done_ctx(ctx,
> S5P_MFC_R2H_CMD_SEQ_DONE_RET,
>   0);
>   }
> @@ -762,7 +761,6 @@ static int s5p_mfc_dec_g_v_ctrl(struct v4l2_ctrl
> *ctrl)
>   return -EINVAL;
>   }
>   /* Should wait for the header to be parsed */
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_wait_for_done_ctx(ctx,
>   S5P_MFC_R2H_CMD_SEQ_DONE_RET, 0);
>   if (ctx->state >= MFCINST_HEAD_PARSED && @@ -1076,7 +1074,6
> @@ static void s5p_mfc_stop_streaming(struct vb2_queue *q)
>   if (IS_MFCV6_PLUS(dev) && (ctx->state == MFCINST_RUNNING))
> {
>   ctx->state = MFCINST_FLUSH;
>   set_work_bit_irqsave(ctx);
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
>   if (s5p_mfc_wait_for_done_ctx(ctx,
>   S5P_MFC_R2H_CMD_DPB_FLUSH_RET, 0))
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 653f28f..407dc63 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -1679,7 +1679,6 @@ static int s5p_mfc_enc_g_v_ctrl(struct v4l2_ctrl
> *ctrl)
>   return -EINVAL;
>   }
>   /* Should wait for the header to be produced */
> - s5p_mfc_clean_ctx_int_flags(ctx);
>   s5p_mfc_wait_for_done_ctx(ctx,
>   S5P_MFC_R2H_CMD_SEQ_DONE_RET, 0);
>   if (ctx->state >= MFCINST_HEAD_PARSED && diff --git
> a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
> b/drivers/media/platform/s

Re: omap3isp Device Tree support status

2014-10-08 Thread Sakari Ailus
Hi Alaganjar,

On Tue, Oct 07, 2014 at 02:37:37AM +0530, Alaganraj Sandhanam wrote:
> Hi Sakari,
> 
> Thanks for the patches.
> On Monday 29 September 2014 03:43 AM, Sakari Ailus wrote:
> > Hi,
> > 
> > I managed to find some time for debugging my original omap3isp DT support
> > patchset (which includes smiapp DT support as well), and found a few small
> > but important bugs.
> > 
> > The status is now that images can be captured using the Nokia N9 camera, in
> > which the sensor is connected to the CSI-2 interface. Laurent confirmed that
> > the parallel interface worked for him (Beagleboard, mt9p031 sensor on
> > Leopard imaging's li-5m03 board).
> Good news!
> > 
> > These patches (on top of the smiapp patches I recently sent for review which
> > are in much better shape) are still experimental and not ready for review. I
> > continue to clean them up and post them to the list when that is done. For
> > now they can be found here:
> > 
> > http://git.linuxtv.org/cgit.cgi/sailus/media_tree.git/log/?h=rm696-043-dt>
> > 
> I couldn't clone the repo, getting "remote corrupt" error.
> 
> $ git remote -v
> media-sakari  git://linuxtv.org/sailus/media_tree.git (fetch)
> media-sakari  git://linuxtv.org/sailus/media_tree.git (push)
> origingit://linuxtv.org/media_tree.git (fetch)
> origingit://linuxtv.org/media_tree.git (push)
> sakarigit://vihersipuli.retiisi.org.uk/~sailus/linux.git (fetch)
> sakarigit://vihersipuli.retiisi.org.uk/~sailus/linux.git (push)
> 
> $ git fetch media-sakari
> warning: cannot parse SRV response: Message too long
> remote: error: Could not read 5ea878796f0a1d9649fe43a6a09df53d3915c0ef
> remote: fatal: revision walk setup failed
> remote: aborting due to possible repository corruption on the remote side.
> fatal: protocol error: bad pack header

I'm not sure what this could be related. Can you fetch from other trees,
e.g. your origin remote? Do you get the same error from the remote on
vihersipuli, and by using http instead?

-- 
Kind regards,

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


[PATCH 1/4] v4l-utils/libdvbv5: avoid crash when failed to get a channel name

2014-10-08 Thread tskd08
From: Akihiro Tsukada 

Signed-off-by: Akihiro Tsukada 
---
 lib/libdvbv5/dvb-file.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 27d9a63..bcb1762 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -1121,20 +1121,21 @@ static int get_program_and_store(struct 
dvb_v5_fe_parms_priv *parms,
if (rc)
dvb_logerr("Couldn't get frontend props");
}
-   if (!*channel) {
-   r = asprintf(&channel, "%.2fMHz#%d", freq/100., service_id);
-   if (r < 0)
-   dvb_perror("asprintf");
-   if (parms->p.verbose)
-   dvb_log("Storing as: '%s'", channel);
-   }
for (j = 0; j < parms->n_props; j++) {
entry->props[j].cmd = parms->dvb_prop[j].cmd;
entry->props[j].u.data = parms->dvb_prop[j].u.data;
 
-   if (!*channel && entry->props[j].cmd == DTV_FREQUENCY)
+   if ((!channel || !*channel) &&
+   entry->props[j].cmd == DTV_FREQUENCY)
freq = parms->dvb_prop[j].u.data;
}
+   if (!channel || !*channel) {
+   r = asprintf(&channel, "%.2fMHz#%d", freq/100., service_id);
+   if (r < 0)
+   dvb_perror("asprintf");
+   if (parms->p.verbose)
+   dvb_log("Storing as: '%s'", channel);
+   }
entry->n_props = parms->n_props;
entry->channel = channel;
 
-- 
2.1.2

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


[PATCH 0/4] v4l-utils:libdvbv5,dvb: add basic support for ISDB-S

2014-10-08 Thread tskd08
From: Akihiro Tsukada 

This patch series adds tuning and scanning features for ISDB-S.
Other part of the libdvbv5 API may not work for ISDB-S.
At least the charset conversion and the parser for extended
event descriptors do not work now,
as they require some ISDB-S(/T) specific modifications.

Akihiro Tsukada (4):
  v4l-utils/libdvbv5: avoid crash when failed to get a channel name
  v4l-utils/libdvbv5: add support for ISDB-S tuning
  v4l-utils/libdvbv5: add support for ISDB-S scanning
  v4l-utils/dvbv5-scan: add support for ISDB-S scanning

 lib/include/libdvbv5/dvb-scan.h |   2 +
 lib/libdvbv5/dvb-fe.c   |   6 +-
 lib/libdvbv5/dvb-file.c |  32 +++---
 lib/libdvbv5/dvb-sat.c  |  11 
 lib/libdvbv5/dvb-scan.c | 125 +++-
 lib/libdvbv5/parse_string.c |  23 
 utils/dvb/dvb-format-convert.c  |   3 +-
 utils/dvb/dvbv5-scan.c  |  14 +
 8 files changed, 203 insertions(+), 13 deletions(-)

-- 
2.1.2

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


[PATCH 4/4] v4l-utils/dvbv5-scan: add support for ISDB-S scanning

2014-10-08 Thread tskd08
From: Akihiro Tsukada 

Signed-off-by: Akihiro Tsukada 
---
 utils/dvb/dvb-format-convert.c |  3 ++-
 utils/dvb/dvbv5-scan.c | 14 ++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
index 4f0e075..bf37945 100644
--- a/utils/dvb/dvb-format-convert.c
+++ b/utils/dvb/dvb-format-convert.c
@@ -125,7 +125,8 @@ int main(int argc, char **argv)
fprintf(stderr, "ERROR: Please specify a valid output file\n");
missing = 1;
} else if (((args.input_format == FILE_ZAP) ||
-  (args.output_format == FILE_ZAP)) && args.delsys <= 0) {
+  (args.output_format == FILE_ZAP)) &&
+  (args.delsys <= 0 || args.delsys == SYS_ISDBS)) {
fprintf(stderr, "ERROR: Please specify a valid delivery system 
for ZAP format\n");
missing = 1;
}
diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
index cdc82ec..0ef95f3 100644
--- a/utils/dvb/dvbv5-scan.c
+++ b/utils/dvb/dvbv5-scan.c
@@ -251,6 +251,16 @@ static int run_scan(struct arguments *args,
if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
pol = POLARIZATION_OFF;
 
+   if (parms->current_sys == SYS_ISDBS) {
+   uint32_t tsid = 0;
+
+   dvb_store_entry_prop(entry, DTV_POLARIZATION, 
POLARIZATION_R);
+
+   dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
+   if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
+ freq, shift, tsid))
+   continue;
+   } else
if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
freq, pol, shift))
continue;
@@ -258,6 +268,10 @@ static int run_scan(struct arguments *args,
count++;
dvb_log("Scanning frequency #%d %d", count, freq);
 
+   if (!args->lnb_name && entry->lnb &&
+   (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))
+   parms->lnb = 
dvb_sat_get_lnb(dvb_sat_search_lnb(entry->lnb));
+
/*
 * Run the scanning logic
 */
-- 
2.1.2

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


[PATCH 2/4] v4l-utils/libdvbv5: add support for ISDB-S tuning

2014-10-08 Thread tskd08
From: Akihiro Tsukada 

Added LNB support for Japanese satellites.
Currently tested with dvbv5-zap, dvb-fe-tool.

Signed-off-by: Akihiro Tsukada 
---
 lib/libdvbv5/dvb-sat.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index e8df06b..70b1021 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -91,6 +91,13 @@ static const struct dvb_sat_lnb lnb[] = {
.freqrange = {
{ 12200, 12700 }
}
+   }, {
+   .name = "Japan 110BS/CS LNBf",
+   .alias = "110BS",
+   .lowfreq = 10678,
+   .freqrange = {
+   { 11727, 12731 }
+   }
},
 };
 
@@ -304,6 +311,8 @@ static int dvbsat_diseqc_set_input(struct 
dvb_v5_fe_parms_priv *parms,
 */
pol_v = 0;
high_band = 1;
+   if (lnb == &lnb[8])
+   vol_high = 1;
} else {
/* Adjust voltage/tone accordingly */
if (parms->p.sat_number < 2) {
@@ -316,6 +325,8 @@ static int dvbsat_diseqc_set_input(struct 
dvb_v5_fe_parms_priv *parms,
rc = dvb_fe_sec_voltage(&parms->p, 1, vol_high);
if (rc)
return rc;
+   if (parms->p.current_sys == SYS_ISDBS)
+   return 0;
 
if (parms->p.sat_number > 0) {
rc = dvb_fe_sec_tone(&parms->p, SEC_TONE_OFF);
-- 
2.1.2

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


[PATCH 3/4] v4l-utils/libdvbv5: add support for ISDB-S scanning

2014-10-08 Thread tskd08
From: Akihiro Tsukada 

added NIT scan for ISDB-S,
fixed wrong/too-close frequency of the scanned entries,
when freq_offset/bandwith was not set properly.

ISDB-S/T specific charset conversion is separeted off
as an iconv module, and not implemented in this lib.

Signed-off-by: Akihiro Tsukada 
---
 lib/include/libdvbv5/dvb-scan.h |   2 +
 lib/libdvbv5/dvb-fe.c   |   6 +-
 lib/libdvbv5/dvb-file.c |  21 +--
 lib/libdvbv5/dvb-scan.c | 125 +++-
 lib/libdvbv5/parse_string.c |  23 
 5 files changed, 170 insertions(+), 7 deletions(-)

diff --git a/lib/include/libdvbv5/dvb-scan.h b/lib/include/libdvbv5/dvb-scan.h
index fe50687..e3a0d24 100644
--- a/lib/include/libdvbv5/dvb-scan.h
+++ b/lib/include/libdvbv5/dvb-scan.h
@@ -387,6 +387,8 @@ int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms);
 
 int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry 
*last_entry,
   uint32_t freq, enum dvb_sat_polarization pol, int 
shift);
+int dvb_new_ts_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry,
+  uint32_t freq, int shift, uint32_t ts_id);
 
 struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms,
 struct dvb_entry *first_entry,
diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index f535311..93c0b9b 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -372,6 +372,8 @@ int dvb_set_sys(struct dvb_v5_fe_parms *p, 
fe_delivery_system_t sys)
parms->p.current_sys = sys;
parms->n_props = rc;
 
+   if (sys == SYS_ISDBS /* || sys == SYS_ISDBT */)
+   parms->p.default_charset = "arib-std-b24";
return 0;
 }
 
@@ -683,8 +685,10 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *p)
dvb_logdbg("LNA is %s", parms->p.lna ? "ON" : "OFF");
}
 
-   if (dvb_fe_is_satellite(tmp_parms.p.current_sys))
+   if (dvb_fe_is_satellite(tmp_parms.p.current_sys)) {
dvb_sat_set_parms(&tmp_parms.p);
+   parms->freq_offset = tmp_parms.freq_offset;
+   }
 
/* Filter out any user DTV_foo property such as DTV_POLARIZATION */
tmp_parms.n_props = dvb_copy_fe_props(tmp_parms.dvb_prop,
diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index bcb1762..0a0e41a 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -1125,12 +1125,25 @@ static int get_program_and_store(struct 
dvb_v5_fe_parms_priv *parms,
entry->props[j].cmd = parms->dvb_prop[j].cmd;
entry->props[j].u.data = parms->dvb_prop[j].u.data;
 
-   if ((!channel || !*channel) &&
-   entry->props[j].cmd == DTV_FREQUENCY)
-   freq = parms->dvb_prop[j].u.data;
+   if (entry->props[j].cmd == DTV_STREAM_ID &&
+   entry->props[j].u.data == 0 &&
+   parms->p.current_sys == SYS_ISDBS)
+   entry->props[j].u.data = 
dvb_scan_handler->pat->header.id;
+
+   if (entry->props[j].cmd != DTV_FREQUENCY)
+   continue;
+
+   if (dvb_fe_is_satellite(parms->p.current_sys) &&
+   entry->props[j].u.data < parms->freq_offset)
+   entry->props[j].u.data += parms->freq_offset;
+
+   if (!channel || !*channel)
+   freq = entry->props[j].u.data;
}
if (!channel || !*channel) {
-   r = asprintf(&channel, "%.2fMHz#%d", freq/100., service_id);
+   r = asprintf(&channel, "%.2f%cHz#%d", freq / 100.,
+   dvb_fe_is_satellite(parms->p.current_sys) ? 'G' : 'M',
+   service_id);
if (r < 0)
dvb_perror("asprintf");
if (parms->p.verbose)
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 3b70f5a..470ef61 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -635,7 +635,7 @@ int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *__p)
rolloff = 115;
break;
case SYS_DVBS:
-   case SYS_ISDBS: /* FIXME: not sure if this rollof is right for ISDB-S */
+   case SYS_ISDBS:
divisor = 10;
rolloff = 135;
break;
@@ -672,11 +672,14 @@ int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *__p)
 * purposes of estimating a max frequency shift here.
 */
dvb_fe_retrieve_parm(&parms->p, DTV_SYMBOL_RATE, &symbol_rate);
+   if (parms->p.current_sys == SYS_ISDBS)
+   symbol_rate = 28800;
bw = (symbol_rate * rolloff) / divisor;
}
if (!bw)
dvb_fe_retrieve_parm(&parms->p, DTV_BANDWIDTH_HZ, &bw);
-
+   if (!bw && parms->p.current_sys == SYS_ISDBT)
+

Re: [PATCH/RFC 1/1] Add a libv4l plugin for Exynos4 camera

2014-10-08 Thread Hans de Goede
Hi,

On 10/08/2014 10:46 AM, Jacek Anaszewski wrote:
> The plugin provides support for the media device on Exynos4 SoC.
> Added is also a media device configuration file parser.
> The media configuration file is used for conveying information
> about media device links that need to be established as well
> as V4L2 user control ioctls redirection to a particular
> sub-device.
> 
> The plugin performs single plane <-> multi plane API conversion,
> video pipeline linking and takes care of automatic data format
> negotiation for the whole pipeline, after intercepting
> VIDIOC_S_FMT or VIDIOC_TRY_FMT ioctls.
> 
> Signed-off-by: Jacek Anaszewski 
> Acked-by: Kyungmin Park 
> Cc: Mauro Carvalho Chehab 
> Cc: Hans Verkuil 
> ---
>  configure.ac   |1 +
>  lib/Makefile.am|5 +-
>  lib/libv4l-exynos4-camera/Makefile.am  |7 +
>  .../libv4l-devconfig-parser.h  |  145 ++
>  lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c  | 2486 
> 
>  5 files changed, 2642 insertions(+), 2 deletions(-)
>  create mode 100644 lib/libv4l-exynos4-camera/Makefile.am
>  create mode 100644 lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
>  create mode 100644 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c

Ugh, that is a big plugin. Can you please split out the parser stuff
into a separate file ?

> 
> diff --git a/configure.ac b/configure.ac
> index c9b0524..ae653b9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -17,6 +17,7 @@ AC_CONFIG_FILES([Makefile
>   lib/libdvbv5/Makefile
>   lib/libv4l2rds/Makefile
>   lib/libv4l-mplane/Makefile
> + lib/libv4l-exynos4-camera/Makefile
>  
>   utils/Makefile
>   utils/libv4l2util/Makefile
> diff --git a/lib/Makefile.am b/lib/Makefile.am
> index 3a0e19c..29455ab 100644
> --- a/lib/Makefile.am
> +++ b/lib/Makefile.am
> @@ -3,9 +3,10 @@ SUBDIRS = \
>   libv4l2 \
>   libv4l1 \
>   libv4l2rds \
> - libv4l-mplane
> + libv4l-mplane \
> + libv4l-exynos4-camera
>  
>  if LINUX_OS
>  SUBDIRS += \
>   libdvbv5
> -endif
> \ No newline at end of file
> +endif
> diff --git a/lib/libv4l-exynos4-camera/Makefile.am 
> b/lib/libv4l-exynos4-camera/Makefile.am
> new file mode 100644
> index 000..3552ec8
> --- /dev/null
> +++ b/lib/libv4l-exynos4-camera/Makefile.am
> @@ -0,0 +1,7 @@
> +if WITH_V4L_PLUGINS
> +libv4l2plugin_LTLIBRARIES = libv4l-exynos4-camera.la
> +endif
> +
> +libv4l_exynos4_camera_la_SOURCES = libv4l-exynos4-camera.c
> +libv4l_exynos4_camera_la_CPPFLAGS = -fvisibility=hidden -std=gnu99
> +libv4l_exynos4_camera_la_LDFLAGS = -avoid-version -module -shared 
> -export-dynamic -lpthread
> diff --git a/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h 
> b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
> new file mode 100644
> index 000..c56a469
> --- /dev/null
> +++ b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
> @@ -0,0 +1,145 @@
> +/*
> + * Parser of media device configuration file.
> + *
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
> + *  http://www.samsung.com
> + *
> + * Author: Jacek Anaszewski 
> + *
> + * The configuration file has to comply with following format:
> + *
> + * Link description entry format:
> + *
> + * link {
> + * source_entity: 
> + * source_pad: 
> + * sink_entity: 
> + * sink_pad: 
> + * }
> + *
> + * The V4L2 control group format:
> + *
> + * v4l2-controls {
> + * : 
> + * : 
> + * ...
> + * : 
> + * }
> + *
> + * Example:
> + *
> + * link {
> + * source_entity: s5p-mipi-csis.0
> + * source_pad: 1
> + * sink_entity: FIMC.0
> + * sink_pad: 0
> + * }
> + *
> + * v4l2-controls {
> + * Color Effects: S5C73M3
> + * Saturation: S5C73M3
> + * }
> + *
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published 
> by
> + * the Free Software Foundation; either version 2.1 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
> + * Lesser General Public License for more details.
> + */
> +
> +#ifndef LIBV4L_DEVCONFIG_PARSER_H
> + #define LIBV4L_DEVCONFIG_PARSER_H
> +
> +#include 
> +
> +#ifdef DEBUG
> +#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)\
> + printf("[%s:%d] [%s] " format " \n", __FILE__, __LINE__, __func__, 
> ##ARG)
> +#else
> +#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)
> +#endif
> +
> +#define V4L2_DEVCFG_PARSER_ERR(format, ARG...)\
> + fprintf(stderr, "Libv4l device config parser: "format "\n", ##ARG)
> +
> +#define V4L2_DEVCFG_PARSER_LOG(format, ARG...)\
> + fprintf(stdout, "Libv4l device config parser: "format "\n", ##ARG)
> +
> +#define ARRAY_SIZE(x)

Re: [PATCH/RFC 1/1] Add a libv4l plugin for Exynos4 camera

2014-10-08 Thread Jacek Anaszewski

Hi Hans,

On 10/08/2014 02:42 PM, Hans de Goede wrote:

Hi,

On 10/08/2014 10:46 AM, Jacek Anaszewski wrote:

The plugin provides support for the media device on Exynos4 SoC.
Added is also a media device configuration file parser.
The media configuration file is used for conveying information
about media device links that need to be established as well
as V4L2 user control ioctls redirection to a particular
sub-device.

The plugin performs single plane <-> multi plane API conversion,
video pipeline linking and takes care of automatic data format
negotiation for the whole pipeline, after intercepting
VIDIOC_S_FMT or VIDIOC_TRY_FMT ioctls.

Signed-off-by: Jacek Anaszewski 
Acked-by: Kyungmin Park 
Cc: Mauro Carvalho Chehab 
Cc: Hans Verkuil 
---
  configure.ac   |1 +
  lib/Makefile.am|5 +-
  lib/libv4l-exynos4-camera/Makefile.am  |7 +
  .../libv4l-devconfig-parser.h  |  145 ++
  lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c  | 2486 
  5 files changed, 2642 insertions(+), 2 deletions(-)
  create mode 100644 lib/libv4l-exynos4-camera/Makefile.am
  create mode 100644 lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
  create mode 100644 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c


Ugh, that is a big plugin. Can you please split out the parser stuff
into a separate file ?


Yes, I tried to split it, but spent so much time fighting with
autotools, that I decided to submit it in this form and ask
more experienced v4l-utils build system maintainers for the advice.
I mentioned this in the cover letter.



diff --git a/configure.ac b/configure.ac
index c9b0524..ae653b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@ AC_CONFIG_FILES([Makefile
lib/libdvbv5/Makefile
lib/libv4l2rds/Makefile
lib/libv4l-mplane/Makefile
+   lib/libv4l-exynos4-camera/Makefile

utils/Makefile
utils/libv4l2util/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3a0e19c..29455ab 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -3,9 +3,10 @@ SUBDIRS = \
libv4l2 \
libv4l1 \
libv4l2rds \
-   libv4l-mplane
+   libv4l-mplane \
+   libv4l-exynos4-camera

  if LINUX_OS
  SUBDIRS += \
libdvbv5
-endif
\ No newline at end of file
+endif
diff --git a/lib/libv4l-exynos4-camera/Makefile.am 
b/lib/libv4l-exynos4-camera/Makefile.am
new file mode 100644
index 000..3552ec8
--- /dev/null
+++ b/lib/libv4l-exynos4-camera/Makefile.am
@@ -0,0 +1,7 @@
+if WITH_V4L_PLUGINS
+libv4l2plugin_LTLIBRARIES = libv4l-exynos4-camera.la
+endif
+
+libv4l_exynos4_camera_la_SOURCES = libv4l-exynos4-camera.c
+libv4l_exynos4_camera_la_CPPFLAGS = -fvisibility=hidden -std=gnu99
+libv4l_exynos4_camera_la_LDFLAGS = -avoid-version -module -shared 
-export-dynamic -lpthread
diff --git a/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h 
b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
new file mode 100644
index 000..c56a469
--- /dev/null
+++ b/lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
@@ -0,0 +1,145 @@
+/*
+ * Parser of media device configuration file.
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Author: Jacek Anaszewski 
+ *
+ * The configuration file has to comply with following format:
+ *
+ * Link description entry format:
+ *
+ * link {
+ * source_entity: 
+ * source_pad: 
+ * sink_entity: 
+ * sink_pad: 
+ * }
+ *
+ * The V4L2 control group format:
+ *
+ * v4l2-controls {
+ * : 
+ * : 
+ * ...
+ * : 
+ * }
+ *
+ * Example:
+ *
+ * link {
+ * source_entity: s5p-mipi-csis.0
+ * source_pad: 1
+ * sink_entity: FIMC.0
+ * sink_pad: 0
+ * }
+ *
+ * v4l2-controls {
+ * Color Effects: S5C73M3
+ * Saturation: S5C73M3
+ * }
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
+ * Lesser General Public License for more details.
+ */
+
+#ifndef LIBV4L_DEVCONFIG_PARSER_H
+   #define LIBV4L_DEVCONFIG_PARSER_H
+
+#include 
+
+#ifdef DEBUG
+#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)\
+   printf("[%s:%d] [%s] " format " \n", __FILE__, __LINE__, __func__, 
##ARG)
+#else
+#define V4L2_DEVCFG_PARSER_DBG(format, ARG...)
+#endif
+
+#define V4L2_DEVCFG_PARSER_ERR(format, ARG...)\
+   fprintf(stderr, "Libv4l device config parser: "format "\n", ##ARG)
+
+#define V4L2_DEVCFG_PARSER_LOG(format, ARG...)\
+   fprintf(stdout, "Libv4l device config parser: "format "\n", ##ARG)
+

Re: [PATCH 2/4] v4l-utils/libdvbv5: add support for ISDB-S tuning

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 21:09:39 +0900
tsk...@gmail.com escreveu:

> From: Akihiro Tsukada 
> 
> Added LNB support for Japanese satellites.
> Currently tested with dvbv5-zap, dvb-fe-tool.
> 
> Signed-off-by: Akihiro Tsukada 
> ---
>  lib/libdvbv5/dvb-sat.c | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
> index e8df06b..70b1021 100644
> --- a/lib/libdvbv5/dvb-sat.c
> +++ b/lib/libdvbv5/dvb-sat.c
> @@ -91,6 +91,13 @@ static const struct dvb_sat_lnb lnb[] = {
>   .freqrange = {
>   { 12200, 12700 }
>   }
> + }, {
> + .name = "Japan 110BS/CS LNBf",
> + .alias = "110BS",
> + .lowfreq = 10678,
> + .freqrange = {
> + { 11727, 12731 }
> + }

Hmm... a quick search for 110BS gave me this datasheet:
http://www.sesl-sharp.com/Products/pdf/rf201309_e.pdf

Frequencies there are a little broader. If this datasheet is
right, .freqrange should be:
{ 11710, 12751 }

>   },
>  };
>  
> @@ -304,6 +311,8 @@ static int dvbsat_diseqc_set_input(struct 
> dvb_v5_fe_parms_priv *parms,
>*/
>   pol_v = 0;
>   high_band = 1;
> + if (lnb == &lnb[8])
> + vol_high = 1;

I don't like the idea of using an index here. It would be easy
to have this broken. 

Also, probably the best would be to add another field and/or a libdvbv5
property to indicate the DiSEqC specific stuff as found in Japan.

What kind of DiSEqC switch are you using (if any)?

>   } else {
>   /* Adjust voltage/tone accordingly */
>   if (parms->p.sat_number < 2) {
> @@ -316,6 +325,8 @@ static int dvbsat_diseqc_set_input(struct 
> dvb_v5_fe_parms_priv *parms,
>   rc = dvb_fe_sec_voltage(&parms->p, 1, vol_high);
>   if (rc)
>   return rc;
> + if (parms->p.current_sys == SYS_ISDBS)
> + return 0;

Are you sure that this need is due to ISDB-S, and not due to a
different DiSEqC switch or satellite system arrangement?

>   if (parms->p.sat_number > 0) {
>   rc = dvb_fe_sec_tone(&parms->p, SEC_TONE_OFF);
--
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 v2 14/14] [media] s5p-mfc: Don't change the image size to smaller than the request.

2014-10-08 Thread Nicolas Dufresne


Le 2014-10-08 06:24, Kamil Debski a écrit :

Hi,

This patch seems complicated and I do not understand your motives.

Could you explain what is the problem with the current aligning of the
values?
Is this a hardware problem? Which MFC version does it affect?
Is it a software problem? If so, maybe the user space application should
take extra care on what value it passes/receives to try_fmt?
This looks like something I wanted to bring here as an RFC but never 
manage to get the time. In an Odroid Integration we have started using 
the following simple patch to work around this:


https://github.com/dsd/linux-odroid/commit/c76b38c1d682b9870ea3b00093ad6500a9c5f5f6

The context is that right now we have decided that alignment in s_fmt 
shall be done with a closest rounding. So the format returned may be 
bigger, or smaller, that's basically random. I've been digging through a 
lot, and so far I have found no rational that explains this choice other 
that this felt right.


In real life, whenever the resulting format is smaller then request, 
there is little we can do other then fail or try again blindly other 
sizes. But with bigger raw buffers, we can use zero-copy  cropping 
techniques to keep going. Here's a example:


image_generator -> hw_converter -> display

As hw_converter is a V4L2 M2M, an ideal use case here would be for 
image_generator to use buffers from the hw_converter. For the scenario, 
it is likely that a fixed video size is wanted, but this size is also 
likely not to match HW requirement. If hw_converter decide to give back 
something smaller, there is nothing image_generator can do. It would 
have to try again with random size to find out that best match. It's a 
bit silly to force that on application, as the hw_converter know the 
closest best match, which is simply the next valid bigger size if that 
exist.


hope that helps,
Nicolas
--
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/RFC 1/1] Add a libv4l plugin for Exynos4 camera

2014-10-08 Thread Antonio Ospite
On Wed, 08 Oct 2014 15:22:43 +0200
Jacek Anaszewski  wrote:

> Hi Hans,
> 
> On 10/08/2014 02:42 PM, Hans de Goede wrote:
> > Hi,
> >
> > On 10/08/2014 10:46 AM, Jacek Anaszewski wrote:
> >> The plugin provides support for the media device on Exynos4 SoC.
> >> Added is also a media device configuration file parser.
> >> The media configuration file is used for conveying information
> >> about media device links that need to be established as well
> >> as V4L2 user control ioctls redirection to a particular
> >> sub-device.
> >>
> >> The plugin performs single plane <-> multi plane API conversion,
> >> video pipeline linking and takes care of automatic data format
> >> negotiation for the whole pipeline, after intercepting
> >> VIDIOC_S_FMT or VIDIOC_TRY_FMT ioctls.
> >>
> >> Signed-off-by: Jacek Anaszewski 
> >> Acked-by: Kyungmin Park 
> >> Cc: Mauro Carvalho Chehab 
> >> Cc: Hans Verkuil 
> >> ---
> >>   configure.ac   |1 +
> >>   lib/Makefile.am|5 +-
> >>   lib/libv4l-exynos4-camera/Makefile.am  |7 +
> >>   .../libv4l-devconfig-parser.h  |  145 ++
> >>   lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c  | 2486 
> >> 
> >>   5 files changed, 2642 insertions(+), 2 deletions(-)
> >>   create mode 100644 lib/libv4l-exynos4-camera/Makefile.am
> >>   create mode 100644 lib/libv4l-exynos4-camera/libv4l-devconfig-parser.h
> >>   create mode 100644 lib/libv4l-exynos4-camera/libv4l-exynos4-camera.c
> >
> > Ugh, that is a big plugin. Can you please split out the parser stuff
> > into a separate file ?
> 
> Yes, I tried to split it, but spent so much time fighting with
> autotools, that I decided to submit it in this form and ask
> more experienced v4l-utils build system maintainers for the advice.
> I mentioned this in the cover letter.
> 

What autotools issue in particular?
The following change followed by "automake && ./configure" should be
enough to add a new file libv4l-devconfig-parser.c:

diff --git a/lib/libv4l-exynos4-camera/Makefile.am 
b/lib/libv4l-exynos4-camera/Makefile.am
index 3552ec8..14d461a 100644
--- a/lib/libv4l-exynos4-camera/Makefile.am
+++ b/lib/libv4l-exynos4-camera/Makefile.am
@@ -2,6 +2,6 @@ if WITH_V4L_PLUGINS
 libv4l2plugin_LTLIBRARIES = libv4l-exynos4-camera.la
 endif

-libv4l_exynos4_camera_la_SOURCES = libv4l-exynos4-camera.c
+libv4l_exynos4_camera_la_SOURCES = libv4l-exynos4-camera.c 
libv4l-devconfig-parser.c
 libv4l_exynos4_camera_la_CPPFLAGS = -fvisibility=hidden -std=gnu99
 libv4l_exynos4_camera_la_LDFLAGS = -avoid-version -module -shared 
-export-dynamic -lpthread


If you wanted to completely reset the build environment you could
even use "git clean", FWIW I have this "git distclean" alias in
~/.gitconfig:

[alias]
distclean = clean -f -d -X

You'll need to rerun "autoreconf -i" after such a cleanup.

Ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
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/4] v4l-utils/libdvbv5: add support for ISDB-S scanning

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 21:09:40 +0900
tsk...@gmail.com escreveu:

> From: Akihiro Tsukada 
> 
> added NIT scan for ISDB-S,
> fixed wrong/too-close frequency of the scanned entries,
> when freq_offset/bandwith was not set properly.
> 
> ISDB-S/T specific charset conversion is separeted off
> as an iconv module, and not implemented in this lib.
> 
> Signed-off-by: Akihiro Tsukada 
> ---
>  lib/include/libdvbv5/dvb-scan.h |   2 +
>  lib/libdvbv5/dvb-fe.c   |   6 +-
>  lib/libdvbv5/dvb-file.c |  21 +--
>  lib/libdvbv5/dvb-scan.c | 125 
> +++-
>  lib/libdvbv5/parse_string.c |  23 
>  5 files changed, 170 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/include/libdvbv5/dvb-scan.h b/lib/include/libdvbv5/dvb-scan.h
> index fe50687..e3a0d24 100644
> --- a/lib/include/libdvbv5/dvb-scan.h
> +++ b/lib/include/libdvbv5/dvb-scan.h
> @@ -387,6 +387,8 @@ int dvb_estimate_freq_shift(struct dvb_v5_fe_parms 
> *parms);
>  
>  int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry 
> *last_entry,
>  uint32_t freq, enum dvb_sat_polarization pol, int 
> shift);
> +int dvb_new_ts_is_needed(struct dvb_entry *entry, struct dvb_entry 
> *last_entry,
> +uint32_t freq, int shift, uint32_t ts_id);
>  
>  struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms,
>struct dvb_entry *first_entry,
> diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
> index f535311..93c0b9b 100644
> --- a/lib/libdvbv5/dvb-fe.c
> +++ b/lib/libdvbv5/dvb-fe.c
> @@ -372,6 +372,8 @@ int dvb_set_sys(struct dvb_v5_fe_parms *p, 
> fe_delivery_system_t sys)
>   parms->p.current_sys = sys;
>   parms->n_props = rc;
>  
> + if (sys == SYS_ISDBS /* || sys == SYS_ISDBT */)
> + parms->p.default_charset = "arib-std-b24";

Actually, the best would be to add a Country property at the library
for this kind of adjustment. If you take a look at page 12 of:

http://www.dibeg.org/techp/aribstd/harmonization/090918_Harmonization_volume8_Receivers.pdf

You'll see that the charset definition is different between JP and BR.
Also, there are several other things that are different among the
descriptors used in Japan (ARIB specs) and South America (NBR specs).
I don't doubt that some other Countries will end by deciding to apply
some different definitions.

So, the best is to add a Country field and use it to handle those
differences. We'll need a new parameter at dvbv5 tools to handle the
Country code. Btw, wscan has an interesting logic of guessing it
from the locale vars. We could use something like that at the userspace
tools as a hint (that could, of course, be overriden).

>   return 0;
>  }
>  
> @@ -683,8 +685,10 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *p)
>   dvb_logdbg("LNA is %s", parms->p.lna ? "ON" : "OFF");
>   }
>  
> - if (dvb_fe_is_satellite(tmp_parms.p.current_sys))
> + if (dvb_fe_is_satellite(tmp_parms.p.current_sys)) {
>   dvb_sat_set_parms(&tmp_parms.p);
> + parms->freq_offset = tmp_parms.freq_offset;
> + }
>  
>   /* Filter out any user DTV_foo property such as DTV_POLARIZATION */
>   tmp_parms.n_props = dvb_copy_fe_props(tmp_parms.dvb_prop,
> diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
> index bcb1762..0a0e41a 100644
> --- a/lib/libdvbv5/dvb-file.c
> +++ b/lib/libdvbv5/dvb-file.c
> @@ -1125,12 +1125,25 @@ static int get_program_and_store(struct 
> dvb_v5_fe_parms_priv *parms,
>   entry->props[j].cmd = parms->dvb_prop[j].cmd;
>   entry->props[j].u.data = parms->dvb_prop[j].u.data;
>  
> - if ((!channel || !*channel) &&
> - entry->props[j].cmd == DTV_FREQUENCY)
> - freq = parms->dvb_prop[j].u.data;
> + if (entry->props[j].cmd == DTV_STREAM_ID &&
> + entry->props[j].u.data == 0 &&
> + parms->p.current_sys == SYS_ISDBS)
> + entry->props[j].u.data = 
> dvb_scan_handler->pat->header.id;

Hmm... I don't like very much the idea of having a code here accessing the
pat->header.id, just for ISDB-S.

All the standard-specific issues should have already being solved here.

It probably makes more sense to fill it at dvb-scan.c, while handling the
standard-specifi stuff, for example, at the function
__dvb_add_update_transponders(). It will likely need a parser for
the ISDB-S descriptor too, at least when we start to have some code that
would allow to force the demod to not use the TMCC data.

> +
> + if (entry->props[j].cmd != DTV_FREQUENCY)
> + continue;
> +
> + if (dvb_fe_is_satellite(parms->p.current_sys) &&
> + entry->props[j].u.data < parms->freq_offset)
> + entry->props[j].u.data += parms->freq_offset;
> +
> + if (!channel || !*cha

Re: [PATCH 4/4] v4l-utils/dvbv5-scan: add support for ISDB-S scanning

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 21:09:41 +0900
tsk...@gmail.com escreveu:

> From: Akihiro Tsukada 
> 
> Signed-off-by: Akihiro Tsukada 
> ---
>  utils/dvb/dvb-format-convert.c |  3 ++-
>  utils/dvb/dvbv5-scan.c | 14 ++
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
> index 4f0e075..bf37945 100644
> --- a/utils/dvb/dvb-format-convert.c
> +++ b/utils/dvb/dvb-format-convert.c
> @@ -125,7 +125,8 @@ int main(int argc, char **argv)
>   fprintf(stderr, "ERROR: Please specify a valid output file\n");
>   missing = 1;
>   } else if (((args.input_format == FILE_ZAP) ||
> -(args.output_format == FILE_ZAP)) && args.delsys <= 0) {
> +(args.output_format == FILE_ZAP)) &&
> +(args.delsys <= 0 || args.delsys == SYS_ISDBS)) {
>   fprintf(stderr, "ERROR: Please specify a valid delivery system 
> for ZAP format\n");
>   missing = 1;
>   }
> diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
> index cdc82ec..0ef95f3 100644
> --- a/utils/dvb/dvbv5-scan.c
> +++ b/utils/dvb/dvbv5-scan.c
> @@ -251,6 +251,16 @@ static int run_scan(struct arguments *args,
>   if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
>   pol = POLARIZATION_OFF;
>  
> + if (parms->current_sys == SYS_ISDBS) {
> + uint32_t tsid = 0;
> +
> + dvb_store_entry_prop(entry, DTV_POLARIZATION, 
> POLARIZATION_R);
> +
> + dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
> + if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
> +   freq, shift, tsid))
> + continue;

This is likely needed for DVB-T2 and DVB-S2 too.

> + } else
>   if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
>   freq, pol, shift))

Just coding style:
} else if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
freq, pol, shift))

We use the same coding style here as the one defined at the Kernel.

>   continue;
> @@ -258,6 +268,10 @@ static int run_scan(struct arguments *args,
>   count++;
>   dvb_log("Scanning frequency #%d %d", count, freq);
>  
> + if (!args->lnb_name && entry->lnb &&
> + (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))

Shouldn't it be: !strcasecmp(entry->lnb, parms->lnb->alias)? Or maybe just
remove this test.

> + parms->lnb = 
> dvb_sat_get_lnb(dvb_sat_search_lnb(entry->lnb));
> +
>   /*
>* Run the scanning logic
>*/

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


Re: [PATCH 1/4] v4l-utils/libdvbv5: avoid crash when failed to get a channel name

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 21:09:38 +0900
tsk...@gmail.com escreveu:

> From: Akihiro Tsukada 
> 
> Signed-off-by: Akihiro Tsukada 
> ---
>  lib/libdvbv5/dvb-file.c | 17 +
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
> index 27d9a63..bcb1762 100644
> --- a/lib/libdvbv5/dvb-file.c
> +++ b/lib/libdvbv5/dvb-file.c
> @@ -1121,20 +1121,21 @@ static int get_program_and_store(struct 
> dvb_v5_fe_parms_priv *parms,
>   if (rc)
>   dvb_logerr("Couldn't get frontend props");
>   }
> - if (!*channel) {
> - r = asprintf(&channel, "%.2fMHz#%d", freq/100., service_id);
> - if (r < 0)
> - dvb_perror("asprintf");
> - if (parms->p.verbose)
> - dvb_log("Storing as: '%s'", channel);
> - }

I prefer to keep the code as is and fix the caller that would be passing
a null pointer here, replacing it for an empty channel name.

>   for (j = 0; j < parms->n_props; j++) {
>   entry->props[j].cmd = parms->dvb_prop[j].cmd;
>   entry->props[j].u.data = parms->dvb_prop[j].u.data;
>  
> - if (!*channel && entry->props[j].cmd == DTV_FREQUENCY)
> + if ((!channel || !*channel) &&
> + entry->props[j].cmd == DTV_FREQUENCY)
>   freq = parms->dvb_prop[j].u.data;
>   }
> + if (!channel || !*channel) {
> + r = asprintf(&channel, "%.2fMHz#%d", freq/100., service_id);
> + if (r < 0)
> + dvb_perror("asprintf");
> + if (parms->p.verbose)
> + dvb_log("Storing as: '%s'", channel);
> + }
>   entry->n_props = parms->n_props;
>   entry->channel = channel;
>  
--
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] coda: drop JPEG buffers not framed by SOI and EOI markers

2014-10-08 Thread Philipp Zabel
This patch adds a quick check for valid JPEG frames before feeding them into
the bitstream buffer: Frames that do not begin with the JPEG start of image
marker and end with the end of image marker are dropped.

Signed-off-by: Philipp Zabel 
---
 drivers/media/platform/coda/coda-bit.c  | 10 ++
 drivers/media/platform/coda/coda-jpeg.c | 13 +
 drivers/media/platform/coda/coda.h  |  1 +
 3 files changed, 24 insertions(+)

diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index 0c67cfd..b4029ae 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -231,6 +231,16 @@ void coda_fill_bitstream(struct coda_ctx *ctx)
 
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
 
+   /* Drop frames that do not start/end with a SOI/EOI markers */
+   if (ctx->codec->src_fourcc == V4L2_PIX_FMT_JPEG &&
+   !coda_jpeg_check_buffer(ctx, src_buf)) {
+   v4l2_err(&ctx->dev->v4l2_dev,
+"dropping invalid JPEG frame\n");
+   src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
+   v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_ERROR);
+   continue;
+   }
+
/* Buffer start position */
start = ctx->bitstream_fifo.kfifo.in &
ctx->bitstream_fifo.kfifo.mask;
diff --git a/drivers/media/platform/coda/coda-jpeg.c 
b/drivers/media/platform/coda/coda-jpeg.c
index 967b015..8fa3e35 100644
--- a/drivers/media/platform/coda/coda-jpeg.c
+++ b/drivers/media/platform/coda/coda-jpeg.c
@@ -14,6 +14,9 @@
 
 #include "coda.h"
 
+#define SOI_MARKER 0xffd8
+#define EOI_MARKER 0xffd9
+
 /*
  * Typical Huffman tables for 8-bit precision luminance and
  * chrominance from JPEG ITU-T.81 (ISO/IEC 10918-1) Annex K.3
@@ -174,6 +177,16 @@ int coda_jpeg_write_tables(struct coda_ctx *ctx)
return 0;
 }
 
+bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb)
+{
+   void *vaddr = vb2_plane_vaddr(vb, 0);
+   u16 soi = be16_to_cpup((__be16 *)vaddr);
+   u16 eoi = be16_to_cpup((__be16 *)(vaddr +
+ vb2_get_plane_payload(vb, 0) - 2));
+
+   return soi == SOI_MARKER && eoi == EOI_MARKER;
+}
+
 /*
  * Scale quantization table using nonlinear scaling factor
  * u8 qtab[64], scale [50,190]
diff --git a/drivers/media/platform/coda/coda.h 
b/drivers/media/platform/coda/coda.h
index 8dd81a7..5dd47e5 100644
--- a/drivers/media/platform/coda/coda.h
+++ b/drivers/media/platform/coda/coda.h
@@ -293,6 +293,7 @@ void coda_bit_stream_end_flag(struct coda_ctx *ctx);
 
 int coda_h264_padding(int size, char *p);
 
+bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb);
 int coda_jpeg_write_tables(struct coda_ctx *ctx);
 void coda_set_jpeg_compression_quality(struct coda_ctx *ctx, int quality);
 
-- 
2.1.0

--
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] coda: set bitstream end flag in coda_release

2014-10-08 Thread Philipp Zabel
This should fix CODA crashes due to timeouts when stopping
the decoding process with SIGINT.

Signed-off-by: Philipp Zabel 
---
 drivers/media/platform/coda/coda-common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 151e45b..ffb9944 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1695,6 +1695,9 @@ static int coda_release(struct file *file)
 
debugfs_remove_recursive(ctx->debugfs_entry);
 
+   if (ctx->inst_type == CODA_INST_DECODER)
+   coda_bit_stream_end_flag(ctx);
+
/* If this instance is running, call .job_abort and wait for it to end 
*/
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
-- 
2.1.0

--
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 0/4] v4l-utils:libdvbv5,dvb: add basic support for ISDB-S

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 21:09:37 +0900
tsk...@gmail.com escreveu:

> From: Akihiro Tsukada 
> 
> This patch series adds tuning and scanning features for ISDB-S.
> Other part of the libdvbv5 API may not work for ISDB-S.

Thanks for the patchset! I sent you some comments about them.

> At least the charset conversion and the parser for extended
> event descriptors do not work now,
> as they require some ISDB-S(/T) specific modifications.

Yeah, it will likely require a table just like the one we've added
for EN 300 468 specific charset with the euro sign.

There are some patches for charset decoding like this one:

http://marc.info/?l=mplayer-dev-eng&m=125642040004816

Not sure how hard would be to port one of those things to libdvbv5.

Regards,
Mauro

> 
> Akihiro Tsukada (4):
>   v4l-utils/libdvbv5: avoid crash when failed to get a channel name
>   v4l-utils/libdvbv5: add support for ISDB-S tuning
>   v4l-utils/libdvbv5: add support for ISDB-S scanning
>   v4l-utils/dvbv5-scan: add support for ISDB-S scanning
> 
>  lib/include/libdvbv5/dvb-scan.h |   2 +
>  lib/libdvbv5/dvb-fe.c   |   6 +-
>  lib/libdvbv5/dvb-file.c |  32 +++---
>  lib/libdvbv5/dvb-sat.c  |  11 
>  lib/libdvbv5/dvb-scan.c | 125 
> +++-
>  lib/libdvbv5/parse_string.c |  23 
>  utils/dvb/dvb-format-convert.c  |   3 +-
>  utils/dvb/dvbv5-scan.c  |  14 +
>  8 files changed, 203 insertions(+), 13 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


Re: Tevii S480 on Unicable SCR System

2014-10-08 Thread Ulrich Eckhardt
Hi,

I have digged a little bit deeper in the code and hopefully found a more 
general solution 
by initializing the voltage in dvb_frontend.c in the function 
dvb_register_frontend.
This should be a more global approach which may also fix this type of problems
with other cards. I will test this patch the next days on a different system 
with a 
CineS2 V5.5 card.

Any opinions about this patch or is my first attempt with patching only the code
for the Tevii S480 a better solution?

-
diff -r f62f56c648b0 drivers/media/dvb-core/dvb_frontend.c
--- a/drivers/media/dvb-core/dvb_frontend.c Wed Oct 08 17:30:52 2014 +0200
+++ b/drivers/media/dvb-core/dvb_frontend.c Wed Oct 08 17:40:20 2014 +0200
@@ -2622,6 +2622,14 @@
 fe, DVB_DEVICE_FRONTEND);
 
/*
+* Ensure that frontend voltage is switched off on initialization
+*/
+   if (dvb_powerdown_on_sleep) {
+   if (fe->ops.set_voltage)
+   fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF);
+   }
+
+   /*
 * Initialize the cache to the proper values according with the
 * first supported delivery system (ops->delsys[0])
 */

-

Am 01.10.2014 um 20:42 schrieb Ulrich Eckhardt:
> Hi,
> 
> i have a development computer with a Tevii S480 connected to a Satellite 
> channel
> router (EN50494). As long as I haven't started a video application this
> computers blocks any other receiver connected to this cable. I have measured 
> the
> output of the Tevii card and found, that after start of the computer, the 
> output
> is set to 18V. This is not reset after loading and initializing the drivers. 
> So
> no other receiver could sent DiSEqC commands to the SCR until
> a video application at this computer initializes the voltage correctly. I 
> think
> the voltage needs to be switched off until this card is really in use by an
> application.
> 
> I have patched the file drivers/media/dvb-frontends/ds3000.c to initialize the
> voltage to OFF, which works for me. But I am not sure, if this is really the
> correct solution:
-- 
Ulrich Eckhardt  http://www.uli-eckhardt.de

Ein Blitzableiter auf dem Kirchturm ist das denkbar stärkste 
Misstrauensvotum gegen den lieben Gott. (Karl Krauss)

--
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: linux-next: Tree for Oct 8 (media/usb/gspca)

2014-10-08 Thread Randy Dunlap
On 10/07/14 23:49, Stephen Rothwell wrote:
> Hi all,
> 
> Please do not add any material intended for v3.19 to you linux-next
> included trees until after v3.18-rc1 has been released.
> 
> Changes since 20141007:
> 

I saw these build errors in gspca when CONFIG_INPUT=m but the gspca
sub-drivers are builtin:

drivers/built-in.o: In function `gspca_dev_probe2':
(.text+0x10ef43): undefined reference to `input_allocate_device'
drivers/built-in.o: In function `gspca_dev_probe2':
(.text+0x10efdd): undefined reference to `input_register_device'
drivers/built-in.o: In function `gspca_dev_probe2':
(.text+0x10f002): undefined reference to `input_free_device'
drivers/built-in.o: In function `gspca_dev_probe2':
(.text+0x10f0ac): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `gspca_disconnect':
(.text+0x10f186): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `sd_int_pkt_scan':
se401.c:(.text+0x11373d): undefined reference to `input_event'
se401.c:(.text+0x11374e): undefined reference to `input_event'
drivers/built-in.o: In function `sd_pkt_scan':
t613.c:(.text+0x119f0e): undefined reference to `input_event'
t613.c:(.text+0x119f1f): undefined reference to `input_event'
drivers/built-in.o: In function `sd_stopN':
t613.c:(.text+0x11a047): undefined reference to `input_event'
drivers/built-in.o:t613.c:(.text+0x11a058): more undefined references to 
`input_event' follow

These could be fixed in Kconfig by something like (for each sub-driver that 
tests
CONFIG_INPUT):

depends on INPUT || INPUT=n

Do you have another preference for fixing this?

thanks,
-- 
~Randy
--
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: Tevii S480 on Unicable SCR System

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 18:52:09 +0200
Ulrich Eckhardt  escreveu:

> Hi,
> 
> I have digged a little bit deeper in the code and hopefully found a more 
> general solution 
> by initializing the voltage in dvb_frontend.c in the function 
> dvb_register_frontend.
> This should be a more global approach which may also fix this type of problems
> with other cards. I will test this patch the next days on a different system 
> with a 
> CineS2 V5.5 card.
> 
> Any opinions about this patch or is my first attempt with patching only the 
> code
> for the Tevii S480 a better solution?

You forgot to add your Signed-off-by to your patch...

> -
> diff -r f62f56c648b0 drivers/media/dvb-core/dvb_frontend.c
> --- a/drivers/media/dvb-core/dvb_frontend.c Wed Oct 08 17:30:52 2014 +0200
> +++ b/drivers/media/dvb-core/dvb_frontend.c Wed Oct 08 17:40:20 2014 +0200
> @@ -2622,6 +2622,14 @@
>  fe, DVB_DEVICE_FRONTEND);
>  
> /*
> +* Ensure that frontend voltage is switched off on initialization
> +*/
> +   if (dvb_powerdown_on_sleep) {

I'm wandering why to test if (dvb_powerdown_on_sleep) here...

MODULE_PARM_DESC(dvb_powerdown_on_sleep, "0: do not power down, 1: turn LNB 
voltage off on sleep (default)");

That controls what happens when the frontend's thread stops, and not
what happens during device initialization.

So, IMHO, it doesn't apply here.

> +   if (fe->ops.set_voltage)
> +   fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF);

I actually have different feelings with regards to the above: I don't
think that the core should take care of it, as this is part of device
initialization. I mean: the frontend driver should be the one responsible
to power off the voltage during module initialization.

Adding this to the core will add an uneeded initialization for most
drivers that do it already.

On the other hand, adding it would help to avoid one additional bug
to be handled when the developer forgets to add such voltage off
setting at the driver's init code, and the board is bad enough to
turn voltage on at reset.

My vote is to fix it at the driver's level.

Regards,
Mauro

> +   }
> +
> +   /*
>  * Initialize the cache to the proper values according with the
>  * first supported delivery system (ops->delsys[0])
>  */
> 
> -
> 
> Am 01.10.2014 um 20:42 schrieb Ulrich Eckhardt:
> > Hi,
> > 
> > i have a development computer with a Tevii S480 connected to a Satellite 
> > channel
> > router (EN50494). As long as I haven't started a video application this
> > computers blocks any other receiver connected to this cable. I have 
> > measured the
> > output of the Tevii card and found, that after start of the computer, the 
> > output
> > is set to 18V. This is not reset after loading and initializing the 
> > drivers. So
> > no other receiver could sent DiSEqC commands to the SCR until
> > a video application at this computer initializes the voltage correctly. I 
> > think
> > the voltage needs to be switched off until this card is really in use by an
> > application.
> > 
> > I have patched the file drivers/media/dvb-frontends/ds3000.c to initialize 
> > the
> > voltage to OFF, which works for me. But I am not sure, if this is really the
> > correct solution:
--
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: Tevii S480 on Unicable SCR System

2014-10-08 Thread Ulrich Eckhardt
Am 08.10.2014 um 20:00 schrieb Mauro Carvalho Chehab:
> Em Wed, 08 Oct 2014 18:52:09 +0200
> Ulrich Eckhardt  escreveu:
>>  
>> /*
>> +* Ensure that frontend voltage is switched off on initialization
>> +*/
>> +   if (dvb_powerdown_on_sleep) {
> 
> I'm wandering why to test if (dvb_powerdown_on_sleep) here...
> 
> MODULE_PARM_DESC(dvb_powerdown_on_sleep, "0: do not power down, 1: turn LNB 
> voltage off on sleep (default)");
> 
> That controls what happens when the frontend's thread stops, and not
> what happens during device initialization.
> So, IMHO, it doesn't apply here.

OK, I agree.

> My vote is to fix it at the driver's level.

So if no other opinions turns up the next days and this problem occurs only on 
the Tevii card, I will reformat my patch in my first E-Mail correctly for 
submission. 
 
Best Regards
Uli
-- 
Ulrich Eckhardt  http://www.uli-eckhardt.de

Ein Blitzableiter auf dem Kirchturm ist das denkbar stärkste 
Misstrauensvotum gegen den lieben Gott. (Karl Krauss)
--
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: linux-next: Tree for Oct 8 (media/usb/gspca)

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 10:13:39 -0700
Randy Dunlap  escreveu:

> On 10/07/14 23:49, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Please do not add any material intended for v3.19 to you linux-next
> > included trees until after v3.18-rc1 has been released.
> > 
> > Changes since 20141007:
> > 
> 
> I saw these build errors in gspca when CONFIG_INPUT=m but the gspca
> sub-drivers are builtin:
> 
> drivers/built-in.o: In function `gspca_dev_probe2':
> (.text+0x10ef43): undefined reference to `input_allocate_device'
> drivers/built-in.o: In function `gspca_dev_probe2':
> (.text+0x10efdd): undefined reference to `input_register_device'
> drivers/built-in.o: In function `gspca_dev_probe2':
> (.text+0x10f002): undefined reference to `input_free_device'
> drivers/built-in.o: In function `gspca_dev_probe2':
> (.text+0x10f0ac): undefined reference to `input_unregister_device'
> drivers/built-in.o: In function `gspca_disconnect':
> (.text+0x10f186): undefined reference to `input_unregister_device'
> drivers/built-in.o: In function `sd_int_pkt_scan':
> se401.c:(.text+0x11373d): undefined reference to `input_event'
> se401.c:(.text+0x11374e): undefined reference to `input_event'
> drivers/built-in.o: In function `sd_pkt_scan':
> t613.c:(.text+0x119f0e): undefined reference to `input_event'
> t613.c:(.text+0x119f1f): undefined reference to `input_event'
> drivers/built-in.o: In function `sd_stopN':
> t613.c:(.text+0x11a047): undefined reference to `input_event'
> drivers/built-in.o:t613.c:(.text+0x11a058): more undefined references to 
> `input_event' follow
> 
> These could be fixed in Kconfig by something like (for each sub-driver that 
> tests
> CONFIG_INPUT):
> 
>   depends on INPUT || INPUT=n
> 
> Do you have another preference for fixing this?

Hmm... The code at the gspca subdrivers looks like:

#if IS_ENABLED(CONFIG_INPUT)
if (data[0] & 0x20) {
input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
input_sync(gspca_dev->input_dev);
input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
input_sync(gspca_dev->input_dev);
}
#endif

As we never got any report about such bug, and this is there for a long
time, I suspect that maybe the IS_ENABLED() macro had some changes on
its behavior. So, IMHO, we should first check if something changed there.

>From gpsca's PoV, IMHO, it should be fine to disable the webcam buttons if
the webcam was compiled as builtin and the input subsystem is compiled as 
module. The core feature expected on a camera is to capture streams. 
Buttons are just a plus.

Also, most cams don't even have buttons. The gspca subdriver has support 
for buttons for the few models that have it.

So, IMHO, it should be ok to have GSPCA=y and INPUT=m, provided that 
the buttons will be disabled.

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


Re: linux-next: Tree for Oct 8 (media/usb/gspca)

2014-10-08 Thread Randy Dunlap
On 10/08/14 11:31, Mauro Carvalho Chehab wrote:
> Em Wed, 08 Oct 2014 10:13:39 -0700
> Randy Dunlap  escreveu:
> 
>> On 10/07/14 23:49, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> Please do not add any material intended for v3.19 to you linux-next
>>> included trees until after v3.18-rc1 has been released.
>>>
>>> Changes since 20141007:
>>>
>>
>> I saw these build errors in gspca when CONFIG_INPUT=m but the gspca
>> sub-drivers are builtin:
>>
>> drivers/built-in.o: In function `gspca_dev_probe2':
>> (.text+0x10ef43): undefined reference to `input_allocate_device'
>> drivers/built-in.o: In function `gspca_dev_probe2':
>> (.text+0x10efdd): undefined reference to `input_register_device'
>> drivers/built-in.o: In function `gspca_dev_probe2':
>> (.text+0x10f002): undefined reference to `input_free_device'
>> drivers/built-in.o: In function `gspca_dev_probe2':
>> (.text+0x10f0ac): undefined reference to `input_unregister_device'
>> drivers/built-in.o: In function `gspca_disconnect':
>> (.text+0x10f186): undefined reference to `input_unregister_device'
>> drivers/built-in.o: In function `sd_int_pkt_scan':
>> se401.c:(.text+0x11373d): undefined reference to `input_event'
>> se401.c:(.text+0x11374e): undefined reference to `input_event'
>> drivers/built-in.o: In function `sd_pkt_scan':
>> t613.c:(.text+0x119f0e): undefined reference to `input_event'
>> t613.c:(.text+0x119f1f): undefined reference to `input_event'
>> drivers/built-in.o: In function `sd_stopN':
>> t613.c:(.text+0x11a047): undefined reference to `input_event'
>> drivers/built-in.o:t613.c:(.text+0x11a058): more undefined references to 
>> `input_event' follow
>>
>> These could be fixed in Kconfig by something like (for each sub-driver that 
>> tests
>> CONFIG_INPUT):
>>
>>  depends on INPUT || INPUT=n
>>
>> Do you have another preference for fixing this?
> 
> Hmm... The code at the gspca subdrivers looks like:
> 
> #if IS_ENABLED(CONFIG_INPUT)

For builtin only, that should be

#if IS_BUILTIN(CONFIG_INPUT)

>   if (data[0] & 0x20) {
>   input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
>   input_sync(gspca_dev->input_dev);
>   input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
>   input_sync(gspca_dev->input_dev);
>   }
> #endif
> 
> As we never got any report about such bug, and this is there for a long
> time, I suspect that maybe the IS_ENABLED() macro had some changes on
> its behavior. So, IMHO, we should first check if something changed there.

I don't see any changes in .

> From gpsca's PoV, IMHO, it should be fine to disable the webcam buttons if
> the webcam was compiled as builtin and the input subsystem is compiled as 
> module. The core feature expected on a camera is to capture streams. 
> Buttons are just a plus.
> 
> Also, most cams don't even have buttons. The gspca subdriver has support 
> for buttons for the few models that have it.
> 
> So, IMHO, it should be ok to have GSPCA=y and INPUT=m, provided that 
> the buttons will be disabled.

Then all of the sub-drivers that use IS_ENABLED(CONFIG_INPUT) should be
changed to use IS_BUILTIN(CONFIG_INPUT).

But that is too restrictive IMO.  The input subsystem will work fine when
CONFIG_INPUT=m and the GSPCA drivers are also loadable modules.
That's simple to express in Kconfig language but probly more messy in CPP.


Thanks.


-- 
~Randy
--
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: linux-next: Tree for Oct 8 (media/usb/gspca)

2014-10-08 Thread Mauro Carvalho Chehab
Em Wed, 08 Oct 2014 13:53:33 -0700
Randy Dunlap  escreveu:

> On 10/08/14 11:31, Mauro Carvalho Chehab wrote:
> > Em Wed, 08 Oct 2014 10:13:39 -0700
> > Randy Dunlap  escreveu:
> > 
> >> On 10/07/14 23:49, Stephen Rothwell wrote:
> >>> Hi all,
> >>>
> >>> Please do not add any material intended for v3.19 to you linux-next
> >>> included trees until after v3.18-rc1 has been released.
> >>>
> >>> Changes since 20141007:
> >>>
> >>
> >> I saw these build errors in gspca when CONFIG_INPUT=m but the gspca
> >> sub-drivers are builtin:
> >>
> >> drivers/built-in.o: In function `gspca_dev_probe2':
> >> (.text+0x10ef43): undefined reference to `input_allocate_device'
> >> drivers/built-in.o: In function `gspca_dev_probe2':
> >> (.text+0x10efdd): undefined reference to `input_register_device'
> >> drivers/built-in.o: In function `gspca_dev_probe2':
> >> (.text+0x10f002): undefined reference to `input_free_device'
> >> drivers/built-in.o: In function `gspca_dev_probe2':
> >> (.text+0x10f0ac): undefined reference to `input_unregister_device'
> >> drivers/built-in.o: In function `gspca_disconnect':
> >> (.text+0x10f186): undefined reference to `input_unregister_device'
> >> drivers/built-in.o: In function `sd_int_pkt_scan':
> >> se401.c:(.text+0x11373d): undefined reference to `input_event'
> >> se401.c:(.text+0x11374e): undefined reference to `input_event'
> >> drivers/built-in.o: In function `sd_pkt_scan':
> >> t613.c:(.text+0x119f0e): undefined reference to `input_event'
> >> t613.c:(.text+0x119f1f): undefined reference to `input_event'
> >> drivers/built-in.o: In function `sd_stopN':
> >> t613.c:(.text+0x11a047): undefined reference to `input_event'
> >> drivers/built-in.o:t613.c:(.text+0x11a058): more undefined references to 
> >> `input_event' follow
> >>
> >> These could be fixed in Kconfig by something like (for each sub-driver 
> >> that tests
> >> CONFIG_INPUT):
> >>
> >>depends on INPUT || INPUT=n
> >>
> >> Do you have another preference for fixing this?
> > 
> > Hmm... The code at the gspca subdrivers looks like:
> > 
> > #if IS_ENABLED(CONFIG_INPUT)
> 
> For builtin only, that should be
> 
> #if IS_BUILTIN(CONFIG_INPUT)
> 
> > if (data[0] & 0x20) {
> > input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
> > input_sync(gspca_dev->input_dev);
> > input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
> > input_sync(gspca_dev->input_dev);
> > }
> > #endif
> > 
> > As we never got any report about such bug, and this is there for a long
> > time, I suspect that maybe the IS_ENABLED() macro had some changes on
> > its behavior. So, IMHO, we should first check if something changed there.
> 
> I don't see any changes in .

Perhaps some changes at the Kbuild source code or scripts badly affected it.

> 
> > From gpsca's PoV, IMHO, it should be fine to disable the webcam buttons if
> > the webcam was compiled as builtin and the input subsystem is compiled as 
> > module. The core feature expected on a camera is to capture streams. 
> > Buttons are just a plus.
> > 
> > Also, most cams don't even have buttons. The gspca subdriver has support 
> > for buttons for the few models that have it.
> > 
> > So, IMHO, it should be ok to have GSPCA=y and INPUT=m, provided that 
> > the buttons will be disabled.
> 
> Then all of the sub-drivers that use IS_ENABLED(CONFIG_INPUT) should be
> changed to use IS_BUILTIN(CONFIG_INPUT).
> 
> But that is too restrictive IMO.  The input subsystem will work fine when
> CONFIG_INPUT=m and the GSPCA drivers are also loadable modules.

Agreed.

Maybe the solution would be something more complex like 
(for drivers/media/usb/gspca/zc3xx.c):

#if (IS_BUILTIN(CONFIG_INPUT)) || (IS_ENABLED(CONFIG_INPUT) && 
!IS_BUILTIN(CONFIG_USB_GSPCA_ZC3XX))

Probably the best would be to write another macro that would evaluate
like the above.

> That's simple to express in Kconfig language but probly more messy in CPP.
> 
> 
> Thanks.
> 
> 
--
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


cron job: media_tree daily build: WARNINGS

2014-10-08 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:   Thu Oct  9 04:00:28 CEST 2014
git branch: test
git hash:   cf3167cf1e969b17671a4d3d956d22718a8ceb85
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-20-g7abd8a7
host hardware:  x86_64
host os:3.17-0.slh.1-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: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: OK
linux-3.11.1-i686: WARNINGS
linux-3.12.23-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-i686: OK
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: WARNINGS
linux-3.12.23-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16-x86_64: WARNINGS
linux-3.17-x86_64: WARNINGS
apps: OK
spec-git: OK
sparse: WARNINGS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Thursday.tar.bz2

The Media Infrastructure API from this daily build is here:

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


Re: linux-next: Tree for Oct 8 (media/usb/gspca)

2014-10-08 Thread Paul Bolle
On Wed, 2014-10-08 at 22:50 -0300, Mauro Carvalho Chehab wrote:
> Em Wed, 08 Oct 2014 13:53:33 -0700
> Randy Dunlap  escreveu:
> > On 10/08/14 11:31, Mauro Carvalho Chehab wrote:
> > > From gpsca's PoV, IMHO, it should be fine to disable the webcam buttons if
> > > the webcam was compiled as builtin and the input subsystem is compiled as 
> > > module. The core feature expected on a camera is to capture streams. 
> > > Buttons are just a plus.
> > > 
> > > Also, most cams don't even have buttons. The gspca subdriver has support 
> > > for buttons for the few models that have it.
> > > 
> > > So, IMHO, it should be ok to have GSPCA=y and INPUT=m, provided that 
> > > the buttons will be disabled.
> > 
> > Then all of the sub-drivers that use IS_ENABLED(CONFIG_INPUT) should be
> > changed to use IS_BUILTIN(CONFIG_INPUT).
> > 
> > But that is too restrictive IMO.  The input subsystem will work fine when
> > CONFIG_INPUT=m and the GSPCA drivers are also loadable modules.
> 
> Agreed.
> 
> Maybe the solution would be something more complex like 
> (for drivers/media/usb/gspca/zc3xx.c):
> 
> #if (IS_BUILTIN(CONFIG_INPUT)) || (IS_ENABLED(CONFIG_INPUT) && 
> !IS_BUILTIN(CONFIG_USB_GSPCA_ZC3XX))

The above discussion meanders a bit, and I just stumbled onto it, but
would
#if IS_BUILTIN(CONFIG_INPUT) || (IS_MODULE(CONFIG_INPUT) && defined(MODULE))

cover your requirements when using macros?

> Probably the best would be to write another macro that would evaluate
> like the above.


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