Re: [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path

2015-12-09 Thread Sakari Ailus
Hi Wu,

Wu, Xia wrote:
> Add dma_buf_put() to decrease refcount of the dmabuf in error path if DMABUF 
> size is smaller than the requirement.
> 
> Signed-off-by: wu xia 
> ---
>  drivers/media/v4l2-core/videobuf2-core.c |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
> b/drivers/media/v4l2-core/videobuf2-core.c
> index 33bdd81..1f232e7 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -1084,6 +1084,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const 
> void *pb)
>   if (planes[plane].length < q->plane_sizes[plane]) {
>   dprintk(1, "invalid dmabuf length for plane %d\n",
>   plane);
> + dma_buf_put(dbuf);
>   ret = -EINVAL;
>   goto err;
>   }

Acked-by: Sakari Ailus 

Looks like the bug has been also in the original implementation, and the
code has been in a bit of flux since, yet the bug has remained...

I think it'd be nice to have this in stable kernels. Mauro, Hans, what
do you think?

-- 
Kind regards,

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


Re: [PATCH 3/7] of: reserved_mem: add support for named reserved mem nodes

2015-12-09 Thread Marek Szyprowski

Hello,

On 2015-12-08 15:58, Rob Herring wrote:

On Mon, Dec 7, 2015 at 6:08 AM, Marek Szyprowski
 wrote:

This patch allows device drivers to use more than one reserved memory
region assigned to given device. When NULL name is passed to
of_reserved_mem_device_init(), the default (first) region is used.

Every property that's an array does not need a name property. Just use
indexes please.


Okay, I will update the patch and add support for indices in the main
implementation as well as a wrapper, which accepts "name" parameter.




Signed-off-by: Marek Szyprowski 
---
  drivers/of/of_reserved_mem.c| 101 +++-
  include/linux/of_reserved_mem.h |   6 ++-
  2 files changed, 84 insertions(+), 23 deletions(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 1a3556a9e9ea..0a0b23b73004 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -21,6 +21,7 @@
  #include 
  #include 
  #include 
+#include 

  #define MAX_RESERVED_REGIONS   16
  static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
@@ -287,31 +288,84 @@ static inline struct reserved_mem *__find_rmem(struct 
device_node *node)
 return NULL;
  }

+static struct reserved_mem *__node_to_rmem(struct device_node *node,
+  const char *name)
+{
+   struct reserved_mem *rmem;
+   struct device_node *target;
+   int idx = 0;
+
+   if (!node)
+   return NULL;
+
+   if (name) {
+   idx = of_property_match_string(node,
+  "memory-region-names", name);
+   if (idx < 0)
+   return NULL;
+   }
+
+   target = of_parse_phandle(node, "memory-region", idx);
+   if (!target)
+   return NULL;
+   rmem = __find_rmem(target);
+   of_node_put(target);
+
+   return rmem;
+}
+
+struct rmem_assigned_device {
+   struct device *dev;
+   struct reserved_mem *rmem;
+   struct list_head list;
+};
+
+static LIST_HEAD(of_rmem_assigned_device_list);
+static DEFINE_MUTEX(of_rmem_assigned_device_mutex);

Not that this is a fast or contended path, but I think a spinlock
would be more appropriate here.


This is not meant to be called really often and for all kinds on 
initialization lists
and structures I saw that mutexes are used instead of spinlocks. There 
is no intention

to let this function to be called from atomic context.




+
  /**
   * of_reserved_mem_device_init() - assign reserved memory region to given 
device
+ * @dev:   Pointer to the device to configure
+ * @np:Pointer to the device_node with 'reserved-memory' 
property
+ * @name:  Optional name of the selected region (can be NULL)
+ *
+ * This function assigns respective DMA-mapping operations based on reserved
+ * memory regionspecified by 'memory-region' property in @np node, named @name
+ * to the @dev device. When NULL name is provided, the default (first) memory
+ * region is used. When driver needs to use more than one reserved memory
+ * region, it should allocate child devices and initialize regions by name for
+ * each of child device.
   *
- * This function assign memory region pointed by "memory-region" device tree
- * property to the given device.
+ * Returns error code or zero on success.
   */
-int of_reserved_mem_device_init(struct device *dev)
+int of_reserved_mem_device_init(struct device *dev, struct device_node *np,
+   const char *name)
  {
+   struct rmem_assigned_device *rd;
 struct reserved_mem *rmem;
-   struct device_node *np;
 int ret;

-   np = of_parse_phandle(dev->of_node, "memory-region", 0);
-   if (!np)
-   return -ENODEV;
-
-   rmem = __find_rmem(np);
-   of_node_put(np);
-
+   rmem = __node_to_rmem(np, name);
 if (!rmem || !rmem->ops || !rmem->ops->device_init)
 return -EINVAL;

+   rd = kmalloc(sizeof(struct rmem_assigned_device), GFP_KERNEL);
+   if (!rd)
+   return -ENOMEM;
+
 ret = rmem->ops->device_init(rmem, dev);
-   if (ret == 0)
+   if (ret == 0) {
+   rd->dev = dev;
+   rd->rmem = rmem;
+
+   mutex_lock(_rmem_assigned_device_mutex);
+   list_add(>list, _rmem_assigned_device_list);
+   mutex_unlock(_rmem_assigned_device_mutex);
+
 dev_info(dev, "assigned reserved memory node %s\n", 
rmem->name);
+   } else {
+   kfree(rd);
+   }

 return ret;
  }
