[PATCH] ddbridge: Replace vmalloc with vzalloc

2016-06-19 Thread Amitoj Kaur Chawla
vzalloc combines vmalloc and memset 0.

The Coccinelle semantic patch used to make this change is as follows:
@@
type T;
T *d;
expression e;
statement S;
@@

d =
-vmalloc
+vzalloc
 (...);
if (!d) S
-   memset(d, 0, sizeof(T));

Signed-off-by: Amitoj Kaur Chawla 
---
 drivers/media/pci/ddbridge/ddbridge-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c 
b/drivers/media/pci/ddbridge/ddbridge-core.c
index 6e995ef..47def73 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1569,10 +1569,9 @@ static int ddb_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
if (pci_enable_device(pdev) < 0)
return -ENODEV;
 
-   dev = vmalloc(sizeof(struct ddb));
+   dev = vzalloc(sizeof(struct ddb));
if (dev == NULL)
return -ENOMEM;
-   memset(dev, 0, sizeof(struct ddb));
 
dev->pdev = pdev;
pci_set_drvdata(pdev, dev);
-- 
1.9.1

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

2016-06-19 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Mon Jun 20 04:00:17 CEST 2016
git branch: test
git hash:   59f0bc11848f8f3242bc1fefae670e745929cd7b
gcc version:i686-linux-gcc (GCC) 5.3.0
sparse version: v0.5.0-56-g7647c77
smatch version: v0.5.0-3428-gdfe27cf
host hardware:  x86_64
host os:4.5.0-264

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-pxa: OK
linux-git-blackfin-bf561: 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.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16.7-i686: OK
linux-3.17.8-i686: OK
linux-3.18.7-i686: OK
linux-3.19-i686: OK
linux-4.0-i686: OK
linux-4.1.1-i686: OK
linux-4.2-i686: OK
linux-4.3-i686: OK
linux-4.4-i686: OK
linux-4.5-i686: OK
linux-4.6-i686: OK
linux-4.7-rc1-i686: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16.7-x86_64: OK
linux-3.17.8-x86_64: OK
linux-3.18.7-x86_64: OK
linux-3.19-x86_64: OK
linux-4.0-x86_64: OK
linux-4.1.1-x86_64: OK
linux-4.2-x86_64: OK
linux-4.3-x86_64: OK
linux-4.4-x86_64: OK
linux-4.5-x86_64: OK
linux-4.6-x86_64: OK
linux-4.7-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: WARNINGS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [very-RFC 0/8] TSN driver for the kernel

2016-06-19 Thread Takashi Sakamoto

(remove C.C. to lkml. This is not so major feature.)

On Jun 19 2916 07:45, Henrik Austad wrote:

snip

802.1Q gives you low latency through the network, but more importantly, no
dropped frames. gPTP gives you a central reference to time.


When such a long message is required, it means that we don't have enough 
premises for this discussion.


You have just interests in gPTP and transferring AVTPDUs, while no 
interests in the others such as "what the basic ideas of TSN come from" 
and "the reason that IEEE 1722 refers to IEC 61883 series which is 
originally designed for IEEE 1394 bus" and "the reason that I was 
motivated to join in this discussion even though not a netdev developer".


Here, could I ask you a question? Do you know a role of cycle start 
packet of IEEE Std 1394?


If you think it's not related to this discussion, please tell it to me. 
Then I'll drop out from this thread.



History Repeats itself.

Takashi Sakamoto
--
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] rc-cec: Add HDMI CEC keymap module

2016-06-19 Thread Hans Verkuil
From: Kamil Debski 

Add the keymap module for HDMI CEC remote control commands.

Signed-off-by: Kamil Debski 
Signed-off-by: Hans Verkuil 
---
 drivers/media/rc/keymaps/Makefile |   1 +
 drivers/media/rc/keymaps/rc-cec.c | 182 ++
 2 files changed, 183 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-cec.c

