[PATCH v8 0/2] Introduce buffer synchronization framework

2013-08-29 Thread Inki Dae
Hi all,

This patch set introduces a buffer synchronization framework based
on DMA BUF[1] and based on ww-mutexes[2] for lock mechanism, and
has been rebased on linux-next.

The purpose of this framework is to provide not only buffer access
control to CPU and CPU, and CPU and DMA, and DMA and DMA but also
easy-to-use interfaces for device drivers and user application.
In addtion, this patch set suggests a way for enhancing performance.

Changelog v8:
Consider the write-and-then-read ordering pointed out by David Herrmann,
- The ordering issue means that a task don't take a lock to the dmabuf
  so this task would be stalled even though this task requested a lock to
  the dmabuf between other task unlocked and tries to lock the dmabuf
  again. For this, we have added a wait event mechanism using only generic
  APIs, wait_event_timeout and wake_up functions.

  The below is how to handle the ordering issue using this mechanism:
  1. Check if there is a sync object added prior to current task's one.
  2. If exists, it unlocks the dmabuf so that other task can take a lock
 to the dmabuf first.
  3. Wait for the wake up event from other task: current task will be
 waked up when other task unlocks the dmabuf.
  4. Take a lock to the dmabuf again.
- Code cleanups.

Changelog v7:
Fix things pointed out by Konrad Rzeszutek Wilk,
- Use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL.
- Make sure to unlock and unreference all dmabuf objects
  when dmabuf_sync_fini() is called.
- Add more comments.
- Code cleanups.

Changelog v6:
- Fix sync lock to multiple reads.
- Add select system call support.
  . Wake up poll_wait when a dmabuf is unlocked.
- Remove unnecessary the use of mutex lock.
- Add private backend ops callbacks.
  . This ops has one callback for device drivers to clean up their
sync object resource when the sync object is freed. For this,
device drivers should implement the free callback properly.
- Update document file.

Changelog v5:
- Rmove a dependence on reservation_object: the reservation_object is used
  to hook up to ttm and dma-buf for easy sharing of reservations across
  devices. However, the dmabuf sync can be used for all dma devices; v4l2
  and drm based drivers, so doesn't need the reservation_object anymore.
  With regared to this, it adds 'void *sync' to dma_buf structure.
- All patches are rebased on mainline, Linux v3.10.

Changelog v4:
- Add user side interface for buffer synchronization mechanism and update
  descriptions related to the user side interface.

Changelog v3:
- remove cache operation relevant codes and update document file.

Changelog v2:
- use atomic_add_unless to avoid potential bug.
- add a macro for checking valid access type.
- code clean.

For generic user mode interface, we have used fcntl and select system
call[3]. As you know, user application sees a buffer object as a dma-buf
file descriptor. So fcntl() call with the file descriptor means to lock
some buffer region being managed by the dma-buf object. And select() call
means to wait for the completion of CPU or DMA access to the dma-buf
without locking. For more detail, you can refer to the dma-buf-sync.txt
in Documentation/

There are some cases user-space process needs this buffer synchronization
framework. One of which is to primarily enhance GPU rendering performance
in case that 3D app draws somthing in a buffer using CPU, and other process
composes the buffer with its own backbuffer using GPU.

In case of 3D app, the app calls glFlush to submit 3d commands to GPU driver
instead of glFinish for more performance. The reason, we call glFlush, is
that glFinish blocks caller's task until the execution of the 3d commands is
completed. So that makes GPU and CPU more idle. As a result, 3d rendering
performance with glFinish is quite lower than glFlush.

However, the use of glFlush has one issue that the the buffer shared with
GPU could be broken when CPU accesses the buffer just after glFlush because
CPU cannot be aware of the completion of GPU access to the buffer.
Of course, the app can be aware of that time using eglWaitGL but this function
is valid only in case of the same context.

The below summarizes how app's window is displayed on Tizen[4] platform:
1. X client requests a window buffer to Xorg.
2. X client draws something in the window buffer using CPU.
3. X client requests SWAP to Xorg.
4. Xorg notifies a damage event to Composite Manager.
5. Composite Manager gets the window buffer (front buffer) through
   DRI2GetBuffers.
6. Composite Manager composes the window buffer and its own back buffer
   using GPU. At this time, eglSwapBuffers is called: internally, 3d
   commands are flushed to gpu driver.
7. Composite Manager requests SWAP to Xorg.
8. Xorg performs drm page flip. At this time, the window buffer is
   displayed on screen.

Web app based on HTML5 also has the same issue. Web browser and Web app
are different process. The Web app can draw something in its own buffer using
CPU, and 

[PATCH v2 2/2] dma-buf: Add user interfaces for dmabuf sync support

2013-08-29 Thread Inki Dae
This patch adds lock and poll callbacks to dma buf file operations,
and these callbacks will be called by fcntl and select system calls.

fcntl and select system calls can be used to wait for the completion
of DMA or CPU access to a shared dmabuf. The difference of them is
fcntl system call takes a lock after the completion but select system
call doesn't. So in case of fcntl system call, it's useful when a task
wants to access a shared dmabuf without any broken. On the other hand,
it's useful when a task wants to just wait for the completion.

Changelog v2:
- Add select system call support.
  . The purpose of this feature is to wait for the completion of DMA or
CPU access to a dmabuf without that caller locks the dmabuf again
after the completion.
That is useful when caller wants to be aware of the completion of
DMA access to the dmabuf, and the caller doesn't use intefaces for
the DMA device driver.

Signed-off-by: Inki Dae inki@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/base/dma-buf.c |   81 
 1 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index cc42a38..f961907 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -30,6 +30,7 @@
 #include linux/export.h
 #include linux/debugfs.h
 #include linux/seq_file.h
+#include linux/poll.h
 #include linux/dmabuf-sync.h
 
 static inline int is_dma_buf_file(struct file *);
@@ -81,9 +82,89 @@ static int dma_buf_mmap_internal(struct file *file, struct 
vm_area_struct *vma)
return dmabuf-ops-mmap(dmabuf, vma);
 }
 