@@ -319,21 +373,26 @@ EXPORT_SYMBOL_GPL(of_reserved_mem_device_init);

  /**
   * of_reserved_mem_device_release() - release reserved memory device 
structures
+ * @dev:   Pointer to the device to deconfigure
   *
   * This function releases structures allocated for memory region handling for
   * the 

Re: [PATCHv11 15/15] videobuf2-core: fix plane_sizes handling in VIDIOC_CREATE_BUFS

2015-12-09 Thread Sakari Ailus
Hi Hans,

On Fri, Nov 20, 2015 at 05:45:48PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> The handling of q->plane_sizes was wrong in vb2_core_create_bufs().
> The q->plane_sizes array was global and it was overwritten by create_bufs.
> So if reqbufs was called with e.g. size 10 then q->plane_sizes[0] would
> be set to 10. If create_bufs was called afterwards with size 20,
> then q->plane_sizes[0] would be overwritten with the new value. Calling
> create_bufs again for size 10 would cause an error since 10 is now
> less than q->plane_sizes[0].
> 
> This patch fixes this problem by 1) removing q->plane_sizes and using the
> vb->planes[].length field instead, and 2) by introducing a min_length field
> in struct vb2_plane. This field is set to the plane size as returned by
> the queue_setup op and is the minimum required plane size. So user pointers
> or dmabufs should all be at least this size.
> 
> Signed-off-by: Hans Verkuil 
> Reported-by: Sakari Ailus 

Thanks!

Acked-by: Sakari Ailus 

-- 
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: Failed to build on 4.2.6

2015-12-09 Thread Luis de Bethencourt

Greg Kroah-Hartman writes:

> On Mon, Dec 07, 2015 at 10:25:19AM -0500, Steven Rostedt wrote:
>> Hi,
>>
>> The attached config doesn't build on 4.2.6, but changing it to the
>> following:
>>
>>  VIDEO_V4L2_SUBDEV_API n -> y
>> +V4L2_FLASH_LED_CLASS n
>>
>> does build.
>
> Did this work on older kernels (4.2.5?  .4?  older?)
>
> thanks,
>
> greg k-h

Hi all,

The problem was:

drivers/media/i2c/adv7604.c: In function ‘adv76xx_get_format’:
drivers/media/i2c/adv7604.c:1861:3: error: implicit declaration of function 
‘v4l2_subdev_get_try_format’ [-Werror=implicit-function-declaration]
   fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);

As Randy mentioned, this if fixed by commit
fc88dd16a0e430f57458e6bd9b62a631c6ea53a1

I backported it locally to test this and build worked fine.

Luis
--
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] v4l: Fix dma buf single plane compat handling

2015-12-09 Thread Sakari Ailus
On Wed, Dec 09, 2015 at 01:11:12AM +0200, Laurent Pinchart wrote:
> Hi Sakari,
> 
> On Tuesday 08 December 2015 17:29:16 Sakari Ailus wrote:
> > On Mon, Dec 07, 2015 at 10:45:39AM +0200, Laurent Pinchart wrote:
> > > From: Gjorgji Rosikopulos 
> > > 
> > > Buffer length is needed for single plane as well, otherwise
> > > is uninitialized and behaviour is undetermined.
> > 
> > How about:
> > 
> > The v4l2_buffer length field must be passed as well from user to kernel and
> > back, otherwise uninitialised values will be used.
> > 
> > > Signed-off-by: Gjorgji Rosikopulos 
> > > Signed-off-by: Laurent Pinchart 
> > 
> > Acked-by: Sakari Ailus 
> > 
> > Shouldn't this be submitted to stable as well?
> 
> I'll CC stable.
> 
> > > ---
> > > 
> > >  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> > > b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index
> > > 8fd84a67478a..b0faa1f7e3a9 100644
> > > --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> > > +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> > > @@ -482,8 +482,10 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp,
> > > struct v4l2_buffer32 __user> 
> > >   return -EFAULT;
> > >   
> > >   break;
> > >   
> > >   case V4L2_MEMORY_DMABUF:
> > > - if (get_user(kp->m.fd, >m.fd))
> > > + if (get_user(kp->m.fd, >m.fd) ||
> > > + get_user(kp->length, >length))
> > > 
> > >   return -EFAULT;
> > > 
> > > +

Without the extra newline, please?

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


[Fwd: Problem with avermedia Volar Black HD (af9015) : recognised but not scanning]

2015-12-09 Thread Olivier Devaux
Hello,

Any ideas on my problem ? Am I on the right mailing-list ?

Any help would be appreciated !

Thanks,
OD

 Message transféré 
> De: oddebian 
> À: linux-media@vger.kernel.org
> Objet: Problem with avermedia Volar Black HD (af9015) : recognised but
> not scanning
> Date: Thu, 03 Dec 2015 19:23:28 +0100
> 
> Hi,
> 
> I have an old avermedia Volar Black HD (af9015) that still works pretty
> well in windows 8 (it scans the whole dvb-t muxes in less than one
> minute and the image is perfect even in HD).
> When I try it on linux, it takes 12 minutes to scan with w_scan, and
> despite showing lines such as :
> updating transponder:
>(QAM_64   f = 4294967 kHz I999B8C999D0T8G32Y0) 0x405A
> to (QAM_64   f = 4294967 kHz I999B8C999D0T8G8Y0) 0x405A
> undefined coderate HP
> in the end, it says :
> 
> tune to: QAM_AUTO f = 482000 kHz I999B8C999D999T999G999Y999 
> (time: 12:13) --no signal--
> tune to: QAM_AUTO f = 482000 kHz I999B8C999D999T999G999Y999  (no signal)
> (time: 12:14) --no signal--
> tune to: QAM_64   f = 4294967 kHz I999B8C999D0T8G8Y0 
> (time: 12:16) skipped: (freq 4294967286 unsupported by driver)
> tune to: QAM_AUTO f = 482166 kHz I999B8C999D999T999G999Y999 
> (time: 12:16) --no signal--
> tune to: QAM_AUTO f = 482166 kHz I999B8C999D999T999G999Y999  (no signal)
> (time: 12:17) --no signal--
> 
> ERROR: Sorry - i couldn't get any working frequency/transponder
> Nothing to scan!!
> 
> 
> The problem is the same on my destop pc (debian 8, kernel
> 3.16.0-4-amd64) and on a Raspberry 1 (Linux osmc 4.2.3-3-osmc, or
> openelec).
> I tried also with tvheadend, but scan does not work either.
> 
> The firmware is correct and installed in /lib/firmware.
> Dmesg shows that the usb device is well detected, with no errors :
> [   13.846959] usb 1-5: dvb_usb_v2: found a 'AverMedia AVerTV Volar
> Black HD (A850)' in cold state
> [   13.847467] usb 1-5: firmware: direct-loading firmware
> dvb-usb-af9015.fw
> [   13.847474] usb 1-5: dvb_usb_v2: downloading firmware from file
> 'dvb-usb-af9015.fw'
> [   13.917176] usb 1-5: dvb_usb_v2: found a 'AverMedia AVerTV Volar
> Black HD (A850)' in warm state
> [   14.327175] usb 1-5: dvb_usb_v2: will pass the complete MPEG2
> transport stream to the software demuxer
> [   14.335086] usb 1-5: DVB: registering adapter 0 frontend 0 (Afatech
> AF9013)...
> [   14.345704] usb 1-5: dvb_usb_v2: 'AverMedia AVerTV Volar Black HD
> (A850)' successfully initialized and connected
> [   14.345795] usbcore: registered new interface driver dvb_usb_af9015
> 
> And lsusb :
> Bus 001 Device 003: ID 07ca:850a AVerMedia Technologies, Inc. AverTV
> Volar Black HD (A850)
> 
> I must say it is very frustrating to see a device still supported in
> windows 8, and working perfectly, but not working anymore in linux
> despite stated as supported in
> http://www.linuxtv.org/wiki/index.php/AVerTV_Volar_Black_HD_%28A850%29
> 
> Thanks in advance for any idea that could help !
> OD
> 


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


[v4l-utils PATCH 1/1] v4l: libv4l2subdev: Precisely convert media bus string to code

2015-12-09 Thread Sakari Ailus
The length of the string was ignored, making it possible for the
conversion to fail due to extra characters in the string.

Signed-off-by: Sakari Ailus 
---
This patch should be applied before the set "[v4l-utils PATCH v2 0/3] List
supported formats in libv4l2subdev":



 utils/media-ctl/libv4l2subdev.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c
index 33c1ee6..cce527d 100644
--- a/utils/media-ctl/libv4l2subdev.c
+++ b/utils/media-ctl/libv4l2subdev.c
@@ -769,14 +769,12 @@ enum v4l2_mbus_pixelcode 
v4l2_subdev_string_to_pixelcode(const char *string,
unsigned int i;
 
for (i = 0; i < ARRAY_SIZE(mbus_formats); ++i) {
-   if (strncmp(mbus_formats[i].name, string, length) == 0)
-   break;
+   if (strncmp(mbus_formats[i].name, string, length) == 0
+   && strlen(mbus_formats[i].name) == length)
+   return mbus_formats[i].code;
}
 
-   if (i == ARRAY_SIZE(mbus_formats))
-   return (enum v4l2_mbus_pixelcode)-1;
-
-   return mbus_formats[i].code;
+   return (enum v4l2_mbus_pixelcode)-1;
 }
 
 static struct {
-- 
2.1.0.231.g7484e3b

--
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 v8 52/55] [media] media-device: remove interfaces and interface links

2015-12-09 Thread Mauro Carvalho Chehab
Em Mon, 23 Nov 2015 23:22:56 +0200
Laurent Pinchart  escreveu:

> Hi Mauro,
> 
> Thank you for the patch.
> 
> On Sunday 06 September 2015 09:03:12 Mauro Carvalho Chehab wrote:
> > Just like what's done with entities, when the media controller is
> > unregistered, release any interface and interface links that
> > might still be there.
> > 
> > Signed-off-by: Mauro Carvalho Chehab 
> > 
> > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > index 7c37aeab05bb..0238885fcc74 100644
> > --- a/drivers/media/media-device.c
> > +++ b/drivers/media/media-device.c
> > @@ -574,6 +574,22 @@ void media_device_unregister(struct media_device *mdev)
> > {
> > struct media_entity *entity;
> > struct media_entity *next;
> > +   struct media_link *link, *tmp_link;
> > +   struct media_interface *intf, *tmp_intf;
> > +
> > +   /* Remove interface links from the media device */
> > +   list_for_each_entry_safe(link, tmp_link, >links,
> > +graph_obj.list) {
> > +   media_gobj_remove(>graph_obj);
> > +   kfree(link);
> > +   }
> > +
> > +   /* Remove all interfaces from the media device */
> > +   list_for_each_entry_safe(intf, tmp_intf, >interfaces,
> > +graph_obj.list) {
> > +   media_gobj_remove(>graph_obj);
> > +   kfree(intf);
> > +   }
> > 
> > list_for_each_entry_safe(entity, next, >entities, graph_obj.list)
> > media_device_unregister_entity(entity);
> > @@ -651,7 +667,6 @@ void media_device_unregister_entity(struct media_entity
> > *entity) /* Remove all data links that belong to this entity */
> > list_for_each_entry_safe(link, tmp, >links, list) {
> > media_gobj_remove(>graph_obj);
> > -   list_del(>list);
> > kfree(link);
> 
> The link has already been freed in media_device_unregister(). You have access-
> after-free and double-free issues here.
> 
> > }
> > 
> > diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> > index a37ccd2edfd5..cd4d767644df 100644
> > --- a/drivers/media/media-entity.c
> > +++ b/drivers/media/media-entity.c
> > @@ -206,6 +206,10 @@ void media_gobj_remove(struct media_gobj *gobj)
> > 
> > /* Remove the object from mdev list */
> > list_del(>list);
> > +
> > +   /* Links have their own list - we need to drop them there too */
> > +   if (media_type(gobj) == MEDIA_GRAPH_LINK)
> > +   list_del(_to_link(gobj)->list);
> 
> Please... That's a very bad layering violation. Let's not do that. Generic 
> graph object code should not contain any type-specific code. You can create a 
> media_link_remove() function for links that will remove the link from the 
> entity links list and call media_gobj_remove().
> 
> >  }
> > 
> >  /**
> > diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> > index ca4a4f23362f..fb5f0e21f137 100644
> > --- a/include/media/media-entity.h
> > +++ b/include/media/media-entity.h
> > @@ -153,7 +153,7 @@ struct media_entity {
> >  };
> > 
> >  /**
> > - * struct media_intf_devnode - Define a Kernel API interface
> > + * struct media_interface - Define a Kernel API interface
> 
> This belongs to a different patch ;-)
> 
> >   *
> >   * @graph_obj: embedded graph object
> >   * @list:  Linked list used to find other interfaces that belong
> > @@ -163,6 +163,11 @@ struct media_entity {
> >   * uapi/media/media.h header, e. g.
> >   * MEDIA_INTF_T_*
> >   * @flags: Interface flags as defined at uapi/media/media.h
> > + *
> > + * NOTE: As media_device_unregister() will free the address of the
> > + *  media_interface, this structure should be embedded as the first
> > + *  element of the derived functions, in order for the address to be
> > + *  the same.
> 
> s/NOTE/DIRTY HACK/
> 
> Or, much better, let's fix it :-) If you want to be able to destroy graph 
> object without needing to know their type, you can add a destroy operation to 
> the graph objects and have per-type implementations. There's probably other 
> options as well.
> 
> >   */
> >  struct media_interface {
> > struct media_gobj   graph_obj;
> > @@ -179,11 +184,11 @@ struct media_interface {
> >   * @minor: Minor number of a device node
> >   */
> >  struct media_intf_devnode {
> > -   struct media_interface  intf;
> > +   struct media_interface  intf; /* must be first field in struct */
> > 
> > /* Should match the fields at media_v2_intf_devnode */
> > -   u32 major;
> > -   u32 minor;
> > +   u32 major;
> > +   u32 minor;
> 
> This doesn't belong to this patch either.
> 
> >  };
> > 
> >  static inline u32 media_entity_id(struct media_entity *entity)
> 

Thanks for review!

Indeed, this patch had several troubles. I reworked on it, fixing

[PATCH v2 0/7] Exynos: MFC driver: reserved memory cleanup and IOMMU support

2015-12-09 Thread Marek Szyprowski
Hello,

This patchset finally perform cleanup of custom code in s5p-mfc codec
driver. The first part is removal of custom, driver specific code for
intializing and handling of reserved memory. Instead, a generic code for
reserved memory regions is used. Then, once it is done, the proper setup
of DMA parameters (max segment size) is applied for all multimedia
devices found on Exynos SoCs to let them properly handle shared buffers
mapped into contiguous DMA address space. The last patch adds support
for IOMMU to MFC driver. Some additional code is needed because of
specific requirements of MFC device firmware (see patch 7 for more
details). When no IOMMU is available, the code fallbacks to generic
reserved memory regions.

After applying this patchset, MFC device works correctly when IOMMU is
either enabled or disabled.

Patches have been tested on top of linux-next from 20151207. I would
prefer to merge patches 1-2 via Samsung tree and patches 3-7 via media
tree (there are no compile-time dependencies between patches 1-2 and
3-7). Patches have been tested on Odroid U3 (Exynos 4412 based) and
Odroid XU3 (Exynos 5422 based) boards.

Best regards
Marek Szyprowski
Samsung R Institute Poland


Changelog:
v2:
- reworked of_reserved_mem_init* functions on request from Rob Herring,
  added separate index and name based selection of reserved region
- adapted for of_reserved_mem_init* related changes

v1: https://www.mail-archive.com/linux-media@vger.kernel.org/msg94100.html
- initial version of another approach for this problem, rewrote driver code
  for new reserved memory bindings, which finally have been merged some
  time ago

v0: 
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-August/189259.html
- old patchset solving the same problem, abandoned due to other tasks
  and long time of merging reserved memory bindings and support code for
  it

Patch summary:

Marek Szyprowski (7):
  ARM: Exynos: convert MFC device to generic reserved memory bindings
  ARM: dts: exynos4412-odroid*: enable MFC device
  of: reserved_mem: add support for named reserved mem nodes
  media: vb2-dma-contig: add helper for setting dma max seg size
  media: set proper max seg size for devices on Exynos SoCs
  media: s5p-mfc: replace custom reserved memory init code with generic
one
  media: s5p-mfc: add iommu support

 .../devicetree/bindings/media/s5p-mfc.txt  |  16 +--
 arch/arm/boot/dts/exynos4210-origen.dts|  22 ++-
 arch/arm/boot/dts/exynos4210-smdkv310.dts  |  22 ++-
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi|  24 
 arch/arm/boot/dts/exynos4412-origen.dts|  22 ++-
 arch/arm/boot/dts/exynos4412-smdk4412.dts  |  22 ++-
 arch/arm/boot/dts/exynos5250-arndale.dts   |  22 ++-
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |  22 ++-
 arch/arm/boot/dts/exynos5250-spring.dts|  22 ++-
 arch/arm/boot/dts/exynos5420-arndale-octa.dts  |  22 ++-
 arch/arm/boot/dts/exynos5420-smdk5420.dts  |  22 ++-
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi |  22 ++-
 arch/arm/mach-exynos/Makefile  |   2 -
 arch/arm/mach-exynos/exynos.c  |  19 ---
 arch/arm/mach-exynos/mfc.h |  16 ---
 arch/arm/mach-exynos/s5p-dev-mfc.c |  94 -
 drivers/media/platform/exynos-gsc/gsc-core.c   |   1 +
 drivers/media/platform/exynos4-is/fimc-core.c  |   1 +
 drivers/media/platform/exynos4-is/fimc-is.c|   1 +
 drivers/media/platform/exynos4-is/fimc-lite.c  |   1 +
 drivers/media/platform/s5p-g2d/g2d.c   |   1 +
 drivers/media/platform/s5p-jpeg/jpeg-core.c|   1 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c   | 153 -
 drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h |  79 +++
 drivers/media/platform/s5p-tv/mixer_video.c|   1 +
 drivers/media/v4l2-core/videobuf2-dma-contig.c |  15 ++
 drivers/of/of_reserved_mem.c   | 104 +++---
 include/linux/of_reserved_mem.h|  31 -
 include/media/videobuf2-dma-contig.h   |   1 +
 29 files changed, 533 insertions(+), 248 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/mfc.h
 delete mode 100644 arch/arm/mach-exynos/s5p-dev-mfc.c
 create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h

-- 
1.9.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 v2 2/7] ARM: dts: exynos4412-odroid*: enable MFC device

2015-12-09 Thread Marek Szyprowski
Enable support for Multimedia Codec (MFC) device for all Exynos4412-based
Odroid boards.

Signed-off-by: Marek Szyprowski 
---
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi 
b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index edf0fc8..5825abf 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -18,6 +18,24 @@
stdout-path = _1;
};
 
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   mfc_left: region@7700 {
+   compatible = "shared-dma-pool";
+   reusable;
+   reg = <0x7700 0x100>;
+   };
+
+   mfc_right: region@7800 {
+   compatible = "shared-dma-pool";
+   reusable;
+   reg = <0x7800 0x100>;
+   };
+   };
+
firmware@0204F000 {
compatible = "samsung,secure-firmware";
reg = <0x0204F000 0x1000>;
@@ -451,6 +469,12 @@
clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
 };
 