diff --git a/drivers/media/rc/keymaps/Makefile 
b/drivers/media/rc/keymaps/Makefile
index fbbd3bb..9cffcc6 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
rc-behold.o \
rc-behold-columbus.o \
rc-budget-ci-old.o \
+   rc-cec.o \
rc-cinergy-1400.o \
rc-cinergy.o \
rc-delock-61959.o \
diff --git a/drivers/media/rc/keymaps/rc-cec.c 
b/drivers/media/rc/keymaps/rc-cec.c
new file mode 100644
index 000..354c8e7
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-cec.c
@@ -0,0 +1,182 @@
+/* Keytable for the CEC remote control
+ *
+ * Copyright (c) 2015 by Kamil Debski
+ *
+ * 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 
+#include 
+
+/*
+ * CEC Spec "High-Definition Multimedia Interface Specification" can be 
obtained
+ * here: http://xtreamerdev.googlecode.com/files/CEC_Specs.pdf
+ * The list of control codes is listed in Table 27: User Control Codes p. 95
+ */
+
+static struct rc_map_table cec[] = {
+   { 0x00, KEY_OK },
+   { 0x01, KEY_UP },
+   { 0x02, KEY_DOWN },
+   { 0x03, KEY_LEFT },
+   { 0x04, KEY_RIGHT },
+   { 0x05, KEY_RIGHT_UP },
+   { 0x06, KEY_RIGHT_DOWN },
+   { 0x07, KEY_LEFT_UP },
+   { 0x08, KEY_LEFT_DOWN },
+   { 0x09, KEY_ROOT_MENU }, /* CEC Spec: Device Root Menu - see Note 2 */
+   /*
+* Note 2: This is the initial display that a device shows. It is
+* device-dependent and can be, for example, a contents menu, setup
+* menu, favorite menu or other menu. The actual menu displayed
+* may also depend on the device's current state.
+*/
+   { 0x0a, KEY_SETUP },
+   { 0x0b, KEY_MENU }, /* CEC Spec: Contents Menu */
+   { 0x0c, KEY_FAVORITES }, /* CEC Spec: Favorite Menu */
+   { 0x0d, KEY_EXIT },
+   /* 0x0e-0x0f: Reserved */
+   { 0x10, KEY_MEDIA_TOP_MENU },
+   { 0x11, KEY_CONTEXT_MENU },
+   /* 0x12-0x1c: Reserved */
+   { 0x1d, KEY_DIGITS }, /* CEC Spec: select/toggle a Number Entry Mode */
+   { 0x1e, KEY_NUMERIC_11 },
+   { 0x1f, KEY_NUMERIC_12 },
+   /* 0x20-0x29: Keys 0 to 9 */
+   { 0x20, KEY_NUMERIC_0 },
+   { 0x21, KEY_NUMERIC_1 },
+   { 0x22, KEY_NUMERIC_2 },
+   { 0x23, KEY_NUMERIC_3 },
+   { 0x24, KEY_NUMERIC_4 },
+   { 0x25, KEY_NUMERIC_5 },
+   { 0x26, KEY_NUMERIC_6 },
+   { 0x27, KEY_NUMERIC_7 },
+   { 0x28, KEY_NUMERIC_8 },
+   { 0x29, KEY_NUMERIC_9 },
+   { 0x2a, KEY_DOT },
+   { 0x2b, KEY_ENTER },
+   { 0x2c, KEY_CLEAR },
+   /* 0x2d-0x2e: Reserved */
+   { 0x2f, KEY_NEXT_FAVORITE }, /* CEC Spec: Next Favorite */
+   { 0x30, KEY_CHANNELUP },
+   { 0x31, KEY_CHANNELDOWN },
+   { 0x32, KEY_PREVIOUS }, /* CEC Spec: Previous Channel */
+   { 0x33, KEY_SOUND }, /* CEC Spec: Sound Select */
+   { 0x34, KEY_VIDEO }, /* 0x34: CEC Spec: Input Select */
+   { 0x35, KEY_INFO }, /* CEC Spec: Display Information */
+   { 0x36, KEY_HELP },
+   { 0x37, KEY_PAGEUP },
+   { 0x38, KEY_PAGEDOWN },
+   /* 0x39-0x3f: Reserved */
+   { 0x40, KEY_POWER },
+   { 0x41, KEY_VOLUMEUP },
+   { 0x42, KEY_VOLUMEDOWN },
+   { 0x43, KEY_MUTE },
+   { 0x44, KEY_PLAYCD },
+   { 0x45, KEY_STOPCD },
+   { 0x46, KEY_PAUSECD },
+   { 0x47, KEY_RECORD },
+   { 0x48, KEY_REWIND },
+   { 0x49, KEY_FASTFORWARD },
+   { 0x4a, KEY_EJECTCD }, /* CEC Spec: Eject */
+   { 0x4b, KEY_FORWARD },
+   { 0x4c, KEY_BACK },
+   { 0x4d, KEY_STOP_RECORD }, /* CEC Spec: Stop-Record */
+   { 0x4e, KEY_PAUSE_RECORD }, /* CEC Spec: Pause-Record */
+   /* 0x4f: Reserved */
+   { 0x50, KEY_ANGLE },
+   { 0x51, KEY_TV2 },
+   { 0x52, KEY_VOD }, /* CEC Spec: Video on Demand */
+   { 0x53, KEY_EPG },
+   { 0x54, KEY_TIME }, /* CEC Spec: Timer */
+   { 0x55, KEY_CONFIG },
+   /*
+* The following codes are hard to implement at this moment, as they
+* carry an additional additional argument. Most likely changes to RC
+* framework are necessary.
+* For now they are interpreted by the CEC framework as 

[PATCH] HDMI CEC rc keymap

2016-06-19 Thread Hans Verkuil
From: Hans Verkuil 

This adds the HDMI CEC keymap module.

This patch depends on these two patches:

https://patchwork.linuxtv.org/patch/34675/
https://patchwork.linuxtv.org/patch/34679/

So those two have to be merged in mainline before this patch can be
merged.

Regards,

Hans

Kamil Debski (1):
  rc-cec: Add HDMI CEC keymap module

 drivers/media/rc/keymaps/Makefile |   1 +
 drivers/media/rc/keymaps/rc-cec.c | 182 ++
 2 files changed, 183 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-cec.c

-- 
2.8.1

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


[PATCH 1/3] dma-buf: propagate errors from dma_buf_describe() on debugfs read

2016-06-19 Thread Mathias Krause
The callback function dma_buf_describe() returns an int not void so the
function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
also fail when acquiring the mutex gets interrupted so always returning
0 in dma_buf_show() is wrong, too.

Fix both issues by avoiding the indirection via dma_buf_show() and call
dma_buf_describe() directly. Rename it to dma_buf_debug_show() to get it
in line with the other functions.

This type mismatch was caught by the PaX RAP plugin.

Signed-off-by: Mathias Krause 
Cc: Sumit Semwal 
Cc: Daniel Vetter 
Cc: Brad Spengler 
Cc: PaX Team 
---
 drivers/dma-buf/dma-buf.c |   14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 6355ab38d630..7094b19bb495 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -824,7 +824,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
 EXPORT_SYMBOL_GPL(dma_buf_vunmap);
 
 #ifdef CONFIG_DEBUG_FS
-static int dma_buf_describe(struct seq_file *s)
+static int dma_buf_debug_show(struct seq_file *s, void *unused)
 {
int ret;
struct dma_buf *buf_obj;
@@ -879,17 +879,9 @@ static int dma_buf_describe(struct seq_file *s)
return 0;
 }
 
-static int dma_buf_show(struct seq_file *s, void *unused)
-{
-   void (*func)(struct seq_file *) = s->private;
-
-   func(s);
-   return 0;
-}
-
 static int dma_buf_debug_open(struct inode *inode, struct file *file)
 {
-   return single_open(file, dma_buf_show, inode->i_private);
+   return single_open(file, dma_buf_debug_show, NULL);
 }
 
 static const struct file_operations dma_buf_debug_fops = {
@@ -913,7 +905,7 @@ static int dma_buf_init_debugfs(void)
return err;
}
 
-   err = dma_buf_debugfs_create_file("bufinfo", dma_buf_describe);
+   err = dma_buf_debugfs_create_file("bufinfo", NULL);
 
if (err)
pr_debug("dma_buf: debugfs: failed to create node bufinfo\n");
-- 
1.7.10.4

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


[PATCH 3/3] dma-buf: remove dma_buf_debugfs_create_file()

2016-06-19 Thread Mathias Krause
There is only a single user of dma_buf_debugfs_create_file() and that
one got the function pointer cast wrong. With that one fixed, there is
no need to have a wrapper for debugfs_create_file(), just call it
directly.

With no users left, we can remove dma_buf_debugfs_create_file().

While at it, simplify the error handling in dma_buf_init_debugfs()
slightly.

Signed-off-by: Mathias Krause 
Cc: Sumit Semwal 
Cc: Daniel Vetter 
---
 drivers/dma-buf/dma-buf.c |   29 +
 include/linux/dma-buf.h   |2 --
 2 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index f03e51561199..20ce0687b111 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -895,22 +895,22 @@ static struct dentry *dma_buf_debugfs_dir;
 
 static int dma_buf_init_debugfs(void)
 {
+   struct dentry *d;
int err = 0;
 
-   dma_buf_debugfs_dir = debugfs_create_dir("dma_buf", NULL);
+   d = debugfs_create_dir("dma_buf", NULL);
+   if (IS_ERR(d))
+   return PTR_ERR(d);
 
-   if (IS_ERR(dma_buf_debugfs_dir)) {
-   err = PTR_ERR(dma_buf_debugfs_dir);
-   dma_buf_debugfs_dir = NULL;
-   return err;
-   }
+   dma_buf_debugfs_dir = d;
 
-   err = dma_buf_debugfs_create_file("bufinfo", NULL);
-
-   if (err) {
+   d = debugfs_create_file("bufinfo", S_IRUGO, dma_buf_debugfs_dir,
+   NULL, _buf_debug_fops);
+   if (IS_ERR(d)) {
pr_debug("dma_buf: debugfs: failed to create node bufinfo\n");
debugfs_remove_recursive(dma_buf_debugfs_dir);
dma_buf_debugfs_dir = NULL;
+   err = PTR_ERR(d);
}
 
return err;
@@ -921,17 +921,6 @@ static void dma_buf_uninit_debugfs(void)
if (dma_buf_debugfs_dir)
debugfs_remove_recursive(dma_buf_debugfs_dir);
 }
-
-int dma_buf_debugfs_create_file(const char *name,
-   int (*write)(struct seq_file *))
-{
-   struct dentry *d;
-
-   d = debugfs_create_file(name, S_IRUGO, dma_buf_debugfs_dir,
-   write, _buf_debug_fops);
-
-   return PTR_ERR_OR_ZERO(d);
-}
 #else
 static inline int dma_buf_init_debugfs(void)
 {
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 4551c6f2a6c4..e0b0741ae671 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -242,6 +242,4 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
 unsigned long);
 void *dma_buf_vmap(struct dma_buf *);
 void dma_buf_vunmap(struct dma_buf *, void *vaddr);
-int dma_buf_debugfs_create_file(const char *name,
-   int (*write)(struct seq_file *));
 #endif /* __DMA_BUF_H__ */
-- 
1.7.10.4

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


[PATCH 2/3] dma-buf: remove dma_buf directory on bufinfo file creation errors

2016-06-19 Thread Mathias Krause
Change the error handling in dma_buf_init_debugfs() to remove the
"dma_buf" directory if creating the "bufinfo" file fails. No need to
have an empty debugfs directory around.

Signed-off-by: Mathias Krause 
Cc: Sumit Semwal 
Cc: Daniel Vetter 
---
 drivers/dma-buf/dma-buf.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 7094b19bb495..f03e51561199 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -907,8 +907,11 @@ static int dma_buf_init_debugfs(void)
 
err = dma_buf_debugfs_create_file("bufinfo", NULL);
 
-   if (err)
+   if (err) {
pr_debug("dma_buf: debugfs: failed to create node bufinfo\n");
+   debugfs_remove_recursive(dma_buf_debugfs_dir);
+   dma_buf_debugfs_dir = NULL;
+   }
 
return err;
 }