+static unsigned int dma_buf_poll(struct file *filp,
+   struct poll_table_struct *poll)
+{
+   struct dma_buf *dmabuf;
+   struct dmabuf_sync_reservation *robj;
+   int ret = 0;
+
+   if (!is_dma_buf_file(filp))
+   return POLLERR;
+
+   dmabuf = filp-private_data;
+   if (!dmabuf || !dmabuf-sync)
+   return POLLERR;
+
+   robj = dmabuf-sync;
+
+   mutex_lock(robj-lock);
+
+   robj-polled = true;
+
+   /*
+* CPU or DMA access to this buffer has been completed, and
+* the blocked task has been waked up. Return poll event
+* so that the task can get out of select().
+*/
+   if (robj-poll_event) {
+   robj-poll_event = false;
+   mutex_unlock(robj-lock);
+   return POLLIN | POLLOUT;
+   }
+
+   /*
+* There is no anyone accessing this buffer so just return.
+*/
+   if (!robj-locked) {
+   mutex_unlock(robj-lock);
+   return POLLIN | POLLOUT;
+   }
+
+   poll_wait(filp, robj-poll_wait, poll);
+
+   mutex_unlock(robj-lock);
+
+   return ret;
+}
+
+static int dma_buf_lock(struct file *file, int cmd, struct file_lock *fl)
+{
+   struct dma_buf *dmabuf;
+   unsigned int type;
+   bool wait = false;
+
+   if (!is_dma_buf_file(file))
+   return -EINVAL;
+
+   dmabuf = file-private_data;
+
+   if ((fl-fl_type  F_UNLCK) == F_UNLCK) {
+   dmabuf_sync_single_unlock(dmabuf);
+   return 0;
+   }
+
+   /* convert flock type to dmabuf sync type. */
+   if ((fl-fl_type  F_WRLCK) == F_WRLCK)
+   type = DMA_BUF_ACCESS_W;
+   else if ((fl-fl_type  F_RDLCK) == F_RDLCK)
+   type = DMA_BUF_ACCESS_R;
+   else
+   return -EINVAL;
+
+   if (fl-fl_flags  FL_SLEEP)
+   wait = true;
+
+   /* TODO. the locking to certain region should also be considered. */
+
+   return dmabuf_sync_single_lock(dmabuf, type, wait);
+}
+
 static const struct file_operations dma_buf_fops = {
.release= dma_buf_release,
.mmap   = dma_buf_mmap_internal,
+   .poll   = dma_buf_poll,
+   .lock   = dma_buf_lock,
 };
 
 /*
-- 
1.7.5.4

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


[PATCH v8 1/2] dmabuf-sync: Add a buffer synchronization framework

2013-08-29 Thread Inki Dae
This patch adds a buffer synchronization framework based on DMA BUF[1]
and and based on ww-mutexes[2] for lock mechanism, and has been rebased
on linux-next.

The purpose of this framework is to provide not only buffer access control
to CPU and DMA but also easy-to-use interfaces for device drivers and
user application. This framework can be used for all dma devices using
system memory as dma buffer, especially for most ARM based SoCs.

Changelog v8:
Consider the write-and-then-read ordering pointed out by David Herrmann,
- The ordering issue means that a task don't take a lock to the dmabuf
  so this task would be stalled even though this task requested a lock to
  the dmabuf between other task unlocked and tries to lock the dmabuf
  again. For this, we have added a wait event mechanism using only generic
  APIs, wait_event_timeout and wake_up functions.

  The below is how to handle the ordering issue using this mechanism:
  1. Check if there is a sync object added prior to current task's one.
  2. If exists, it unlocks the dmabuf so that other task can take a lock
 to the dmabuf first.
  3. Wait for the wake up event from other task: current task will be
 waked up when other task unlocks the dmabuf.
  4. Take a lock to the dmabuf again.
- Code cleanups.

Changelog v7:
Fix things pointed out by Konrad Rzeszutek Wilk,
- Use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL.
- make sure to unlock and unreference all dmabuf objects
  when dmabuf_sync_fini() is called.
- Add more comments.
- code cleanups.

Changelog v6:
- Fix sync lock to multiple reads.
- Add select system call support.
  . Wake up poll_wait when a dmabuf is unlocked.
- Remove unnecessary the use of mutex lock.
- Add private backend ops callbacks.
  . This ops has one callback for device drivers to clean up their
sync object resource when the sync object is freed. For this,
device drivers should implement the free callback properly.
- Update document file.

Changelog v5:
- Rmove a dependence on reservation_object: the reservation_object is used
  to hook up to ttm and dma-buf for easy sharing of reservations across
  devices. However, the dmabuf sync can be used for all dma devices; v4l2
  and drm based drivers, so doesn't need the reservation_object anymore.
  With regared to this, it adds 'void *sync' to dma_buf structure.
- All patches are rebased on mainline, Linux v3.10.

Changelog v4:
- Add user side interface for buffer synchronization mechanism and update
  descriptions related to the user side interface.

Changelog v3:
- remove cache operation relevant codes and update document file.

Changelog v2:
- use atomic_add_unless to avoid potential bug.
- add a macro for checking valid access type.
- code clean.

The mechanism of this framework has the following steps,
1. Register dmabufs to a sync object - A task gets a new sync object and
can add one or more dmabufs that the task wants to access.
This registering should be performed when a device context or an event
context such as a page flip event is created or before CPU accesses a shared
buffer.

dma_buf_sync_get(a sync object, a dmabuf);

2. Lock a sync object - A task tries to lock all dmabufs added in its own
sync object. Basically, the lock mechanism uses ww-mutex[1] to avoid dead
lock issue and for race condition between CPU and CPU, CPU and DMA, and DMA
and DMA. Taking a lock means that others cannot access all locked dmabufs
until the task that locked the corresponding dmabufs, unlocks all the locked
dmabufs.
This locking should be performed before DMA or CPU accesses these dmabufs.

dma_buf_sync_lock(a sync object);

3. Unlock a sync object - The task unlocks all dmabufs added in its own sync
object. The unlock means that the DMA or CPU accesses to the dmabufs have
been completed so that others may access them.
This unlocking should be performed after DMA or CPU has completed accesses
to the dmabufs.

dma_buf_sync_unlock(a sync object);

4. Unregister one or all dmabufs from a sync object - A task unregisters
the given dmabufs from the sync object. This means that the task dosen't
want to lock the dmabufs.
The unregistering should be performed after DMA or CPU has completed
accesses to the dmabufs or when dma_buf_sync_lock() is failed.

dma_buf_sync_put(a sync object, a dmabuf);
dma_buf_sync_put_all(a sync object);

The described steps may be summarized as:
get - lock - CPU or DMA access to a buffer/s - unlock - put

This framework includes the following two features.
1. read (shared) and write (exclusive) locks - A task is required to declare
the access type when the task tries to register a dmabuf;
READ, WRITE, READ DMA, or WRITE DMA.

The below is example codes,
struct dmabuf_sync *sync;

sync = dmabuf_sync_init(...);
...

dmabuf_sync_get(sync, dmabuf, DMA_BUF_ACCESS_R);
   

[patch v2] [media] mx3-camera: locking cleanup in mx3_videobuf_queue()

2013-08-29 Thread Dan Carpenter
Smatch complains about the locking here because we mix spin_lock_irq()
with spin_lock_irqsave() in an unusual way.  According to Smatch, it's
not always clear if the IRQs are enabled or disabled when we return.  It
turns out this function is always called with IRQs enabled and we can
just use spin_lock_irq().

It's called from __enqueue_in_driver().

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---
v2: The first version changed everything to irq_save/restore() but that
wasn't right because we wanted IRQs enabled and not simply restored.

diff --git a/drivers/media/platform/soc_camera/mx3_camera.c 
b/drivers/media/platform/soc_camera/mx3_camera.c
index 1047e3e..18eab8e 100644
--- a/drivers/media/platform/soc_camera/mx3_camera.c
+++ b/drivers/media/platform/soc_camera/mx3_camera.c
@@ -266,7 +266,6 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
struct idmac_channel *ichan = mx3_cam-idmac_channel[0];
struct idmac_video_param *video = ichan-params.video;
const struct soc_mbus_pixelfmt *host_fmt = icd-current_fmt-host_fmt;
-   unsigned long flags;
dma_cookie_t cookie;
size_t new_size;
 
@@ -328,7 +327,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
memset(vb2_plane_vaddr(vb, 0), 0xaa, vb2_get_plane_payload(vb, 
0));
 #endif
 
-   spin_lock_irqsave(mx3_cam-lock, flags);
+   spin_lock_irq(mx3_cam-lock);
list_add_tail(buf-queue, mx3_cam-capture);
 
if (!mx3_cam-active)
@@ -351,7 +350,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
if (mx3_cam-active == buf)
mx3_cam-active = NULL;
 
-   spin_unlock_irqrestore(mx3_cam-lock, flags);
+   spin_unlock_irq(mx3_cam-lock);
 error:
vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
 }
--
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


[RESEND PATCH v2 0/7] Add device tree support for Exynos4412 Trats2 cameras

2013-08-29 Thread Sylwester Nawrocki
[Sigh, I've forgotten to Cc some mailing lists when submitting this
 previously, resending with device tree and samsung-soc ML added]

This series is intended to add device tree support for both cameras
on the Exynos4412 SoC Trats 2 board. It converts related drivers to use
the v4l2-async API and expose the sensor's master clock supplied by the
camera host interface through the common clock API.

This changeset is an updated version of my patch series [1] separating
the sensor subdev driver from the exynos4-fimc-is module and adding
asynchronous sensor registration support. There is also included next
iteration of the patch adding DT bits to the rear facing S5C73M3 camera
module driver [2].

The S5K6A3 is a raw image sensor of the front facing camera connected
to the SoC local ISP (FIMC-IS).

This series has run-time dependency on the patches adding clk_unregister()
implementation [3].

Any feedback, especially on the s5k6a3: Add DT binding documentation
patch, where I've described some issue with the common video-interfaces
binding is welcome.

[1] http://www.spinics.net/lists/linux-media/msg66073.html
[2] https://linuxtv.org/patch/19386/
[3] https://lkml.org/lkml/2013/8/24/63

Thanks,
Sylwester

Andrzej Hajda (1):
  V4L: s5c73m3: Add device tree support

Sylwester Nawrocki (6):
  V4L: s5k6a3: Add DT binding documentation
  V4L: Add driver for s5k6a3 image sensor
  V4L: s5k6a3: Add support for asynchronous subdev registration
  exynos4-is: Add clock provider for the external clocks
  exynos4-is: Use external s5k6a3 sensor driver
  exynos4-is: Add support for asynchronous sensor subddevs registration

 .../devicetree/bindings/media/samsung-fimc.txt |   21 +-
 .../devicetree/bindings/media/samsung-s5c73m3.txt  |   95 ++
 .../devicetree/bindings/media/samsung-s5k6a3.txt   |   31 ++
 drivers/media/i2c/Kconfig  |8 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/s5c73m3/s5c73m3-core.c   |  206 +---
 drivers/media/i2c/s5c73m3/s5c73m3-spi.c|6 +
 drivers/media/i2c/s5c73m3/s5c73m3.h|4 +
 drivers/media/i2c/s5k6a3.c |  340 
 drivers/media/platform/exynos4-is/fimc-is-regs.c   |2 +-
 drivers/media/platform/exynos4-is/fimc-is-sensor.c |  285 +---
 drivers/media/platform/exynos4-is/fimc-is-sensor.h |   49 +--
 drivers/media/platform/exynos4-is/fimc-is.c|   97 +++---
 drivers/media/platform/exynos4-is/fimc-is.h|4 +-
 drivers/media/platform/exynos4-is/media-dev.c  |  335 +--
 drivers/media/platform/exynos4-is/media-dev.h  |   31 +-
 16 files changed, 984 insertions(+), 531 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5c73m3.txt
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5k6a3.txt
 create mode 100644 drivers/media/i2c/s5k6a3.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


[RESEND PATCH v2 1/7] V4L: s5c73m3: Add device tree support

2013-08-29 Thread Sylwester Nawrocki
From: Andrzej Hajda a.ha...@samsung.com

This patch adds the V4L2 asychronous subdev registration and
device tree support. Common clock API is used to control the
sensor master clock from within the subdev driver.

Signed-off-by: Andrzej Hajda a.ha...@samsung.com
Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes since v1:
 - added missing ret assignment on clk_get failure,
 - fixed error paths in probe(),
 - changed clock name to cis_extclk as specified in the datasheet,
 - separate properties used for the XSHUTDOWN, STANDBY GPIOs,
 - multiple correctiond in the binding documentation (improved
   description of data-lanes and clock-frequency properties).
---
 .../devicetree/bindings/media/samsung-s5c73m3.txt  |   95 +
 drivers/media/i2c/s5c73m3/s5c73m3-core.c   |  206 +++-
 drivers/media/i2c/s5c73m3/s5c73m3-spi.c|6 +
 drivers/media/i2c/s5c73m3/s5c73m3.h|4 +
 4 files changed, 261 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5c73m3.txt

diff --git a/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt 
b/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt
new file mode 100644
index 000..6d6c0b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt
@@ -0,0 +1,95 @@
+Samsung S5C73M3 8Mp camera ISP
+--
+
+The S5C73M3 camera ISP supports MIPI CSI-2 and parallel (ITU-R BT.656) video
+data busses. The I2C bus is the main control bus and additionally the SPI bus
+is used, mostly for transferring the firmware to and from the device. Two
+slave device nodes corresponding to these control bus interfaces are required
+and should be placed under respective bus controller nodes.
+
+I2C slave device node
+-
+
+Required properties:
+
+- compatible   : samsung,s5c73m3;
+- reg  : I2C slave address of the sensor;
+- vdd-int-supply: digital power supply (1.2V);
+- vdda-supply  : analog power supply (1.2V);
+- vdd-reg-supply: regulator input power supply (2.8V);
+- vddio-host-supply : host I/O power supply (1.8V to 2.8V);
+- vddio-cis-supply  : CIS I/O power supply (1.2V to 1.8V);
+- vdd-af-supply: lens power supply (2.8V);
+- xshutdown-gpios   : specifier of GPIO connected to the XSHUTDOWN pin;
+- standby-gpios : specifier of GPIO connected to the STANDBY pin;
+- clocks   : contains the sensor's CIS_EXTCLK clock specifier;
+- clock-names  : contains cis_extclk entry;
+
+Optional properties:
+
+- clock-frequency   : the frequency at which the cis_extclk clock should be
+ configured to operate, in Hz; if this property is not
+ specified default 24 MHz value will be used.
+
+The common video interfaces bindings (see video-interfaces.txt) should be used
+to specify link from the S5C73M3 to an external image data receiver. The 
S5C73M3
+device node should contain one 'port' child node with an 'endpoint' subnode for
+this purpose. The data link from a raw image sensor to the S5C73M3 can be
+similarly specified, but it is optional since the S5C73M3 ISP and a raw image
+sensor are usually inseparable and form a hybrid module.
+
+Following properties are valid for the endpoint node(s):
+
+endpoint subnode
+
+
+- data-lanes : (optional) specifies MIPI CSI-2 data lanes as covered in
+  video-interfaces.txt. This sensor doesn't support data lane remapping
+  and physical lane indexes in subsequent elements of the array should
+  be only consecutive ascending values.
+
+SPI device node
+---
+
+Required properties:
+
+- compatible   : samsung,s5c73m3;
+
+For more details see description of the SPI busses bindings
+(../spi/spi-bus.txt) and bindings of a specific bus controller.
+
+Example:
+
+i2c@138A00 {
+   ...
+   s5c73m3@3c {
+   compatible = samsung,s5c73m3;
+   reg = 0x3c;
+   vdd-int-supply = buck9_reg;
+   vdda-supply = ldo17_reg;
+   vdd-reg-supply = cam_io_reg;
+   vddio-host-supply = ldo18_reg;
+   vddio-cis-supply = ldo9_reg;
+   vdd-af-supply = cam_af_reg;
+   clock-frequency = 2400;
+   clocks = clk 0;
+   clock-names = cis_extclk;
+   reset-gpios = gpf1 3 1;
+   standby-gpios = gpm0 1 1;
+   port {
+   s5c73m3_ep: endpoint {
+   remote-endpoint = csis0_ep;
+   data-lanes = 1 2 3 4;
+   };
+   };
+   };
+};
+
+spi@1392000 {
+   ...
+   s5c73m3_spi: s5c73m3 {
+   compatible = samsung,s5c73m3;
+   reg = 0;
+   ...
+   };
+};
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c 

[RESEND PATCH v2 2/7] V4L: s5k6a3: Add DT binding documentation

2013-08-29 Thread Sylwester Nawrocki
This patch adds binding documentation for the Samsung S5K6A3(YX)
raw image sensor.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---

The binding of this sensors shows some issue in the generic video-interfaces
binding. Namely The video bus type (serial MIPI CSI-2, parallel ITU-R BT.656,
etc.) is being determined by the binding parser (v4l2-of.c) depending on what
properties are found in an enddpoint node.

Please have a look at the data-lanes property description. The sensor supports
MIPI CSI-2 and SMIA CCP2 interfaces which both use one data lane. One data lane
is everything this sensors supports. During our discussions on the generic
bidings in the past I proposed to introduce a property in the endpoint node
that would indicate what bus type (standard/protocol) is used, e.g. MIPI CSI-2,
ITU-R BT.656, SMIA CCP2, etc. It was argued though that we can well determine
bus type based on properties found in the endpoint node.

So now in case of this sensor I'm not sure how it can be differentiated
whether MIPI CSI-2 or CCP2 bus is used. There is no CCP2 specific generic
properties yet. Anyway I'm not really happy there is no property like bus_type
that would clearly indicate what data bus type is used. Then would would for
instance not specify data-lanes in endpoint node just to differentiate
between MIPI CSI-2 and the parallel busses.

The main issue for this particular binding is that even with data-lanes = 1;
it is still impossible to figure out whether MIPI CSI-2 or SMIA CCP2 data bus
is used.

So how about introducing, e.g. a string type bus_type common property ?
I'm considering starting a separate thread for discussing this.
---
 .../devicetree/bindings/media/samsung-s5k6a3.txt   |   31 
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/samsung-s5k6a3.txt

diff --git a/Documentation/devicetree/bindings/media/samsung-s5k6a3.txt 
b/Documentation/devicetree/bindings/media/samsung-s5k6a3.txt
new file mode 100644
index 000..a51fbe8
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/samsung-s5k6a3.txt
@@ -0,0 +1,31 @@
+Samsung S5K6A3(YX) raw image sensor
+-
+
+S5K6A3YX is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+and CCI (I2C compatible) control bus.
+
+Required properties:
+
+- compatible   : samsung,s5k6a3yx;
+- reg  : I2C slave address of the sensor;
+- svdda-supply : core voltage supply;
+- svddio-supply: I/O voltage supply;
+- gpios: specifier of a GPIO connected to the RESET pin;
+- clocks   : should contain the sensor's EXTCLK clock specifier, from
+ the common clock bindings.
+- clock-names  : should contain extclk entry;
+
+Optional properties:
+
+- clock-frequency : the frequency at which the extclk clock should be
+   configured to operate, in Hz; if this property is not
+   specified default 24 MHz value will be used.
+
+The common video interfaces bindings (see video-interfaces.txt) should be
+used to specify link to the image data receiver. The S5K6A3(YX) device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Following properties are valid for the endpoint node:
+
+- data-lanes : (optional) specifies MIPI CSI-2 data lanes as covered in
+  video-interfaces.txt.  The sensor supports only one data lane.
--
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


[RESEND PATCH v2 3/7] V4L: Add driver for s5k6a3 image sensor

2013-08-29 Thread Sylwester Nawrocki
This patch adds subdev driver for Samsung S5K6A3 raw image sensor.
As it is intended at the moment to be used only with the Exynos
FIMC-IS (camera ISP) subsystem it is a pretty minimal subdev driver.
It doesn't do any I2C communication since the sensor is controlled
by the ISP and its own firmware.
This driver can be updated in future, should anyone need it to be
a regular subdev driver where the main CPU communicates with the
sensor directly.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
Changes since v1:
 - added missing pm_runtime_disable(),
 - removed subdev name overriding,
 - s/S5K6A3_DEF_PIX/S5K6A3_DEFAULT_
---
 drivers/media/i2c/Kconfig  |8 ++
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/s5k6a3.c |  324 
 3 files changed, 333 insertions(+)
 create mode 100644 drivers/media/i2c/s5k6a3.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index d18be19..c3619a5 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -587,6 +587,14 @@ config VIDEO_S5K6AA
  This is a V4L2 sensor-level driver for Samsung S5K6AA(FX) 1.3M
  camera sensor with an embedded SoC image signal processor.

+config VIDEO_S5K6A3
+   tristate Samsung S5K6A3 sensor support
+   depends on MEDIA_CAMERA_SUPPORT
+   depends on I2C  VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API  OF
+   ---help---
+ This is a V4L2 sensor-level driver for Samsung S5K6A3 raw
+ camera sensor.
+
 config VIDEO_S5K4ECGX
 tristate Samsung S5K4ECGX sensor support
 depends on I2C  VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 9f462df..e7be364 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -66,6 +66,7 @@ obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
 obj-$(CONFIG_VIDEO_SR030PC30)  += sr030pc30.o
 obj-$(CONFIG_VIDEO_NOON010PC30)+= noon010pc30.o
 obj-$(CONFIG_VIDEO_S5K6AA) += s5k6aa.o
+obj-$(CONFIG_VIDEO_S5K6A3) += s5k6a3.o
 obj-$(CONFIG_VIDEO_S5K4ECGX)   += s5k4ecgx.o
 obj-$(CONFIG_VIDEO_S5C73M3)+= s5c73m3/
 obj-$(CONFIG_VIDEO_ADP1653)+= adp1653.o
diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c
new file mode 100644
index 000..ba86e24
--- /dev/null
+++ b/drivers/media/i2c/s5k6a3.c
@@ -0,0 +1,324 @@
+/*
+ * Samsung S5K6A3 image sensor driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Sylwester Nawrocki s.nawro...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/clk.h
+#include linux/delay.h
+#include linux/device.h
+#include linux/errno.h
+#include linux/gpio.h
+#include linux/i2c.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/of_gpio.h
+#include linux/pm_runtime.h
+#include linux/regulator/consumer.h
+#include linux/slab.h
+#include linux/videodev2.h
+#include media/v4l2-async.h
+#include media/v4l2-subdev.h
+
+#define S5K6A3_SENSOR_MAX_WIDTH1392
+#define S5K6A3_SENSOR_MAX_HEIGHT   1392
+#define S5K6A3_SENSOR_MIN_WIDTH32
+#define S5K6A3_SENSOR_MIN_HEIGHT   32
+
+#define S5K6A3_DEFAULT_WIDTH   1296
+#define S5K6A3_DEFAULT_HEIGHT  732
+
+#define S5K6A3_DRV_NAMES5K6A3
+#define S5K6A3_DEFAULT_CLK_FREQ2400U
+
+#define S5K6A3_NUM_SUPPLIES2
+
+/**
+ * struct s5k6a3 - fimc-is sensor data structure
+ * @dev: pointer to this I2C client device structure
+ * @subdev: the image sensor's v4l2 subdev
+ * @pad: subdev media source pad
+ * @supplies: image sensor's voltage regulator supplies
+ * @gpio_reset: GPIO connected to the sensor's reset pin
+ * @lock: mutex protecting the structure's members below
+ * @format: media bus format at the sensor's source pad
+ */
+struct s5k6a3 {
+   struct device *dev;
+   struct v4l2_subdev subdev;
+   struct media_pad pad;
+   struct regulator_bulk_data supplies[S5K6A3_NUM_SUPPLIES];
+   int gpio_reset;
+   struct mutex lock;
+   struct v4l2_mbus_framefmt format;
+   u32 clock_frequency;
+};
+
+static const char * const s5k6a3_supply_names[] = {
+   svdda,
+   svddio
+};
+
+static inline struct s5k6a3 *sd_to_s5k6a3(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct s5k6a3, subdev);
+}
+
+static const struct v4l2_mbus_framefmt s5k6a3_formats[] = {
+   {
+   .code = V4L2_MBUS_FMT_SGRBG10_1X10,
+   .colorspace = V4L2_COLORSPACE_SRGB,
+   .field = V4L2_FIELD_NONE,
+   }
+};
+
+static const struct v4l2_mbus_framefmt *find_sensor_format(
+   struct v4l2_mbus_framefmt *mf)
+{
+   int i;
+
+   for (i = 0; i  ARRAY_SIZE(s5k6a3_formats); i++)
+   if 

[RESEND PATCH v2 4/7] V4L: s5k6a3: Add support for asynchronous subdev registration

2013-08-29 Thread Sylwester Nawrocki
This patch converts the driver to use v4l2 asynchronous subdev
registration API an the clock API to control the external master
clock directly.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/i2c/s5k6a3.c |   36 ++--
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c
index ba86e24..f65a4f8 100644
--- a/drivers/media/i2c/s5k6a3.c
+++ b/drivers/media/i2c/s5k6a3.c
@@ -34,6 +34,7 @@
 #define S5K6A3_DEFAULT_HEIGHT  732
 
 #define S5K6A3_DRV_NAMES5K6A3
+#define S5K6A3_CLK_NAMEextclk
 #define S5K6A3_DEFAULT_CLK_FREQ2400U
 
 #define S5K6A3_NUM_SUPPLIES2
@@ -56,6 +57,7 @@ struct s5k6a3 {
int gpio_reset;
struct mutex lock;
struct v4l2_mbus_framefmt format;
+   struct clk *clock;
u32 clock_frequency;
 };
 
@@ -181,19 +183,25 @@ static int s5k6a3_s_power(struct v4l2_subdev *sd, int on)
 {
struct s5k6a3 *sensor = sd_to_s5k6a3(sd);
int gpio = sensor-gpio_reset;
-   int ret;
+   int ret = 0;
 
if (on) {
+   ret = clk_set_rate(sensor-clock, sensor-clock_frequency);
+   if (ret  0)
+   return ret;
+
ret = pm_runtime_get(sensor-dev);
if (ret  0)
return ret;
 
ret = regulator_bulk_enable(S5K6A3_NUM_SUPPLIES,
sensor-supplies);
-   if (ret  0) {
-   pm_runtime_put(sensor-dev);
-   return ret;
-   }
+   if (ret  0)
+   goto rpm_put;
+
+   ret = clk_prepare_enable(sensor-clock);
+   if (ret  0)
+   goto reg_dis;
 
if (gpio_is_valid(gpio)) {
gpio_set_value(gpio, 1);
@@ -209,10 +217,12 @@ static int s5k6a3_s_power(struct v4l2_subdev *sd, int on)
if (gpio_is_valid(gpio))
gpio_set_value(gpio, 0);
 
-   ret = regulator_bulk_disable(S5K6A3_NUM_SUPPLIES,
-sensor-supplies);
-   if (!ret)
-   pm_runtime_put(sensor-dev);
+   clk_disable_unprepare(sensor-clock);
+reg_dis:
+   regulator_bulk_disable(S5K6A3_NUM_SUPPLIES,
+   sensor-supplies);
+rpm_put:
+   pm_runtime_put(sensor-dev);
}
return ret;
 }
@@ -240,6 +250,7 @@ static int s5k6a3_probe(struct i2c_client *client,
 
mutex_init(sensor-lock);
sensor-gpio_reset = -EINVAL;
+   sensor-clock = ERR_PTR(-EINVAL);
sensor-dev = dev;
 
gpio = of_get_gpio_flags(dev-of_node, 0, NULL);
@@ -266,6 +277,10 @@ static int s5k6a3_probe(struct i2c_client *client,
if (ret  0)
return ret;
 
+   sensor-clock = devm_clk_get(dev, S5K6A3_CLK_NAME);
+   if (IS_ERR(sensor-clock))
+   return -EPROBE_DEFER;
+
sd = sensor-subdev;
v4l2_i2c_subdev_init(sd, client, s5k6a3_subdev_ops);
sensor-subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
@@ -282,7 +297,7 @@ static int s5k6a3_probe(struct i2c_client *client,
pm_runtime_no_callbacks(dev);
pm_runtime_enable(dev);
 
-   return 0;
+   return v4l2_async_register_subdev(sd);
 }
 
 static int s5k6a3_remove(struct i2c_client *client)
@@ -290,6 +305,7 @@ static int s5k6a3_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
 
pm_runtime_disable(client-dev);
+   v4l2_async_unregister_subdev(sd);
media_entity_cleanup(sd-entity);
return 0;
 }
-- 
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


[RESEND PATCH v2 5/7] exynos4-is: Add clock provider for the external clocks

2013-08-29 Thread Sylwester Nawrocki
This patch adds clock provider to expose the sclk_cam0/1 clocks
for image sensor subdevs.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 .../devicetree/bindings/media/samsung-fimc.txt |   17 ++-
 drivers/media/platform/exynos4-is/media-dev.c  |  115 
 drivers/media/platform/exynos4-is/media-dev.h  |   18 ++-
 3 files changed, 147 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/samsung-fimc.txt 
b/Documentation/devicetree/bindings/media/samsung-fimc.txt
index 96312f6..9f4d295 100644
--- a/Documentation/devicetree/bindings/media/samsung-fimc.txt
+++ b/Documentation/devicetree/bindings/media/samsung-fimc.txt
@@ -91,6 +91,15 @@ Optional properties
 - samsung,camclk-out : specifies clock output for remote sensor,
   0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT;
 
+'clock-controller' node (optional)
+--
+
+The purpose of this node is to define a clock provider for external image
+sensors and link any of the CAM_?_CLKOUT clock outputs with related external
+clock consumer device. Properties specific to this node are described in
+../clock/clock-bindings.txt.
+
+
 Image sensor nodes
 --
 
@@ -114,7 +123,7 @@ Example:
vddio-supply = ...;
 
clock-frequency = 2400;
-   clocks = ...;
+   clocks = camclk 1;
clock-names = mclk;
 
port {
@@ -135,7 +144,7 @@ Example:
vddio-supply = ...;
 
clock-frequency = 2400;
-   clocks = ...;
+   clocks = camclk 0;
clock-names = mclk;
 
port {
@@ -156,6 +165,10 @@ Example:
pinctrl-names = default;
pinctrl-0 = cam_port_a_clk_active;
 
+   camclk: clock-controller {
+  #clock-cells = 1;
+   };
+
/* parallel camera ports */
parallel-ports {
/* camera A input */
diff --git a/drivers/media/platform/exynos4-is/media-dev.c 
b/drivers/media/platform/exynos4-is/media-dev.c
index e327f45..6fba5f6 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -11,6 +11,8 @@
  */
 
 #include linux/bug.h
+#include linux/clk.h
+#include linux/clk-provider.h
 #include linux/device.h
 #include linux/errno.h
 #include linux/i2c.h
@@ -1438,6 +1440,108 @@ static int fimc_md_get_pinctrl(struct fimc_md *fmd)
return 0;
 }
 
+#ifdef CONFIG_OF
+static int cam_clk_prepare(struct clk_hw *hw)
+{
+   struct cam_clk *camclk = to_cam_clk(hw);
+   int ret;
+
+   if (camclk-fmd-pmf == NULL)
+   return -ENODEV;
+
+   ret = pm_runtime_get_sync(camclk-fmd-pmf);
+   return ret  0 ? ret : 0;
+}
+
+static void cam_clk_unprepare(struct clk_hw *hw)
+{
+   struct cam_clk *camclk = to_cam_clk(hw);
+
+   if (camclk-fmd-pmf == NULL)
+   return;
+
+   pm_runtime_put_sync(camclk-fmd-pmf);
+}
+
+static const struct clk_ops cam_clk_ops = {
+   .prepare = cam_clk_prepare,
+   .unprepare = cam_clk_unprepare,
+};
+
+static const char *cam_clk_p_names[] = { sclk_cam0, sclk_cam1 };
+
+static void fimc_md_unregister_clk_provider(struct fimc_md *fmd)
+{
+   struct cam_clk_provider *cp = fmd-clk_provider;
+   unsigned int i;
+
+   if (cp-of_node)
+   of_clk_del_provider(cp-of_node);
+
+   for (i = 0; i  ARRAY_SIZE(cp-clks); i++)
+   if (!IS_ERR(cp-clks[i]))
+   clk_unregister(cp-clks[i]);
+}
+
+static int fimc_md_register_clk_provider(struct fimc_md *fmd)
+{
+   struct cam_clk_provider *cp = fmd-clk_provider;
+   struct device *dev = fmd-pdev-dev;
+   struct device_node *node;
+   int i, ret;
+
+   for (i = 0; i  ARRAY_SIZE(cp-clks); i++)
+   cp-clks[i] = ERR_PTR(-EINVAL);
+
+   node = of_get_child_by_name(dev-of_node, clock-controller);
+   if (!node) {
+   dev_warn(dev, clock-controller node at %s not found\n,
+   dev-of_node-full_name);
+   return 0;
+   }
+   for (i = 0; i  FIMC_MAX_CAMCLKS; i++) {
+   struct cam_clk *camclk = cp-camclk[i];
+   struct clk_init_data init;
+   char clk_name[16];
+   struct clk *clk;
+
+   snprintf(clk_name, sizeof(clk_name), cam_clkout%d, i);
+
+   init.name = clk_name;
+   init.ops = cam_clk_ops;
+   init.flags = CLK_SET_RATE_PARENT;
+   init.parent_names = cam_clk_p_names[i];
+   init.num_parents = 1;
+   camclk-hw.init = init;
+   camclk-fmd = fmd;
+
+   clk = 

[RESEND PATCH v2 6/7] exynos4-is: Use external s5k6a3 sensor driver

2013-08-29 Thread Sylwester Nawrocki
This patch removes the common fimc-is-sensor driver for image sensors
that are normally controlled by the FIMC-IS firmware. The FIMC-IS
driver now contains only a table of properties specific to each sensor.
The sensor properties required for the ISP's firmware are parsed from
device tree and retrieved from the internal table, which is selected
based on the compatible property of an image sensor.

To use the Exynos4x12 internal ISP the S5K6A3 sensor driver (drivers/
media/i2c/s5k6a3.c) is now required.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/platform/exynos4-is/fimc-is-regs.c   |2 +-
 drivers/media/platform/exynos4-is/fimc-is-sensor.c |  285 +---
 drivers/media/platform/exynos4-is/fimc-is-sensor.h |   49 +---
 drivers/media/platform/exynos4-is/fimc-is.c|   97 +++
 drivers/media/platform/exynos4-is/fimc-is.h|4 +-
 5 files changed, 57 insertions(+), 380 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c 
b/drivers/media/platform/exynos4-is/fimc-is-regs.c
index f758e26..c1bc76d 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-regs.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c
@@ -136,7 +136,7 @@ void fimc_is_hw_set_sensor_num(struct fimc_is *is)
mcuctl_write(IH_REPLY_DONE, is, MCUCTL_REG_ISSR(0));
mcuctl_write(is-sensor_index, is, MCUCTL_REG_ISSR(1));
mcuctl_write(IHC_GET_SENSOR_NUM, is, MCUCTL_REG_ISSR(2));
-   mcuctl_write(FIMC_IS_SENSOR_NUM, is, MCUCTL_REG_ISSR(3));
+   mcuctl_write(FIMC_IS_SENSORS_NUM, is, MCUCTL_REG_ISSR(3));
 }
 
 void fimc_is_hw_close_sensor(struct fimc_is *is, unsigned int index)
diff --git a/drivers/media/platform/exynos4-is/fimc-is-sensor.c 
b/drivers/media/platform/exynos4-is/fimc-is-sensor.c
index 6647421..10e82e2 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-sensor.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-sensor.c
@@ -2,276 +2,21 @@
  * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
  *
  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
- *
  * Author: Sylwester Nawrocki s.nawro...@samsung.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include linux/delay.h
-#include linux/device.h
-#include linux/errno.h
-#include linux/gpio.h
-#include linux/i2c.h
-#include linux/kernel.h
-#include linux/module.h
-#include linux/of_gpio.h
-#include linux/pm_runtime.h
-#include linux/regulator/consumer.h
-#include linux/slab.h
-#include media/v4l2-subdev.h
 
-#include fimc-is.h
 #include fimc-is-sensor.h
 
-#define DRIVER_NAME FIMC-IS-SENSOR
-
-static const char * const sensor_supply_names[] = {
-   svdda,
-   svddio,
-};
-
-static const struct v4l2_mbus_framefmt fimc_is_sensor_formats[] = {
-   {
-   .code = V4L2_MBUS_FMT_SGRBG10_1X10,
-   .colorspace = V4L2_COLORSPACE_SRGB,
-   .field = V4L2_FIELD_NONE,
-   }
-};
-
-static const struct v4l2_mbus_framefmt *find_sensor_format(
-   struct v4l2_mbus_framefmt *mf)
-{
-   int i;
-
-   for (i = 0; i  ARRAY_SIZE(fimc_is_sensor_formats); i++)
-   if (mf-code == fimc_is_sensor_formats[i].code)
-   return fimc_is_sensor_formats[i];
-
-   return fimc_is_sensor_formats[0];
-}
-
-static int fimc_is_sensor_enum_mbus_code(struct v4l2_subdev *sd,
- struct v4l2_subdev_fh *fh,
- struct v4l2_subdev_mbus_code_enum *code)
-{
-   if (code-index = ARRAY_SIZE(fimc_is_sensor_formats))
-   return -EINVAL;
-
-   code-code = fimc_is_sensor_formats[code-index].code;
-   return 0;
-}
-
-static void fimc_is_sensor_try_format(struct fimc_is_sensor *sensor,
- struct v4l2_mbus_framefmt *mf)
-{
-   const struct sensor_drv_data *dd = sensor-drvdata;
-   const struct v4l2_mbus_framefmt *fmt;
-
-   fmt = find_sensor_format(mf);
-   mf-code = fmt-code;
-   v4l_bound_align_image(mf-width, 16 + 8, dd-width, 0,
- mf-height, 12 + 8, dd-height, 0, 0);
-}
-
-static struct v4l2_mbus_framefmt *__fimc_is_sensor_get_format(
-   struct fimc_is_sensor *sensor, struct v4l2_subdev_fh *fh,
-   u32 pad, enum v4l2_subdev_format_whence which)
-{
-   if (which == V4L2_SUBDEV_FORMAT_TRY)
-   return fh ? v4l2_subdev_get_try_format(fh, pad) : NULL;
-
-   return sensor-format;
-}
-
-static int fimc_is_sensor_set_fmt(struct v4l2_subdev *sd,
- struct v4l2_subdev_fh *fh,
- struct v4l2_subdev_format *fmt)
-{
-   struct fimc_is_sensor *sensor = sd_to_fimc_is_sensor(sd);
-   struct v4l2_mbus_framefmt *mf;
-
-   

[RESEND PATCH v2 7/7] exynos4-is: Add support for asynchronous sensor subddevs registration

2013-08-29 Thread Sylwester Nawrocki
Add support for registering external sensor subdevs using the v4l2-async
API. The async API is used only for sensor subdevs and only for platforms
instantiated from Device Tree.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---

Changes since v1:
 - register clock provider after registering FIMC devices so the clock
   can be actually used right after it is registered.
---
 .../devicetree/bindings/media/samsung-fimc.txt |4 +-
 drivers/media/platform/exynos4-is/media-dev.c  |  234 +++-
 drivers/media/platform/exynos4-is/media-dev.h  |   13 +-
 3 files changed, 146 insertions(+), 105 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/samsung-fimc.txt 
b/Documentation/devicetree/bindings/media/samsung-fimc.txt
index 9f4d295..daf145d 100644
--- a/Documentation/devicetree/bindings/media/samsung-fimc.txt
+++ b/Documentation/devicetree/bindings/media/samsung-fimc.txt
@@ -106,8 +106,8 @@ Image sensor nodes
 The sensor device nodes should be added to their control bus controller (e.g.
 I2C0) nodes and linked to a port node in the csis or the parallel-ports node,
 using the common video interfaces bindings, defined in video-interfaces.txt.
-The implementation of this bindings requires clock-frequency property to be
-present in the sensor device nodes.
+An optional clock-frequency property needs to be present in the sensor device
+nodes. Default value when this property is not present is 24 MHz.

 Example:

diff --git a/drivers/media/platform/exynos4-is/media-dev.c 
b/drivers/media/platform/exynos4-is/media-dev.c
index 6fba5f6..c10dee2 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -27,6 +27,7 @@
 #include linux/pm_runtime.h
 #include linux/types.h
 #include linux/slab.h
+#include media/v4l2-async.h
 #include media/v4l2-ctrls.h
 #include media/v4l2-of.h
 #include media/media-device.h
@@ -221,6 +222,7 @@ static int __fimc_pipeline_open(struct 
exynos_media_pipeline *ep,
if (ret  0)
return ret;
}
+
ret = fimc_md_set_camclk(sd, true);
if (ret  0)
goto err_wbclk;
@@ -381,77 +383,18 @@ static void fimc_md_unregister_sensor(struct v4l2_subdev 
*sd)
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct i2c_adapter *adapter;

-   if (!client)
+   if (!client || client-dev.of_node)
return;

v4l2_device_unregister_subdev(sd);

-   if (!client-dev.of_node) {
-   adapter = client-adapter;
-   i2c_unregister_device(client);
-   if (adapter)
-   i2c_put_adapter(adapter);
-   }
+   adapter = client-adapter;
+   i2c_unregister_device(client);
+   if (adapter)
+   i2c_put_adapter(adapter);
 }

 #ifdef CONFIG_OF
-/* Register I2C client subdev associated with @node. */
-static int fimc_md_of_add_sensor(struct fimc_md *fmd,
-struct device_node *node, int index)
-{
-   struct fimc_sensor_info *si;
-   struct i2c_client *client;
-   struct v4l2_subdev *sd;
-   int ret;
-
-   if (WARN_ON(index = ARRAY_SIZE(fmd-sensor)))
-   return -EINVAL;
-   si = fmd-sensor[index];
-
-   client = of_find_i2c_device_by_node(node);
-   if (!client)
-   return -EPROBE_DEFER;
-
-   device_lock(client-dev);
-
-   if (!client-driver ||
-   !try_module_get(client-driver-driver.owner)) {
-   ret = -EPROBE_DEFER;
-   v4l2_info(fmd-v4l2_dev, No driver found for %s\n,
-   node-full_name);
-   goto dev_put;
-   }
-
-   /* Enable sensor's master clock */
-   ret = __fimc_md_set_camclk(fmd, si-pdata, true);
-   if (ret  0)
-   goto mod_put;
-   sd = i2c_get_clientdata(client);
-
-   ret = v4l2_device_register_subdev(fmd-v4l2_dev, sd);
-   __fimc_md_set_camclk(fmd, si-pdata, false);
-   if (ret  0)
-   goto mod_put;
-
-   v4l2_set_subdev_hostdata(sd, si-pdata);
-   if (si-pdata.fimc_bus_type == FIMC_BUS_TYPE_ISP_WRITEBACK)
-   sd-grp_id = GRP_ID_FIMC_IS_SENSOR;
-   else
-   sd-grp_id = GRP_ID_SENSOR;
-
-   si-subdev = sd;
-   v4l2_info(fmd-v4l2_dev, Registered sensor subdevice: %s (%d)\n,
- sd-name, fmd-num_sensors);
-   fmd-num_sensors++;
-
-mod_put:
-   module_put(client-driver-driver.owner);
-dev_put:
-   device_unlock(client-dev);
-   put_device(client-dev);
-   return ret;
-}
-
 /* Parse port node and register as a sub-device any sensor specified there. */
 static int fimc_md_parse_port_node(struct fimc_md *fmd,
   struct device_node *port,
@@ -460,7 +403,6 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
   

Re: [PATCH v2 4/7] V4L: s5k6a3: Add support for asynchronous subdev registration

2013-08-29 Thread Sylwester Nawrocki
On 08/28/2013 06:21 PM, Guennadi Liakhovetski wrote:
 Hi Sylwester,
 
 Just one doubt below
 
 On Wed, 28 Aug 2013, Sylwester Nawrocki wrote:
 
  This patch converts the driver to use v4l2 asynchronous subdev
  registration API an the clock API to control the external master
  clock directly.
  
  Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   drivers/media/i2c/s5k6a3.c |   36 ++--
   1 file changed, 26 insertions(+), 10 deletions(-)
  
  diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c
  index ba86e24..f65a4f8 100644
  --- a/drivers/media/i2c/s5k6a3.c
  +++ b/drivers/media/i2c/s5k6a3.c
 [snip]
 
  @@ -282,7 +297,7 @@ static int s5k6a3_probe(struct i2c_client *client,
 pm_runtime_no_callbacks(dev);
 pm_runtime_enable(dev);
   
  -  return 0;
  +  return v4l2_async_register_subdev(sd);

 If the above fails - don't you have to do any clean up? E.g. below you do 
 disable runtime PM and clean up the media entity.

You're right, the clean up steps are missing. Thanks for pointing out,
I've corrected this for the next iteration.

Thanks,
Sylwester
--
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 5/5] [media] exynos-mscl: Add Makefile for M-Scaler driver

2013-08-29 Thread Sylwester Nawrocki
Hi Shaik,

On 08/19/2013 12:58 PM, Shaik Ameer Basha wrote:
 This patch adds the Makefile for the M-Scaler (M2M scaler).

Perhaps we could combine this with patch 3/5 ?

--
Regards,
Sylwester
--
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 v3 1/6] media: s5p-tv: Replace mxr_ macro by default dev_

2013-08-29 Thread Tomasz Figa
Hi Mateusz,

On Wednesday 28 of August 2013 18:12:59 Mateusz Krawczuk wrote:
 Replace mxr_dbg, mxr_info and mxr_warn by generic solution.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  drivers/media/platform/s5p-tv/mixer.h   |  12 ---
  drivers/media/platform/s5p-tv/mixer_drv.c   |  47 ++-
  drivers/media/platform/s5p-tv/mixer_grp_layer.c |   2 +-
  drivers/media/platform/s5p-tv/mixer_reg.c   |   6 +-
  drivers/media/platform/s5p-tv/mixer_video.c | 100
  drivers/media/platform/s5p-tv/mixer_vp_layer.c 
 |   2 +-
  6 files changed, 78 insertions(+), 91 deletions(-)

Although, this is a valid patch, I don't think it is related by any way to 
migration of S5PV210 to common clock framework. So, IMHO, this patch should 
be send separately, not as a part of this series.

Best regards,
Tomasz

--
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] media: st-rc: Add ST remote control driver

2013-08-29 Thread Mauro Carvalho Chehab
Em Thu, 29 Aug 2013 10:11:56 +0100
Sean Young s...@mess.org escreveu:

 On Wed, Aug 28, 2013 at 04:33:50PM +0100, Srinivas KANDAGATLA wrote:
  From: Srinivas Kandagatla srinivas.kandaga...@st.com
  
  This patch adds support to ST RC driver, which is basically a IR/UHF
  receiver and transmitter. This IP (IRB) is common across all the ST
  parts for settop box platforms. IRB is embedded in ST COMMS IP block.
  It supports both Rx  Tx functionality.
  
  In this driver adds only Rx functionality via LIRC codec.
  
  Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
  ---
  Hi Chehab,
  
  This is a very simple rc driver for IRB controller found in STi ARM CA9 
  SOCs.
  STi ARM SOC support went in 3.11 recently.
  This driver is a raw driver which feeds data to lirc codec for the user 
  lircd
  to decode the keys.
  
  This patch is based on git://linuxtv.org/media_tree.git master branch.
  
  Changes since v1:
  - Device tree bindings cleaned up as suggested by Mark and Pawel
  - use ir_raw_event_reset under overflow conditions as suggested by Sean.
  - call ir_raw_event_handle in interrupt handler as suggested by Sean.
  - correct allowed_protos flag with RC_BIT_ types as suggested by Sean.
  - timeout and rx resolution added as suggested by Sean.
 
 Acked-by: Sean Young s...@mess.org
 
 Note minor nitpicks below.
  
  Thanks,
  srini
  
   Documentation/devicetree/bindings/media/st-rc.txt |   24 ++
   drivers/media/rc/Kconfig  |   10 +
   drivers/media/rc/Makefile |1 +
   drivers/media/rc/st_rc.c  |  392 
  +
   4 files changed, 427 insertions(+), 0 deletions(-)
   create mode 100644 Documentation/devicetree/bindings/media/st-rc.txt
   create mode 100644 drivers/media/rc/st_rc.c
  
  diff --git a/Documentation/devicetree/bindings/media/st-rc.txt 
  b/Documentation/devicetree/bindings/media/st-rc.txt
  new file mode 100644
  index 000..20fe264
  --- /dev/null
  +++ b/Documentation/devicetree/bindings/media/st-rc.txt
  @@ -0,0 +1,24 @@
  +Device-Tree bindings for ST IRB IP
  +
  +Required properties:
  +   - compatible: should be st,comms-irb.
  +   - reg: base physical address of the controller and length of memory
  +   mapped  region.
  +   - interrupts: interrupt number to the cpu. The interrupt specifier
  +   format depends on the interrupt controller parent.
  +
  +Optional properties:
  +   - rx-mode: can be infrared or uhf.
  +   - tx-mode: should be infrared.
  +   - pinctrl-names, pinctrl-0: the pincontrol settings to configure
  +   muxing properly for IRB pins.
  +   - clocks : phandle of clock.
  +
  +Example node:
  +
  +   rc: rc@fe518000 {
  +   compatible  = st,comms-irb;
  +   reg = 0xfe518000 0x234;
  +   interrupts  =  0 203 0;
  +   rx-mode = infrared;
  +   };
  diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
  index 11e84bc..bf301ed 100644
  --- a/drivers/media/rc/Kconfig
  +++ b/drivers/media/rc/Kconfig
  @@ -322,4 +322,14 @@ config IR_GPIO_CIR
 To compile this driver as a module, choose M here: the module will
 be called gpio-ir-recv.
   
  +config RC_ST
  +   tristate ST remote control receiver
  +   depends on ARCH_STI  LIRC  OF
 
 Minor nitpick, this should not depend on LIRC, it depends on RC_CORE.
 
  +   help
  +Say Y here if you want support for ST remote control driver
  +which allows both IR and UHF RX.
  +The driver passes raw pluse and space information to the LIRC decoder.
  +
  +If you're not sure, select N here.
  +
   endif #RC_DEVICES
  diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
  index 56bacf0..f4eb32c 100644
  --- a/drivers/media/rc/Makefile
  +++ b/drivers/media/rc/Makefile
  @@ -30,3 +30,4 @@ obj-$(CONFIG_RC_LOOPBACK) += rc-loopback.o
   obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o
   obj-$(CONFIG_IR_IGUANA) += iguanair.o
   obj-$(CONFIG_IR_TTUSBIR) += ttusbir.o
  +obj-$(CONFIG_RC_ST) += st_rc.o
  diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
  new file mode 100644
  index 000..5caa6c5
  --- /dev/null
  +++ b/drivers/media/rc/st_rc.c
  @@ -0,0 +1,392 @@
  +/*
  + * Copyright (C) 2013 STMicroelectronics Limited
  + * Author: Srinivas Kandagatla srinivas.kandaga...@st.com
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License as published by
  + * the Free Software Foundation; either version 2 of the License, or
  + * (at your option) any later version.
  + */
  +#include linux/kernel.h
  +#include linux/clk.h
  +#include linux/interrupt.h
  +#include linux/module.h
  +#include linux/of.h
  +#include linux/platform_device.h
  +#include media/rc-core.h
  +#include linux/pinctrl/consumer.h
  +
  +struct st_rc_device {
  +   struct device   *dev;
  +   int 

Re: [PATCH v4.1 3/3] v4l: Add V4L2_BUF_FLAG_TIMESTAMP_SOF and use it

2013-08-29 Thread Sakari Ailus
Hi Laurent,

On Thu, Aug 29, 2013 at 01:25:05AM +0200, Laurent Pinchart wrote:
 Hi Sakari,
 
 On Wednesday 28 August 2013 19:39:19 Sakari Ailus wrote:
  On Wed, Aug 28, 2013 at 06:14:44PM +0200, Laurent Pinchart wrote:
  ...
  
  diff --git a/drivers/media/usb/uvc/uvc_queue.c
  b/drivers/media/usb/uvc/uvc_queue.c index cd962be..0d80512 100644
  --- a/drivers/media/usb/uvc/uvc_queue.c
  +++ b/drivers/media/usb/uvc/uvc_queue.c
  @@ -149,7 +149,8 @@ int uvc_queue_init(struct uvc_video_queue
  *queue, enum v4l2_buf_type type,
  queue-queue.buf_struct_size = sizeof(struct uvc_buffer);
  queue-queue.ops = uvc_queue_qops;
  queue-queue.mem_ops = vb2_vmalloc_memops;
  -   queue-queue.timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
  +   queue-queue.timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
  +   | V4L2_BUF_FLAG_TIMESTAMP_SOF;
  ret = vb2_queue_init(queue-queue);
  if (ret)
  return ret;
  diff --git a/include/media/videobuf2-core.h
  b/include/media/videobuf2-core.h index 6781258..033efc7 100644
  --- a/include/media/videobuf2-core.h
  +++ b/include/media/videobuf2-core.h
  @@ -307,6 +307,7 @@ struct v4l2_fh;
  
* @buf_struct_size: size of the driver-specific buffer structure;
* 0 indicates the driver doesn't want to use a custom 
  buffer
* structure type, so sizeof(struct vb2_buffer) will is 
  used
  
  + * @timestamp_type: Timestamp flags; V4L2_BUF_FLAGS_TIMESTAMP_*
  
* @gfp_flags: additional gfp flags used when allocating the
buffers.
* Typically this is 0, but it may be e.g. GFP_DMA or 
 __GFP_DMA32
* to force the buffer allocation to a specific memory 
  zone.
  
  diff --git a/include/uapi/linux/videodev2.h
  b/include/uapi/linux/videodev2.h index 691077d..c57765e 100644
  --- a/include/uapi/linux/videodev2.h
  +++ b/include/uapi/linux/videodev2.h
  @@ -695,6 +695,16 @@ struct v4l2_buffer {
  
   #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN0x
   #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC  0x2000
   #define V4L2_BUF_FLAG_TIMESTAMP_COPY   0x4000
  
  +/*
  + * Timestamp taken once the first pixel is received (or
  transmitted).
  + * If the flag is not set the buffer timestamp is taken at the end
  of
  + * the frame. This is not a timestamp type.
 
 UVC devices timestamp frames when the frame is captured, not when the
 first pixel is transmitted.

I.e. we shouldn't set the SOF flag? When the frame is captured doesn't
say much, or almost anything in terms of *when*. The frames have
exposure time and rolling shutter makes a difference, too.
   
   The UVC 1.1 specification defines the timestamp as
   
   The source clock time in native deviceclock units when the raw frame
   capture begins.
   
   What devices do in practice may differ :-)
  
  I think that this should mean start-of-frame - exposure time. I'd really
  wonder if any practical implementation does that however.
 
 It's start-of-frame - exposure time - internal delays (UVC webcams are 
 supposed to report their internal delay value as well).

Do they report it? How about the exposure time?

If you know them all you can calculate the SOF timestamp. The fewer
timestamps are available for user programs the better.

It's another matter then if there are webcams that report these values
wrong. Then you could get timestamps that are complete garbage. But I guess
you could compare them to the current monotonic timestamp and detect such
cases.

  What's your suggestion; should we use the SOF flag for this or do you prefer
  the end-of-frame timestamp instead? I think it'd be quite nice for drivers
  to know which one is which without having to guess, and based on the above
  start-of-frame comes as close to that definition as is meaningful.
 
 SOF is better than EOF. Do we need a start-of-capture flag, or could we 
 document SOF as meaning start-of-capture or start-of-reception depending on 
 what the device can do ?

One possibility is to dedicate a few flags for this; by using three bits
we'd get eight different timestamps already. But I have to say that fewer is
better. :-)

-- 
Cheers,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] media: st-rc: Add ST remote control driver

2013-08-29 Thread Srinivas KANDAGATLA
On 29/08/13 10:11, Sean Young wrote:
 On Wed, Aug 28, 2013 at 04:33:50PM +0100, Srinivas KANDAGATLA wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@st.com

 This patch adds support to ST RC driver, which is basically a IR/UHF
 receiver and transmitter. This IP (IRB) is common across all the ST
 parts for settop box platforms. IRB is embedded in ST COMMS IP block.
 It supports both Rx  Tx functionality.

 In this driver adds only Rx functionality via LIRC codec.

 Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
 ---
 Hi Chehab,

 This is a very simple rc driver for IRB controller found in STi ARM CA9 SOCs.
 STi ARM SOC support went in 3.11 recently.
 This driver is a raw driver which feeds data to lirc codec for the user lircd
 to decode the keys.

 This patch is based on git://linuxtv.org/media_tree.git master branch.

 Changes since v1:
  - Device tree bindings cleaned up as suggested by Mark and Pawel
  - use ir_raw_event_reset under overflow conditions as suggested by Sean.
  - call ir_raw_event_handle in interrupt handler as suggested by Sean.
  - correct allowed_protos flag with RC_BIT_ types as suggested by Sean.
  - timeout and rx resolution added as suggested by Sean.
 
 Acked-by: Sean Young s...@mess.org

Thankyou Sean for the Ack.
 
 Note minor nitpicks below.

 Thanks,
 srini

  Documentation/devicetree/bindings/media/st-rc.txt |   24 ++
  drivers/media/rc/Kconfig  |   10 +
  drivers/media/rc/Makefile |1 +
  drivers/media/rc/st_rc.c  |  392 
 +
  4 files changed, 427 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/media/st-rc.txt
  create mode 100644 drivers/media/rc/st_rc.c


 diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
 index 11e84bc..bf301ed 100644
 --- a/drivers/media/rc/Kconfig
 +++ b/drivers/media/rc/Kconfig
 @@ -322,4 +322,14 @@ config IR_GPIO_CIR
 To compile this driver as a module, choose M here: the module will
 be called gpio-ir-recv.
  
 +config RC_ST
 +tristate ST remote control receiver
 +depends on ARCH_STI  LIRC  OF
 
 Minor nitpick, this should not depend on LIRC, it depends on RC_CORE.
Yes, I will make it depend on RC_CORE, remove OF as suggested by Mauro
CC and select LIRC to something like.

depends on ARCH_STI  RC_CORE
select LIRC

 +static int st_rc_probe(struct platform_device *pdev)
 +{
 +int ret = -EINVAL;
 +struct rc_dev *rdev;
 +struct device *dev = pdev-dev;
 +struct resource *res;
 +struct st_rc_device *rc_dev;
 +struct device_node *np = pdev-dev.of_node;
 +const char *rx_mode;
 +
 +rc_dev = devm_kzalloc(dev, sizeof(struct st_rc_device), GFP_KERNEL);
 +rdev = rc_allocate_device();
 +
 +if (!rc_dev || !rdev)
 +return -ENOMEM;
 
 If one fails and the other succeeds you have a leak.

Yes... I will fix it in v3.
 
 +
 +if (np  !of_property_read_string(np, rx-mode, rx_mode)) {
 +

[...]

 +static SIMPLE_DEV_PM_OPS(st_rc_pm_ops, st_rc_suspend, st_rc_resume);
 +#endif
 +
 +#ifdef CONFIG_OF
 
 Since this depends on OF it will always be defined.
Removed OF dependency in Kconfig.
 +module_platform_driver(st_rc_driver);
 +
 +MODULE_DESCRIPTION(RC Transceiver driver for STMicroelectronics 
 platforms);
 +MODULE_AUTHOR(STMicroelectronics (RD) Ltd);
 +MODULE_LICENSE(GPL);
 -- 
 1.7.6.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: [PATCH v2] media: st-rc: Add ST remote control driver

2013-08-29 Thread Srinivas KANDAGATLA
On 29/08/13 11:49, Mauro Carvalho Chehab wrote:
 +MODULE_AUTHOR(STMicroelectronics (RD) Ltd);
   +MODULE_LICENSE(GPL);
   -- 
   1.7.6.5
 Except for the few points that Sean commented, the patch seems ok on my eyes.

Thankyou for reviewing. I will send v3 with the fixes.

thanks,
srini


 
 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 v2 5/5] [media] exynos-mscl: Add Makefile for M-Scaler driver

2013-08-29 Thread Shaik Ameer Basha
Hi Sylwester,

On Thu, Aug 29, 2013 at 3:42 PM, Sylwester Nawrocki
s.nawro...@samsung.com wrote:
 Hi Shaik,

 On 08/19/2013 12:58 PM, Shaik Ameer Basha wrote:
 This patch adds the Makefile for the M-Scaler (M2M scaler).

 Perhaps we could combine this with patch 3/5 ?

Ok. I will do that.

are you done with the review? can I start preparing for v3?

Regards,
Shaik



 --
 Regards,
 Sylwester
 --
 To unsubscribe from this list: send the line unsubscribe linux-samsung-soc 
 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.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: [PATCH v2] media: st-rc: Add ST remote control driver

2013-08-29 Thread Sean Young
On Thu, Aug 29, 2013 at 12:29:00PM +0100, Srinivas KANDAGATLA wrote:
 On 29/08/13 10:11, Sean Young wrote:
  On Wed, Aug 28, 2013 at 04:33:50PM +0100, Srinivas KANDAGATLA wrote:
  From: Srinivas Kandagatla srinivas.kandaga...@st.com
  +config RC_ST
  +  tristate ST remote control receiver
  +  depends on ARCH_STI  LIRC  OF
  
  Minor nitpick, this should not depend on LIRC, it depends on RC_CORE.
 Yes, I will make it depend on RC_CORE, remove OF as suggested by Mauro
 CC and select LIRC to something like.
 
 depends on ARCH_STI  RC_CORE
 select LIRC

The driver is usable with the kernel ir decoders, there is no need to 
select LIRC or use lirc at all.

You can either define a remote in drivers/media/rc/keymaps and set 
the rcdev-map_name, or it can be loaded at runtime using ir-keytable(1);
either way you don't need to use a lirc userspace daemon.


Sean
--
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] media: st-rc: Add ST remote control driver

2013-08-29 Thread Srinivas KANDAGATLA
On 29/08/13 13:01, Sean Young wrote:
 On Thu, Aug 29, 2013 at 12:29:00PM +0100, Srinivas KANDAGATLA wrote:
 On 29/08/13 10:11, Sean Young wrote:
 On Wed, Aug 28, 2013 at 04:33:50PM +0100, Srinivas KANDAGATLA wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@st.com
 +config RC_ST
 +  tristate ST remote control receiver
 +  depends on ARCH_STI  LIRC  OF

 Minor nitpick, this should not depend on LIRC, it depends on RC_CORE.
 Yes, I will make it depend on RC_CORE, remove OF as suggested by Mauro
 CC and select LIRC to something like.

 depends on ARCH_STI  RC_CORE
 select LIRC
 
 The driver is usable with the kernel ir decoders, there is no need to 
 select LIRC or use lirc at all.
 
 You can either define a remote in drivers/media/rc/keymaps and set 
 the rcdev-map_name, or it can be loaded at runtime using ir-keytable(1);
 either way you don't need to use a lirc userspace daemon.
Yep.. got it.
I will remove LIRC selection.

Thanks,
srini
 
 
 Sean
 --
 To unsubscribe from this list: send the line unsubscribe devicetree in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.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


[PATCH v3] media: st-rc: Add ST remote control driver

2013-08-29 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com

This patch adds support to ST RC driver, which is basically a IR/UHF
receiver and transmitter. This IP (IRB) is common across all the ST
parts for settop box platforms. IRB is embedded in ST COMMS IP block.
It supports both Rx  Tx functionality.

In this driver adds only Rx functionality via LIRC codec.

Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
Acked-by: Sean Young s...@mess.org
---
Hi Chehab,

This is a very simple rc driver for IRB controller found in STi ARM CA9 SOCs.
STi ARM SOC support went in 3.11 recently.
This driver is a raw driver which feeds data to lirc codec for the user lircd
to decode the keys.

This patch is based on git://linuxtv.org/media_tree.git master branch.

If its not too late can you please consider this driver for 3.12.

Changes since v2:
- Updated Kconfig dependencies as suggested by Sean and Chehab.
- Fixed a logical check spoted by Sean.

Changes since v1:
- Device tree bindings cleaned up as suggested by Mark and Pawel
- use ir_raw_event_reset under overflow conditions as suggested by Sean.
- call ir_raw_event_handle in interrupt handler as suggested by Sean.
- correct allowed_protos flag with RC_BIT_ types as suggested by Sean.
- timeout and rx resolution added as suggested by Sean.

Thankyou all for reviewing and commenting.

Thanks,
srini

 Documentation/devicetree/bindings/media/st-rc.txt |   24 ++
 drivers/media/rc/Kconfig  |   10 +
 drivers/media/rc/Makefile |1 +
 drivers/media/rc/st_rc.c  |  396 +
 4 files changed, 431 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/st-rc.txt
 create mode 100644 drivers/media/rc/st_rc.c

diff --git a/Documentation/devicetree/bindings/media/st-rc.txt 
b/Documentation/devicetree/bindings/media/st-rc.txt
new file mode 100644
index 000..20fe264
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/st-rc.txt
@@ -0,0 +1,24 @@
+Device-Tree bindings for ST IRB IP
+
+Required properties:
+   - compatible: should be st,comms-irb.
+   - reg: base physical address of the controller and length of memory
+   mapped  region.
+   - interrupts: interrupt number to the cpu. The interrupt specifier
+   format depends on the interrupt controller parent.
+
+Optional properties:
+   - rx-mode: can be infrared or uhf.
+   - tx-mode: should be infrared.
+   - pinctrl-names, pinctrl-0: the pincontrol settings to configure
+   muxing properly for IRB pins.
+   - clocks : phandle of clock.
+
+Example node:
+
+   rc: rc@fe518000 {
+   compatible  = st,comms-irb;
+   reg = 0xfe518000 0x234;
+   interrupts  =  0 203 0;
+   rx-mode = infrared;
+   };
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 11e84bc..557afc5 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -322,4 +322,14 @@ config IR_GPIO_CIR
   To compile this driver as a module, choose M here: the module will
   be called gpio-ir-recv.
 
+config RC_ST
+   tristate ST remote control receiver
+   depends on ARCH_STI  RC_CORE
+   help
+Say Y here if you want support for ST remote control driver
+which allows both IR and UHF RX.
+The driver passes raw pluse and space information to the LIRC decoder.
+
+If you're not sure, select N here.
+
 endif #RC_DEVICES
diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index 56bacf0..f4eb32c 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -30,3 +30,4 @@ obj-$(CONFIG_RC_LOOPBACK) += rc-loopback.o
 obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o
 obj-$(CONFIG_IR_IGUANA) += iguanair.o
 obj-$(CONFIG_IR_TTUSBIR) += ttusbir.o
+obj-$(CONFIG_RC_ST) += st_rc.o
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
new file mode 100644
index 000..e2dad9c
--- /dev/null
+++ b/drivers/media/rc/st_rc.c
@@ -0,0 +1,396 @@
+/*
+ * Copyright (C) 2013 STMicroelectronics Limited
+ * Author: Srinivas Kandagatla srinivas.kandaga...@st.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#include linux/kernel.h
+#include linux/clk.h
+#include linux/interrupt.h
+#include linux/module.h
+#include linux/of.h
+#include linux/platform_device.h
+#include media/rc-core.h
+#include linux/pinctrl/consumer.h
+
+struct st_rc_device {
+   struct device   *dev;
+   int irq;
+   int irq_wake;
+   struct clk  *sys_clock;
+   void  

[PATCH v3 2/6] v4l: ti-vpe: Add helpers for creating VPDMA descriptors

2013-08-29 Thread Archit Taneja
Create functions which the VPE driver can use to create a VPDMA descriptor and
add it to a VPDMA descriptor list. These functions take a pointer to an existing
list, and append the configuration/data/control descriptor header to the list.

In the case of configuration descriptors, the creation of a payload block may be
required(the payloads can hold VPE MMR values, or scaler coefficients). The
allocation of the payload buffer and it's content is left to the VPE driver.
However, the VPDMA library provides helper macros to create payload in the
correct format.

Add debug functions to dump the descriptors in a way such that it's easy to see
the values of different fields in the descriptors.

Signed-off-by: Archit Taneja arc...@ti.com
---
 drivers/media/platform/ti-vpe/vpdma.c  | 268 +++
 drivers/media/platform/ti-vpe/vpdma.h  |  48 +++
 drivers/media/platform/ti-vpe/vpdma_priv.h | 521 +
 3 files changed, 837 insertions(+)

diff --git a/drivers/media/platform/ti-vpe/vpdma.c 
b/drivers/media/platform/ti-vpe/vpdma.c
index 42db12c..af0a5ff 100644
--- a/drivers/media/platform/ti-vpe/vpdma.c
+++ b/drivers/media/platform/ti-vpe/vpdma.c
@@ -21,6 +21,7 @@
 #include linux/platform_device.h
 #include linux/sched.h
 #include linux/slab.h
+#include linux/videodev2.h
 
 #include vpdma.h
 #include vpdma_priv.h
@@ -416,6 +417,273 @@ int vpdma_submit_descs(struct vpdma_data *vpdma, struct 
vpdma_desc_list *list)
return 0;
 }
 
+static void dump_cfd(struct vpdma_cfd *cfd)
+{
+   int class;
+
+   class = cfd_get_class(cfd);
+
+   pr_debug(config descriptor of payload class: %s\n,
+   class == CFD_CLS_BLOCK ? simple block :
+   address data block);
+
+   if (class == CFD_CLS_BLOCK)
+   pr_debug(word0: dst_addr_offset = 0x%08x\n,
+   cfd-dest_addr_offset);
+
+   if (class == CFD_CLS_BLOCK)
+   pr_debug(word1: num_data_wrds = %d\n, cfd-block_len);
+
+   pr_debug(word2: payload_addr = 0x%08x\n, cfd-payload_addr);
+
+   pr_debug(word3: pkt_type = %d, direct = %d, class = %d, dest = %d, 
+   payload_len = %d\n, cfd_get_pkt_type(cfd),
+   cfd_get_direct(cfd), class, cfd_get_dest(cfd),
+   cfd_get_payload_len(cfd));
+}
+
+/*
+ * append a configuration descriptor to the given descriptor list, where the
+ * payload is in the form of a simple data block specified in the descriptor
+ * header, this is used to upload scaler coefficients to the scaler module
+ */
+void vpdma_add_cfd_block(struct vpdma_desc_list *list, int client,
+   struct vpdma_buf *blk, u32 dest_offset)
+{
+   struct vpdma_cfd *cfd;
+   int len = blk-size;
+
+   WARN_ON(blk-dma_addr  VPDMA_DESC_ALIGN);
+
+   cfd = list-next;
+   WARN_ON((void *)(cfd + 1)  (list-buf.addr + list-buf.size));
+
+   cfd-dest_addr_offset = dest_offset;
+   cfd-block_len = len;
+   cfd-payload_addr = (u32) blk-dma_addr;
+   cfd-ctl_payload_len = cfd_pkt_payload_len(CFD_INDIRECT, CFD_CLS_BLOCK,
+   client, len  4);
+
+   list-next = cfd + 1;
+
+   dump_cfd(cfd);
+}
+
+/*
+ * append a configuration descriptor to the given descriptor list, where the
+ * payload is in the address data block format, this is used to a configure a
+ * discontiguous set of MMRs
+ */
+void vpdma_add_cfd_adb(struct vpdma_desc_list *list, int client,
+   struct vpdma_buf *adb)
+{
+   struct vpdma_cfd *cfd;
+   unsigned int len = adb-size;
+
+   WARN_ON(len  VPDMA_ADB_SIZE_ALIGN);
+   WARN_ON(adb-dma_addr  VPDMA_DESC_ALIGN);
+
+   cfd = list-next;
+   BUG_ON((void *)(cfd + 1)  (list-buf.addr + list-buf.size));
+
+   cfd-w0 = 0;
+   cfd-w1 = 0;
+   cfd-payload_addr = (u32) adb-dma_addr;
+   cfd-ctl_payload_len = cfd_pkt_payload_len(CFD_INDIRECT, CFD_CLS_ADB,
+   client, len  4);
+
+   list-next = cfd + 1;
+
+   dump_cfd(cfd);
+};
+
+/*
+ * control descriptor format change based on what type of control descriptor it
+ * is, we only use 'sync on channel' control descriptors for now, so assume 
it's
+ * that
+ */
+static void dump_ctd(struct vpdma_ctd *ctd)
+{
+   pr_debug(control descriptor\n);
+
+   pr_debug(word3: pkt_type = %d, source = %d, ctl_type = %d\n,
+   ctd_get_pkt_type(ctd), ctd_get_source(ctd), ctd_get_ctl(ctd));
+}
+
+/*
+ * append a 'sync on channel' type control descriptor to the given descriptor
+ * list, this descriptor stalls the VPDMA list till the time DMA is completed
+ * on the specified channel
+ */
+void vpdma_add_sync_on_channel_ctd(struct vpdma_desc_list *list,
+   enum vpdma_channel chan)
+{
+   struct vpdma_ctd *ctd;
+
+   ctd = list-next;
+   WARN_ON((void *)(ctd + 1)  (list-buf.addr + list-buf.size));
+
+   ctd-w0 = 0;
+   ctd-w1 = 0;
+   ctd-w2 = 0;
+   ctd-type_source_ctl = 

[PATCH v3 6/6] experimental: arm: dts: dra7xx: Add a DT node for VPE

2013-08-29 Thread Archit Taneja
Add a DT node for VPE in dra7.dtsi. This is experimental because we might need
to split the VPE address space a bit more, and also because the IRQ line
described is accessible the IRQ crossbar driver is added for DRA7XX.

Cc: Rajendra Nayak rna...@ti.com
Cc: Sricharan R r.sricha...@ti.com
Signed-off-by: Archit Taneja arc...@ti.com
---
 arch/arm/boot/dts/dra7.dtsi | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index ce9a0f0..7c1cbfe 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -484,6 +484,17 @@
dmas = sdma 70, sdma 71;
dma-names = tx0, rx0;
};
+
+   vpe {
+   compatible = ti,vpe;
+   ti,hwmods = vpe;
+   reg = 0x489d 0xd000, 0x489dd000 0x400;
+   reg-names = vpe, vpdma;
+   interrupts = 0 158 0x4;
+   #address-cells = 1;
+   #size-cells = 0;
+   };
+
};
 
clocks {
-- 
1.8.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 v3 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info

2013-08-29 Thread Archit Taneja
Add hwmod data for the VPE IP, this is needed for the IP to be reset during
boot, and control the functional clock when the driver needs it via
pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's
ocp interface list.

Cc: Rajendra Nayak rna...@ti.com
Cc: Sricharan R r.sricha...@ti.com
Signed-off-by: Archit Taneja arc...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index f647998b..181365d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = {
},
 };
 
+/*
+ * 'vpe' class
+ *
+ */
+
+static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = {
+   .sysc_offs  = 0x0010,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class dra7xx_vpe_hwmod_class = {
+   .name   = vpe,
+   .sysc   = dra7xx_vpe_sysc,
+};
+
+/* vpe */
+static struct omap_hwmod dra7xx_vpe_hwmod = {
+   .name   = vpe,
+   .class  = dra7xx_vpe_hwmod_class,
+   .clkdm_name = vpe_clkdm,
+   .main_clk   = dpll_core_h23x2_ck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET,
+   .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_HWCTRL,
+   },
+   },
+};
 
 /*
  * Interfaces
@@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if 
dra7xx_l4_wkup__wd_timer2 = {
.user   = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* l4_per3 - vpe */
+static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = {
+   .master = dra7xx_l4_per3_hwmod,
+   .slave  = dra7xx_vpe_hwmod,
+   .clk= l3_iclk_div,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
dra7xx_l3_main_2__l3_instr,
dra7xx_l4_cfg__l3_main_1,
@@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] 
__initdata = {
dra7xx_l3_main_1__vcp2,
dra7xx_l4_per2__vcp2,
dra7xx_l4_wkup__wd_timer2,
+   dra7xx_l4_per3__vpe,
NULL,
 };
 
-- 
1.8.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 v3 1/6] v4l: ti-vpe: Create a vpdma helper library

2013-08-29 Thread Archit Taneja
The primary function of VPDMA is to move data between external memory and
internal processing modules(in our case, VPE) that source or sink data. VPDMA is
capable of buffering this data and then delivering the data as demanded to the
modules as programmed. The modules that source or sink data are referred to as
clients or ports. A channel is setup inside the VPDMA to connect a specific
memory buffer to a specific client. The VPDMA centralizes the DMA control
functions and buffering required to allow all the clients to minimize the
effect of long latency times.

Add the following to the VPDMA helper:

- A data struct which describe VPDMA channels. For now, these channels are the
  ones used only by VPE, the list of channels will increase when VIP(Video
  Input Port) also uses the VPDMA library. This channel information will be
  used to populate fields required by data descriptors.

- Data structs which describe the different data types supported by VPDMA. This
  data type information will be used to populate fields required by data
  descriptors and used by the VPE driver to map a V4L2 format to the
  corresponding VPDMA data type.

- Provide VPDMA register offset definitions, functions to read, write and modify
  VPDMA registers.

- Functions to create and submit a VPDMA list. A list is a group of descriptors
  that makes up a set of DMA transfers that need to be completed. Each
  descriptor will either perform a DMA transaction to fetch input buffers and
  write to output buffers(data descriptors), or configure the MMRs of sub blocks
  of VPE(configuration descriptors), or provide control information to VPDMA
  (control descriptors).

- Functions to allocate, map and unmap buffers needed for the descriptor list,
  payloads containing MMR values and scaler coefficients. These use the DMA
  mapping APIs to ensure exclusive access to VPDMA.

- Functions to enable VPDMA interrupts. VPDMA can trigger an interrupt on the
  VPE interrupt line when a descriptor list is parsed completely and the DMA
  transactions are completed. This requires masking the events in VPDMA
  registers and configuring some top level VPE interrupt registers.

- Enable some VPDMA specific parameters: frame start event(when to start DMA for
  a client) and line mode(whether each line fetched should be mirrored or not).

- Function to load firmware required by VPDMA. VPDMA requires a firmware for
  it's internal list manager. We add the required request_firmware apis to fetch
  this firmware from user space.

- Function to dump VPDMA registers.

- A function to initialize and create a VPDMA instance, this will be called by
  the VPE driver with it's platform device pointer, this function will take care
  of loading VPDMA firmware and returning a vpdma_data instance back to the VPE
  driver. The VIP driver will also call the same init function to initialize 
it's
  own VPDMA instance.

Signed-off-by: Archit Taneja arc...@ti.com
---
 drivers/media/platform/ti-vpe/vpdma.c  | 578 +
 drivers/media/platform/ti-vpe/vpdma.h  | 154 
 drivers/media/platform/ti-vpe/vpdma_priv.h | 119 ++
 3 files changed, 851 insertions(+)
 create mode 100644 drivers/media/platform/ti-vpe/vpdma.c
 create mode 100644 drivers/media/platform/ti-vpe/vpdma.h
 create mode 100644 drivers/media/platform/ti-vpe/vpdma_priv.h

diff --git a/drivers/media/platform/ti-vpe/vpdma.c 
b/drivers/media/platform/ti-vpe/vpdma.c
new file mode 100644
index 000..42db12c
--- /dev/null
+++ b/drivers/media/platform/ti-vpe/vpdma.c
@@ -0,0 +1,578 @@
+/*
+ * VPDMA helper library
+ *
+ * Copyright (c) 2013 Texas Instruments Inc.
+ *
+ * David Griego, dagri...@biglakesoftware.com
+ * Dale Farnsworth, d...@farnsworth.org
+ * Archit Taneja, arc...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#include linux/delay.h
+#include linux/dma-mapping.h
+#include linux/err.h
+#include linux/firmware.h
+#include linux/io.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/sched.h
+#include linux/slab.h
+
+#include vpdma.h
+#include vpdma_priv.h
+
+#define VPDMA_FIRMWARE vpdma-1b8.bin
+
+const struct vpdma_data_format vpdma_yuv_fmts[] = {
+   [VPDMA_DATA_FMT_Y444] = {
+   .data_type  = DATA_TYPE_Y444,
+   .depth  = 8,
+   },
+   [VPDMA_DATA_FMT_Y422] = {
+   .data_type  = DATA_TYPE_Y422,
+   .depth  = 8,
+   },
+   [VPDMA_DATA_FMT_Y420] = {
+   .data_type  = DATA_TYPE_Y420,
+   .depth  = 8,
+   },
+   [VPDMA_DATA_FMT_C444] = {
+   .data_type  = DATA_TYPE_C444,
+   .depth  = 8,
+   },
+   [VPDMA_DATA_FMT_C422] = {
+   .data_type  = DATA_TYPE_C422,
+   .depth  = 8,

[PATCH v3 4/6] v4l: ti-vpe: Add de-interlacer support in VPE

2013-08-29 Thread Archit Taneja
Add support for the de-interlacer block in VPE.

For de-interlacer to work, we need to enable 2 more sets of VPE input ports
which fetch data from the 'last' and 'last to last' fields of the interlaced
video. Apart from that, we need to enable the Motion vector output and input
ports, and also allocate DMA buffers for them.

We need to make sure that two most recent fields in the source queue are
available and in the 'READY' state. Once a mem2mem context gets access to the
VPE HW(in device_run), it extracts the addresses of the 3 buffers, and provides
it to the data descriptors for the 3 sets of input ports((LUMA1, CHROMA1),
(LUMA2, CHROMA2), and (LUMA3, CHROMA3)) respectively for the 3 consecutive
fields. The motion vector and output port descriptors are configured and the
list is submitted to VPDMA.

Once the transaction is done, the v4l2 buffer corresponding to the oldest
field(the 3rd one) is changed to the state 'DONE', and the buffers corresponding
to 1st and 2nd fields become the 2nd and 3rd field for the next de-interlace
operation. This way, for each deinterlace operation, we have the 3 most recent
fields. After each transaction, we also swap the motion vector buffers, the new
input motion vector buffer contains the resultant motion information of all the
previous frames, and the new output motion vector buffer will be used to hold
the updated motion vector to capture the motion changes in the next field. The
motion vector buffers are allocated using the DMA allocation API.

The de-interlacer is removed from bypass mode, it requires some extra default
configurations which are now added. The chrominance upsampler coefficients are
added for interlaced frames. Some VPDMA parameters like frame start event and
line mode are configured for the 2 extra sets of input ports.

Signed-off-by: Archit Taneja arc...@ti.com
---
 drivers/media/platform/ti-vpe/vpe.c | 378 
 1 file changed, 344 insertions(+), 34 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index 85b0880..c2bc0f4 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -69,6 +69,8 @@
 #define VPE_CHROMA 1
 
 /* per m2m context info */
+#define VPE_MAX_SRC_BUFS   3   /* need 3 src fields to de-interlace */
+
 #define VPE_DEF_BUFS_PER_JOB   1   /* default one buffer per batch job */
 
 /*
@@ -110,6 +112,38 @@ static const struct vpe_us_coeffs us_coeffs[] = {
0x00C8, 0x0348, 0x0018, 0x3FD8, 0x3FB8, 0x0378, 0x00E8, 0x3FE8,
0x00C8, 0x0348, 0x0018, 0x3FD8, 0x3FB8, 0x0378, 0x00E8, 0x3FE8,
},
+   {
+   /* Coefficients for Top Field Interlaced input */
+   0x0051, 0x03D5, 0x3FE3, 0x3FF7, 0x3FB5, 0x02E9, 0x018F, 0x3FD3,
+   /* Coefficients for Bottom Field Interlaced input */
+   0x016B, 0x0247, 0x00B1, 0x3F9D, 0x3FCF, 0x03DB, 0x005D, 0x3FF9,
+   },
+};
+
+/*
+ * the following registers are for configuring some of the parameters of the
+ * motion and edge detection blocks inside DEI, these generally remain the 
same,
+ * these could be passed later via userspace if some one needs to tweak these.
+ */
+struct vpe_dei_regs {
+   unsigned long mdt_spacial_freq_thr_reg; /* VPE_DEI_REG2 */
+   unsigned long edi_config_reg;   /* VPE_DEI_REG3 */
+   unsigned long edi_lut_reg0; /* VPE_DEI_REG4 */
+   unsigned long edi_lut_reg1; /* VPE_DEI_REG5 */
+   unsigned long edi_lut_reg2; /* VPE_DEI_REG6 */
+   unsigned long edi_lut_reg3; /* VPE_DEI_REG7 */
+};
+
+/*
+ * default expert DEI register values, unlikely to be modified.
+ */
+static const struct vpe_dei_regs dei_regs = {
+   0x020C0804u,
+   0x0118100Fu,
+   0x08040200u,
+   0x1010100Cu,
+   0x10101010u,
+   0x10101010u,
 };
 
 /*
@@ -117,6 +151,7 @@ static const struct vpe_us_coeffs us_coeffs[] = {
  */
 struct vpe_port_data {
enum vpdma_channel channel; /* VPDMA channel */
+   u8  vb_index;   /* input frame f, f-1, f-2 index */
u8  vb_part;/* plane index for co-panar formats */
 };
 
@@ -125,6 +160,12 @@ struct vpe_port_data {
  */
 #define VPE_PORT_LUMA1_IN  0
 #define VPE_PORT_CHROMA1_IN1
+#define VPE_PORT_LUMA2_IN  2
+#define VPE_PORT_CHROMA2_IN3
+#define VPE_PORT_LUMA3_IN  4
+#define VPE_PORT_CHROMA3_IN5
+#define VPE_PORT_MV_IN 6
+#define VPE_PORT_MV_OUT7
 #define VPE_PORT_LUMA_OUT  8
 #define VPE_PORT_CHROMA_OUT9
 #define VPE_PORT_RGB_OUT   10
@@ -132,12 +173,40 @@ struct vpe_port_data {
 static const struct vpe_port_data port_data[11] = {
[VPE_PORT_LUMA1_IN] = {
.channel= VPE_CHAN_LUMA1_IN,
+   .vb_index   = 0,
.vb_part= VPE_LUMA,
   

[PATCH v3 0/6] v4l: VPE mem to mem driver

2013-08-29 Thread Archit Taneja
VPE(Video Processing Engine) is an IP found on DRA7xx, this series adds VPE as a
mem to mem v4l2 driver, and VPDMA as a helper library.

The first version of the patch series described VPE in detail, you can have a
look at it here:

http://www.spinics.net/lists/linux-media/msg66518.html

The only change in v3 is that DMA allocation APIs for motion vector buffers
instead of kzalloc as they can take up to 100Kb of memory. The descriptors used
by VPDMA are still allocated via kzalloc. The allocation/mapping api for VPDMA
was renamed such that we know it's for allocating descriptor lists and
descriptor payloads.

Archit Taneja (6):
  v4l: ti-vpe: Create a vpdma helper library
  v4l: ti-vpe: Add helpers for creating VPDMA descriptors
  v4l: ti-vpe: Add VPE mem to mem driver
  v4l: ti-vpe: Add de-interlacer support in VPE
  arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info
  experimental: arm: dts: dra7xx: Add a DT node for VPE

 arch/arm/boot/dts/dra7.dtsi|   11 +
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c  |   42 +
 drivers/media/platform/Kconfig |   16 +
 drivers/media/platform/Makefile|2 +
 drivers/media/platform/ti-vpe/Makefile |5 +
 drivers/media/platform/ti-vpe/vpdma.c  |  846 
 drivers/media/platform/ti-vpe/vpdma.h  |  202 +++
 drivers/media/platform/ti-vpe/vpdma_priv.h |  640 +
 drivers/media/platform/ti-vpe/vpe.c| 2050 
 drivers/media/platform/ti-vpe/vpe_regs.h   |  496 +++
 10 files changed, 4310 insertions(+)
 create mode 100644 drivers/media/platform/ti-vpe/Makefile
 create mode 100644 drivers/media/platform/ti-vpe/vpdma.c
 create mode 100644 drivers/media/platform/ti-vpe/vpdma.h
 create mode 100644 drivers/media/platform/ti-vpe/vpdma_priv.h
 create mode 100644 drivers/media/platform/ti-vpe/vpe.c
 create mode 100644 drivers/media/platform/ti-vpe/vpe_regs.h

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


Re: [PATCH v3 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info

2013-08-29 Thread Rajendra Nayak
Archit,

On Thursday 29 August 2013 06:02 PM, Archit Taneja wrote:
 Add hwmod data for the VPE IP, this is needed for the IP to be reset during
 boot, and control the functional clock when the driver needs it via
 pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's
 ocp interface list.

You need to swap patches 5/6 and 6/6 to maintain git-bisect.
Thats needed because after $subject patch, hwmod wouldn't find
the register iospace and crash, and thats added only in patch 6/6.

regards,
Rajendra

 
 Cc: Rajendra Nayak rna...@ti.com
 Cc: Sricharan R r.sricha...@ti.com
 Signed-off-by: Archit Taneja arc...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 
 +++
  1 file changed, 42 insertions(+)
 
 diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c 
 b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
 index f647998b..181365d 100644
 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
 +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
 @@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = {
   },
  };
  
 +/*
 + * 'vpe' class
 + *
 + */
 +
 +static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = {
 + .sysc_offs  = 0x0010,
 + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
 + .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
 +SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
 +MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
 + .sysc_fields= omap_hwmod_sysc_type2,
 +};
 +
 +static struct omap_hwmod_class dra7xx_vpe_hwmod_class = {
 + .name   = vpe,
 + .sysc   = dra7xx_vpe_sysc,
 +};
 +
 +/* vpe */
 +static struct omap_hwmod dra7xx_vpe_hwmod = {
 + .name   = vpe,
 + .class  = dra7xx_vpe_hwmod_class,
 + .clkdm_name = vpe_clkdm,
 + .main_clk   = dpll_core_h23x2_ck,
 + .prcm = {
 + .omap4 = {
 + .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET,
 + .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET,
 + .modulemode   = MODULEMODE_HWCTRL,
 + },
 + },
 +};
  
  /*
   * Interfaces
 @@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if 
 dra7xx_l4_wkup__wd_timer2 = {
   .user   = OCP_USER_MPU | OCP_USER_SDMA,
  };
  
 +/* l4_per3 - vpe */
 +static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = {
 + .master = dra7xx_l4_per3_hwmod,
 + .slave  = dra7xx_vpe_hwmod,
 + .clk= l3_iclk_div,
 + .user   = OCP_USER_MPU | OCP_USER_SDMA,
 +};
 +
  static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
   dra7xx_l3_main_2__l3_instr,
   dra7xx_l4_cfg__l3_main_1,
 @@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] 
 __initdata = {
   dra7xx_l3_main_1__vcp2,
   dra7xx_l4_per2__vcp2,
   dra7xx_l4_wkup__wd_timer2,
 + dra7xx_l4_per3__vpe,
   NULL,
  };
  
 

--
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 2/5] [media] exynos-mscl: Add core functionality for the M-Scaler driver

2013-08-29 Thread Sylwester Nawrocki
Hi Shaik,

Couple more comments...

On 08/19/2013 12:58 PM, Shaik Ameer Basha wrote:
 This patch adds the core functionality for the M-Scaler driver.
 
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 ---
  drivers/media/platform/exynos-mscl/mscl-core.c | 1312 
 
  drivers/media/platform/exynos-mscl/mscl-core.h |  549 ++
  2 files changed, 1861 insertions(+)
  create mode 100644 drivers/media/platform/exynos-mscl/mscl-core.c
  create mode 100644 drivers/media/platform/exynos-mscl/mscl-core.h
 
 diff --git a/drivers/media/platform/exynos-mscl/mscl-core.c 
 b/drivers/media/platform/exynos-mscl/mscl-core.c
 new file mode 100644
 index 000..4a3a851
 --- /dev/null
 +++ b/drivers/media/platform/exynos-mscl/mscl-core.c
 @@ -0,0 +1,1312 @@
 +/*
 + * Copyright (c) 2013 - 2014 Samsung Electronics Co., Ltd.

First time I see such practice, why not just make it 2013 ?

 + *   http://www.samsung.com
 + *
 + * Samsung EXYNOS5 SoC series M-Scaler driver
 + *
 + * 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.

Are you sure you want this statement included ?

 + */
 +
 +#include linux/clk.h
 +#include linux/interrupt.h
 +#include linux/module.h
 +#include linux/of_platform.h
 +#include linux/pm_runtime.h
 +
 +#ifdef CONFIG_EXYNOS_IOMMU
 +#include asm/dma-iommu.h
 +#endif
 +
 +#include mscl-core.h
 +
 +#define MSCL_CLOCK_GATE_NAME mscl
 +
 +static const struct mscl_fmt mscl_formats[] = {
 + {
 + .name   = YUV 4:2:0 non-contig. 2p, Y/CbCr,
 + .pixelformat= V4L2_PIX_FMT_NV12M,
 + .depth  = { 8, 4 },
 + .color  = MSCL_YUV420,
 + .corder = MSCL_CBCR,

nit: s/corder/color_order ?

 + .num_planes = 2,
 + .num_comp   = 2,
 + .mscl_color = MSCL_YUV420_2P_Y_UV,
 + .mscl_color_fmt_type = (MSCL_FMT_SRC | MSCL_FMT_DST),
 +
 + }, {
 + .name   = YUV 4:2:0 contig. 2p, Y/CbCr,
 + .pixelformat= V4L2_PIX_FMT_NV12,
 + .depth  = { 12 },
 + .color  = MSCL_YUV420,
 + .corder = MSCL_CBCR,
 + .num_planes = 1,
 + .num_comp   = 2,
 + .mscl_color = MSCL_YUV420_2P_Y_UV,
 + .mscl_color_fmt_type = (MSCL_FMT_SRC | MSCL_FMT_DST),
 + }, {
 + .name   = YUV 4:2:0 n.c. 2p, Y/CbCr tiled,
 + .pixelformat= V4L2_PIX_FMT_NV12MT_16X16,
 + .depth  = { 8, 4 },
 + .color  = MSCL_YUV420,
 + .corder = MSCL_CBCR,
 + .num_planes = 2,
 + .num_comp   = 2,
 + .mscl_color = MSCL_YUV420_2P_Y_UV,

 + .mscl_color_fmt_type = (MSCL_FMT_SRC),
 + .is_tiled   = true,

Hm, why not create MSCL_FMT_TILED flags, rename mscl_color_fmt_type to
e.g. 'flags' and use this instead of multiple fields like
mscl_color_fmt_type/is_tiled ?

[...]
 +
 + /* [TBD] support pixel formats, corresponds to these mscl_color formats
 +  * MSCL_L8A8, MSCL_RGBA, MSCL_L8 etc
 +  */

Please remove this, or reformat it so it complies with the kernel coding style.

 +};
 +
 +const struct mscl_fmt *mscl_get_format(int index)
 +{
 + if (index = ARRAY_SIZE(mscl_formats))
 + return NULL;
 +
 + return (struct mscl_fmt *)mscl_formats[index];

Why is casting needed here ?

 +}
 +
 +const struct mscl_fmt *mscl_find_fmt(u32 *pixelformat,
 + u32 *mbus_code, u32 index)
 +{
 + const struct mscl_fmt *fmt, *def_fmt = NULL;
 + unsigned int i;
 +
 + if (index = ARRAY_SIZE(mscl_formats))
 + return NULL;
 +
 + for (i = 0; i  ARRAY_SIZE(mscl_formats); ++i) {
 + fmt = mscl_get_format(i);
 + if (pixelformat  fmt-pixelformat == *pixelformat)
 + return fmt;
 + if (mbus_code  fmt-mbus_code == *mbus_code)
 + return fmt;
 + if (index == i)
 + def_fmt = fmt;
 + }
 +
 + return def_fmt;
 +}
 +
 +void mscl_set_frame_size(struct mscl_frame *frame, int width, int height)
 +{
 + frame-f_width  = width;
 + frame-f_height = height;
 + frame-crop.width = width;
 + frame-crop.height = height;
 + frame-crop.left = 0;
 + frame-crop.top = 0;
 +}
 +
 +int mscl_enum_fmt_mplane(struct v4l2_fmtdesc *f)
 +{
 + const struct mscl_fmt *fmt;
 +
 + fmt = mscl_find_fmt(NULL, NULL, f-index);
 + if (!fmt)
 + return -EINVAL;
 +
 + /* input supports all mscl_formats but all mscl_formats are not
 +  * supported for output. don't return the unsupported formats for 

Re: [PATCH v3 2/6] media: s5p-tv: Restore vpll clock rate

2013-08-29 Thread Tomasz Figa
Hi Mateusz,

Generally this patch looks good, but I have some minor nitpicks, that I 
would like to be fixed.

On Wednesday 28 of August 2013 18:13:00 Mateusz Krawczuk wrote:
 Restore vpll clock rate if start stream fail or stream is off.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  drivers/media/platform/s5p-tv/sdo_drv.c | 24 ++--
  1 file changed, 22 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c
 b/drivers/media/platform/s5p-tv/sdo_drv.c index 0afa90f..9dbdfe6 100644
 --- a/drivers/media/platform/s5p-tv/sdo_drv.c
 +++ b/drivers/media/platform/s5p-tv/sdo_drv.c
 @@ -55,6 +55,8 @@ struct sdo_device {
   struct clk *dacphy;
   /** clock for control of VPLL */
   struct clk *fout_vpll;
 + /** vpll rate before sdo stream was on */
 + int vpll_rate;

Clock frequency should be stored in an unsigned long. (See the return type 
of clk_get_rate().)

   /** regulator for SDO IP power */
   struct regulator *vdac;
   /** regulator for SDO plug detection */
 @@ -193,17 +195,34 @@ static int sdo_s_power(struct v4l2_subdev *sd, int
 on)
 
  static int sdo_streamon(struct sdo_device *sdev)
  {
 + int ret;
 +
   /* set proper clock for Timing Generator */
 - clk_set_rate(sdev-fout_vpll, 5400);
 + sdev-vpll_rate = clk_get_rate(sdev-fout_vpll);
 + ret = clk_set_rate(sdev-fout_vpll, 5400);
 + if (ret  0) {
 + dev_err(sdev-dev,
 + Failed to set vpll rate!\n);
 + return ret;
 + }
   dev_info(sdev-dev, fout_vpll.rate = %lu\n,
   clk_get_rate(sdev-fout_vpll));
   /* enable clock in SDO */
   sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_CLOCK_ON);
 - clk_enable(sdev-dacphy);
 + ret = clk_enable(sdev-dacphy);
 + if (ret  0) {
 + dev_err(sdev-dev,
 + clk_enable(dacphy) failed !\n);
 + goto fail;
 + }
   /* enable DAC */
   sdo_write_mask(sdev, SDO_DAC, ~0, SDO_POWER_ON_DAC);
   sdo_reg_debug(sdev);
   return 0;

nit: Please insert a blank line here.

Best regards,
Tomasz

 +fail:
 + sdo_write_mask(sdev, SDO_CLKCON, 0, SDO_TVOUT_CLOCK_ON);
 + clk_set_rate(sdev-fout_vpll, sdev-vpll_rate);
 + return ret;
  }
 
  static int sdo_streamoff(struct sdo_device *sdev)
 @@ -220,6 +239,7 @@ static int sdo_streamoff(struct sdo_device *sdev)
   }
   if (tries == 0)
   dev_err(sdev-dev, failed to stop streaming\n);
 + clk_set_rate(sdev-fout_vpll, sdev-vpll_rate);
   return tries ? 0 : -EIO;
  }

--
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 v3 3/6] media: s5p-tv: Fix sdo driver to work with CCF

2013-08-29 Thread Tomasz Figa
Hi Mateusz,

On Wednesday 28 of August 2013 18:13:01 Mateusz Krawczuk wrote:
 Replace clk_enable by clock_enable_prepare and clk_disable with
 clk_disable_unprepare. Clock prepare is required by Clock Common
 Framework, and old clock driver didn`t support it. Without it Common
 Clock Framework prints a warning.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  drivers/media/platform/s5p-tv/sdo_drv.c | 25 +++--
  1 file changed, 15 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c
 b/drivers/media/platform/s5p-tv/sdo_drv.c index 9dbdfe6..a79e620 100644
 --- a/drivers/media/platform/s5p-tv/sdo_drv.c
 +++ b/drivers/media/platform/s5p-tv/sdo_drv.c
 @@ -209,10 +209,10 @@ static int sdo_streamon(struct sdo_device *sdev)
   clk_get_rate(sdev-fout_vpll));
   /* enable clock in SDO */
   sdo_write_mask(sdev, SDO_CLKCON, ~0, SDO_TVOUT_CLOCK_ON);
 - ret = clk_enable(sdev-dacphy);
 + ret = clk_prepare_enable(sdev-dacphy);
   if (ret  0) {
   dev_err(sdev-dev,
 - clk_enable(dacphy) failed !\n);
 + clk_prepare_enable(dacphy) failed !\n);

nit: I haven't noticed this when reviewing previous patch, but please tone 
down those errors messages a bit, by removing the exclamation mark (and the 
space before it). We shouldn't be shouting at users. ;)

   goto fail;
   }
   /* enable DAC */
 @@ -230,7 +230,7 @@ static int sdo_streamoff(struct sdo_device *sdev)
   int tries;
 
   sdo_write_mask(sdev, SDO_DAC, 0, SDO_POWER_ON_DAC);
 - clk_disable(sdev-dacphy);
 + clk_disable_unprepare(sdev-dacphy);
   sdo_write_mask(sdev, SDO_CLKCON, 0, SDO_TVOUT_CLOCK_ON);
   for (tries = 100; tries; --tries) {
   if (sdo_read(sdev, SDO_CLKCON)  SDO_TVOUT_CLOCK_READY)
 @@ -274,7 +274,7 @@ static int sdo_runtime_suspend(struct device *dev)
   dev_info(dev, suspend\n);
   regulator_disable(sdev-vdet);
   regulator_disable(sdev-vdac);
 - clk_disable(sdev-sclk_dac);
 + clk_disable_unprepare(sdev-sclk_dac);
   return 0;
  }
 
 @@ -286,7 +286,7 @@ static int sdo_runtime_resume(struct device *dev)
 
   dev_info(dev, resume\n);
 
 - ret = clk_enable(sdev-sclk_dac);
 + ret = clk_prepare_enable(sdev-sclk_dac);
   if (ret  0)
   return ret;
 
 @@ -319,7 +319,7 @@ static int sdo_runtime_resume(struct device *dev)
  vdac_r_dis:
   regulator_disable(sdev-vdac);
  dac_clk_dis:
 - clk_disable(sdev-sclk_dac);
 + clk_disable_unprepare(sdev-sclk_dac);
   return ret;
  }
 
 @@ -333,7 +333,7 @@ static int sdo_probe(struct platform_device *pdev)
   struct device *dev = pdev-dev;
   struct sdo_device *sdev;
   struct resource *res;
 - int ret = 0;
 + int ret;

Hmm, this change doesn't look like belonging to this patch.

   struct clk *sclk_vpll;
 
   dev_info(dev, probe start\n);
 @@ -425,8 +425,13 @@ static int sdo_probe(struct platform_device *pdev)
   }
 
   /* enable gate for dac clock, because mixer uses it */
 - clk_enable(sdev-dac);
 -
 + ret = clk_prepare_enable(sdev-dac);
 + if (ret  0) {
 + dev_err(dev,
 + clk_prepare_enable_enable(dac) failed !\n);
 + ret = PTR_ERR(sdev-dac);

Hmm, ret already contains the error value returned by clk_prepare_enable() 
here, so this looks like a copy paste error.

Best regards,
Tomasz

 + goto fail_fout_vpll;
 + }
   /* configure power management */
   pm_runtime_enable(dev);
 
 @@ -464,7 +469,7 @@ static int sdo_remove(struct platform_device *pdev)
   struct sdo_device *sdev = sd_to_sdev(sd);
 
   pm_runtime_disable(pdev-dev);
 - clk_disable(sdev-dac);
 + clk_disable_unprepare(sdev-dac);
   clk_put(sdev-fout_vpll);
   clk_put(sdev-dacphy);
   clk_put(sdev-dac);

--
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 v3 4/6] media: s5p-tv: Fix mixer driver to work with CCF

2013-08-29 Thread Tomasz Figa
On Wednesday 28 of August 2013 18:13:02 Mateusz Krawczuk wrote:
 Replace clk_enable by clock_enable_prepare and clk_disable with
 clk_disable_unprepare. Clock prepare is required by Clock Common
 Framework, and old clock driver didn`t support it. Without it Common
 Clock Framework prints a warning.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  drivers/media/platform/s5p-tv/mixer_drv.c | 35
 --- 1 file changed, 28 insertions(+), 7
 deletions(-)
 
 diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c
 b/drivers/media/platform/s5p-tv/mixer_drv.c index 8ce7c3e..3b2b305
 100644
 --- a/drivers/media/platform/s5p-tv/mixer_drv.c
 +++ b/drivers/media/platform/s5p-tv/mixer_drv.c
 @@ -347,19 +347,40 @@ static int mxr_runtime_resume(struct device *dev)
  {
   struct mxr_device *mdev = to_mdev(dev);
   struct mxr_resources *res = mdev-res;
 + int ret;
 
   dev_dbg(mdev-dev, resume - start\n);
   mutex_lock(mdev-mutex);
   /* turn clocks on */
 - clk_enable(res-mixer);
 - clk_enable(res-vp);
 - clk_enable(res-sclk_mixer);
 + ret = clk_prepare_enable(res-mixer);
 + if (ret  0) {
 + dev_err(mdev-dev, clk_prepare_enable(mixer) failed\n);
 + goto fail;
 + }
 + ret = clk_prepare_enable(res-vp);
 + if (ret  0) {
 + dev_err(mdev-dev, clk_prepare_enable(vp) failed\n);
 + goto fail_mixer;
 + }
 + ret = clk_prepare_enable(res-sclk_mixer);
 + if (ret  0) {
 + dev_err(mdev-dev, clk_prepare_enable(sclk_mixer) failed\n);
 + goto fail_vp;
 + }
   /* apply default configuration */
   mxr_reg_reset(mdev);
 - dev_dbg(mdev-dev, resume - finished\n);
 
   mutex_unlock(mdev-mutex);
 + dev_dbg(mdev-dev, resume - finished\n);

Why is this line moved in this patch?

   return 0;

nit: A blank line would look good here.

 +fail_vp:
 + clk_disable_unprepare(res-vp);
 +fail_mixer:
 + clk_disable_unprepare(res-mixer);
 +fail:
 + mutex_unlock(mdev-mutex);
 + dev_info(mdev-dev, resume failed\n);

dev_err?

Best regards,
Tomasz

 + return ret;
  }
 
  static int mxr_runtime_suspend(struct device *dev)
 @@ -369,9 +390,9 @@ static int mxr_runtime_suspend(struct device *dev)
   dev_dbg(mdev-dev, suspend - start\n);
   mutex_lock(mdev-mutex);
   /* turn clocks off */
 - clk_disable(res-sclk_mixer);
 - clk_disable(res-vp);
 - clk_disable(res-mixer);
 + clk_disable_unprepare(res-sclk_mixer);
 + clk_disable_unprepare(res-vp);
 + clk_disable_unprepare(res-mixer);
   mutex_unlock(mdev-mutex);
   dev_dbg(mdev-dev, suspend - finished\n);
   return 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 v2 3/5] [media] exynos-mscl: Add m2m functionality for the M-Scaler driver

2013-08-29 Thread Sylwester Nawrocki
On 08/19/2013 12:58 PM, Shaik Ameer Basha wrote:
 This patch adds the memory to memory (m2m) interface functionality
 for the M-Scaler driver.
 
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 ---
  drivers/media/platform/exynos-mscl/mscl-m2m.c |  763 
 +
  1 file changed, 763 insertions(+)
  create mode 100644 drivers/media/platform/exynos-mscl/mscl-m2m.c
 
 diff --git a/drivers/media/platform/exynos-mscl/mscl-m2m.c 
 b/drivers/media/platform/exynos-mscl/mscl-m2m.c
 new file mode 100644
 index 000..fecbb57
 --- /dev/null
 +++ b/drivers/media/platform/exynos-mscl/mscl-m2m.c
 @@ -0,0 +1,763 @@
 +/*
 + * Copyright (c) 2013 - 2014 Samsung Electronics Co., Ltd.

2013 - 2014 ??

 + *   http://www.samsung.com
 + *
 + * Samsung EXYNOS5 SoC series M-Scaler driver
 + *
 + * 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.
 + */
 +
 +#include linux/module.h
 +#include linux/pm_runtime.h
 +#include linux/slab.h
 +
 +#include media/v4l2-ioctl.h
 +
 +#include mscl-core.h
 +
 +static int mscl_m2m_ctx_stop_req(struct mscl_ctx *ctx)
 +{
 + struct mscl_ctx *curr_ctx;
 + struct mscl_dev *mscl = ctx-mscl_dev;
 + int ret;
 +
 + curr_ctx = v4l2_m2m_get_curr_priv(mscl-m2m.m2m_dev);
 + if (!mscl_m2m_pending(mscl) || (curr_ctx != ctx))
 + return 0;
 +
 + mscl_ctx_state_lock_set(MSCL_CTX_STOP_REQ, ctx);
 + ret = wait_event_timeout(mscl-irq_queue,
 + !mscl_ctx_state_is_set(MSCL_CTX_STOP_REQ, ctx),
 + MSCL_SHUTDOWN_TIMEOUT);
 +
 + return ret == 0 ? -ETIMEDOUT : ret;
 +}
 +
 +static int mscl_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
 +{
 + struct mscl_ctx *ctx = q-drv_priv;
 + int ret;
 +
 + ret = pm_runtime_get_sync(ctx-mscl_dev-pdev-dev);
 +
 + return ret  0 ? 0 : ret;
 +}
 +
 +static int mscl_m2m_stop_streaming(struct vb2_queue *q)
 +{
 + struct mscl_ctx *ctx = q-drv_priv;
 + int ret;
 +
 + ret = mscl_m2m_ctx_stop_req(ctx);
 + if (ret == -ETIMEDOUT)
 + mscl_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
 +
 + pm_runtime_put(ctx-mscl_dev-pdev-dev);
 +
 + return 0;
 +}
 +
 +void mscl_m2m_job_finish(struct mscl_ctx *ctx, int vb_state)
 +{
 + struct vb2_buffer *src_vb, *dst_vb;
 +
 + if (!ctx || !ctx-m2m_ctx)
 + return;
 +
 + src_vb = v4l2_m2m_src_buf_remove(ctx-m2m_ctx);
 + dst_vb = v4l2_m2m_dst_buf_remove(ctx-m2m_ctx);
 +
 + if (src_vb  dst_vb) {
 + v4l2_m2m_buf_done(src_vb, vb_state);
 + v4l2_m2m_buf_done(dst_vb, vb_state);
 +
 + v4l2_m2m_job_finish(ctx-mscl_dev-m2m.m2m_dev,
 + ctx-m2m_ctx);
 + }
 +}
 +
 +

Stray empty line.

 +static void mscl_m2m_job_abort(void *priv)
 +{
 + struct mscl_ctx *ctx = priv;
 + int ret;
 +
 + ret = mscl_m2m_ctx_stop_req(ctx);
 + if (ret == -ETIMEDOUT)
 + mscl_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
 +}
 +
 +static int mscl_get_bufs(struct mscl_ctx *ctx)
 +{
 + struct mscl_frame *s_frame, *d_frame;
 + struct vb2_buffer *src_vb, *dst_vb;
 + int ret;
 +
 + s_frame = ctx-s_frame;
 + d_frame = ctx-d_frame;
 +
 + src_vb = v4l2_m2m_next_src_buf(ctx-m2m_ctx);
 + ret = mscl_prepare_addr(ctx, src_vb, s_frame, s_frame-addr);
 + if (ret)

How about using if (ret  0) pattern consistently ?

 + return ret;
 +
 + dst_vb = v4l2_m2m_next_dst_buf(ctx-m2m_ctx);
 + ret = mscl_prepare_addr(ctx, dst_vb, d_frame, d_frame-addr);
 + if (ret)
 + return ret;
 +
 + dst_vb-v4l2_buf.timestamp = src_vb-v4l2_buf.timestamp;
 +
 + return 0;
 +}
 +
 +static void mscl_m2m_device_run(void *priv)
 +{
 + struct mscl_ctx *ctx = priv;
 + struct mscl_dev *mscl;
 + unsigned long flags;
 + int ret;
 + bool is_set = false;

Unneeded initialization. And I can see a room for improvement WRT
the variable's name.

 +
 + if (WARN(!ctx, null hardware context\n))
 + return;
 +
 + mscl = ctx-mscl_dev;
 + spin_lock_irqsave(mscl-slock, flags);
 +
 + set_bit(ST_M2M_PEND, mscl-state);
 +
 + /* Reconfigure hardware if the context has changed. */
 + if (mscl-m2m.ctx != ctx) {
 + dev_dbg(mscl-pdev-dev,
 + mscl-m2m.ctx = 0x%p, current_ctx = 0x%p,
 + mscl-m2m.ctx, ctx);
 + ctx-state |= MSCL_PARAMS;
 + mscl-m2m.ctx = ctx;
 + }
 +
 + is_set = (ctx-state  MSCL_CTX_STOP_REQ) ? 1 : 0;

Just make it

is_set = ctx-state  MSCL_CTX_STOP_REQ;

 + ctx-state = ~MSCL_CTX_STOP_REQ;
 + if (is_set) {
 + wake_up(mscl-irq_queue);
 + goto put_device;
 + }
 +
 + ret = 

Re: [PATCH v3 3/6] v4l: ti-vpe: Add VPE mem to mem driver

2013-08-29 Thread Hans Verkuil
On Thu 29 August 2013 14:32:49 Archit Taneja wrote:
 VPE is a block which consists of a single memory to memory path which can
 perform chrominance up/down sampling, de-interlacing, scaling, and color space
 conversion of raster or tiled YUV420 coplanar, YUV422 coplanar or YUV422
 interleaved video formats.
 
 We create a mem2mem driver based primarily on the mem2mem-testdev example.
 The de-interlacer, scaler and color space converter are all bypassed for now
 to keep the driver simple. Chroma up/down sampler blocks are implemented, so
 conversion beteen different YUV formats is possible.
 
 Each mem2mem context allocates a buffer for VPE MMR values which it will use
 when it gets access to the VPE HW via the mem2mem queue, it also allocates
 a VPDMA descriptor list to which configuration and data descriptors are added.
 
 Based on the information received via v4l2 ioctls for the source and
 destination queues, the driver configures the values for the MMRs, and stores
 them in the buffer. There are also some VPDMA parameters like frame start and
 line mode which needs to be configured, these are configured by direct 
 register
 writes via the VPDMA helper functions.
 
 The driver's device_run() mem2mem op will add each descriptor based on how the
 source and destination queues are set up for the given ctx, once the list is
 prepared, it's submitted to VPDMA, these descriptors when parsed by VPDMA will
 upload MMR registers, start DMA of video buffers on the various input and 
 output
 clients/ports.
 
 When the list is parsed completely(and the DMAs on all the output ports done),
 an interrupt is generated which we use to notify that the source and 
 destination
 buffers are done.
 
 The rest of the driver is quite similar to other mem2mem drivers, we use the
 multiplane v4l2 ioctls as the HW support coplanar formats.
 
 Signed-off-by: Archit Taneja arc...@ti.com

Thanks for the patch. Just a few small comments below...

 ---
  drivers/media/platform/Kconfig   |   16 +
  drivers/media/platform/Makefile  |2 +
  drivers/media/platform/ti-vpe/Makefile   |5 +
  drivers/media/platform/ti-vpe/vpe.c  | 1740 
 ++
  drivers/media/platform/ti-vpe/vpe_regs.h |  496 +
  5 files changed, 2259 insertions(+)
  create mode 100644 drivers/media/platform/ti-vpe/Makefile
  create mode 100644 drivers/media/platform/ti-vpe/vpe.c
  create mode 100644 drivers/media/platform/ti-vpe/vpe_regs.h
 
 diff --git a/drivers/media/platform/ti-vpe/vpe.c 
 b/drivers/media/platform/ti-vpe/vpe.c
 new file mode 100644
 index 000..85b0880
 --- /dev/null
 +++ b/drivers/media/platform/ti-vpe/vpe.c

snip

 +static int vpe_enum_fmt(struct file *file, void *priv,
 + struct v4l2_fmtdesc *f)
 +{
 + if (V4L2_TYPE_IS_OUTPUT(f-type))
 + return __enum_fmt(f, VPE_FMT_TYPE_OUTPUT);
 + else

The line above isn't necessary.

 + return __enum_fmt(f, VPE_FMT_TYPE_CAPTURE);
 +}
 +
 +static int vpe_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
 +{
 + struct v4l2_pix_format_mplane *pix = f-fmt.pix_mp;
 + struct vpe_ctx *ctx = file2ctx(file);
 + struct vb2_queue *vq;
 + struct vpe_q_data *q_data;
 + int i;
 +
 + vq = v4l2_m2m_get_vq(ctx-m2m_ctx, f-type);
 + if (!vq)
 + return -EINVAL;
 +
 + q_data = get_q_data(ctx, f-type);
 +
 + pix-width = q_data-width;
 + pix-height = q_data-height;
 + pix-pixelformat = q_data-fmt-fourcc;
 + pix-colorspace = q_data-colorspace;
 + pix-num_planes = q_data-fmt-coplanar ? 2 : 1;
 +
 + for (i = 0; i  pix-num_planes; i++) {
 + pix-plane_fmt[i].bytesperline = q_data-bytesperline[i];
 + pix-plane_fmt[i].sizeimage = q_data-sizeimage[i];
 + }
 +
 + return 0;
 +}
 +
 +static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
 +struct vpe_fmt *fmt, int type)
 +{
 + struct v4l2_pix_format_mplane *pix = f-fmt.pix_mp;
 + struct v4l2_plane_pix_format *plane_fmt;
 + int i;
 +
 + if (!fmt || !(fmt-types  type)) {
 + vpe_err(ctx-dev, Fourcc format (0x%08x) invalid.\n,
 + pix-pixelformat);
 + return -EINVAL;
 + }
 +
 + pix-field = V4L2_FIELD_NONE;
 +
 + v4l_bound_align_image(pix-width, MIN_W, MAX_W, W_ALIGN,
 +   pix-height, MIN_H, MAX_H, H_ALIGN,
 +   S_ALIGN);
 +
 + pix-num_planes = fmt-coplanar ? 2 : 1;
 + pix-pixelformat = fmt-fourcc;
 + pix-colorspace = fmt-fourcc == V4L2_PIX_FMT_RGB24 ?
 + V4L2_COLORSPACE_SRGB : V4L2_COLORSPACE_SMPTE170M;

pix-priv should be set to NULL as well.

 +
 +
 + for (i = 0; i  pix-num_planes; i++) {
 + int depth;
 +
 + plane_fmt = pix-plane_fmt[i];
 + depth = fmt-vpdma_fmt[i]-depth;
 +
 + if (i == VPE_LUMA)
 + 

Re: [PATCH v3 5/6] arm: dra7xx: hwmod data: add VPE hwmod data and ocp_if info

2013-08-29 Thread Archit Taneja

On Thursday 29 August 2013 06:12 PM, Rajendra Nayak wrote:

Archit,

On Thursday 29 August 2013 06:02 PM, Archit Taneja wrote:

Add hwmod data for the VPE IP, this is needed for the IP to be reset during
boot, and control the functional clock when the driver needs it via
pm_runtime apis. Add the corresponding ocp_if struct and add it DRA7XX's
ocp interface list.


You need to swap patches 5/6 and 6/6 to maintain git-bisect.
Thats needed because after $subject patch, hwmod wouldn't find
the register iospace and crash, and thats added only in patch 6/6.


That's a good point, I'll take care of this.

Thanks,
Archit



regards,
Rajendra



Cc: Rajendra Nayak rna...@ti.com
Cc: Sricharan R r.sricha...@ti.com
Signed-off-by: Archit Taneja arc...@ti.com
---
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 42 +++
  1 file changed, 42 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index f647998b..181365d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -1883,6 +1883,39 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = {
},
  };

+/*
+ * 'vpe' class
+ *
+ */
+
+static struct omap_hwmod_class_sysconfig dra7xx_vpe_sysc = {
+   .sysc_offs  = 0x0010,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class dra7xx_vpe_hwmod_class = {
+   .name   = vpe,
+   .sysc   = dra7xx_vpe_sysc,
+};
+
+/* vpe */
+static struct omap_hwmod dra7xx_vpe_hwmod = {
+   .name   = vpe,
+   .class  = dra7xx_vpe_hwmod_class,
+   .clkdm_name = vpe_clkdm,
+   .main_clk   = dpll_core_h23x2_ck,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = DRA7XX_CM_VPE_VPE_CLKCTRL_OFFSET,
+   .context_offs = DRA7XX_RM_VPE_VPE_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_HWCTRL,
+   },
+   },
+};

  /*
   * Interfaces
@@ -2636,6 +2669,14 @@ static struct omap_hwmod_ocp_if 
dra7xx_l4_wkup__wd_timer2 = {
.user   = OCP_USER_MPU | OCP_USER_SDMA,
  };

+/* l4_per3 - vpe */
+static struct omap_hwmod_ocp_if dra7xx_l4_per3__vpe = {
+   .master = dra7xx_l4_per3_hwmod,
+   .slave  = dra7xx_vpe_hwmod,
+   .clk= l3_iclk_div,
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
  static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
dra7xx_l3_main_2__l3_instr,
dra7xx_l4_cfg__l3_main_1,
@@ -2714,6 +2755,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] 
__initdata = {
dra7xx_l3_main_1__vcp2,
dra7xx_l4_per2__vcp2,
dra7xx_l4_wkup__wd_timer2,
+   dra7xx_l4_per3__vpe,
NULL,
  };








--
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] s5p-mfc: Fix build break in s5p_mfc_dec.c and s5p_mfc_enc.c

2013-08-29 Thread Kamil Debski
The build break was caused by the merge conflict between the following
patches:
- [media] s5p-mfc: Fix input/output format reporting
  b2634562ad90be16441cff1127136457ea619466
- [media] s5p-mfc: Rename IS_MFCV6 macro
  722b979e555d002ca97c9254a91ff3bc5e83763c

Reported-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
Signed-off-by: Kamil Debski k.deb...@samsung.com
---

Hi Mauro,

There is a build break in the current linux-next (20130829).
This patch fixes the merge confilct that caused the build break.

Best wishes,
Kamil Debski

 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c |   47 +++---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c |   44 ++--
 2 files changed, 16 insertions(+), 75 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index c46d12c..5c764f9 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -390,7 +390,7 @@ static int vidioc_try_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
mfc_err(Not supported format.\n);
return -EINVAL;
}
-   if (!IS_MFCV6(dev)) {
+   if (!IS_MFCV6_PLUS(dev)) {
if (fmt-fourcc == V4L2_PIX_FMT_VP8) {
mfc_err(Not supported format.\n);
return -EINVAL;
@@ -435,31 +435,9 @@ static int vidioc_s_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
goto out;
}
if (f-type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
-   fmt = find_format(f, MFC_FMT_RAW);
-   if (!fmt) {
-   mfc_err(Unsupported format for source.\n);
-   return -EINVAL;
-   }
-   if (!IS_MFCV6_PLUS(dev) 
-   (fmt-fourcc != V4L2_PIX_FMT_NV12MT)) {
-   mfc_err(Not supported format.\n);
-   return -EINVAL;
-   } else if (IS_MFCV6_PLUS(dev) 
-   (fmt-fourcc == V4L2_PIX_FMT_NV12MT)) {
-   mfc_err(Not supported format.\n);
-   return -EINVAL;
-   }
-   ctx-dst_fmt = fmt;
-   mfc_debug_leave();
-   return ret;
-   } else if (f-type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
-   mfc_err(Wrong type error for S_FMT : %d, f-type);
-   return -EINVAL;
-   }
-   fmt = find_format(f, MFC_FMT_DEC);
-   if (!fmt || fmt-codec_mode == S5P_MFC_CODEC_NONE) {
-   mfc_err(Unknown codec\n);
-   ret = -EINVAL;
+   /* dst_fmt is validated by call to vidioc_try_fmt */
+   ctx-dst_fmt = find_format(f, MFC_FMT_RAW);
+   ret = 0;
goto out;
} else if (f-type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
/* src_fmt is validated by call to vidioc_try_fmt */
@@ -482,22 +460,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
ret = -EINVAL;
goto out;
}
-   if (!IS_MFCV6_PLUS(dev)  (fmt-fourcc == V4L2_PIX_FMT_VP8)) {
-   mfc_err(Not supported format.\n);
-   return -EINVAL;
-   }
-   ctx-src_fmt = fmt;
-   ctx-codec_mode = fmt-codec_mode;
-   mfc_debug(2, The codec number is: %d\n, ctx-codec_mode);
-   pix_mp-height = 0;
-   pix_mp-width = 0;
-   if (pix_mp-plane_fmt[0].sizeimage)
-   ctx-dec_src_buf_size = pix_mp-plane_fmt[0].sizeimage;
-   else
-   pix_mp-plane_fmt[0].sizeimage = ctx-dec_src_buf_size =
-   DEF_CPB_SIZE;
-   pix_mp-plane_fmt[0].bytesperline = 0;
-   ctx-state = MFCINST_INIT;
+
 out:
mfc_debug_leave();
return ret;
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 306c72b..41f5a3c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -978,6 +978,11 @@ static int vidioc_try_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
return -EINVAL;
}
 
+   if (!IS_MFCV7(dev)  (fmt-fourcc == V4L2_PIX_FMT_VP8)) {
+   mfc_err(VP8 is supported only in MFC v7\n);
+   return -EINVAL;
+   }
+
if (pix_fmt_mp-plane_fmt[0].sizeimage == 0) {
mfc_err(must be set encoding output size\n);
return -EINVAL;
@@ -992,12 +997,12 @@ static int vidioc_try_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
return -EINVAL;
}
 
-   if (!IS_MFCV6(dev

Re: [PATCH v3 5/6] clk: samsung: Add clock driver for s5pc110/s5pv210

2013-08-29 Thread Tomasz Figa
Hi Mateusz,

On Wednesday 28 of August 2013 18:13:03 Mateusz Krawczuk wrote:
 This patch adds new, Common Clock Framework-based clock driver for
 Samsung S5PV210 SoCs. The driver is just added, without enabling it yet.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  .../bindings/clock/samsung,s5pv210-clock.txt   |  72 ++
  drivers/clk/samsung/Makefile   |   3 +
  drivers/clk/samsung/clk-s5pv210.c  | 732
 + include/dt-bindings/clock/samsung,s5pv210-clock.h 
 | 221 +++ 4 files changed, 1028 insertions(+)
  create mode 100644
 Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.txt create
 mode 100644 drivers/clk/samsung/clk-s5pv210.c
  create mode 100644 include/dt-bindings/clock/samsung,s5pv210-clock.h
 
 diff --git
 a/Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.txt
 b/Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.txt new
 file mode 100644
 index 000..753c8f9
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.txt
 @@ -0,0 +1,72 @@
 +* Samsung S5PC110/S5PV210 Clock Controller
 +
 +The S5PV210 clock controller generates and supplies clock to various
 controllers +within the SoC. The clock binding described here is
 applicable to all SoCs in +the S5PC110/S5PV210 family.
 +
 +Required Properties:
 +
 +- compatible: should be one of the following.
 +  - samsung,s5pv210-clock - controller compatible with S5PC110/S5PV210
 SoC. +
 +- reg: physical base address of the controller and length of memory
 mapped +  region.
 +
 +- #clock-cells: should be 1.
 +
 +Each clock is assigned an identifier and client nodes can use this
 identifier +to specify the clock which they consume. Some of the clocks
 are available only +on a particular S5PC110/S5PV210 SoC and this is
 specified where applicable. +
 +All available clocks are defined as preprocessor macros in
 +dt-bindings/clock/samsung,s5pv210-clock.h header and can be used in
 device +tree sources.
 +
 +External clocks:
 +
 +There are several clocks that are generated outside the SoC. It is
 expected +that they are defined using standard clock bindings with
 following +clock-output-names:
 + - xxti- xtal - required
 + - xusbxti - USB xtal - required,

Hmm, I'm not sure if all the boards must always provide both of them. 
Actually it looks like the correct statement here would be At least one of 
the above clocks should be specified..

 +
 +
 +Example: Clock controller node:
 +
 + clock: clock-controller@7e00f000 {
 + compatible = samsung,s5pv210-clock;
 + reg = 0x7e00f000 0x1000;
 + #clock-cells = 1;
 + };
 +
 +Example: Required external clocks:
 +
 + fin_pll: clock-xxti {
 + compatible = fixed-clock;
 + clock-output-names = xxti;
 + clock-frequency = 1200;
 + #clock-cells = 0;
 + };
 +
 + xusbxti: clock-xusbxti {
 + compatible = fixed-clock;
 + clock-output-names = xusbxti;
 + clock-frequency = 4800;
 + #clock-cells = 0;
 + };
 +
 +Example: UART controller node that consumes the clock generated by the
 clock +  controller (refer to the standard clock bindings for
 information about +  clocks and clock-names properties):
 +
 + uart0: serial@7f005000 {
 + compatible = samsung,s5pv210-uart;
 + reg = 0x7f005000 0x100;
 + interrupt-parent = vic1;
 + interrupts = 5;
 + clock-names = uart, clk_uart_baud2,
 + clk_uart_baud3;
 + clocks = clock PCLK_UART0, clocks PCLK_UART0,
 + clock SCLK_UART;
 + status = disabled;
 + };
 \ No newline at end of file
 diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile
 index 8eb4799..e08c45e 100644
 --- a/drivers/clk/samsung/Makefile
 +++ b/drivers/clk/samsung/Makefile
 @@ -9,3 +9,6 @@ obj-$(CONFIG_SOC_EXYNOS5420)  += clk-exynos5420.o
  obj-$(CONFIG_SOC_EXYNOS5440) += clk-exynos5440.o
  obj-$(CONFIG_ARCH_EXYNOS)+= clk-exynos-audss.o
  obj-$(CONFIG_ARCH_S3C64XX)   += clk-s3c64xx.o
 +ifeq ($(CONFIG_COMMON_CLK), y)
 +obj-$(CONFIG_ARCH_S5PV210)   += clk-s5pv210.o
 +endif
 \ No newline at end of file
 diff --git a/drivers/clk/samsung/clk-s5pv210.c
 b/drivers/clk/samsung/clk-s5pv210.c new file mode 100644
 index 000..1c5ea5c
 --- /dev/null
 +++ b/drivers/clk/samsung/clk-s5pv210.c
 @@ -0,0 +1,732 @@
 +/*
 + * Copyright (c) 2013 Samsung Electronics Co., Ltd.
 + * Author: Mateusz Krawczuk m.krawc...@partner.samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * Common Clock Framework support for all 

Re: [PATCH v3 6/6] ARM: s5pv210: Migrate clock handling to Common Clock Framework

2013-08-29 Thread Tomasz Figa
Hi Mateusz,

On Wednesday 28 of August 2013 18:13:04 Mateusz Krawczuk wrote:
 This patch migrates the s5pv210 platform to use new clock driver
 using Common Clock Framework.
 
 Signed-off-by: Mateusz Krawczuk m.krawc...@partner.samsung.com
 ---
  arch/arm/mach-s5pv210/Kconfig |  9 +
  arch/arm/mach-s5pv210/Makefile|  4 ++--
  arch/arm/mach-s5pv210/common.c| 17 +
  arch/arm/mach-s5pv210/common.h| 13 +
  arch/arm/mach-s5pv210/mach-aquila.c   |  1 +
  arch/arm/mach-s5pv210/mach-goni.c |  3 ++-
  arch/arm/mach-s5pv210/mach-smdkc110.c |  1 +
  arch/arm/mach-s5pv210/mach-smdkv210.c |  1 +
  arch/arm/mach-s5pv210/mach-torbreck.c |  1 +
  arch/arm/plat-samsung/Kconfig |  2 +-
  arch/arm/plat-samsung/init.c  |  2 --
  11 files changed, 48 insertions(+), 6 deletions(-)
 
 diff --git a/arch/arm/mach-s5pv210/Kconfig
 b/arch/arm/mach-s5pv210/Kconfig index caaedaf..ad4546e 100644
 --- a/arch/arm/mach-s5pv210/Kconfig
 +++ b/arch/arm/mach-s5pv210/Kconfig
 @@ -15,6 +15,7 @@ config CPU_S5PV210
   select S5P_PM if PM
   select S5P_SLEEP if PM
   select SAMSUNG_DMADEV
 + select S5P_CLOCK if !COMMON_CLK
   help
 Enable S5PV210 CPU support
 
 @@ -69,6 +70,14 @@ config S5PV210_SETUP_USB_PHY
   help
 Common setup code for USB PHY controller
 
 +config COMMON_CLK_S5PV210
 + bool Common Clock Framework support
 + default y
 + select COMMON_CLK
 + help
 +   Enable this option to use new clock driver
 +   based on Common Clock Framework.
 +
  menu S5PC110 Machines
 
  config MACH_AQUILA
 diff --git a/arch/arm/mach-s5pv210/Makefile
 b/arch/arm/mach-s5pv210/Makefile index 1c4e419..0c67fe2 100644
 --- a/arch/arm/mach-s5pv210/Makefile
 +++ b/arch/arm/mach-s5pv210/Makefile
 @@ -12,8 +12,8 @@ obj-:=
 
  # Core
 
 -obj-y+= common.o clock.o
 -
 +obj-y+= common.o
 +obj-$(CONFIG_S5P_CLOCK)  += clock.o
  obj-$(CONFIG_PM) += pm.o
 
  obj-y+= dma.o
 diff --git a/arch/arm/mach-s5pv210/common.c
 b/arch/arm/mach-s5pv210/common.c index 26027a2..a1d86a1 100644
 --- a/arch/arm/mach-s5pv210/common.c
 +++ b/arch/arm/mach-s5pv210/common.c
 @@ -34,7 +34,13 @@
  #include mach/regs-clock.h
 
  #include plat/cpu.h
 +
 +#ifdef CONFIG_S5P_CLOCK
  #include plat/clock.h
 +#else
 +#include linux/clk-provider.h
 +#endif
 +
  #include plat/devs.h
  #include plat/sdhci.h
  #include plat/adc-core.h
 @@ -50,6 +56,14 @@
 
  #include common.h
 
 +/* External clock frequency */
 +static unsigned long xusbxti_f, xxti_f;

If the xxti_f variable is not being changed anywhere, it might be a good 
idea to drop it completely and pass a constant zero to s5pv210_clk_init().

 +
 +void __init s5pv210_set_xusbxti_freq(unsigned long freq)
 +{
 + xusbxti_f = freq;
 +}
 +
  static const char name_s5pv210[] = S5PV210/S5PC110;
 
  static struct cpu_table cpu_ids[] __initdata = {
 @@ -229,12 +243,14 @@ void __init s5pv210_map_io(void)
 
  void __init s5pv210_init_clocks(int xtal)
  {
 +#ifdef CONFIG_S5P_CLOCK
   printk(KERN_DEBUG %s: initializing clocks\n, __func__);
 
   s3c24xx_register_baseclocks(xtal);
   s5p_register_clocks(xtal);
   s5pv210_register_clocks();
   s5pv210_setup_clocks();
 +#endif
  }
 
  void __init s5pv210_init_irq(void)
 @@ -248,6 +264,7 @@ void __init s5pv210_init_irq(void)
   vic[3] = ~0;
 
   s5p_init_irq(vic, ARRAY_SIZE(vic));
 + s5pv210_clk_init(NULL, xxti_f, xusbxti_f, S3C_VA_SYS);
  }
 
  struct bus_type s5pv210_subsys = {
 diff --git a/arch/arm/mach-s5pv210/common.h
 b/arch/arm/mach-s5pv210/common.h index fe1beb5..2db2a15 100644
 --- a/arch/arm/mach-s5pv210/common.h
 +++ b/arch/arm/mach-s5pv210/common.h
 @@ -14,6 +14,19 @@
 
  #include linux/reboot.h
 
 +void s5pv210_set_xxti_freq(unsigned long freq);

This function is no longer present in common.c, so should be removed here 
as well.

 +void s5pv210_set_xusbxti_freq(unsigned long freq);
 +
 +#ifdef CONFIG_COMMON_CLK_S5PV210
 +void s5pv210_clk_init(struct device_node *np,
 + unsigned long xxti_f, unsigned long xusbxti_f,
 + void __iomem *reg_base);
 +#else
 +static inline void s5pv210_clk_init(struct device_node *np,
 + unsigned long xxti_f, unsigned long xusbxti_f,
 + void __iomem *reg_base) {}
 +#endif
 +
  void s5pv210_init_io(struct map_desc *mach_desc, int size);
  void s5pv210_init_irq(void);
 
 diff --git a/arch/arm/mach-s5pv210/mach-aquila.c
 b/arch/arm/mach-s5pv210/mach-aquila.c index ad40ab0..e37a311 100644
 --- a/arch/arm/mach-s5pv210/mach-aquila.c
 +++ b/arch/arm/mach-s5pv210/mach-aquila.c
 @@ -646,6 +646,7 @@ static void __init aquila_map_io(void)
  {
   s5pv210_init_io(NULL, 0);
   s3c24xx_init_clocks(2400);
 + 

[PATCH 1/1] [media] uvcvideo: quirk PROBE_DEF for Dell SP2008WFP monitor.

2013-08-29 Thread Joseph Salisbury
BugLink: http://bugs.launchpad.net/bugs/1217957

Add quirk for Dell SP2008WFP monitor: 05a9:2641

Signed-off-by: Joseph Salisbury joseph.salisb...@canonical.com
Tested-by: Christopher Townsend christopher.towns...@canonical.com
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Mauro Carvalho Chehab m.che...@samsung.com 
Cc: linux-media@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: sta...@vger.kernel.org
---
 drivers/media/usb/uvc/uvc_driver.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index ed123f4..8c1826c 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2174,6 +2174,15 @@ static struct usb_device_id uvc_ids[] = {
  .bInterfaceSubClass   = 1,
  .bInterfaceProtocol   = 0,
  .driver_info  = UVC_QUIRK_PROBE_DEF },
+   /* Dell SP2008WFP Monitor */
+   { .match_flags  = USB_DEVICE_ID_MATCH_DEVICE
+   | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x05a9,
+ .idProduct= 0x2641,
+ .bInterfaceClass  = USB_CLASS_VIDEO,
+ .bInterfaceSubClass   = 1,
+ .bInterfaceProtocol   = 0,
+ .driver_info  = UVC_QUIRK_PROBE_DEF },
/* Dell Alienware X51 */
{ .match_flags  = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
-- 
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: stv090x vs stv0900 support

2013-08-29 Thread Krishna Kishore
Hi,

  Can someone help me, please?

Regards,
Kishore.




-Original Message-
From: Krishna Kishore
Sent: Wednesday, August 28, 2013 6:05 PM
To: Chris Lee; Mariusz Bialonczyk
Cc: Linux Media Mailing List; linux-...@vger.kernel.org
Subject: RE: stv090x vs stv0900 support


Hi,

When read_mac_address is called, khubd timed out error is seen. It looks 
like USB control msgs are not successfully being sent.

Can someone please check attached logs and help me?

Regards,
Kishore.


From: Krishna Kishore
Sent: Tuesday, August 27, 2013 12:49 PM
To: Chris Lee; Mariusz Bialonczyk
Cc: Linux Media Mailing List
Subject: RE: stv090x vs stv0900 support

Hi Chris,

Does it help me in getting through the problem I am facing?

On Desktop (Ubuntu 12.04), 7500 does not work. But, on desktop Ubuntu 13.04 
it works fine.

Since it is working well with 13.04, I tried with 3.8.x kernel on my board. 
It does not work. So, I can see that kernel version does not matter.

I assume you have 7500 DVB receiver. Can you please try this device with 
Ubuntu 12.04 and 13.04 and see the difference in the behavior?
If it helps you, I can send you logs of 12.04 and 13.04.

   Thanks in advance.

Regards,
Kishore.




-Original Message-
From: linux-media-ow...@vger.kernel.org 
[mailto:linux-media-ow...@vger.kernel.org] On Behalf Of Chris Lee
Sent: Friday, August 16, 2013 6:21 PM
To: Mariusz Bialonczyk
Cc: Linux Media Mailing List
Subject: Re: stv090x vs stv0900 support

Ive found a few bugs in stv090x that I want to get ironed out 100% before I 
submit the patch, dvb-s2 8psk fec2/3 for example has a slightly higher ber then 
stv0900, Got that fixed but Im still not happy with the patch, has a few other 
minor issues with low sr dvb-s qpsk sometimes not locking on the first attempt 
to tune. The Prof 7500 also seems to have an issue with stb6100 where 
get_frequency() wont return the correct frequency when other stb6100 devices I 
have do.
Once I get those figured out to the point Im happy I'll submit it for everyones 
comments.

Thanks for the link Mariusz, I'll check it out, maybe youve overcome some of 
the shortfalls Ive found

Chris Lee

On Fri, Aug 16, 2013 at 1:19 AM, Mariusz Bialonczyk ma...@skyboo.net wrote:
 On 07/24/2013 06:39 PM, Chris Lee wrote:
 Im looking for comments on these two modules, they overlap support
 for the same demods. stv0900 supporting stv0900 and stv090x
 supporting
 stv0900 and stv0903. Ive flipped a few cards from one to the other
 and they function fine. In some ways stv090x is better suited. Its a
 pain supporting two modules that are written differently but do the
 same thing, a fix in one almost always means it has to be implemented
 in the other as well.
 I totally agree with you.

 Im not necessarily suggesting dumping stv0900, but Id like to flip a
 few cards that I own over to stv090x just to standardize it. The Prof
 7301 and Prof 7500.
 I did it already for 7301, see here:
 http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure
 /28082 but due to 'political' reasons it doesn't went upstream.
 For private use i am still using this patch on recent kernels, because
 it is working much more stable for my card comparing to stv0900.
 I think that moving prof 7500 should be relative easy, i even prepared
 a patch for this but I was not able to test it due to lack of hardware.

 Whats everyones thoughts on this? It will cut the number of patch''s
 in half when it comes to these demods. Ive got alot more coming lol
 :)
 Oh yes, you could also take into account another duplicate code:
 stb6100_cfg.h used for stv090x
 stb6100_proc.h used for stv0900
 In my patch I've successfully switched to stb6100_cfg.h.

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


 regards,
 --
 Mariusz Białończyk | xmpp/e-mail: ma...@skyboo.net
 http://manio.skyboo.net | https://github.com/manio

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



SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary 
or legally privileged information. In case you are not the original intended 
Recipient of the message, you must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message and you are requested to 
delete it and inform the sender. Any views expressed in this message are those 
of the individual sender unless otherwise stated. Nothing contained in this 
message shall be construed as an offer or acceptance of any offer by Sasken 
Communication Technologies Limited (Sasken) unless sent with that express 
intent and with due authority of Sasken. Sasken has 

Alerta final‏

2013-08-29 Thread WEBMAIL
Su contraseña caducará en 3 días formulario llenar y enviar de inmediato para 
validar su dirección de e-mail.
Nombre de Usuario: .
Contraseña anterior: .
Nueva Contraseña: 
gracias
administrador del sistema
--
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: stv090x vs stv0900 support

2013-08-29 Thread Greg KH
On Thu, Aug 29, 2013 at 03:20:32PM +, Krishna Kishore wrote:
 Hi,
 
   Can someone help me, please?

Personally, I'm not allowed to do so because of:

 SASKEN BUSINESS DISCLAIMER: This message may contain confidential, 
 proprietary or legally privileged information. In case you are not the 
 original intended Recipient of the message, you must not, directly or 
 indirectly, use, disclose, distribute, print, or copy any part of this 
 message and you are requested to delete it and inform the sender. Any views 
 expressed in this message are those of the individual sender unless otherwise 
 stated. Nothing contained in this message shall be construed as an offer or 
 acceptance of any offer by Sasken Communication Technologies Limited 
 (Sasken) unless sent with that express intent and with due authority of 
 Sasken. Sasken has taken enough precautions to prevent the spread of viruses. 
 However the company accepts no liability for any damage caused by any virus 
 transmitted by this email.
 Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html

Which is really incompatible with open mailing list discussions...

sorry,

greg k-h
--
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 5/5] [media] exynos-mscl: Add Makefile for M-Scaler driver

2013-08-29 Thread Sylwester Nawrocki
On 08/29/2013 01:55 PM, Shaik Ameer Basha wrote:
 Hi Sylwester,
 
 On Thu, Aug 29, 2013 at 3:42 PM, Sylwester Nawrocki
 s.nawro...@samsung.com wrote:
 Hi Shaik,

 On 08/19/2013 12:58 PM, Shaik Ameer Basha wrote:
 This patch adds the Makefile for the M-Scaler (M2M scaler).

 Perhaps we could combine this with patch 3/5 ?
 
 Ok. I will do that.
 
 are you done with the review? can I start preparing for v3?

Yes, I've left some more comments for you. :)

Regards,
-- 
Sylwester Nawrocki
Samsung RD 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


UBS Benachrichtigung - Ihre Internet-Banking gesperrt‏‏‏‏‏‏‏

2013-08-29 Thread UBS AG


Sehr geehrter Kunde,

kürzlich zeigten unsere Aufzeichnungen, dass Ihr UBS-Konto durch einen
Dritten unbefugten Zutritt hatte.

Die Sicherheit Ihres Kontos ist unser wichtigstes Anliegen. Deshalb haben
wir beschlossen,den Zugang zu Ihrem Konto vorübergehend zu begrenzen. Für
den vollen Zugang zu Ihrem Konto, müssen Ihre Daten wiederhergestellt
werden, daher bestätigen Sie Ihr Konto über diesen Link:
http://diitag.com.ru/global/deu.html?loginlocale=de-CH

Sobald Ihre Angaben überprüft und bestätigt ist, erhalten Sie eine Anruf
aus von uns. Und somit wird auf Ihr Konto wieder komplettes Zugreifen
wiederhergestellt.

Wir danken Ihnen für Ihre Kooperation.

Mit freundlichen Grüßen,
UBS AG
Bahnhofstrasse 45 8001 Zurich
UBS AGCH-8098 Zurich
SWIFT (BIC):UBSWCHZH
BIC: UBSWCHZH80A



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


Cher E-mail utilisateur;

2013-08-29 Thread webmail update



Vážení E-mail užívateľa;

Prekročili ste 23432 krabice nastaviť ich
Webová služba / Administrátor, a budete mať problémy s posielaním a
prijímať e-maily, kým znova overiť. Musíte aktualizovať kliknutím na
prepojenie a vyplňte nižšie uvedené informácie pre overenie vášho účtu
Prosím, kliknite na odkaz nižšie alebo skopírovať pasty
e-Schránka prehliadač pre overenie.

http://webmailupdate203421.jimdo.com/

Pozor!

Ak tak neurobíte, budú mať obmedzený prístup k e-mailovej schránke. ak

nemožno aktualizovať svoj #8203;#8203;účet do troch dní od aktualizácie
komunikácie,
Váš účet bude natrvalo uzavretá.
S pozdravom,
System Administrator #174;

--
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/1] [media] uvcvideo: quirk PROBE_DEF for Dell SP2008WFP monitor.

2013-08-29 Thread Laurent Pinchart
Hi Joseph,

Thank you for the patch.

On Thursday 29 August 2013 11:17:41 Joseph Salisbury wrote:
 BugLink: http://bugs.launchpad.net/bugs/1217957
 
 Add quirk for Dell SP2008WFP monitor: 05a9:2641
 
 Signed-off-by: Joseph Salisbury joseph.salisb...@canonical.com
 Tested-by: Christopher Townsend christopher.towns...@canonical.com
 Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
 Cc: Mauro Carvalho Chehab m.che...@samsung.com
 Cc: linux-media@vger.kernel.org
 Cc: linux-ker...@vger.kernel.org
 Cc: sta...@vger.kernel.org

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

I've applied it to my tree. Given that we're too close to the v3.12 merge 
window I will push it for v3.13.

 ---
  drivers/media/usb/uvc/uvc_driver.c |9 +
  1 file changed, 9 insertions(+)
 
 diff --git a/drivers/media/usb/uvc/uvc_driver.c
 b/drivers/media/usb/uvc/uvc_driver.c index ed123f4..8c1826c 100644
 --- a/drivers/media/usb/uvc/uvc_driver.c
 +++ b/drivers/media/usb/uvc/uvc_driver.c
 @@ -2174,6 +2174,15 @@ static struct usb_device_id uvc_ids[] = {
 .bInterfaceSubClass   = 1,
 .bInterfaceProtocol   = 0,
 .driver_info  = UVC_QUIRK_PROBE_DEF },
 + /* Dell SP2008WFP Monitor */
 + { .match_flags  = USB_DEVICE_ID_MATCH_DEVICE
 + | USB_DEVICE_ID_MATCH_INT_INFO,
 +   .idVendor = 0x05a9,
 +   .idProduct= 0x2641,
 +   .bInterfaceClass  = USB_CLASS_VIDEO,
 +   .bInterfaceSubClass   = 1,
 +   .bInterfaceProtocol   = 0,
 +   .driver_info  = UVC_QUIRK_PROBE_DEF },
   /* Dell Alienware X51 */
   { .match_flags  = USB_DEVICE_ID_MATCH_DEVICE
 
   | USB_DEVICE_ID_MATCH_INT_INFO,
-- 
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/RFC v3 06/19] video: display: OF support

2013-08-29 Thread Laurent Pinchart
Hi Philipp,

On Tuesday 27 August 2013 11:30:51 Philipp Zabel wrote:
 Hi Laurent,
 
 I have another small issue with the graph helpers below:
 
 Am Samstag, den 10.08.2013, 01:03 +0200 schrieb Laurent Pinchart:
 [...]
 
  +/*
  -
   
* Graph Helpers
*/
  
  @@ -420,6 +599,161 @@ int display_entity_link_graph(struct device *dev,
  struct list_head *entities) 
   }
   EXPORT_SYMBOL_GPL(display_entity_link_graph);
  
  +#ifdef CONFIG_OF
  +
  +static int display_of_entity_link_entity(struct device *dev,
  +struct display_entity *entity,
  +struct list_head *entities,
  +struct display_entity *root)
  +{
  +   u32 link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED;
  +   const struct device_node *node = entity-dev-of_node;
  +   struct media_entity *local = entity-entity;
  +   struct device_node *ep = NULL;
  +   int ret = 0;
  +
  +   dev_dbg(dev, creating links for entity %s\n, local-name);
  +
  +   while (1) {
  +   struct media_entity *remote = NULL;
  +   struct media_pad *remote_pad;
  +   struct media_pad *local_pad;
  +   struct display_of_link link;
  +   struct display_entity *ent;
  +   struct device_node *next;
  +
  +   /* Get the next endpoint and parse its link. */
  +   next = display_of_get_next_endpoint(node, ep);
  +   if (next == NULL)
  +   break;
  +
  +   of_node_put(ep);
  +   ep = next;
  +
  +   dev_dbg(dev, processing endpoint %s\n, ep-full_name);
  +
  +   ret = display_of_parse_link(ep, link);
  +   if (ret  0) {
  +   dev_err(dev, failed to parse link for %s\n,
  +   ep-full_name);
  +   continue;
  +   }
  +
  +   /* Skip source pads, they will be processed from the other end 
  of
  +* the link.
  +*/
  +   if (link.local_port = local-num_pads) {
  +   dev_err(dev, invalid port number %u on %s\n,
  +   link.local_port, link.local_node-full_name);
  +   display_of_put_link(link);
  +   ret = -EINVAL;
  +   break;
  +   }
  +
  +   local_pad = local-pads[link.local_port];
  +
  +   if (local_pad-flags  MEDIA_PAD_FL_SOURCE) {
  +   dev_dbg(dev, skipping source port %s:%u\n,
  +   link.local_node-full_name, link.local_port);
  +   display_of_put_link(link);
  +   continue;
  +   }
  +
  +   /* Find the remote entity. If not found, just skip the link as
  +* it goes out of scope of the entities handled by the notifier.
  +*/
  +   list_for_each_entry(ent, entities, list) {
  +   if (ent-dev-of_node == link.remote_node) {
  +   remote = ent-entity;
  +   break;
  +   }
  +   }
  +
  +   if (root-dev-of_node == link.remote_node)
  +   remote = root-entity;
  +
  +   if (remote == NULL) {
  +   dev_dbg(dev, no entity found for %s\n,
  +   link.remote_node-full_name);
  +   display_of_put_link(link);
  +   continue;
  +   }
  +
  +   if (link.remote_port = remote-num_pads) {
  +   dev_err(dev, invalid port number %u on %s\n,
  +   link.remote_port, link.remote_node-full_name);
  +   display_of_put_link(link);
  +   ret = -EINVAL;
  +   break;
  +   }
  +
  +   remote_pad = remote-pads[link.remote_port];
  +
  +   display_of_put_link(link);
  +
  +   /* Create the media link. */
  +   dev_dbg(dev, creating %s:%u - %s:%u link\n,
  +   remote-name, remote_pad-index,
  +   local-name, local_pad-index);
  +
  +   ret = media_entity_create_link(remote, remote_pad-index,
  +  local, local_pad-index,
  +  link_flags);
  +   if (ret  0) {
  +   dev_err(dev,
  +   failed to create %s:%u - %s:%u link\n,
  +   remote-name, remote_pad-index,
  +   local-name, local_pad-index);
  +   break;
  +   }
  +   }
  +
  +   of_node_put(ep);
  +   return ret;
  +}
  +
  +/**
  + * display_of_entity_link_graph - Link all entities in a graph
  + * @dev: device used to print debugging and error messages
  + * @root: optional root display entity
  + * @entities: list of display entities in the 

[PATCH v1 04/19] uvcvideo: Create separate debugfs entries for each streaming interface.

2013-08-29 Thread Pawel Osciak
Add interface number to debugfs entry name to be able to create separate
entries for each streaming interface for devices exposing more than one,
instead of failing to create more than one.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_debugfs.c 
b/drivers/media/usb/uvc/uvc_debugfs.c
index 14561a5..0663fbd 100644
--- a/drivers/media/usb/uvc/uvc_debugfs.c
+++ b/drivers/media/usb/uvc/uvc_debugfs.c
@@ -84,7 +84,8 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream)
if (uvc_debugfs_root_dir == NULL)
return -ENODEV;
 
-   sprintf(dir_name, %u-%u, udev-bus-busnum, udev-devnum);
+   sprintf(dir_name, %u-%u-%u, udev-bus-busnum, udev-devnum,
+   stream-intfnum);
 
dent = debugfs_create_dir(dir_name, uvc_debugfs_root_dir);
if (IS_ERR_OR_NULL(dent)) {
-- 
1.8.4

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


[PATCH v1 12/19] uvcvideo: Reorganize next buffer handling.

2013-08-29 Thread Pawel Osciak
Move getting the first buffer from the current queue to a uvc_queue function
and out of the USB completion handler.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_isight.c |  6 --
 drivers/media/usb/uvc/uvc_queue.c  | 14 ++
 drivers/media/usb/uvc/uvc_video.c  | 29 -
 drivers/media/usb/uvc/uvcvideo.h   |  7 +++
 4 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_isight.c 
b/drivers/media/usb/uvc/uvc_isight.c
index 8510e72..ab01286 100644
--- a/drivers/media/usb/uvc/uvc_isight.c
+++ b/drivers/media/usb/uvc/uvc_isight.c
@@ -99,10 +99,12 @@ static int isight_decode(struct uvc_video_queue *queue, 
struct uvc_buffer *buf,
return 0;
 }
 
-void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
-   struct uvc_buffer *buf)
+void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream)
 {
int ret, i;
+   struct uvc_buffer *buf;
+
+   buf = uvc_queue_get_first_buf(stream-queue);
 
for (i = 0; i  urb-number_of_packets; ++i) {
if (urb-iso_frame_desc[i].status  0) {
diff --git a/drivers/media/usb/uvc/uvc_queue.c 
b/drivers/media/usb/uvc/uvc_queue.c
index cd962be..55d2670 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -352,6 +352,20 @@ void uvc_queue_cancel(struct uvc_video_queue *queue, int 
disconnect)
spin_unlock_irqrestore(queue-irqlock, flags);
 }
 
+struct uvc_buffer *uvc_queue_get_first_buf(struct uvc_video_queue *queue)
+{
+   struct uvc_buffer *buf = NULL;
+   unsigned long flags;
+
+   spin_lock_irqsave(queue-irqlock, flags);
+   if (!list_empty(queue-irqqueue))
+   buf = list_first_entry(queue-irqqueue, struct uvc_buffer,
+   queue);
+   spin_unlock_irqrestore(queue-irqlock, flags);
+
+   return buf;
+}
+
 struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue,
struct uvc_buffer *buf)
 {
diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index b4ebccd..2f9a5fa 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1193,11 +1193,11 @@ static int uvc_video_encode_data(struct uvc_streaming 
*stream,
 /*
  * Completion handler for video URBs.
  */
-static void uvc_video_decode_isoc(struct urb *urb, struct uvc_streaming 
*stream,
-   struct uvc_buffer *buf)
+static void uvc_video_decode_isoc(struct urb *urb, struct uvc_streaming 
*stream)
 {
u8 *mem;
int ret, i;
+   struct uvc_buffer *buf = NULL;
 
for (i = 0; i  urb-number_of_packets; ++i) {
if (urb-iso_frame_desc[i].status  0) {
@@ -1211,6 +1211,7 @@ static void uvc_video_decode_isoc(struct urb *urb, struct 
uvc_streaming *stream,
 
/* Decode the payload header. */
mem = urb-transfer_buffer + urb-iso_frame_desc[i].offset;
+   buf = uvc_queue_get_first_buf(stream-queue);
do {
ret = uvc_video_decode_start(stream, buf, mem,
urb-iso_frame_desc[i].actual_length);
@@ -1241,11 +1242,11 @@ static void uvc_video_decode_isoc(struct urb *urb, 
struct uvc_streaming *stream,
}
 }
 
-static void uvc_video_decode_bulk(struct urb *urb, struct uvc_streaming 
*stream,
-   struct uvc_buffer *buf)
+static void uvc_video_decode_bulk(struct urb *urb, struct uvc_streaming 
*stream)
 {
u8 *mem;
int len, ret;
+   struct uvc_buffer *buf;
 
/*
 * Ignore ZLPs if they're not part of a frame, otherwise process them
@@ -1258,6 +1259,8 @@ static void uvc_video_decode_bulk(struct urb *urb, struct 
uvc_streaming *stream,
len = urb-actual_length;
stream-bulk.payload_size += len;
 
+   buf = uvc_queue_get_first_buf(stream-queue);
+
/* If the URB is the first of its payload, decode and save the
 * header.
 */
@@ -1309,12 +1312,13 @@ static void uvc_video_decode_bulk(struct urb *urb, 
struct uvc_streaming *stream,
}
 }
 
-static void uvc_video_encode_bulk(struct urb *urb, struct uvc_streaming 
*stream,
-   struct uvc_buffer *buf)
+static void uvc_video_encode_bulk(struct urb *urb, struct uvc_streaming 
*stream)
 {
u8 *mem = urb-transfer_buffer;
int len = stream-urb_size, ret;
+   struct uvc_buffer *buf;
 
+   buf = uvc_queue_get_first_buf(stream-queue);
if (buf == NULL) {
urb-transfer_buffer_length = 0;
return;
@@ -1355,9 +1359,6 @@ static void uvc_video_encode_bulk(struct urb *urb, struct 
uvc_streaming *stream,
 static void uvc_video_complete(struct urb *urb)
 {
struct uvc_streaming *stream = urb-context;
-   struct uvc_video_queue *queue = stream-queue;
-   struct uvc_buffer *buf = NULL;
-   unsigned long flags;

[PATCH v1 10/19] uvcvideo: Support UVC 1.5 runtime control property.

2013-08-29 Thread Pawel Osciak
UVC 1.5 introduces the concept of runtime controls, which can be set during
streaming. Non-runtime controls can only be changed while device is idle.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c | 45 +---
 drivers/media/usb/uvc/uvc_v4l2.c | 18 ++--
 drivers/media/usb/uvc/uvcvideo.h | 12 +++
 3 files changed, 57 insertions(+), 18 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index d735c88..b0a19b9 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1076,8 +1076,19 @@ void __uvc_ctrl_unlock(struct uvc_video_chain *chain)
mutex_unlock(chain-pipeline-ctrl_mutex);
 }
 
+static int uvc_check_ctrl_runtime(struct uvc_control *ctrl, bool streaming)
+{
+   if (streaming  !ctrl-in_runtime) {
+   uvc_trace(UVC_TRACE_CONTROL,
+   Control disabled while streaming\n);
+   return -EBUSY;
+   }
+
+   return 0;
+}
+
 int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
-   struct v4l2_queryctrl *v4l2_ctrl)
+   struct v4l2_queryctrl *v4l2_ctrl, bool streaming)
 {
struct uvc_control *ctrl;
struct uvc_control_mapping *mapping;
@@ -1093,6 +1104,10 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
goto done;
}
 
+   ret = uvc_check_ctrl_runtime(ctrl, streaming);
+   if (ret  0)
+   goto done;
+
ret = __uvc_query_v4l2_ctrl(chain, ctrl, mapping, v4l2_ctrl);
 done:
__uvc_ctrl_unlock(chain);
@@ -1109,7 +1124,7 @@ done:
  * manually.
  */
 int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
-   struct v4l2_querymenu *query_menu)
+   struct v4l2_querymenu *query_menu, bool streaming)
 {
struct uvc_menu_info *menu_info;
struct uvc_control_mapping *mapping;
@@ -1132,6 +1147,10 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
goto done;
}
 
+   ret = uvc_check_ctrl_runtime(ctrl, streaming);
+   if (ret  0)
+   goto done;
+
if (query_menu-index = mapping-menu_count) {
ret = -EINVAL;
goto done;
@@ -1436,21 +1455,26 @@ done:
return ret;
 }
 
-int uvc_ctrl_get(struct uvc_video_chain *chain,
-   struct v4l2_ext_control *xctrl)
+int uvc_ctrl_get(struct uvc_video_chain *chain, struct v4l2_ext_control *xctrl,
+bool streaming)
 {
struct uvc_control *ctrl;
struct uvc_control_mapping *mapping;
+   int ret;
 
ctrl = uvc_find_control(chain, xctrl-id, mapping);
if (ctrl == NULL)
return -EINVAL;
 
+   ret = uvc_check_ctrl_runtime(ctrl, streaming);
+   if (ret  0)
+   return ret;
+
return __uvc_ctrl_get(chain, ctrl, mapping, xctrl-value);
 }
 
-int uvc_ctrl_set(struct uvc_video_chain *chain,
-   struct v4l2_ext_control *xctrl)
+int uvc_ctrl_set(struct uvc_video_chain *chain, struct v4l2_ext_control *xctrl,
+bool streaming)
 {
struct uvc_control *ctrl;
struct uvc_control_mapping *mapping;
@@ -1466,6 +1490,10 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
if (!(ctrl-info.flags  UVC_CTRL_FLAG_SET_CUR))
return -EACCES;
 
+   ret = uvc_check_ctrl_runtime(ctrl, streaming);
+   if (ret  0)
+   return ret;
+
/* Clamp out of range values. */
switch (mapping-v4l2_type) {
case V4L2_CTRL_TYPE_INTEGER:
@@ -1885,8 +1913,9 @@ static int uvc_ctrl_add_info(struct uvc_device *dev, 
struct uvc_control *ctrl,
ctrl-initialized = 1;
 
uvc_trace(UVC_TRACE_CONTROL, Added control %pUl/%u to device %s 
-   entity %u\n, ctrl-info.entity, ctrl-info.selector,
-   dev-udev-devpath, ctrl-entity-id);
+   entity %u, init/runtime %d/%d\n, ctrl-info.entity,
+   ctrl-info.selector, dev-udev-devpath, ctrl-entity-id,
+   ctrl-on_init, ctrl-in_runtime);
 
 done:
if (ret  0)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index a899159..decd65f 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -597,7 +597,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned 
int cmd, void *arg)
 
/* Get, Set  Query control */
case VIDIOC_QUERYCTRL:
-   return uvc_query_v4l2_ctrl(chain, arg);
+   return uvc_query_v4l2_ctrl(chain, arg,
+   uvc_is_stream_streaming(stream));
 
case VIDIOC_G_CTRL:
{
@@ -611,7 +612,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned 
int cmd, void *arg)
if (ret  0)
return ret;
 
-   ret = uvc_ctrl_get(chain, xctrl);
+   ret = uvc_ctrl_get(chain, xctrl,
+ 

[PATCH v1 16/19] v4l: Add encoding camera controls.

2013-08-29 Thread Pawel Osciak
Add defines for controls found in UVC 1.5 encoding cameras.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 29 +
 include/uapi/linux/v4l2-controls.h   | 31 +++
 2 files changed, 60 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index c3f0803..0b3a632 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -781,6 +781,35 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_AUTO_FOCUS_STATUS:return Auto Focus, Status;
case V4L2_CID_AUTO_FOCUS_RANGE: return Auto Focus, Range;
 
+   case V4L2_CID_ENCODER_MIN_FRAME_INTERVAL: return Encoder, min. frame 
interval;
+   case V4L2_CID_ENCODER_RATE_CONTROL_MODE: return Encoder, rate control 
mode;
+   case V4L2_CID_ENCODER_AVERAGE_BITRATE:  return Encoder, average 
bitrate;
+   case V4L2_CID_ENCODER_CPB_SIZE: return Encoder, CPB size;
+   case V4L2_CID_ENCODER_PEAK_BIT_RATE:return Encoder, peak bit rate;
+   case V4L2_CID_ENCODER_QP_PARAM_I:   return Encoder, QP param for I 
frames;
+   case V4L2_CID_ENCODER_QP_PARAM_P:   return Encoder, QP param for P 
frames;
+   case V4L2_CID_ENCODER_QP_PARAM_BG:  return Encoder, QP param for 
B/G frames;
+   case V4L2_CID_ENCODER_NUM_GDR_FRAMES:   return Encoder, number of GDR 
frames;
+   case V4L2_CID_ENCODER_LTR_BUFFER_CONTROL: return Encoder, LTR buffer 
control;
+   case V4L2_CID_ENCODER_LTR_BUFFER_TRUST_MODE: return Encoder, LTR 
buffer trust mode;
+   case V4L2_CID_ENCODER_LTR_PICTURE_POSITION: return Encoder, LTR 
picture position;
+   case V4L2_CID_ENCODER_LTR_PICTURE_MODE: return Encoder, LTR picture 
mode;
+   case V4L2_CID_ENCODER_LTR_VALIDATION:   return Encoder, LTR 
validation;
+   case V4L2_CID_ENCODER_MIN_QP:   return Encoder, minimum QP 
param;
+   case V4L2_CID_ENCODER_MAX_QP:   return Encoder, maximum QP 
param;
+   case V4L2_CID_ENCODER_SYNC_FRAME_INTERVAL: return Encoder, sync frame 
interval;
+   case V4L2_CID_ENCODER_ERROR_RESILIENCY: return Encoder, error 
resiliency;
+   case V4L2_CID_ENCODER_TEMPORAL_LAYER_ENABLE: return Encoder, temporal 
layer enable;
+
+   case V4L2_CID_ENCODER_VP8_SLICE_MODE:   return Encoder, VP8 slice 
mode;
+   case V4L2_CID_ENCODER_VP8_SYNC_FRAME_TYPE: return Encoder, VP8 sync 
frame type;
+   case V4L2_CID_ENCODER_VP8_DCT_PARTS_PER_FRAME: return Encoder, VP8, 
DCT partitions per frame;
+
+   case V4L2_CID_ENCODER_H264_PROFILE_TOOLSET: return Encoder, H.264 
profile and toolset;
+   case V4L2_CID_ENCODER_H264_LEVEL_IDC_LIMIT: return Encoder, H.264 
level IDC limit;
+   case V4L2_CID_ENCODER_H264_SEI_PAYLOAD_TYPE: return Encoder, H.264 SEI 
payload type;
+   case V4L2_CID_ENCODER_H264_LAYER_PRIORITY: return Encoder, H.264 layer 
priority;
+
/* FM Radio Modulator control */
/* Keep the order of the 'case's the same as in videodev2.h! */
case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
diff --git a/include/uapi/linux/v4l2-controls.h 
b/include/uapi/linux/v4l2-controls.h
index 083bb5a..ef3a30d 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -729,6 +729,37 @@ enum v4l2_auto_focus_range {
V4L2_AUTO_FOCUS_RANGE_INFINITY  = 3,
 };
 
+/* Controls found in UVC 1.5 encoding cameras */
+#define V4L2_CID_ENCODER_MIN_FRAME_INTERVAL(V4L2_CID_CAMERA_CLASS_BASE+32)
+#define V4L2_CID_ENCODER_RATE_CONTROL_MODE (V4L2_CID_CAMERA_CLASS_BASE+33)
+#define V4L2_CID_ENCODER_AVERAGE_BITRATE   (V4L2_CID_CAMERA_CLASS_BASE+34)
+#define V4L2_CID_ENCODER_CPB_SIZE  (V4L2_CID_CAMERA_CLASS_BASE+35)
+#define V4L2_CID_ENCODER_PEAK_BIT_RATE (V4L2_CID_CAMERA_CLASS_BASE+36)
+#define V4L2_CID_ENCODER_QP_PARAM_I(V4L2_CID_CAMERA_CLASS_BASE+37)
+#define V4L2_CID_ENCODER_QP_PARAM_P(V4L2_CID_CAMERA_CLASS_BASE+38)
+#define V4L2_CID_ENCODER_QP_PARAM_BG   (V4L2_CID_CAMERA_CLASS_BASE+39)
+#define V4L2_CID_ENCODER_NUM_GDR_FRAMES
(V4L2_CID_CAMERA_CLASS_BASE+40)
+#define V4L2_CID_ENCODER_LTR_BUFFER_CONTROL(V4L2_CID_CAMERA_CLASS_BASE+41)
+#define V4L2_CID_ENCODER_LTR_BUFFER_TRUST_MODE (V4L2_CID_CAMERA_CLASS_BASE+42)
+#define V4L2_CID_ENCODER_LTR_PICTURE_POSITION  (V4L2_CID_CAMERA_CLASS_BASE+43)
+#define V4L2_CID_ENCODER_LTR_PICTURE_MODE  (V4L2_CID_CAMERA_CLASS_BASE+44)
+#define V4L2_CID_ENCODER_LTR_VALIDATION
(V4L2_CID_CAMERA_CLASS_BASE+45)
+#define V4L2_CID_ENCODER_MIN_QP
(V4L2_CID_CAMERA_CLASS_BASE+46)
+#define V4L2_CID_ENCODER_MAX_QP
(V4L2_CID_CAMERA_CLASS_BASE+47)
+#define V4L2_CID_ENCODER_SYNC_FRAME_INTERVAL   (V4L2_CID_CAMERA_CLASS_BASE+48)
+#define V4L2_CID_ENCODER_ERROR_RESILIENCY  

[PATCH v1 11/19] uvcvideo: Support V4L2_CTRL_TYPE_BITMASK controls.

2013-08-29 Thread Pawel Osciak
Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index b0a19b9..a0493d6 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1550,6 +1550,24 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, struct 
v4l2_ext_control *xctrl,
 
break;
 
+   case V4L2_CTRL_TYPE_BITMASK:
+   value = xctrl-value;
+
+   /* If GET_RES is supported, it will return a bitmask of bits
+* that can be set. If it isn't, allow any value.
+*/
+   if (ctrl-info.flags  UVC_CTRL_FLAG_GET_RES) {
+   if (!ctrl-cached) {
+   ret = uvc_ctrl_populate_cache(chain, ctrl);
+   if (ret  0)
+   return ret;
+   }
+   step = mapping-get(mapping, UVC_GET_RES,
+   uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));
+   if (value  ~step)
+   return -ERANGE;
+   }
+
default:
value = xctrl-value;
break;
-- 
1.8.4

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


[PATCH v1 00/19] UVC 1.5 VP8 support for uvcvideo

2013-08-29 Thread Pawel Osciak
Hello everyone,

This series adds support for UVC 1.5 and VP8 encoding cameras to the uvcvideo
driver. The official specification for the new standard can be found here:
http://www.usb.org/developers/devclass_docs.

The main change in 1.5 is support for encoding cameras. Those cameras contain
additional UVC entities, called Encoding Units, with their own set of controls
governing encode parameters. Typical encoding cameras (see examples in class
spec) expose two USB Video Streaming Interfaces (VSIs): one for raw stream
formats and one for encoded streams. Typically, both get their source stream
from a single sensor, producing raw and encoded versions of the video feed
simultaneously.
Encoding Units may also support the so-called simulcast formats, which allow
additional sub-streams, or layers, used to achieve temporal scalability.
The spec allows up to 4 simulcast layers. Those layers are encoded in the same
format, but encoding parameters, such as resolution, bitrate, etc., may,
depending on the camera capabilities, be changed independently for each layer,
and their streaming state may also be controlled independently as well. The
layers are streamed from the same USB VSI, and the information which layer
a frame belongs to is contained in its payload header.

In V4L2 API, a separate video node is created for each VSI: one for raw formats
VSI and another for the encoded formats VSI. Both can operate completely
independently from each other. In addition, if the Encoding Unit supports
simulcast, one V4L2 node is created for each stream layer instead, and each
can be controlled independently, including streamon/streamoff state, setting
resolution and controls. Once a simulcast format is successfully set for one
of the simulcast video nodes however, it cannot be changed, unless all connected
nodes are idle, i.e. they are not streaming and their buffers are freed.

The userspace can discover if a set of nodes belongs to one encoding unit
by traversing media controller topology of the camera.


I will be gradually posting documentation changes for new features after initial
rounds of reviews. This is a relatively major change to the UVC driver and
although I tried to keep the existing logic for UVC 1.5 cameras intact as much
as possible, I would very much appreciate it if these patches could get some
testing from you as well, on your own devices/systems.

Thanks,
Pawel Osciak


Pawel Osciak (19):
  uvcvideo: Add UVC query tracing.
  uvcvideo: Return 0 when setting probe control succeeds.
  uvcvideo: Add support for multiple chains with common roots.
  uvcvideo: Create separate debugfs entries for each streaming interface.
  uvcvideo: Add support for UVC1.5 PC control.
  uvcvideo: Recognize UVC 1.5 encoding units.
  uvcvideo: Unify error reporting during format descriptor parsing.
  uvcvideo: Add UVC1.5 VP8 format support.
  uvcvideo: Reorganize uvc_{get,set}_le_value.
  uvcvideo: Support UVC 1.5 runtime control property.
  uvcvideo: Support V4L2_CTRL_TYPE_BITMASK controls.
  uvcvideo: Reorganize next buffer handling.
  uvcvideo: Unify UVC payload header parsing.
  v4l: Add v4l2_buffer flags for VP8-specific special frames.
  uvcvideo: Add support for VP8 special frame flags.
  v4l: Add encoding camera controls.
  uvcvideo: Add UVC 1.5 Encoding Unit controls.
  v4l: Add V4L2_PIX_FMT_VP8_SIMULCAST format.
  uvcvideo: Add support for UVC 1.5 VP8 simulcast.

 drivers/media/usb/uvc/uvc_ctrl.c | 960 ---
 drivers/media/usb/uvc/uvc_debugfs.c  |   3 +-
 drivers/media/usb/uvc/uvc_driver.c   | 604 ++
 drivers/media/usb/uvc/uvc_entity.c   | 129 -
 drivers/media/usb/uvc/uvc_isight.c   |  12 +-
 drivers/media/usb/uvc/uvc_queue.c|  25 +-
 drivers/media/usb/uvc/uvc_v4l2.c | 284 +--
 drivers/media/usb/uvc/uvc_video.c| 704 -
 drivers/media/usb/uvc/uvcvideo.h | 214 +++-
 drivers/media/v4l2-core/v4l2-ctrls.c |  29 ++
 include/uapi/linux/usb/video.h   |  45 ++
 include/uapi/linux/v4l2-controls.h   |  31 ++
 include/uapi/linux/videodev2.h   |   8 +
 13 files changed, 2421 insertions(+), 627 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v1 08/19] uvcvideo: Add UVC1.5 VP8 format support.

2013-08-29 Thread Pawel Osciak
Add detection and parsing of VP8 format and frame descriptors and
reorganize format parsing code.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_driver.c | 120 -
 drivers/media/usb/uvc/uvcvideo.h   |   4 +-
 include/uapi/linux/usb/video.h |   8 +++
 3 files changed, 104 insertions(+), 28 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index 936ddc7..27a7a11 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -312,7 +312,7 @@ static int uvc_parse_format(struct uvc_device *dev,
struct uvc_frame *frame;
const unsigned char *start = buffer;
unsigned int interval;
-   unsigned int i, n;
+   unsigned int i, n, intervals_off;
__u8 ftype;
 
format-type = buffer[2];
@@ -401,6 +401,18 @@ static int uvc_parse_format(struct uvc_device *dev,
format-nframes = 1;
break;
 
+   case UVC_VS_FORMAT_VP8:
+   if (buflen  13)
+   goto format_error;
+
+   format-bpp = 0;
+   format-flags = UVC_FMT_FLAG_COMPRESSED;
+   ftype = UVC_VS_FRAME_VP8;
+   strlcpy(format-name, VP8, sizeof(format-name));
+   format-fcc = V4L2_PIX_FMT_VP8;
+
+   break;
+
case UVC_VS_FORMAT_MPEG2TS:
case UVC_VS_FORMAT_STREAM_BASED:
/* Not supported yet. */
@@ -417,44 +429,83 @@ static int uvc_parse_format(struct uvc_device *dev,
buflen -= buffer[0];
buffer += buffer[0];
 
-   /* Parse the frame descriptors. Only uncompressed, MJPEG and frame
-* based formats have frame descriptors.
+   /* Parse the frame descriptors. Only uncompressed, MJPEG, temporally
+* encoded and frame based formats have frame descriptors.
 */
while (buflen  2  buffer[1] == USB_DT_CS_INTERFACE 
   buffer[2] == ftype) {
frame = format-frame[format-nframes];
-   if (ftype != UVC_VS_FRAME_FRAME_BASED)
-   n = buflen  25 ? buffer[25] : 0;
-   else
-   n = buflen  21 ? buffer[21] : 0;
-
-   n = n ? n : 3;
 
-   if (buflen  26 + 4*n) {
-   uvc_trace(UVC_TRACE_DESCR, device %d videostreaming 
-  interface %d FRAME error\n, dev-udev-devnum,
-  alts-desc.bInterfaceNumber);
-   return -EINVAL;
-   }
-
-   frame-bFrameIndex = buffer[3];
-   frame-bmCapabilities = buffer[4];
-   frame-wWidth = get_unaligned_le16(buffer[5]);
-   frame-wHeight = get_unaligned_le16(buffer[7]);
-   frame-dwMinBitRate = get_unaligned_le32(buffer[9]);
-   frame-dwMaxBitRate = get_unaligned_le32(buffer[13]);
-   if (ftype != UVC_VS_FRAME_FRAME_BASED) {
+   switch (ftype) {
+   case UVC_VS_FRAME_UNCOMPRESSED:
+   case UVC_VS_FRAME_MJPEG:
+   intervals_off = 26;
+   if (buflen  intervals_off)
+   goto frame_error;
+
+   frame-bFrameIndex = buffer[3];
+   frame-bmCapabilities = buffer[4];
+   frame-wWidth = get_unaligned_le16(buffer[5]);
+   frame-wHeight = get_unaligned_le16(buffer[7]);
+   frame-dwMinBitRate = get_unaligned_le32(buffer[9]);
+   frame-dwMaxBitRate = get_unaligned_le32(buffer[13]);
frame-dwMaxVideoFrameBufferSize =
get_unaligned_le32(buffer[17]);
frame-dwDefaultFrameInterval =
get_unaligned_le32(buffer[21]);
-   frame-bFrameIntervalType = buffer[25];
-   } else {
+   frame-bFrameIntervalType = n = buffer[25];
+   break;
+
+   case UVC_VS_FRAME_FRAME_BASED:
+   intervals_off = 26;
+   if (buflen  intervals_off)
+   goto frame_error;
+
+   frame-bFrameIndex = buffer[3];
+   frame-bmCapabilities = buffer[4];
+   frame-wWidth = get_unaligned_le16(buffer[5]);
+   frame-wHeight = get_unaligned_le16(buffer[7]);
+   frame-dwMinBitRate = get_unaligned_le32(buffer[9]);
+   frame-dwMaxBitRate = get_unaligned_le32(buffer[13]);
frame-dwMaxVideoFrameBufferSize = 0;
frame-dwDefaultFrameInterval =
get_unaligned_le32(buffer[17]);
-   frame-bFrameIntervalType = buffer[21];
+ 

[PATCH v1 17/19] uvcvideo: Add UVC 1.5 Encoding Unit controls.

2013-08-29 Thread Pawel Osciak
These controls allow modifying encoding parameters.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c | 445 +++
 include/uapi/linux/usb/video.h   |  23 ++
 2 files changed, 468 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index a0493d6..cd02c99 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -351,6 +351,167 @@ static struct uvc_control_info uvc_ctrls[] = {
| UVC_CTRL_FLAG_RESTORE
| UVC_CTRL_FLAG_AUTO_UPDATE,
},
+   /*
+* All EU controls are marked as AUTO_UPDATE, because many are, and also
+* we can't cache all of them as they are stream/layer dependent, which
+* would be too slow/too much to cache.
+*/
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_PROFILE_TOOLSET_CONTROL,
+   .index  = 1,
+   .size   = 6,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_DEF
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_MIN_FRAME_INTERVAL_CONTROL,
+   .index  = 3,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_MIN | UVC_CTRL_FLAG_GET_MAX
+   | UVC_CTRL_FLAG_GET_DEF
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_SLICE_MODE_CONTROL,
+   .index  = 4,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_MIN | UVC_CTRL_FLAG_GET_MAX
+   | UVC_CTRL_FLAG_GET_DEF
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_RATE_CONTROL_MODE_CONTROL,
+   .index  = 5,
+   .size   = 1,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_DEF
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_AVERAGE_BITRATE_CONTROL,
+   .index  = 6,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR
+   | UVC_CTRL_FLAG_GET_RANGE
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_CPB_SIZE_CONTROL,
+   .index  = 7,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR
+   | UVC_CTRL_FLAG_GET_RANGE
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_PEAK_BIT_RATE_CONTROL,
+   .index  = 8,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR
+   | UVC_CTRL_FLAG_GET_RANGE
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_QUANTIZATION_PARAMS_CONTROL,
+   .index  = 9,
+   .size   = 6,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_MIN | UVC_CTRL_FLAG_GET_MAX
+   | UVC_CTRL_FLAG_GET_DEF
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_SYNC_REF_FRAME_CONTROL,
+   .index  = 10,
+   .size   = 4,
+   .flags  = UVC_CTRL_FLAG_SET_CUR | UVC_CTRL_FLAG_GET_CUR
+   | UVC_CTRL_FLAG_GET_MIN | UVC_CTRL_FLAG_GET_MAX
+   | UVC_CTRL_FLAG_AUTO_UPDATE,
+   },
+   {
+   .entity = UVC_GUID_UVC_ENCODING,
+   .selector   = UVC_EU_LTR_BUFFER_CONTROL,
+   .index  = 11,
+   

[PATCH v1 15/19] uvcvideo: Add support for VP8 special frame flags.

2013-08-29 Thread Pawel Osciak
Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_video.c | 18 +-
 drivers/media/usb/uvc/uvcvideo.h  | 10 ++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 59f57a2..0291817 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1136,6 +1136,8 @@ static int uvc_video_parse_header(struct uvc_streaming 
*stream,
if (header-has_scr)
header-length += 6;
 
+   header-buf_flags = 0;
+
if (stream-cur_format-fcc == V4L2_PIX_FMT_VP8) {
/* VP8 payload has 2 additional bytes of BFH. */
header-length += 2;
@@ -1147,6 +1149,16 @@ static int uvc_video_parse_header(struct uvc_streaming 
*stream,
header-has_sli = data[1]  UVC_STREAM_SLI;
if (header-has_sli)
header-length += 2;
+
+   /* Codec-specific flags for v4l2_buffer. */
+   header-buf_flags |= (data[1]  UVC_STREAM_STI) ?
+   V4L2_BUF_FLAG_KEYFRAME : 0;
+   header-buf_flags |= (data[2]  UVC_STREAM_VP8_PRF) ?
+   V4L2_BUF_FLAG_PREV_FRAME : 0;
+   header-buf_flags |= (data[2]  UVC_STREAM_VP8_ARF) ?
+   V4L2_BUF_FLAG_ALTREF_FRAME : 0;
+   header-buf_flags |= (data[2]  UVC_STREAM_VP8_GRF) ?
+   V4L2_BUF_FLAG_GOLDEN_FRAME : 0;
}
 
/* - bHeaderLength value can't be larger than the packet size. */
@@ -1222,6 +1234,8 @@ static void uvc_video_decode_isoc(struct urb *urb, struct 
uvc_streaming *stream)
if (ret  0)
continue;
 
+   buf-buf.v4l2_buf.flags |= header.buf_flags;
+
/* Decode the payload data. */
uvc_video_decode_data(stream, buf, mem + header.length,
urb-iso_frame_desc[i].actual_length - header.length);
@@ -1293,8 +1307,10 @@ static void uvc_video_decode_bulk(struct urb *urb, 
struct uvc_streaming *stream)
 */
 
/* Process video data. */
-   if (!stream-bulk.skip_payload  buf != NULL)
+   if (!stream-bulk.skip_payload  buf != NULL) {
uvc_video_decode_data(stream, buf, mem, len);
+   buf-buf.v4l2_buf.flags |= header.buf_flags;
+   }
 
/* Detect the payload end by a URB smaller than the maximum size (or
 * a payload size equal to the maximum) and process the header again.
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index b355b2c..fb21459 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -145,6 +145,14 @@
 #define UVC_FMT_FLAG_COMPRESSED0x0001
 #define UVC_FMT_FLAG_STREAM0x0002
 
+/* v4l2_buffer codec flags */
+#define UVC_V4L2_BUFFER_CODEC_FLAGS(V4L2_BUF_FLAG_KEYFRAME | \
+V4L2_BUF_FLAG_PFRAME | \
+V4L2_BUF_FLAG_BFRAME | \
+V4L2_BUF_FLAG_PREV_FRAME | \
+V4L2_BUF_FLAG_GOLDEN_FRAME | \
+V4L2_BUF_FLAG_ALTREF_FRAME)
+
 /* 
  * Structures.
  */
@@ -472,6 +480,8 @@ struct uvc_payload_header {
 
int length;
int payload_size;
+
+   __u32 buf_flags; /* v4l2_buffer flags */
 };
 
 struct uvc_streaming {
-- 
1.8.4

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


[PATCH v1 03/19] uvcvideo: Add support for multiple chains with common roots.

2013-08-29 Thread Pawel Osciak
This adds support for pipelines that fork into branches consisting of more
than one entity, creating a chain for each fork and putting common entities
on all chains that share them.

This requires us to share the ctrl_mutex across forked chains. Whenever we
discover a shared part of a chain, we assign the pointer to an existing
mutex to the sharing chain instead of creating a new one.

The forward scan is not needed anymore, as after scanning back from OTs,
we go over all entities which are not on a path from an OT and accept
single-XU branches, adding them to the existing chains.

Also extract control locking into __uvc_ctrl_{lock,unlock} functions.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c   |  70 -
 drivers/media/usb/uvc/uvc_driver.c | 210 +
 drivers/media/usb/uvc/uvc_entity.c |  15 ++-
 drivers/media/usb/uvc/uvc_v4l2.c   |   9 +-
 drivers/media/usb/uvc/uvcvideo.h   |  20 +++-
 5 files changed, 199 insertions(+), 125 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index a2f4501..ba159a4 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -841,6 +841,7 @@ static struct uvc_control *uvc_find_control(struct 
uvc_video_chain *chain,
 {
struct uvc_control *ctrl = NULL;
struct uvc_entity *entity;
+   struct uvc_chain_entry *entry;
int next = v4l2_id  V4L2_CTRL_FLAG_NEXT_CTRL;
 
*mapping = NULL;
@@ -849,7 +850,8 @@ static struct uvc_control *uvc_find_control(struct 
uvc_video_chain *chain,
v4l2_id = V4L2_CTRL_ID_MASK;
 
/* Find the control. */
-   list_for_each_entry(entity, chain-entities, chain) {
+   list_for_each_entry(entry, chain-entities, chain_entry) {
+   entity = entry-entity;
__uvc_find_control(entity, v4l2_id, mapping, ctrl, next);
if (ctrl  !next)
return ctrl;
@@ -1048,6 +1050,16 @@ static int __uvc_query_v4l2_ctrl(struct uvc_video_chain 
*chain,
return 0;
 }
 
+int __uvc_ctrl_lock(struct uvc_video_chain *chain)
+{
+   return mutex_lock_interruptible(chain-pipeline-ctrl_mutex) ?
+   -ERESTARTSYS : 0;
+}
+void __uvc_ctrl_unlock(struct uvc_video_chain *chain)
+{
+   mutex_unlock(chain-pipeline-ctrl_mutex);
+}
+
 int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
struct v4l2_queryctrl *v4l2_ctrl)
 {
@@ -1055,9 +1067,9 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
struct uvc_control_mapping *mapping;
int ret;
 
-   ret = mutex_lock_interruptible(chain-ctrl_mutex);
+   ret = __uvc_ctrl_lock(chain);
if (ret  0)
-   return -ERESTARTSYS;
+   return ret;
 
ctrl = uvc_find_control(chain, v4l2_ctrl-id, mapping);
if (ctrl == NULL) {
@@ -1067,7 +1079,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
 
ret = __uvc_query_v4l2_ctrl(chain, ctrl, mapping, v4l2_ctrl);
 done:
-   mutex_unlock(chain-ctrl_mutex);
+   __uvc_ctrl_unlock(chain);
return ret;
 }
 
@@ -1094,9 +1106,9 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
query_menu-id = id;
query_menu-index = index;
 
-   ret = mutex_lock_interruptible(chain-ctrl_mutex);
+   ret = __uvc_ctrl_lock(chain);
if (ret  0)
-   return -ERESTARTSYS;
+   return ret;
 
ctrl = uvc_find_control(chain, query_menu-id, mapping);
if (ctrl == NULL || mapping-v4l2_type != V4L2_CTRL_TYPE_MENU) {
@@ -1132,7 +1144,7 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
strlcpy(query_menu-name, menu_info-name, sizeof query_menu-name);
 
 done:
-   mutex_unlock(chain-ctrl_mutex);
+   __uvc_ctrl_unlock(chain);
return ret;
 }
 
@@ -1257,9 +1269,9 @@ static int uvc_ctrl_add_event(struct 
v4l2_subscribed_event *sev, unsigned elems)
struct uvc_control *ctrl;
int ret;
 
-   ret = mutex_lock_interruptible(handle-chain-ctrl_mutex);
+   ret = __uvc_ctrl_lock(handle-chain);
if (ret  0)
-   return -ERESTARTSYS;
+   return ret;
 
ctrl = uvc_find_control(handle-chain, sev-id, mapping);
if (ctrl == NULL) {
@@ -1285,7 +1297,7 @@ static int uvc_ctrl_add_event(struct 
v4l2_subscribed_event *sev, unsigned elems)
}
 
 done:
-   mutex_unlock(handle-chain-ctrl_mutex);
+   __uvc_ctrl_unlock(handle-chain);
return ret;
 }
 
@@ -1293,9 +1305,9 @@ static void uvc_ctrl_del_event(struct 
v4l2_subscribed_event *sev)
 {
struct uvc_fh *handle = container_of(sev-fh, struct uvc_fh, vfh);
 
-   mutex_lock(handle-chain-ctrl_mutex);
+   __uvc_ctrl_lock(handle-chain);
list_del(sev-node);
-   mutex_unlock(handle-chain-ctrl_mutex);
+   __uvc_ctrl_unlock(handle-chain);
 }
 
 const struct v4l2_subscribed_event_ops 

[PATCH v1 07/19] uvcvideo: Unify error reporting during format descriptor parsing.

2013-08-29 Thread Pawel Osciak
Add common error handling paths for format parsing failures.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_driver.c | 35 ++-
 1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index d950b40..936ddc7 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -322,13 +322,8 @@ static int uvc_parse_format(struct uvc_device *dev,
case UVC_VS_FORMAT_UNCOMPRESSED:
case UVC_VS_FORMAT_FRAME_BASED:
n = buffer[2] == UVC_VS_FORMAT_UNCOMPRESSED ? 27 : 28;
-   if (buflen  n) {
-   uvc_trace(UVC_TRACE_DESCR, device %d videostreaming 
-  interface %d FORMAT error\n,
-  dev-udev-devnum,
-  alts-desc.bInterfaceNumber);
-   return -EINVAL;
-   }
+   if (buflen  n)
+   goto format_error;
 
/* Find the format descriptor from its GUID. */
fmtdesc = uvc_format_by_guid(buffer[5]);
@@ -356,13 +351,8 @@ static int uvc_parse_format(struct uvc_device *dev,
break;
 
case UVC_VS_FORMAT_MJPEG:
-   if (buflen  11) {
-   uvc_trace(UVC_TRACE_DESCR, device %d videostreaming 
-  interface %d FORMAT error\n,
-  dev-udev-devnum,
-  alts-desc.bInterfaceNumber);
-   return -EINVAL;
-   }
+   if (buflen  11)
+   goto format_error;
 
strlcpy(format-name, MJPEG, sizeof format-name);
format-fcc = V4L2_PIX_FMT_MJPEG;
@@ -372,13 +362,8 @@ static int uvc_parse_format(struct uvc_device *dev,
break;
 
case UVC_VS_FORMAT_DV:
-   if (buflen  9) {
-   uvc_trace(UVC_TRACE_DESCR, device %d videostreaming 
-  interface %d FORMAT error\n,
-  dev-udev-devnum,
-  alts-desc.bInterfaceNumber);
-   return -EINVAL;
-   }
+   if (buflen  9)
+   goto format_error;
 
switch (buffer[8]  0x7f) {
case 0:
@@ -542,6 +527,14 @@ static int uvc_parse_format(struct uvc_device *dev,
}
 
return buffer - start;
+
+format_error:
+   uvc_trace(UVC_TRACE_DESCR, device %d videostreaming 
+   interface %d FORMAT error\n,
+   dev-udev-devnum,
+   alts-desc.bInterfaceNumber);
+   return -EINVAL;
+
 }
 
 static int uvc_parse_streaming(struct uvc_device *dev,
-- 
1.8.4

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


[PATCH v1 14/19] v4l: Add v4l2_buffer flags for VP8-specific special frames.

2013-08-29 Thread Pawel Osciak
Add bits for previous, golden and altref frame types.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 include/uapi/linux/videodev2.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 437f1b0..c011ee0 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -687,6 +687,10 @@ struct v4l2_buffer {
 #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN0x
 #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC  0x2000
 #define V4L2_BUF_FLAG_TIMESTAMP_COPY   0x4000
+/* VP8 special frames */
+#define V4L2_BUF_FLAG_PREV_FRAME   0x1  /* VP8 prev frame */
+#define V4L2_BUF_FLAG_GOLDEN_FRAME 0x2  /* VP8 golden frame */
+#define V4L2_BUF_FLAG_ALTREF_FRAME 0x4  /* VP8 altref frame */
 
 /**
  * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
-- 
1.8.4

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


[PATCH v1 02/19] uvcvideo: Return 0 when setting probe control succeeds.

2013-08-29 Thread Pawel Osciak
Return 0 instead of returning size of the probe control on successful set.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 695f6d9..1198989 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -296,6 +296,8 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
%d (exp. %u).\n, probe ? probe : commit,
ret, size);
ret = -EIO;
+   } else {
+   ret = 0;
}
 
kfree(data);
-- 
1.8.4

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


[PATCH v1 13/19] uvcvideo: Unify UVC payload header parsing.

2013-08-29 Thread Pawel Osciak
Create a separate function for parsing UVC payload headers and extract code
from other functions into it. Store the parsed values in a header struct.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_video.c | 270 +++---
 drivers/media/usb/uvc/uvcvideo.h  |  21 +++
 2 files changed, 157 insertions(+), 134 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 2f9a5fa..59f57a2 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -422,40 +422,14 @@ static int uvc_commit_video(struct uvc_streaming *stream,
 
 static void
 uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf,
-  const __u8 *data, int len)
+   struct uvc_payload_header *header)
 {
struct uvc_clock_sample *sample;
-   unsigned int header_size;
-   bool has_pts = false;
-   bool has_scr = false;
unsigned long flags;
struct timespec ts;
u16 host_sof;
u16 dev_sof;
 
-   switch (data[1]  (UVC_STREAM_PTS | UVC_STREAM_SCR)) {
-   case UVC_STREAM_PTS | UVC_STREAM_SCR:
-   header_size = 12;
-   has_pts = true;
-   has_scr = true;
-   break;
-   case UVC_STREAM_PTS:
-   header_size = 6;
-   has_pts = true;
-   break;
-   case UVC_STREAM_SCR:
-   header_size = 8;
-   has_scr = true;
-   break;
-   default:
-   header_size = 2;
-   break;
-   }
-
-   /* Check for invalid headers. */
-   if (len  header_size)
-   return;
-
/* Extract the timestamps:
 *
 * - store the frame PTS in the buffer structure
@@ -463,17 +437,17 @@ uvc_video_clock_decode(struct uvc_streaming *stream, 
struct uvc_buffer *buf,
 *   kernel timestamps and store them with the SCR STC and SOF fields
 *   in the ring buffer
 */
-   if (has_pts  buf != NULL)
-   buf-pts = get_unaligned_le32(data[2]);
+   if (header-has_pts  buf != NULL)
+   buf-pts = header-pts;
 
-   if (!has_scr)
+   if (!header-has_scr)
return;
 
/* To limit the amount of data, drop SCRs with an SOF identical to the
 * previous one.
 */
-   dev_sof = get_unaligned_le16(data[header_size - 2]);
-   if (dev_sof == stream-clock.last_sof)
+   dev_sof = header-sof;
+   if (dev_sof = stream-clock.last_sof)
return;
 
stream-clock.last_sof = dev_sof;
@@ -513,7 +487,7 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct 
uvc_buffer *buf,
spin_lock_irqsave(stream-clock.lock, flags);
 
sample = stream-clock.samples[stream-clock.head];
-   sample-dev_stc = get_unaligned_le32(data[header_size - 6]);
+   sample-dev_stc = header-stc;
sample-dev_sof = dev_sof;
sample-host_sof = host_sof;
sample-host_ts = ts;
@@ -756,114 +730,74 @@ done:
  */
 
 static void uvc_video_stats_decode(struct uvc_streaming *stream,
-   const __u8 *data, int len)
+   struct uvc_payload_header *header)
 {
-   unsigned int header_size;
-   bool has_pts = false;
-   bool has_scr = false;
-   u16 uninitialized_var(scr_sof);
-   u32 uninitialized_var(scr_stc);
-   u32 uninitialized_var(pts);
-
if (stream-stats.stream.nb_frames == 0 
stream-stats.frame.nb_packets == 0)
ktime_get_ts(stream-stats.stream.start_ts);
 
-   switch (data[1]  (UVC_STREAM_PTS | UVC_STREAM_SCR)) {
-   case UVC_STREAM_PTS | UVC_STREAM_SCR:
-   header_size = 12;
-   has_pts = true;
-   has_scr = true;
-   break;
-   case UVC_STREAM_PTS:
-   header_size = 6;
-   has_pts = true;
-   break;
-   case UVC_STREAM_SCR:
-   header_size = 8;
-   has_scr = true;
-   break;
-   default:
-   header_size = 2;
-   break;
-   }
-
-   /* Check for invalid headers. */
-   if (len  header_size || data[0]  header_size) {
-   stream-stats.frame.nb_invalid++;
-   return;
-   }
-
-   /* Extract the timestamps. */
-   if (has_pts)
-   pts = get_unaligned_le32(data[2]);
-
-   if (has_scr) {
-   scr_stc = get_unaligned_le32(data[header_size - 6]);
-   scr_sof = get_unaligned_le16(data[header_size - 2]);
-   }
-
/* Is PTS constant through the whole frame ? */
-   if (has_pts  stream-stats.frame.nb_pts) {
-   if (stream-stats.frame.pts != pts) {
+   if (header-has_pts  stream-stats.frame.nb_pts) {
+   if (stream-stats.frame.pts != header-pts) {
  

[PATCH v1 09/19] uvcvideo: Reorganize uvc_{get,set}_le_value.

2013-08-29 Thread Pawel Osciak
Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c | 62 
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 72d6724..d735c88 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -707,18 +707,12 @@ static inline void uvc_clear_bit(__u8 *data, int bit)
data[bit  3] = ~(1  (bit  7));
 }
 
-/* Extract the bit string specified by mapping-offset and mapping-size
- * from the little-endian data stored at 'data' and return the result as
- * a signed 32bit integer. Sign extension will be performed if the mapping
- * references a signed data type.
- */
-static __s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
-   __u8 query, const __u8 *data)
+static int __uvc_get_le_value(int bits, int offset, const __u8 *data,
+   __u32 data_type)
 {
-   int bits = mapping-size;
-   int offset = mapping-offset;
__s32 value = 0;
__u8 mask;
+   int size = bits;
 
data += offset / 8;
offset = 7;
@@ -733,22 +727,49 @@ static __s32 uvc_get_le_value(struct uvc_control_mapping 
*mapping,
}
 
/* Sign-extend the value if needed. */
-   if (mapping-data_type == UVC_CTRL_DATA_TYPE_SIGNED)
-   value |= -(value  (1  (mapping-size - 1)));
+   if (data_type == UVC_CTRL_DATA_TYPE_SIGNED)
+   value |= -(value  (1  (size - 1)));
 
return value;
 }
 
+/* Extract the bit string specified by mapping-offset and mapping-size
+ * from the little-endian data stored at 'data' and return the result as
+ * a signed 32bit integer. Sign extension will be performed if the mapping
+ * references a signed data type.
+ */
+static __s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
+   __u8 query, const __u8 *data)
+{
+   return __uvc_get_le_value(mapping-size, mapping-offset, data,
+   mapping-data_type);
+}
+
+static void __uvc_set_le_value(int bits, int offset, __s32 value, __u8 *data,
+   bool keep_existing)
+{
+   __u8 mask;
+
+   data += offset / 8;
+   offset = 7;
+
+   for (; bits  0; data++) {
+   mask = ((1LL  bits) - 1)  offset;
+   if (!keep_existing)
+   *data = (*data  ~mask);
+   *data |= ((value  offset)  mask);
+   value = (8 - offset);
+   bits -= 8 - offset;
+   offset = 0;
+   }
+}
+
 /* Set the bit string specified by mapping-offset and mapping-size
  * in the little-endian data stored at 'data' to the value 'value'.
  */
 static void uvc_set_le_value(struct uvc_control_mapping *mapping,
__s32 value, __u8 *data)
 {
-   int bits = mapping-size;
-   int offset = mapping-offset;
-   __u8 mask;
-
/* According to the v4l2 spec, writing any value to a button control
 * should result in the action belonging to the button control being
 * triggered. UVC devices however want to see a 1 written - override
@@ -757,16 +778,7 @@ static void uvc_set_le_value(struct uvc_control_mapping 
*mapping,
if (mapping-v4l2_type == V4L2_CTRL_TYPE_BUTTON)
value = -1;
 
-   data += offset / 8;
-   offset = 7;
-
-   for (; bits  0; data++) {
-   mask = ((1LL  bits) - 1)  offset;
-   *data = (*data  ~mask) | ((value  offset)  mask);
-   value = offset ? offset : 8;
-   bits -= 8 - offset;
-   offset = 0;
-   }
+   __uvc_set_le_value(mapping-size, mapping-offset, value, data, false);
 }
 
 /* 
-- 
1.8.4

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


[PATCH v1 01/19] uvcvideo: Add UVC query tracing.

2013-08-29 Thread Pawel Osciak
Add a new trace argument enabling UVC query details and contents logging.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_video.c | 45 +--
 drivers/media/usb/uvc/uvcvideo.h  |  9 
 2 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 3394c34..695f6d9 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -29,22 +29,6 @@
 /* 
  * UVC Controls
  */
-
-static int __uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
-   __u8 intfnum, __u8 cs, void *data, __u16 size,
-   int timeout)
-{
-   __u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
-   unsigned int pipe;
-
-   pipe = (query  0x80) ? usb_rcvctrlpipe(dev-udev, 0)
- : usb_sndctrlpipe(dev-udev, 0);
-   type |= (query  0x80) ? USB_DIR_IN : USB_DIR_OUT;
-
-   return usb_control_msg(dev-udev, pipe, query, type, cs  8,
-   unit  8 | intfnum, data, size, timeout);
-}
-
 static const char *uvc_query_name(__u8 query)
 {
switch (query) {
@@ -69,6 +53,35 @@ static const char *uvc_query_name(__u8 query)
}
 }
 
+static int __uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
+   __u8 intfnum, __u8 cs, void *data, __u16 size,
+   int timeout)
+{
+   __u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
+   unsigned int pipe;
+   int ret;
+
+   pipe = (query  0x80) ? usb_rcvctrlpipe(dev-udev, 0)
+ : usb_sndctrlpipe(dev-udev, 0);
+   type |= (query  0x80) ? USB_DIR_IN : USB_DIR_OUT;
+
+   uvc_trace(UVC_TRACE_QUERY,
+   %s (%d): size=%d, unit=%d, cs=%d, intf=%d\n,
+   uvc_query_name(query), query, size, unit, cs, intfnum);
+   uvc_trace(UVC_TRACE_QUERY, Sent:\n);
+   uvc_print_hex_dump(UVC_TRACE_QUERY, data, size);
+
+   ret = usb_control_msg(dev-udev, pipe, query, type, cs  8,
+   unit  8 | intfnum, data, size, timeout);
+   if (ret == -EPIPE)
+   uvc_trace(UVC_TRACE_QUERY, Got device STALL on query!\n);
+
+   uvc_trace(UVC_TRACE_QUERY, Received:\n);
+   uvc_print_hex_dump(UVC_TRACE_QUERY, data, size);
+
+   return ret;
+}
+
 int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
__u8 intfnum, __u8 cs, void *data, __u16 size)
 {
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 9e35982..75e0153 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -574,6 +574,7 @@ struct uvc_driver {
 #define UVC_TRACE_VIDEO(1  10)
 #define UVC_TRACE_STATS(1  11)
 #define UVC_TRACE_CLOCK(1  12)
+#define UVC_TRACE_QUERY(1  13)
 
 #define UVC_WARN_MINMAX0
 #define UVC_WARN_PROBE_DEF 1
@@ -599,6 +600,14 @@ extern unsigned int uvc_timeout_param;
 #define uvc_printk(level, msg...) \
printk(level uvcvideo:  msg)
 
+#define uvc_print_hex_dump(flag, buf, len) \
+   do { \
+   if (uvc_trace_param  flag) { \
+   print_hex_dump(KERN_DEBUG, uvcvideo: , \
+   DUMP_PREFIX_NONE, 16, 1, buf, len, false); \
+   } \
+   } while (0)
+
 /* --
  * Internal functions.
  */
-- 
1.8.4

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


[PATCH v1 05/19] uvcvideo: Add support for UVC1.5 PC control.

2013-08-29 Thread Pawel Osciak
Add support for UVC 1.5 Probe  Commit control.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_video.c | 52 ---
 include/uapi/linux/usb/video.h|  7 ++
 2 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 1198989..b4ebccd 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -168,14 +168,25 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming 
*stream,
}
 }
 
+int uvc_get_probe_ctrl_size(struct uvc_streaming *stream)
+{
+   if (stream-dev-uvc_version  0x0110)
+   return 26;
+   else if (stream-dev-uvc_version  0x0150)
+   return 34;
+   else
+   return 48;
+}
+
 static int uvc_get_video_ctrl(struct uvc_streaming *stream,
struct uvc_streaming_control *ctrl, int probe, __u8 query)
 {
__u8 *data;
__u16 size;
int ret;
+   int i;
 
-   size = stream-dev-uvc_version = 0x0110 ? 34 : 26;
+   size = uvc_get_probe_ctrl_size(stream);
if ((stream-dev-quirks  UVC_QUIRK_PROBE_DEF) 
query == UVC_GET_DEF)
return -EIO;
@@ -230,7 +241,7 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
ctrl-dwMaxVideoFrameSize = get_unaligned_le32(data[18]);
ctrl-dwMaxPayloadTransferSize = get_unaligned_le32(data[22]);
 
-   if (size == 34) {
+   if (size = 34) {
ctrl-dwClockFrequency = get_unaligned_le32(data[26]);
ctrl-bmFramingInfo = data[30];
ctrl-bPreferedVersion = data[31];
@@ -244,6 +255,26 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
ctrl-bMaxVersion = 0;
}
 
+   if (size = 48) {
+   ctrl-bUsage = data[34];
+   ctrl-bBitDepthLuma = data[35];
+   ctrl-bmSetting = data[36];
+   ctrl-bMaxNumberOfRefFramesPlus1 = data[37];
+   ctrl-bmRateControlModes = get_unaligned_le16(data[38]);
+   for (i = 0; i  ARRAY_SIZE(ctrl-bmLayoutPerStream); ++i) {
+   ctrl-bmLayoutPerStream[i] =
+   get_unaligned_le16(data[40 + i * 2]);
+   }
+   } else {
+   ctrl-bUsage = 0;
+   ctrl-bBitDepthLuma = 0;
+   ctrl-bmSetting = 0;
+   ctrl-bMaxNumberOfRefFramesPlus1 = 0;
+   ctrl-bmRateControlModes = 0;
+   for (i = 0; i  ARRAY_SIZE(ctrl-bmLayoutPerStream); ++i)
+   ctrl-bmLayoutPerStream[i] = 0;
+   }
+
/* Some broken devices return null or wrong dwMaxVideoFrameSize and
 * dwMaxPayloadTransferSize fields. Try to get the value from the
 * format and frame descriptors.
@@ -262,8 +293,9 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
__u8 *data;
__u16 size;
int ret;
+   int i;
 
-   size = stream-dev-uvc_version = 0x0110 ? 34 : 26;
+   size = uvc_get_probe_ctrl_size(stream);
data = kzalloc(size, GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
@@ -280,7 +312,7 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
put_unaligned_le32(ctrl-dwMaxVideoFrameSize, data[18]);
put_unaligned_le32(ctrl-dwMaxPayloadTransferSize, data[22]);
 
-   if (size == 34) {
+   if (size = 34) {
put_unaligned_le32(ctrl-dwClockFrequency, data[26]);
data[30] = ctrl-bmFramingInfo;
data[31] = ctrl-bPreferedVersion;
@@ -288,6 +320,18 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
data[33] = ctrl-bMaxVersion;
}
 
+   if (size = 48) {
+   data[34] = ctrl-bUsage;
+   data[35] = ctrl-bBitDepthLuma;
+   data[36] = ctrl-bmSetting;
+   data[37] = ctrl-bMaxNumberOfRefFramesPlus1;
+   *(__le16 *)data[38] = cpu_to_le16(ctrl-bmRateControlModes);
+   for (i = 0; i  ARRAY_SIZE(ctrl-bmLayoutPerStream); ++i) {
+   *(__le16 *)data[40 + i * 2] =
+   cpu_to_le16(ctrl-bmLayoutPerStream[i]);
+   }
+   }
+
ret = __uvc_query_ctrl(stream-dev, UVC_SET_CUR, 0, stream-intfnum,
probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data,
size, uvc_timeout_param);
diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
index 3b3b95e..331c071 100644
--- a/include/uapi/linux/usb/video.h
+++ b/include/uapi/linux/usb/video.h
@@ -432,6 +432,7 @@ struct uvc_color_matching_descriptor {
 #define UVC_DT_COLOR_MATCHING_SIZE 6
 
 /* 4.3.1.1. Video Probe and Commit Controls */
+#define UVC_NUM_SIMULCAST_STREAMS  4
 struct uvc_streaming_control {
__u16 bmHint;
 

[PATCH v1 18/19] v4l: Add V4L2_PIX_FMT_VP8_SIMULCAST format.

2013-08-29 Thread Pawel Osciak
This format is used by UVC 1.5 VP8-encoding cameras. When it is used, the camera
may encode captured frames into one or more streams, each of which may
be configured differently. This allows simultaneous capture of streams
with different resolutions, bitrates, and other settings, depending on the
camera capabilities.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 include/uapi/linux/videodev2.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index c011ee0..8b0d4ad 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -402,6 +402,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M 
Annex G compliant stream */
 #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M 
Annex L compliant stream */
 #define V4L2_PIX_FMT_VP8  v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
+#define V4L2_PIX_FMT_VP8_SIMULCAST v4l2_fourcc('V', 'P', '8', 'S') /* VP8 
simulcast */
 
 /*  Vendor-specific formats   */
 #define V4L2_PIX_FMT_CPIA1v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
@@ -691,6 +692,9 @@ struct v4l2_buffer {
 #define V4L2_BUF_FLAG_PREV_FRAME   0x1  /* VP8 prev frame */
 #define V4L2_BUF_FLAG_GOLDEN_FRAME 0x2  /* VP8 golden frame */
 #define V4L2_BUF_FLAG_ALTREF_FRAME 0x4  /* VP8 altref frame */
+/* Simulcast layer structure. */
+#define V4L2_BUF_FLAG_LAYER_STRUCTURE_SHIFT19  /* Bits 19-20 for layer */
+#define V4L2_BUF_FLAG_LAYER_STRUCTURE_MASK 0x3 /* structure information. */
 
 /**
  * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
-- 
1.8.4

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


[PATCH v1 06/19] uvcvideo: Recognize UVC 1.5 encoding units.

2013-08-29 Thread Pawel Osciak
Add encoding unit definitions and descriptor parsing code and allow them to
be added to chains.

Signed-off-by: Pawel Osciak posc...@chromium.org
---
 drivers/media/usb/uvc/uvc_ctrl.c   | 37 ++---
 drivers/media/usb/uvc/uvc_driver.c | 67 +-
 drivers/media/usb/uvc/uvcvideo.h   | 14 +++-
 include/uapi/linux/usb/video.h |  1 +
 4 files changed, 105 insertions(+), 14 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index ba159a4..72d6724 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -777,6 +777,7 @@ static const __u8 uvc_processing_guid[16] = 
UVC_GUID_UVC_PROCESSING;
 static const __u8 uvc_camera_guid[16] = UVC_GUID_UVC_CAMERA;
 static const __u8 uvc_media_transport_input_guid[16] =
UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT;
+static const __u8 uvc_encoding_guid[16] = UVC_GUID_UVC_ENCODING;
 
 static int uvc_entity_match_guid(const struct uvc_entity *entity,
const __u8 guid[16])
@@ -795,6 +796,9 @@ static int uvc_entity_match_guid(const struct uvc_entity 
*entity,
return memcmp(entity-extension.guidExtensionCode,
  guid, 16) == 0;
 
+   case UVC_VC_ENCODING_UNIT:
+   return memcmp(uvc_encoding_guid, guid, 16) == 0;
+
default:
return 0;
}
@@ -2105,12 +2109,13 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
 {
struct uvc_entity *entity;
unsigned int i;
+   int num_found;
 
/* Walk the entities list and instantiate controls */
list_for_each_entry(entity, dev-entities, list) {
struct uvc_control *ctrl;
-   unsigned int bControlSize = 0, ncontrols;
-   __u8 *bmControls = NULL;
+   unsigned int bControlSize = 0, ncontrols = 0;
+   __u8 *bmControls = NULL, *bmControlsRuntime = NULL;
 
if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) {
bmControls = entity-extension.bmControls;
@@ -2121,13 +2126,25 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
} else if (UVC_ENTITY_TYPE(entity) == UVC_ITT_CAMERA) {
bmControls = entity-camera.bmControls;
bControlSize = entity-camera.bControlSize;
+   } else if (UVC_ENTITY_TYPE(entity) == UVC_VC_ENCODING_UNIT) {
+   bmControls = entity-encoding.bmControls;
+   bmControlsRuntime = entity-encoding.bmControlsRuntime;
+   bControlSize = entity-encoding.bControlSize;
}
 
/* Remove bogus/blacklisted controls */
uvc_ctrl_prune_entity(dev, entity);
 
/* Count supported controls and allocate the controls array */
-   ncontrols = memweight(bmControls, bControlSize);
+   for (i = 0; i  bControlSize; ++i) {
+   if (bmControlsRuntime) {
+   ncontrols += hweight8(bmControls[i]
+ | bmControlsRuntime[i]);
+   } else {
+   ncontrols += hweight8(bmControls[i]);
+   }
+   }
+
if (ncontrols == 0)
continue;
 
@@ -2139,8 +2156,17 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
 
/* Initialize all supported controls */
ctrl = entity-controls;
-   for (i = 0; i  bControlSize * 8; ++i) {
-   if (uvc_test_bit(bmControls, i) == 0)
+   for (i = 0, num_found = 0;
+   i  bControlSize * 8  num_found  ncontrols; ++i) {
+   if (uvc_test_bit(bmControls, i) == 1)
+   ctrl-on_init = 1;
+   if (bmControlsRuntime 
+   uvc_test_bit(bmControlsRuntime, i) == 1)
+   ctrl-in_runtime = 1;
+   else if (!bmControlsRuntime)
+   ctrl-in_runtime = ctrl-on_init;
+
+   if (ctrl-on_init == 0  ctrl-in_runtime == 0)
continue;
 
ctrl-entity = entity;
@@ -2148,6 +2174,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
 
uvc_ctrl_init_ctrl(dev, ctrl);
ctrl++;
+   num_found++;
}
}
 
diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index d7ff707..d950b40 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1155,6 +1155,37 @@ static int uvc_parse_standard_control(struct uvc_device 
*dev,
list_add_tail(unit-list, dev-entities);
break;
 
+   case UVC_VC_ENCODING_UNIT:
+  

[PATCH] media: usb: b2c2: Kconfig: add PCI dependancy to DVB_B2C2_FLEXCOP_USB

2013-08-29 Thread Chen Gang
DVB_B2C2_FLEXCOP_USB need depend on PCI, or can not pass compiling with
allmodconfig for h8300.

The related error:

  drivers/media/usb/b2c2/flexcop-usb.c: In function 'flexcop_usb_transfer_exit':
  drivers/media/usb/b2c2/flexcop-usb.c:393:3: error: implicit declaration of 
function 'pci_free_consistent' [-Werror=implicit-function-declaration]
 pci_free_consistent(NULL,
 ^
  drivers/media/usb/b2c2/flexcop-usb.c: In function 'flexcop_usb_transfer_init':
  drivers/media/usb/b2c2/flexcop-usb.c:410:2: error: implicit declaration of 
function 'pci_alloc_consistent' [-Werror=implicit-function-declaration]
fc_usb-iso_buffer = pci_alloc_consistent(NULL,
^
  drivers/media/usb/b2c2/flexcop-usb.c:410:21: warning: assignment makes 
pointer from integer without a cast [enabled by default]
fc_usb-iso_buffer = pci_alloc_consistent(NULL,
   ^
  cc1: some warnings being treated as errors


Signed-off-by: Chen Gang gang.c...@asianux.com
---
 drivers/media/usb/b2c2/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/usb/b2c2/Kconfig b/drivers/media/usb/b2c2/Kconfig
index 17d3583..06fdf30 100644
--- a/drivers/media/usb/b2c2/Kconfig
+++ b/drivers/media/usb/b2c2/Kconfig
@@ -1,6 +1,6 @@
 config DVB_B2C2_FLEXCOP_USB
tristate Technisat/B2C2 Air/Sky/Cable2PC USB
-   depends on DVB_CORE  I2C
+   depends on DVB_CORE  I2C  PCI
help
  Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by 
Technisat/B2C2,
 
-- 
1.7.7.6
--
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

2013-08-29 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:   Fri Aug 30 04:00:14 CEST 2013
git branch: test
git hash:   26a20eb09d44dc064c4f5d1f024bd501c09edb4b
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: 0.4.5-rc1
host hardware:  x86_64
host os:3.10.1

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: WARNINGS
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: OK
linux-3.10.1-i686: OK
linux-3.1.10-i686: OK
linux-3.11-rc1-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-2.6.31.14-x86_64: WARNINGS
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: OK
linux-3.10.1-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.11-rc1-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
apps: WARNINGS
spec-git: OK
ABI WARNING: change for arm-at91
ABI WARNING: change for arm-davinci
ABI WARNING: change for arm-exynos
ABI WARNING: change for arm-mx
ABI WARNING: change for arm-omap
ABI WARNING: change for arm-omap1
ABI WARNING: change for arm-pxa
ABI WARNING: change for blackfin
ABI WARNING: change for i686
ABI WARNING: change for m32r
ABI WARNING: change for mips
ABI WARNING: change for powerpc64
ABI WARNING: change for sh
ABI WARNING: change for x86_64
sparse version: 0.4.5-rc1
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.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: [PATCH 1/1] [media] uvcvideo: quirk PROBE_DEF for Dell SP2008WFP monitor.

2013-08-29 Thread Greg KH
On Fri, Aug 30, 2013 at 02:41:17AM +0200, Laurent Pinchart wrote:
 Hi Joseph,
 
 Thank you for the patch.
 
 On Thursday 29 August 2013 11:17:41 Joseph Salisbury wrote:
  BugLink: http://bugs.launchpad.net/bugs/1217957
  
  Add quirk for Dell SP2008WFP monitor: 05a9:2641
  
  Signed-off-by: Joseph Salisbury joseph.salisb...@canonical.com
  Tested-by: Christopher Townsend christopher.towns...@canonical.com
  Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
  Cc: Mauro Carvalho Chehab m.che...@samsung.com
  Cc: linux-media@vger.kernel.org
  Cc: linux-ker...@vger.kernel.org
  Cc: sta...@vger.kernel.org
 
 Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 
 I've applied it to my tree. Given that we're too close to the v3.12 merge 
 window I will push it for v3.13.

A quirk has to wait that long?  That's not ok, they should go in much
sooner than that...

thanks,

greg k-h
--
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