+ {
+   memory-region = <_left>, <_right>;
+   memory-region-names = "left", "right";
+   status = "okay";
+};
+
  {
status = "okay";
 };
-- 
1.9.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 v2 1/7] ARM: Exynos: convert MFC device to generic reserved memory bindings

2015-12-09 Thread Marek Szyprowski
This patch replaces custom properties for definining reserved memory
regions with generic reserved memory bindings. All custom code for
handling MFC-specific reserved memory can be now removed from Exynos-DT
generic board code.

Signed-off-by: Marek Szyprowski 
---
 .../devicetree/bindings/media/s5p-mfc.txt  | 16 ++--
 arch/arm/boot/dts/exynos4210-origen.dts| 22 -
 arch/arm/boot/dts/exynos4210-smdkv310.dts  | 22 -
 arch/arm/boot/dts/exynos4412-origen.dts| 22 -
 arch/arm/boot/dts/exynos4412-smdk4412.dts  | 22 -
 arch/arm/boot/dts/exynos5250-arndale.dts   | 22 -
 arch/arm/boot/dts/exynos5250-smdk5250.dts  | 22 -
 arch/arm/boot/dts/exynos5250-spring.dts| 22 -
 arch/arm/boot/dts/exynos5420-arndale-octa.dts  | 22 -
 arch/arm/boot/dts/exynos5420-smdk5420.dts  | 22 -
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 22 -
 arch/arm/mach-exynos/Makefile  |  2 -
 arch/arm/mach-exynos/exynos.c  | 19 -
 arch/arm/mach-exynos/mfc.h | 16 
 arch/arm/mach-exynos/s5p-dev-mfc.c | 94 --
 15 files changed, 208 insertions(+), 159 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/mfc.h
 delete mode 100644 arch/arm/mach-exynos/s5p-dev-mfc.c

diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt 
b/Documentation/devicetree/bindings/media/s5p-mfc.txt
index 2d5787e..4603673 100644
--- a/Documentation/devicetree/bindings/media/s5p-mfc.txt
+++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt
@@ -21,16 +21,16 @@ Required properties:
   - clock-names : from common clock binding: must contain "mfc",
  corresponding to entry in the clocks property.
 
-  - samsung,mfc-r : Base address of the first memory bank used by MFC
-   for DMA contiguous memory allocation and its size.
-
-  - samsung,mfc-l : Base address of the second memory bank used by MFC
-   for DMA contiguous memory allocation and its size.
-
 Optional properties:
   - power-domains : power-domain property defined with a phandle
   to respective power domain.
 
+  - memory-region : from reserved memory binding: phandles to two reserved
+   memory regions: accessed by "left" and "right" mfc memory bus
+   interfaces, used when no SYSMMU support is available
+  - memory-region-names : from reserved memory binding: must be "left"
+   and "right"
+
 Example:
 SoC specific DT entry:
 
@@ -46,6 +46,6 @@ mfc: codec@1340 {
 Board specific DT entry:
 
 codec@1340 {
-   samsung,mfc-r = <0x4300 0x80>;
-   samsung,mfc-l = <0x5100 0x80>;
+   memory-region = <_left>, <_right>;
+   memory-region-names = "left", "right";
 };
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts 
b/arch/arm/boot/dts/exynos4210-origen.dts
index b8f8669..5a5ec93 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -30,6 +30,24 @@
   0x7000 0x1000>;
};
 
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   mfc_left: region@5100 {
+   compatible = "shared-dma-pool";
+   no-map;
+   reg = <0x5100 0x80>;
+   };
+
+   mfc_right: region@4300 {
+   compatible = "shared-dma-pool";
+   no-map;
+   reg = <0x4300 0x80>;
+   };
+   };
+
chosen {
bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M 
console=ttySAC2,115200 init=/linuxrc";
stdout-path = _2;
@@ -292,8 +310,8 @@
 };
 
  {
-   samsung,mfc-r = <0x4300 0x80>;
-   samsung,mfc-l = <0x5100 0x80>;
+   memory-region = <_left>, <_right>;
+   memory-region-names = "left", "right";
status = "okay";
 };
 
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts 
b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index bc1448b..0d204b7 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -26,6 +26,24 @@
reg = <0x4000 0x8000>;
};
 
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   mfc_left: region@5100 {
+   compatible = "shared-dma-pool";
+   no-map;
+   reg = <0x5100 0x80>;
+   };
+
+   mfc_right: region@4300 {
+   compatible = "shared-dma-pool";
+   no-map;
+   reg = <0x4300 0x80>;
+   };
+ 

[PATCH v2 6/7] media: s5p-mfc: replace custom reserved memory init code with generic one