-- 
1.7.10.4

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


[PATCH 0/3] dma-buf: debugfs fixes

2016-06-19 Thread Mathias Krause
This small series is the v2 of the patch posted initially here:

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

It not only fixes the type mix-up and addresses Daniel's remark (patch 1),
it also smoothes out the error handling in dma_buf_init_debugfs() (patch 2)
and removes the then unneeded function dma_buf_debugfs_create_file() (patch
3).

Please apply!

Mathias Krause (3):
  dma-buf: propagate errors from dma_buf_describe() on debugfs read
  dma-buf: remove dma_buf directory on bufinfo file creation errors
  dma-buf: remove dma_buf_debugfs_create_file()

 drivers/dma-buf/dma-buf.c |   44 ++--
 include/linux/dma-buf.h   |2 --
 2 files changed, 14 insertions(+), 32 deletions(-)

-- 
1.7.10.4

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


sur40: DMA-SG and performance question

2016-06-19 Thread Florian Echtler
Hello everyone,

I've been doing some latency testing on my sur40 driver, and I've
measured over 160 ms of round-trip delay (with an external high-speed
camera, delay between lighting up an LED and seeing the on-screen
response in the video stream).

I'm aware that this value has to factor in screen refresh rates etc.,
but it still seems to me that at least 100 ms have to be accounted for
purely by image acquisition and delivery.