2015-12-09 Thread Marek Szyprowski
This patch removes custom code for initialization and handling of
reserved memory regions in s5p-mfc driver and replaces it with generic
named reserved memory regions specified in device tree.

s5p-mfc driver now handles two reserved memory regions: "left" and
"right", defined by generic reserved memory bindings. Support for non-dt
platform has been removed, because all supported platforms have been
converted to device tree.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 129 +++
 1 file changed, 62 insertions(+), 67 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3e9cdaf..3063449 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "s5p_mfc_common.h"
 #include "s5p_mfc_ctrl.h"
@@ -1022,55 +1023,67 @@ static const struct v4l2_file_operations s5p_mfc_fops = 
{
.mmap = s5p_mfc_mmap,
 };
 
-static int match_child(struct device *dev, void *data)
+/* DMA memory related helper functions */
+static void s5p_mfc_memdev_release(struct device *dev)
 {
-   if (!dev_name(dev))
-   return 0;
-   return !strcmp(dev_name(dev), (char *)data);
+   of_reserved_mem_device_release(dev);
 }
 
-static void *mfc_get_drv_data(struct platform_device *pdev);
-
-static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)
+static struct device *s5p_mfc_alloc_memdev(struct device *dev, const char 
*name)
 {
-   unsigned int mem_info[2] = { };
+   struct device *child;
+   int ret;
 
-   dev->mem_dev_l = devm_kzalloc(>plat_dev->dev,
-   sizeof(struct device), GFP_KERNEL);
-   if (!dev->mem_dev_l) {
-   mfc_err("Not enough memory\n");
-   return -ENOMEM;
-   }
-   device_initialize(dev->mem_dev_l);
-   of_property_read_u32_array(dev->plat_dev->dev.of_node,
-   "samsung,mfc-l", mem_info, 2);
-   if (dma_declare_coherent_memory(dev->mem_dev_l, mem_info[0],
-   mem_info[0], mem_info[1],
-   DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) == 0) {
-   mfc_err("Failed to declare coherent memory for\n"
-   "MFC device\n");
-   return -ENOMEM;
+   child = devm_kzalloc(dev, sizeof(struct device), GFP_KERNEL);
+   if (!child)
+   return NULL;
+
+   device_initialize(child);
+   dev_set_name(child, "%s:%s", dev_name(dev), name);
+   child->parent = dev;
+   child->bus = dev->bus;
+   child->coherent_dma_mask = dev->coherent_dma_mask;
+   child->dma_mask = dev->dma_mask;
+   child->release = s5p_mfc_memdev_release;
+
+   if (device_add(child) == 0) {
+   ret = of_reserved_mem_init_by_name(child, dev->of_node, name);
+   if (ret == 0)
+   return child;
}
 
-   dev->mem_dev_r = devm_kzalloc(>plat_dev->dev,
-   sizeof(struct device), GFP_KERNEL);
-   if (!dev->mem_dev_r) {
-   mfc_err("Not enough memory\n");
-   return -ENOMEM;
-   }
-   device_initialize(dev->mem_dev_r);
-   of_property_read_u32_array(dev->plat_dev->dev.of_node,
-   "samsung,mfc-r", mem_info, 2);
-   if (dma_declare_coherent_memory(dev->mem_dev_r, mem_info[0],
-   mem_info[0], mem_info[1],
-   DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) == 0) {
-   pr_err("Failed to declare coherent memory for\n"
-   "MFC device\n");
-   return -ENOMEM;
+   put_device(child);
+   return NULL;
+}
+
+static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev)
+{
+   struct device *dev = _dev->plat_dev->dev;
+
+   /*
+* Create and initialize virtual devices for accessing
+* reserved memory regions.
+*/
+   mfc_dev->mem_dev_l = s5p_mfc_alloc_memdev(dev, "left");
+   if (!mfc_dev->mem_dev_l)
+   return -ENODEV;
+   mfc_dev->mem_dev_r = s5p_mfc_alloc_memdev(dev, "right");
+   if (!mfc_dev->mem_dev_r) {
+   device_unregister(mfc_dev->mem_dev_l);
+   return -ENODEV;
}
+
return 0;
 }
 
+static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev)
+{
+   device_unregister(mfc_dev->mem_dev_l);
+   device_unregister(mfc_dev->mem_dev_r);
+}
+
+static void *mfc_get_drv_data(struct platform_device *pdev);
+
 /* MFC probe function */
 static int s5p_mfc_probe(struct platform_device *pdev)
 {
@@ -1096,12 +1109,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 
dev->variant = mfc_get_drv_data(pdev);
 
-   ret = s5p_mfc_init_pm(dev);
-   if (ret < 0) {
-   dev_err(>dev, "failed to 

[PATCH v2 7/7] media: s5p-mfc: add iommu support

2015-12-09 Thread Marek Szyprowski
This patch adds support for IOMMU to s5p-mfc device driver. MFC firmware
is limited and it cannot use the default configuration. If IOMMU is
available, the patch disables the default DMA address space
configuration and creates a new address space of size limited to 256M
and base address set to 0x2000.

For now the same address space is shared by both 'left' and 'right'
memory channels, because the DMA/IOMMU frameworks do not support
configuring them separately. This is not optimal, but besides limiting
total address space available has no other drawbacks (MFC firmware
supports 256M of address space per each channel).

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c   | 24 
 drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h | 79 ++
 2 files changed, 103 insertions(+)
 create mode 100644 drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3063449..bae7c0f 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -30,6 +30,7 @@
 #include "s5p_mfc_dec.h"
 #include "s5p_mfc_enc.h"
 #include "s5p_mfc_intr.h"
+#include "s5p_mfc_iommu.h"
 #include "s5p_mfc_opr.h"
 #include "s5p_mfc_cmd.h"
 #include "s5p_mfc_pm.h"
@@ -1061,6 +1062,22 @@ static int s5p_mfc_configure_dma_memory(struct 
s5p_mfc_dev *mfc_dev)
struct device *dev = _dev->plat_dev->dev;
 
/*
+* When IOMMU is available, we cannot use the default configuration,
+* because of MFC firmware requirements: address space limited to
+* 256M and non-zero default start address.
+* This is still simplified, not optimal configuration, but for now
+* IOMMU core doesn't allow to configure device's IOMMUs channel
+* separately.
+*/
+   if (exynos_is_iommu_available(dev)) {
+   int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE,
+S5P_MFC_IOMMU_DMA_SIZE);
+   if (ret == 0)
+   mfc_dev->mem_dev_l = mfc_dev->mem_dev_r = dev;
+   return ret;
+   }
+
+   /*
 * Create and initialize virtual devices for accessing
 * reserved memory regions.
 */
@@ -1078,6 +1095,13 @@ static int s5p_mfc_configure_dma_memory(struct 
s5p_mfc_dev *mfc_dev)
 
 static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev)
 {
+   struct device *dev = _dev->plat_dev->dev;
+
+   if (exynos_is_iommu_available(dev)) {
+   exynos_unconfigure_iommu(dev);
+   return;
+   }
+
device_unregister(mfc_dev->mem_dev_l);
device_unregister(mfc_dev->mem_dev_r);
 }
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h 
b/drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h
new file mode 100644
index 000..5d1d1c2
--- /dev/null
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2015 Samsung Electronics Co.Ltd
+ * Authors: Marek Szyprowski 
+ *
+ * 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.
+ */
+
+#ifndef S5P_MFC_IOMMU_H_
+#define S5P_MFC_IOMMU_H_
+
+#define S5P_MFC_IOMMU_DMA_BASE 0x2000lu
+#define S5P_MFC_IOMMU_DMA_SIZE SZ_256M
+
+#ifdef CONFIG_EXYNOS_IOMMU
+
+#include 
+
+static inline bool exynos_is_iommu_available(struct device *dev)
+{
+   return dev->archdata.iommu != NULL;
+}
+
+static inline void exynos_unconfigure_iommu(struct device *dev)
+{
+   struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
+
+   arm_iommu_detach_device(dev);
+   arm_iommu_release_mapping(mapping);
+}
+
+static inline int exynos_configure_iommu(struct device *dev,
+unsigned int base, unsigned int size)
+{
+   struct dma_iommu_mapping *mapping = NULL;
+   int ret;
+
+   /* Disable the default mapping created by device core */
+   if (to_dma_iommu_mapping(dev))
+   exynos_unconfigure_iommu(dev);
+
+   mapping = arm_iommu_create_mapping(dev->bus, base, size);
+   if (IS_ERR(mapping)) {
+   pr_warn("Failed to create IOMMU mapping for device %s\n",
+   dev_name(dev));
+   return PTR_ERR(mapping);
+   }
+
+   ret = arm_iommu_attach_device(dev, mapping);
+   if (ret) {
+   pr_warn("Failed to attached device %s to IOMMU_mapping\n",
+   dev_name(dev));
+   arm_iommu_release_mapping(mapping);
+   return ret;
+   }
+
+   return 0;
+}
+
+#else
+
+static inline bool exynos_is_iommu_available(struct device *dev)
+{
+   

[PATCH v2 4/7] media: vb2-dma-contig: add helper for setting dma max seg size

2015-12-09 Thread Marek Szyprowski
Add a helper function for device drivers to set DMA's max_seg_size.
Setting it to largest possible value lets DMA-mapping API always create
contiguous mappings in DMA address space. This is essential for all
devices, which use dma-contig videobuf2 memory allocator and shared
buffers.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/v4l2-core/videobuf2-dma-contig.c | 15 +++
 include/media/videobuf2-dma-contig.h   |  1 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c 
b/drivers/media/v4l2-core/videobuf2-dma-contig.c
index c331272..628518d 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -742,6 +742,21 @@ void vb2_dma_contig_cleanup_ctx(void *alloc_ctx)
 }
 EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx);
 
+int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
+{
+   if (!dev->dma_parms) {
+   dev->dma_parms = devm_kzalloc(dev, sizeof(dev->dma_parms),
+ GFP_KERNEL);
+   if (!dev->dma_parms)
+   return -ENOMEM;
+   }
+   if (dma_get_max_seg_size(dev) < size)
+   return dma_set_max_seg_size(dev, size);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);
+
 MODULE_DESCRIPTION("DMA-contig memory handling routines for videobuf2");
 MODULE_AUTHOR("Pawel Osciak ");
 MODULE_LICENSE("GPL");
diff --git a/include/media/videobuf2-dma-contig.h 
b/include/media/videobuf2-dma-contig.h
index c33dfa6..0e6ba64 100644
--- a/include/media/videobuf2-dma-contig.h
+++ b/include/media/videobuf2-dma-contig.h
@@ -26,6 +26,7 @@ vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned 
int plane_no)
 
 void *vb2_dma_contig_init_ctx(struct device *dev);
 void vb2_dma_contig_cleanup_ctx(void *alloc_ctx);
+int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size);
 
 extern const struct vb2_mem_ops vb2_dma_contig_memops;
 
-- 
1.9.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 v2 5/7] media: set proper max seg size for devices on Exynos SoCs

2015-12-09 Thread Marek Szyprowski
All multimedia devices found on Exynos SoCs support only contiguous
buffers, so set DMA max segment size to DMA_BIT_MASK(32) to let memory
allocator to correctly create contiguous memory mappings.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/exynos-gsc/gsc-core.c  | 1 +
 drivers/media/platform/exynos4-is/fimc-core.c | 1 +
 drivers/media/platform/exynos4-is/fimc-is.c   | 1 +
 drivers/media/platform/exynos4-is/fimc-lite.c | 1 +
 drivers/media/platform/s5p-g2d/g2d.c  | 1 +
 drivers/media/platform/s5p-jpeg/jpeg-core.c   | 1 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c  | 2 ++
 drivers/media/platform/s5p-tv/mixer_video.c   | 1 +
 8 files changed, 9 insertions(+)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
b/drivers/media/platform/exynos-gsc/gsc-core.c
index 9b9e423..4f90be4 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1140,6 +1140,7 @@ static int gsc_probe(struct platform_device *pdev)
goto err_m2m;
 
/* Initialize continious memory allocator */
+   vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(gsc->alloc_ctx)) {
ret = PTR_ERR(gsc->alloc_ctx);
diff --git a/drivers/media/platform/exynos4-is/fimc-core.c 
b/drivers/media/platform/exynos4-is/fimc-core.c
index cef2a7f..368e19b 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -1019,6 +1019,7 @@ static int fimc_probe(struct platform_device *pdev)
}
 
/* Initialize contiguous memory allocator */
+   vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(fimc->alloc_ctx)) {
ret = PTR_ERR(fimc->alloc_ctx);
diff --git a/drivers/media/platform/exynos4-is/fimc-is.c 
b/drivers/media/platform/exynos4-is/fimc-is.c
index 49658ca..123772f 100644
--- a/drivers/media/platform/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/exynos4-is/fimc-is.c
@@ -841,6 +841,7 @@ static int fimc_is_probe(struct platform_device *pdev)
if (ret < 0)
goto err_pm;
 
+   vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(is->alloc_ctx)) {
ret = PTR_ERR(is->alloc_ctx);
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c 
b/drivers/media/platform/exynos4-is/fimc-lite.c
index 60660c3..a7e47c7 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1564,6 +1564,7 @@ static int fimc_lite_probe(struct platform_device *pdev)
goto err_sd;
}
 
+   vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
if (IS_ERR(fimc->alloc_ctx)) {
ret = PTR_ERR(fimc->alloc_ctx);
diff --git a/drivers/media/platform/s5p-g2d/g2d.c 
b/drivers/media/platform/s5p-g2d/g2d.c
index e1936d9..31f6c23 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -681,6 +681,7 @@ static int g2d_probe(struct platform_device *pdev)
goto put_clk_gate;
}
 
+   vb2_dma_contig_set_max_seg_size(>dev, DMA_BIT_MASK(32));
dev->alloc_ctx = vb2_dma_contig_init_ctx(>dev);
if (IS_ERR(dev->alloc_ctx)) {
ret = PTR_ERR(dev->alloc_ctx);
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 4a608cb..6bd92f0 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2839,6 +2839,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
goto device_register_rollback;
}
 
+   vb2_dma_contig_set_max_seg_size(>dev, DMA_BIT_MASK(32));
jpeg->alloc_ctx = vb2_dma_contig_init_ctx(>dev);
if (IS_ERR(jpeg->alloc_ctx)) {
v4l2_err(>v4l2_dev, "Failed to init memory allocator\n");
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3ffe2ec..3e9cdaf 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1143,11 +1143,13 @@ static int s5p_mfc_probe(struct platform_device *pdev)
}
}
 