My question now is: can any of this latency be caused by my usage of
DMA-SG (see [1] ff.), or is this a zero-copy operation, i.e. the data is
delivered directly to the V4L2 buffer from the USB host controller?

Thanks & best regards, Florian

[1]
https://git.kernel.org/cgit/linux/kernel/git/mchehab/linux-media.git/tree/drivers/input/touchscreen/sur40.c#n431
-- 
SENT FROM MY DEC VT50 TERMINAL



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] dma-buf: propagate errors from dma_buf_describe() on debugfs read

2016-06-19 Thread Mathias Krause
On 19 June 2016 at 10:45, Daniel Vetter  wrote:
> On Fri, Jun 17, 2016 at 08:57:03PM +0200, Mathias Krause wrote:
>> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
>> index 6355ab38d630..0f2a4592fdd2 100644
>> --- a/drivers/dma-buf/dma-buf.c
>> +++ b/drivers/dma-buf/dma-buf.c
>> @@ -881,10 +881,9 @@ static int dma_buf_describe(struct seq_file *s)
>>
>>  static int dma_buf_show(struct seq_file *s, void *unused)
>>  {
>> - void (*func)(struct seq_file *) = s->private;
>> + int (*func)(struct seq_file *) = s->private;
>>
>> - func(s);
>> - return 0;
>> + return func(s);
>
> Probably even better to just nuke that indirection. Set this pointer to
> NULL and inline dma_buf_describe into dma_buf_show.

Even further, we can get rid of dma_buf_debugfs_create_file() too as
it's only used to create this indirection.
I'll send a v2 just doing that.

Thanks,
Mathias
--
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: [very-RFC 0/8] TSN driver for the kernel

2016-06-19 Thread Richard Cochran
On Sun, Jun 19, 2016 at 12:45:50AM +0200, Henrik Austad wrote:
> edit: this turned out to be a somewhat lengthy answer. I have tried to 
> shorten it down somewhere. it is getting late and I'm getting increasingly 
> incoherent (Richard probably knows what I'm talking about ;) so I'll stop 
> for now.

Thanks for your responses, Henrik.  I think your explanations are on spot.

> note that an adjustable sample-clock is not a *requirement* but in general 
> you'd want to avoid resampling in software.

Yes, but..

Adjusting the local clock rate to match the AVB network rate is
essential.  You must be able to *continuously* adjust the rate in
order to compensate drift.  Again, there are exactly two ways to do
it, namely in hardware (think VCO) or in software (dynamic
resampling).

What you cannot do is simply buffer the AV data and play it out
blindly at the local clock rate.

Regarding the media clock, if I understand correctly, there the talker
has two possibilities.  Either the talker samples the stream at the
gPTP rate, or the talker must tell the listeners the relationship
(phase offset and frequency ratio) between the media clock and the
gPTP time.  Please correct me if I got the wrong impression...

Thanks,
Richard
--
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] dma-buf: propagate errors from dma_buf_describe() on debugfs read

2016-06-19 Thread Daniel Vetter
On Fri, Jun 17, 2016 at 08:57:03PM +0200, Mathias Krause wrote:
> The callback function dma_buf_describe() returns an int not void so the
> function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
> also fail when acquiring the mutex gets interrupted so always returning
> 0 in dma_buf_show() is wrong, too.
> 
> Fix both issues by casting the function pointer to the correct type and
> propagate its return value.
> 
> This type mismatch was caught by the PaX RAP plugin.
> 
> Signed-off-by: Mathias Krause 
> Cc: Sumit Semwal 
> Cc: Daniel Vetter 
> Cc: PaX Team 
> ---
>  drivers/dma-buf/dma-buf.c |5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 6355ab38d630..0f2a4592fdd2 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -881,10 +881,9 @@ static int dma_buf_describe(struct seq_file *s)
>  
>  static int dma_buf_show(struct seq_file *s, void *unused)
>  {
> - void (*func)(struct seq_file *) = s->private;
> + int (*func)(struct seq_file *) = s->private;
>  
> - func(s);
> - return 0;
> + return func(s);

Probably even better to just nuke that indirection. Set this pointer to
NULL and inline dma_buf_describe into dma_buf_show.
-Daniel

>  }
>  
>  static int dma_buf_debug_open(struct inode *inode, struct file *file)
> -- 
> 1.7.10.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
--
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