+   vb2_dma_contig_set_max_seg_size(dev->mem_dev_l, DMA_BIT_MASK(32));
dev->alloc_ctx[0] = vb2_dma_contig_init_ctx(dev->mem_dev_l);
if (IS_ERR(dev->alloc_ctx[0])) {
ret = PTR_ERR(dev->alloc_ctx[0]);
goto err_res;
}
+   vb2_dma_contig_set_max_seg_size(dev->mem_dev_r, DMA_BIT_MASK(32));
dev->alloc_ctx[1] = vb2_dma_contig_init_ctx(dev->mem_dev_r);
if (IS_ERR(dev->alloc_ctx[1])) {
ret = 

[PATCH v2 3/7] of: reserved_mem: add support for named reserved mem nodes

2015-12-09 Thread Marek Szyprowski
This patch allows device drivers to initialize more than one reserved
memory region assigned to given device. When driver needs to use more
than one reserved memory region, it should allocate child devices and
initialize regions by index or name for each of its child devices.

Signed-off-by: Marek Szyprowski 
---
 drivers/of/of_reserved_mem.c| 104 
 include/linux/of_reserved_mem.h |  31 ++--
 2 files changed, 112 insertions(+), 23 deletions(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index be77e75..a583480 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define MAX_RESERVED_REGIONS   16
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
@@ -281,53 +282,116 @@ static inline struct reserved_mem *__find_rmem(struct 
device_node *node)
return NULL;
 }
 
+struct rmem_assigned_device {
+   struct device *dev;
+   struct reserved_mem *rmem;
+   struct list_head list;
+};
+
+static LIST_HEAD(of_rmem_assigned_device_list);
+static DEFINE_MUTEX(of_rmem_assigned_device_mutex);
+
 /**
  * of_reserved_mem_device_init() - assign reserved memory region to given 
device
+ * @dev:   Pointer to the device to configure
+ * @np:Pointer to the device_node with 'reserved-memory' 
property
+ * @idx:   Index of selected region
+ *
+ * This function assigns respective DMA-mapping operations based on reserved
+ * memory region specified by 'memory-region' property in @np node to the @dev
+ * device. When driver needs to use more than one reserved memory region, it
+ * should allocate child devices and initialize regions by name for each of
+ * child device.
  *
- * This function assign memory region pointed by "memory-region" device tree
- * property to the given device.
+ * Returns error code or zero on success.
  */
-int of_reserved_mem_device_init(struct device *dev)
+int of_reserved_mem_init(struct device *dev, struct device_node *np, int idx)
 {
+   struct rmem_assigned_device *rd;
+   struct device_node *target;
struct reserved_mem *rmem;
-   struct device_node *np;
int ret;
 
-   np = of_parse_phandle(dev->of_node, "memory-region", 0);
-   if (!np)
-   return -ENODEV;
+   if (!np || !dev)
+   return -EINVAL;
+
+   target = of_parse_phandle(np, "memory-region", idx);
+   if (!target)
+   return -EINVAL;
 
-   rmem = __find_rmem(np);
-   of_node_put(np);
+   rmem = __find_rmem(target);
+   of_node_put(target);
 
if (!rmem || !rmem->ops || !rmem->ops->device_init)
return -EINVAL;
 
+   rd = kmalloc(sizeof(struct rmem_assigned_device), GFP_KERNEL);
+   if (!rd)
+   return -ENOMEM;
+
ret = rmem->ops->device_init(rmem, dev);
-   if (ret == 0)
+   if (ret == 0) {
+   rd->dev = dev;
+   rd->rmem = rmem;
+
+   mutex_lock(_rmem_assigned_device_mutex);
+   list_add(>list, _rmem_assigned_device_list);
+   mutex_unlock(_rmem_assigned_device_mutex);
+
dev_info(dev, "assigned reserved memory node %s\n", rmem->name);
+   } else {
+   kfree(rd);
+   }
 
return ret;
 }
-EXPORT_SYMBOL_GPL(of_reserved_mem_device_init);
+EXPORT_SYMBOL_GPL(of_reserved_mem_init);
+
+/**
+ * of_reserved_mem_device_init() - assign reserved memory region to given 
device
+ * @dev:   Pointer to the device to configure
+ * @np:Pointer to the device_node with 'reserved-memory' 
property
+ * @name:  Name of the selected region
+ *
+ * This function assigns respective DMA-mapping operations based on reserved
+ * memory region specified by 'memory-region' property in @np node, named @name
+ * to the @dev device.
+ *
+ * Returns error code or zero on success.
+ */
+int of_reserved_mem_init_by_name(struct device *dev, struct device_node *np,
+  const char *name)
+{
+   int idx = of_property_match_string(np, "memory-region-names", name);
+
+   if (idx < 0)
+   return -EINVAL;
+   return of_reserved_mem_init(dev, np, idx);
+}
+EXPORT_SYMBOL_GPL(of_reserved_mem_init_by_name);
 
 /**
  * of_reserved_mem_device_release() - release reserved memory device structures
+ * @dev:   Pointer to the device to deconfigure
  *
  * This function releases structures allocated for memory region handling for
  * the given device.
  */
 void of_reserved_mem_device_release(struct device *dev)
 {
-   struct reserved_mem *rmem;
-   struct device_node *np;
-
-   np = of_parse_phandle(dev->of_node, "memory-region", 0);
-   if (!np)
-   return;
-
-   rmem = __find_rmem(np);
-   of_node_put(np);
+   struct rmem_assigned_device *rd;
+   struct 

[PATCH 3/4] media: s5p-mfc: remove non-device-tree init code

2015-12-09 Thread Marek Szyprowski
Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 37 +---
 1 file changed, 5 insertions(+), 32 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index bae7c0f..5d0a75e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1489,27 +1489,6 @@ static struct s5p_mfc_variant mfc_drvdata_v8 = {
.fw_name[0] = "s5p-mfc-v8.fw",
 };
 
-static const struct platform_device_id mfc_driver_ids[] = {
-   {
-   .name = "s5p-mfc",
-   .driver_data = (unsigned long)_drvdata_v5,
-   }, {
-   .name = "s5p-mfc-v5",
-   .driver_data = (unsigned long)_drvdata_v5,
-   }, {
-   .name = "s5p-mfc-v6",
-   .driver_data = (unsigned long)_drvdata_v6,
-   }, {
-   .name = "s5p-mfc-v7",
-   .driver_data = (unsigned long)_drvdata_v7,
-   }, {
-   .name = "s5p-mfc-v8",
-   .driver_data = (unsigned long)_drvdata_v8,
-   },
-   {},
-};
-MODULE_DEVICE_TABLE(platform, mfc_driver_ids);
-
 static const struct of_device_id exynos_mfc_match[] = {
{
.compatible = "samsung,mfc-v5",
@@ -1531,24 +1510,18 @@ MODULE_DEVICE_TABLE(of, exynos_mfc_match);
 static void *mfc_get_drv_data(struct platform_device *pdev)
 {
struct s5p_mfc_variant *driver_data = NULL;
+   const struct of_device_id *match;
+
+   match = of_match_node(exynos_mfc_match, pdev->dev.of_node);
+   if (match)
+   driver_data = (struct s5p_mfc_variant *)match->data;
 
-   if (pdev->dev.of_node) {
-   const struct of_device_id *match;
-   match = of_match_node(exynos_mfc_match,
-   pdev->dev.of_node);
-   if (match)
-   driver_data = (struct s5p_mfc_variant *)match->data;
-   } else {
-   driver_data = (struct s5p_mfc_variant *)
-   platform_get_device_id(pdev)->driver_data;
-   }
return driver_data;
 }
 
 static struct platform_driver s5p_mfc_driver = {
.probe  = s5p_mfc_probe,
.remove = s5p_mfc_remove,
-   .id_table   = mfc_driver_ids,
.driver = {
.name   = S5P_MFC_NAME,
.pm = _mfc_pm_ops,
-- 
1.9.2

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


[PATCH 2/4] media: s5p-g2d: remove non-device-tree init code

2015-12-09 Thread Marek Szyprowski
Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/s5p-g2d/g2d.c | 27 +--
 drivers/media/platform/s5p-g2d/g2d.h |  5 -
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c 
b/drivers/media/platform/s5p-g2d/g2d.c
index 31f6c23..be411a9 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -720,16 +720,12 @@ static int g2d_probe(struct platform_device *pdev)
 
def_frame.stride = (def_frame.width * def_frame.fmt->depth) >> 3;
 
-   if (!pdev->dev.of_node) {
-   dev->variant = g2d_get_drv_data(pdev);
-   } else {
-   of_id = of_match_node(exynos_g2d_match, pdev->dev.of_node);
-   if (!of_id) {
-   ret = -ENODEV;
-   goto unreg_video_dev;
-   }
-   dev->variant = (struct g2d_variant *)of_id->data;
+   of_id = of_match_node(exynos_g2d_match, pdev->dev.of_node);
+   if (!of_id) {
+   ret = -ENODEV;
+   goto unreg_video_dev;
}
+   dev->variant = (struct g2d_variant *)of_id->data;
 
return 0;
 
@@ -789,22 +785,9 @@ static const struct of_device_id exynos_g2d_match[] = {
 };
 MODULE_DEVICE_TABLE(of, exynos_g2d_match);
 
-static const struct platform_device_id g2d_driver_ids[] = {
-   {
-   .name = "s5p-g2d",
-   .driver_data = (unsigned long)_drvdata_v3x,
-   }, {
-   .name = "s5p-g2d-v4x",
-   .driver_data = (unsigned long)_drvdata_v4x,
-   },
-   {},
-};
-MODULE_DEVICE_TABLE(platform, g2d_driver_ids);
-
 static struct platform_driver g2d_pdrv = {
.probe  = g2d_probe,
.remove = g2d_remove,
-   .id_table   = g2d_driver_ids,
.driver = {
.name = G2D_NAME,
.of_match_table = exynos_g2d_match,
diff --git a/drivers/media/platform/s5p-g2d/g2d.h 
b/drivers/media/platform/s5p-g2d/g2d.h
index b0e52ab..e31df54 100644
--- a/drivers/media/platform/s5p-g2d/g2d.h
+++ b/drivers/media/platform/s5p-g2d/g2d.h
@@ -89,8 +89,3 @@ void g2d_set_flip(struct g2d_dev *d, u32 r);
 void g2d_set_v41_stretch(struct g2d_dev *d,
struct g2d_frame *src, struct g2d_frame *dst);
 void g2d_set_cmd(struct g2d_dev *d, u32 c);
-
-static inline struct g2d_variant *g2d_get_drv_data(struct platform_device 
*pdev)
-{
-   return (struct g2d_variant *)platform_get_device_id(pdev)->driver_data;
-}
-- 
1.9.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 1/4] media: exynos-gsc: remove non-device-tree init code

2015-12-09 Thread Marek Szyprowski
Exynos platform has been fully converted to device tree, so old platform
device based init data can be now removed.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/exynos-gsc/gsc-core.c | 33 +---
 drivers/media/platform/exynos-gsc/gsc-core.h |  1 -
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
b/drivers/media/platform/exynos-gsc/gsc-core.c
index 4f90be4..1b744a6 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -967,15 +967,6 @@ static struct gsc_driverdata gsc_v_100_drvdata = {
.lclk_frequency = 26600UL,
 };
 
-static const struct platform_device_id gsc_driver_ids[] = {
-   {
-   .name   = "exynos-gsc",
-   .driver_data= (unsigned long)_v_100_drvdata,
-   },
-   {},
-};
-MODULE_DEVICE_TABLE(platform, gsc_driver_ids);
-
 static const struct of_device_id exynos_gsc_match[] = {
{
.compatible = "samsung,exynos5-gsc",
@@ -988,17 +979,11 @@ MODULE_DEVICE_TABLE(of, exynos_gsc_match);
 static void *gsc_get_drv_data(struct platform_device *pdev)
 {
struct gsc_driverdata *driver_data = NULL;
+   const struct of_device_id *match;
 
-   if (pdev->dev.of_node) {
-   const struct of_device_id *match;
-   match = of_match_node(exynos_gsc_match,
-   pdev->dev.of_node);
-   if (match)
-   driver_data = (struct gsc_driverdata *)match->data;
-   } else {
-   driver_data = (struct gsc_driverdata *)
-   platform_get_device_id(pdev)->driver_data;
-   }
+   match = of_match_node(exynos_gsc_match, pdev->dev.of_node);
+   if (match)
+   driver_data = (struct gsc_driverdata *)match->data;
 
return driver_data;
 }
@@ -1084,19 +1069,14 @@ static int gsc_probe(struct platform_device *pdev)
if (!gsc)
return -ENOMEM;
 
-   if (dev->of_node)
-   gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc");
-   else
-   gsc->id = pdev->id;
-
-   if (gsc->id >= drv_data->num_entities) {
+   gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc");
+   if (gsc->id >= drv_data->num_entities || gsc->id < 0) {
dev_err(dev, "Invalid platform device id: %d\n", gsc->id);
return -EINVAL;
}
 
gsc->variant = drv_data->variant[gsc->id];
gsc->pdev = pdev;
-   gsc->pdata = dev->platform_data;
 
init_waitqueue_head(>irq_queue);
spin_lock_init(>slock);
@@ -1254,7 +1234,6 @@ static const struct dev_pm_ops gsc_pm_ops = {
 static struct platform_driver gsc_driver = {
.probe  = gsc_probe,
.remove = gsc_remove,
-   .id_table   = gsc_driver_ids,
.driver = {
.name   = GSC_MODULE_NAME,
.pm = _pm_ops,
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h 
b/drivers/media/platform/exynos-gsc/gsc-core.h
index e93a233..ec4000c 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.h
+++ b/drivers/media/platform/exynos-gsc/gsc-core.h
@@ -340,7 +340,6 @@ struct gsc_dev {
void __iomem*regs;
wait_queue_head_t   irq_queue;
struct gsc_m2m_device   m2m;
-   struct exynos_platform_gscaler  *pdata;
unsigned long   state;
struct vb2_alloc_ctx*alloc_ctx;
struct video_device vdev;
-- 
1.9.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 160/182] [media]: cxd2830r: use gpiochip data pointer

2015-12-09 Thread Linus Walleij
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Antti Palosaari 
Cc: Mauro Carvalho Chehab 
Cc: linux-media@vger.kernel.org
Signed-off-by: Linus Walleij 
---
Mauro: please ACK this so I can merge it in the GPIO tree.
---
 drivers/media/dvb-frontends/cxd2820r_core.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c 
b/drivers/media/dvb-frontends/cxd2820r_core.c
index 24a457d9d803..ba4cb7557aa5 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -606,8 +606,7 @@ static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, 
int enable)
 static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr,
int val)
 {
-   struct cxd2820r_priv *priv =
-   container_of(chip, struct cxd2820r_priv, gpio_chip);
+   struct cxd2820r_priv *priv = gpiochip_get_data(chip);
u8 gpio[GPIO_COUNT];
 
dev_dbg(>i2c->dev, "%s: nr=%d val=%d\n", __func__, nr, val);
@@ -620,8 +619,7 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip 
*chip, unsigned nr,
 
 static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val)
 {
-   struct cxd2820r_priv *priv =
-   container_of(chip, struct cxd2820r_priv, gpio_chip);
+   struct cxd2820r_priv *priv = gpiochip_get_data(chip);
u8 gpio[GPIO_COUNT];
 
dev_dbg(>i2c->dev, "%s: nr=%d val=%d\n", __func__, nr, val);
@@ -636,8 +634,7 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, 
unsigned nr, int val)
 
 static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr)
 {
-   struct cxd2820r_priv *priv =
-   container_of(chip, struct cxd2820r_priv, gpio_chip);
+   struct cxd2820r_priv *priv = gpiochip_get_data(chip);
 
dev_dbg(>i2c->dev, "%s: nr=%d\n", __func__, nr);
 
@@ -731,7 +728,7 @@ struct dvb_frontend *cxd2820r_attach(const struct 
cxd2820r_config *cfg,
priv->gpio_chip.base = -1; /* dynamic allocation */
priv->gpio_chip.ngpio = GPIO_COUNT;
priv->gpio_chip.can_sleep = 1;
-   ret = gpiochip_add(>gpio_chip);
+   ret = gpiochip_add_data(>gpio_chip, priv);
if (ret)
goto error;
 
-- 
2.4.3

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


[PATCH 4/4] media: exynos4-is: remove non-device-tree init code

2015-12-09 Thread Marek Szyprowski
Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski 
---
 drivers/media/platform/exynos4-is/fimc-core.c | 50 ---
 1 file changed, 50 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-core.c 
b/drivers/media/platform/exynos4-is/fimc-core.c
index 368e19b..a470fe5 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -1155,26 +1155,6 @@ static const struct fimc_pix_limit s5p_pix_limit[4] = {
},
 };
 
-static const struct fimc_variant fimc0_variant_s5p = {
-   .has_inp_rot = 1,
-   .has_out_rot = 1,
-   .has_cam_if  = 1,
-   .min_inp_pixsize = 16,
-   .min_out_pixsize = 16,
-   .hor_offs_align  = 8,
-   .min_vsize_align = 16,
-   .pix_limit   = _pix_limit[0],
-};
-
-static const struct fimc_variant fimc2_variant_s5p = {
-   .has_cam_if  = 1,
-   .min_inp_pixsize = 16,
-   .min_out_pixsize = 16,
-   .hor_offs_align  = 8,
-   .min_vsize_align = 16,
-   .pix_limit   = _pix_limit[1],
-};
-
 static const struct fimc_variant fimc0_variant_s5pv210 = {
.has_inp_rot = 1,
.has_out_rot = 1,
@@ -1207,18 +1187,6 @@ static const struct fimc_variant fimc2_variant_s5pv210 = 
{
.pix_limit   = _pix_limit[2],
 };
 
-/* S5PC100 */
-static const struct fimc_drvdata fimc_drvdata_s5p = {
-   .variant = {
-   [0] = _variant_s5p,
-   [1] = _variant_s5p,
-   [2] = _variant_s5p,
-   },
-   .num_entities   = 3,
-   .lclk_frequency = 13300UL,
-   .out_buf_count  = 4,
-};
-
 /* S5PV210, S5PC110 */
 static const struct fimc_drvdata fimc_drvdata_s5pv210 = {
.variant = {
@@ -1252,23 +1220,6 @@ static const struct fimc_drvdata fimc_drvdata_exynos4x12 
= {
.out_buf_count  = 32,
 };
 
-static const struct platform_device_id fimc_driver_ids[] = {
-   {
-   .name   = "s5p-fimc",
-   .driver_data= (unsigned long)_drvdata_s5p,
-   }, {
-   .name   = "s5pv210-fimc",
-   .driver_data= (unsigned long)_drvdata_s5pv210,
-   }, {
-   .name   = "exynos4-fimc",
-   .driver_data= (unsigned long)_drvdata_exynos4210,
-   }, {
-   .name   = "exynos4x12-fimc",
-   .driver_data= (unsigned long)_drvdata_exynos4x12,
-   },
-   { },
-};
-
 static const struct of_device_id fimc_of_match[] = {
{
.compatible = "samsung,s5pv210-fimc",
@@ -1291,7 +1242,6 @@ static const struct dev_pm_ops fimc_pm_ops = {
 static struct platform_driver fimc_driver = {
.probe  = fimc_probe,
.remove = fimc_remove,
-   .id_table   = fimc_driver_ids,
.driver = {
.of_match_table = fimc_of_match,
.name   = FIMC_DRIVER_NAME,
-- 
1.9.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: DVBSky T980C ci not working with kernel 4.x

2015-12-09 Thread Timo Helkiö

On 08.12.2015 05:49, Nibble Max wrote:


Does this card work with the media code from dvbsky.net from kernel 4.x?

On 2015-12-06 19:10:41, Timo_Helkiö  wrote:


Hi


Common interface in Dvbsky T980C is not working with Ubuntu 15.10 kernel
4.2.0 and vanilla kernel 4.6 and latest dvb-drivers from Linux-media
git. With Ubuntu 15.04 and kernel 3.19 it is working. I have tryid to
find differences in drivers, but my knolege of c it is not possible.
Erros message is "invalid PC-card".

I have also Tevii S470 with same PCIe bridge Conexant cx23885.

How to debug this? I can do minor changes to drivers for testing it.

   Timo Helkiö
--
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


Best Regards,
Max
N�r��y���b�X��ǧv�^�)޺{.n�+{���bj)���w*jg����ݢj/���z�ޖ��2�ޙ���&�)ߡ�a�����G���h��j:+v���w�٥



Yes, with drivers from dvbsky.net CI is working, but other card 
TechnoTrend TT-connect CT2-4650 CI stoped working totaly. It has same 
chips as Dvbsky T980C:


Demodulator: Silicon Labs Si2168-A20
Tuner: Silicon Labs Si2158-A20
CI chip: CIMaX SP2HF

Dvbsky-based driver uses precompiled sit2_op.o insteadt of s12168 module.

Who could merge these?

   Timo Helkiö
--
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: Dear TV card experts - I need you help

2015-12-09 Thread Benjamin Larsson

On 12/04/2015 05:35 PM, Mr Andersson wrote:

Hi Benjamin,

Thanks for your answer. Jag uppskattar din hjälp ;)

So 50 USD per mux. And I could simultaneously record up to  4 channels
per mux ? Is that satellite dependant?

Could you give me an example of high quality/value cards I should look at first?

Also, what linux software would be best to use together with these
cards? I am looking initially at just streaming the content right of,
although we might need to hook into the stream and manipulate it.
Later, we'd also might be interested in recording the stream as well.

Thanks!


Hi, the question you ask needs an answer in the form of basic digital tv 
tutorial. I suggest you search the web for that info.


Regarding software I suggest you look at the tvheadend project. It has a 
software model that is easy to understand.


Regarding hardware I would go for quad pcie in a form factor that would 
fit in rack-mounted servers. You need high density and that is the only 
way to get that. So I would say skip trying to find something cheap, get 
something that is reliable and maintainable.


MvH
Benjamin Larsson
--
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


dtv-scan-table has two ATSC files?

2015-12-09 Thread Maury Markowitz
I’m making some updates to the ATSC dtv-scan-tables. Two questions:

1)
Why do we have "us-ATSC-center-frequencies-8VSB” *and* 
"us-NTSC-center-frequencies-8VSB”? They appear to be identical. The later 
could, theoretically, list NTSC encoded channels instead of 8VSB, but doesn’t 
actually do that. Suggest removing it?

2)
A number of the channel listings in those files have not been used for 
television use for several years now. Specifically channels 2 to 6 and 
everything from 51 and up were long ago sold off to cell phone use.

Additionally, channel 37 was *never* used, at least in the US and Canada, 
because it interfered with radio astronomy (IIRC it was sitting on one of the 
Lyman lines).

Since scanning through all of these channels will no longer work, perhaps it 
would be time to remove them? It reduces the total scan list from 80 channels 
to only 45, and would greatly improve scan times.--
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] ca-ON-Toronto: adding scan file for Toronto, Canada

2015-12-09 Thread Maury Markowitz
My second patch, you can be slightly less gentle now :-)

This is a scan listing for the Toronto area, along with some of the harder to 
get signals. I was unsure how to enter the NTSC (analog) signals so I commented 
them out.

---
 atsc/ca-ON-Toronto | 200 +
 1 file changed, 200 insertions(+)
 create mode 100644 atsc/ca-ON-Toronto

diff --git a/atsc/ca-ON-Toronto b/atsc/ca-ON-Toronto
new file mode 100644
index 000..3923f64
--- /dev/null
+++ b/atsc/ca-ON-Toronto
@@ -0,0 +1,200 @@
+#--
+# location: Toronto, ON, Canada
+# provider: OTA
+# date (-mm-dd): 2015-12-09
+# provided by (opt): maury.markow...@gmail.com
+#--
+#
+# The following list are the main channels available in Toronto, including
+# both local channels as well as those from the US in the Buffalo area.
+# More distant stations like Rochester and Syracuse are listed below
+#
+#--
+# CFTO, Toronto CTV, physical channel 9, virtual channel 9, 17.4 kW, 1611' CN 
tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 189028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WUTV, Buffalo FOX, physical channel 14, virtual channel 29, 1000 kW, 981' 
tower, 43.025612 -78.928373
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 473028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CHCH, Hamilton independent, physical channel 15, virtual channel 11, 132 kW, 
unknown tower, 43.207500 -79.774167
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 479028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CICA, Toronto TVO, physical channel 19, virtual channel 19, 106.5 kW, 1611' 
CN tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 503028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CBLT, Toronto CBC, physical channel 20, virtual channel 5, 38 kW, 1611' CN 
tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 509028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CBLFT, Toronto CBC French, physical channel 25, virtual channel 25, 2.5 kW, 
1611' CN tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 539028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WNLO, Buffalo CW, physical channel 32, virtual channel 23, 1000 kW, 994' 
tower, 43.030057 -78.920594
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 581028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WGRZ, Buffalo NBC, physical channel 33, virtual channel 2, 480 kW, 968' 
tower, 42.718671 -78.562801
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 587028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CHCJ, Hamilton CTV Two, physical channel 35, virtual channel 35, 390 kW, 
unknown tower, 43.231667 -79.859167
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 599028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CITS, Hamilton CTS, physical channel 36, virtual channel 36, 5 kW, unknown 
tower, 43.207500 -79.774167
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 605028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WKBW, Buffalo ABC, physical channel 38, virtual channel 7, 358 kW, 1420' 
tower, 42.637505 -78.619719
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 611028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WIVB, Buffalo CBS, physical channel 39, virtual channel 4, 790 kW, 1368' 
tower, 42.659227 -78.625581
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 623028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CJMT, Toronto Omni, physical channel 40, virtual channel 40, 19.5 kW, 1611' 
CN tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 629028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CIII, Toronto Global, physical channel 41, virtual channel 41, 38 kW, 1611' 
CN tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 635028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# WNED, Buffalo PBS, physical channel 43, virtual channel 17, 473 kW, 1110' 
tower, 43.207500 -79.774167
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 647028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CITY, Toronto independent, physical channel 44, virtual channel 57, 21 kW, 
1611' CN tower, 43.642500 -79.387222
+[CHANNEL]
+   DELIVERY_SYSTEM = ATSC
+   FREQUENCY = 653028615
+   MODULATION = VSB/8
+   INVERSION = AUTO
+
+# CFMT, Toronto Omni 2, physical 

RE: [PATCH] media: videobuf2-core: Fix one __qbuf_dmabuf() error path

2015-12-09 Thread Wu, Xia
Hi, Sakari,
On Wed, Dec 09, 2015 at 4:26PM, Sakari wrote:

> Hi Wu,
> 
> Wu, Xia wrote:
> > Add dma_buf_put() to decrease refcount of the dmabuf in error path if
> DMABUF size is smaller than the requirement.
> >
> > Signed-off-by: wu xia 
> > ---
> >  drivers/media/v4l2-core/videobuf2-core.c |1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/media/v4l2-core/videobuf2-core.c
> > b/drivers/media/v4l2-core/videobuf2-core.c
> > index 33bdd81..1f232e7 100644
> > --- a/drivers/media/v4l2-core/videobuf2-core.c
> > +++ b/drivers/media/v4l2-core/videobuf2-core.c
> > @@ -1084,6 +1084,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb,
> const void *pb)
> > if (planes[plane].length < q->plane_sizes[plane]) {
> > dprintk(1, "invalid dmabuf length for plane %d\n",
> > plane);
> > +   dma_buf_put(dbuf);
> > ret = -EINVAL;
> > goto err;
> > }
> 
> Acked-by: Sakari Ailus 
> 
> Looks like the bug has been also in the original implementation, and the code
> has been in a bit of flux since, yet the bug has remained...
> 
> I think it'd be nice to have this in stable kernels. Mauro, Hans, what do you
> think?

Thank you for your feedback. Yes, it seems that the bug is there for a long 
time.
It's better to have this fix in stable kernels.

> 
> --
> Kind regards,
> 
> Sakari Ailus
> sakari.ai...@linux.intel.com
--
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: ERRORS

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

Results of the daily build of media_tree:

date:   Thu Dec 10 04:00:17 CET 2015
git branch: test
git hash:   991ce92f8de24cde063d531246602b6e14d3fef2
gcc version:i686-linux-gcc (GCC) 5.1.0
sparse version: v0.5.0
smatch version: v0.5.0-3202-g618e15b
host hardware:  x86_64
host os:4.2.0-164

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-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.32.27-i686: ERRORS
linux-2.6.33.7-i686: ERRORS
linux-2.6.34.7-i686: ERRORS
linux-2.6.35.9-i686: ERRORS
linux-2.6.36.4-i686: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-3.0.60-i686: ERRORS
linux-3.1.10-i686: ERRORS
linux-3.2.37-i686: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.4.27-i686: ERRORS
linux-3.5.7-i686: ERRORS
linux-3.6.11-i686: ERRORS
linux-3.7.4-i686: ERRORS
linux-3.8-i686: ERRORS
linux-3.9.2-i686: ERRORS
linux-3.10.1-i686: ERRORS
linux-3.11.1-i686: ERRORS
linux-3.12.23-i686: ERRORS
linux-3.13.11-i686: ERRORS
linux-3.14.9-i686: ERRORS
linux-3.15.2-i686: ERRORS
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-rc1-i686: OK
linux-2.6.32.27-x86_64: ERRORS
linux-2.6.33.7-x86_64: ERRORS
linux-2.6.34.7-x86_64: ERRORS
linux-2.6.35.9-x86_64: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.60-x86_64: ERRORS
linux-3.1.10-x86_64: ERRORS
linux-3.2.37-x86_64: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-x86_64: ERRORS
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-x86_64: ERRORS
linux-3.8-x86_64: ERRORS
linux-3.9.2-x86_64: ERRORS
linux-3.10.1-x86_64: ERRORS
linux-3.11.1-x86_64: ERRORS
linux-3.12.23-x86_64: ERRORS
linux-3.13.11-x86_64: ERRORS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-x86_64: ERRORS
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-rc1-x86_64: OK
apps: WARNINGS
spec-git: WARNINGS
sparse: ERRORS
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


[PATCH] us-ATSC-center-frequencies-8VSB: Added channel numbers in comments to make the file easier to use by comparing against local channel lists.

2015-12-09 Thread Maury Markowitz
This is my first attempt at a patch, so please be gentle.

Signed-off-by: Maury Markowitz 

---
 atsc/us-ATSC-center-frequencies-8VSB | 78 
 1 file changed, 78 insertions(+)

diff --git a/atsc/us-ATSC-center-frequencies-8VSB 
b/atsc/us-ATSC-center-frequencies-8VSB
index e744878..abb05fb 100644
--- a/atsc/us-ATSC-center-frequencies-8VSB
+++ b/atsc/us-ATSC-center-frequencies-8VSB
@@ -1,410 +1,488 @@
 # US ATSC center frequencies, use if in doubt
 
+# VHF low-band, channels 2 to 6, no longer used for television broadcasting
+
+#channel 2
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 57028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 3
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 63028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 4
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 69028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 5
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 79028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 6
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 85028615
MODULATION = VSB/8
INVERSION = AUTO
 
+# VHF high-band, channels 7 to 13, not common but a few digital stations on it
+
+#channel 7
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 177028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 8
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 183028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 9
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 189028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 10
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 195028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 11
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 201028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 12
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 207028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 13
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 213028615
MODULATION = VSB/8
INVERSION = AUTO
 
+# UHF, channels 14 to 51, most existing stations, almost all digital
+
+#channel 14
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 473028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 15
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 479028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 16
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 485028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 17
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 491028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 18
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 497028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 19
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 503028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 20
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 509028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 21
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 515028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 22
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 521028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 23
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 527028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 24
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 533028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 25
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 539028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 26
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 545028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 27
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 551028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 28
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 557028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 29
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 563028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 30
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 569028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 31
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 575028615
MODULATION = VSB/8
INVERSION = AUTO
 
+#channel 32
 [CHANNEL]
DELIVERY_SYSTEM = ATSC
FREQUENCY = 581028615

Re: [PATCH v2 2/7] ARM: dts: exynos4412-odroid*: enable MFC device

2015-12-09 Thread Krzysztof Kozlowski
On 09.12.2015 22:58, Marek Szyprowski wrote:
> Enable support for Multimedia Codec (MFC) device for all Exynos4412-based
> Odroid boards.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 24 
>  1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi 
> b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> index edf0fc8..5825abf 100644
> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> @@ -18,6 +18,24 @@
>   stdout-path = _1;
>   };
>  
> + reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + mfc_left: region@7700 {
> + compatible = "shared-dma-pool";
> + reusable;
> + reg = <0x7700 0x100>;

Doesn't this exceed the memory of Odroid X?

For other Exynos4412 boards the length is 0x80. I am curious: any
particular reason for the difference?

Best regards,
Krzysztof

--
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/7] ARM: dts: exynos4412-odroid*: enable MFC device

2015-12-09 Thread Krzysztof Kozlowski
On 10.12.2015 16:44, Krzysztof Kozlowski wrote:
> On 09.12.2015 22:58, Marek Szyprowski wrote:
>> Enable support for Multimedia Codec (MFC) device for all Exynos4412-based

... and one more finding: I think the abbreviation is Multi Format Codec.

BR,
Krzysztof

>> Odroid boards.
>>
>> Signed-off-by: Marek Szyprowski 
>> ---
>>  arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 24 
>> 
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi 
>> b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
>> index edf0fc8..5825abf 100644
>> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
>> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
>> @@ -18,6 +18,24 @@
>>  stdout-path = _1;
>>  };
>>  
>> +reserved-memory {
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +ranges;
>> +
>> +mfc_left: region@7700 {
>> +compatible = "shared-dma-pool";
>> +reusable;
>> +reg = <0x7700 0x100>;
> 
> Doesn't this exceed the memory of Odroid X?
> 
> For other Exynos4412 boards the length is 0x80. I am curious: any
> particular reason for the difference?
> 
> Best regards,
> Krzysztof
> 
> 

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