19 May, 2017

1 commit

  • Avoid warnings like those:

    drivers/media/pci/ddbridge/ddbridge-core.c: In function 'dvb_input_detach':
    drivers/media/pci/ddbridge/ddbridge-core.c:787:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (input->fe) {
    ^
    drivers/media/pci/ddbridge/ddbridge-core.c:792:2: note: here
    case 4:
    ^~~~
    ...

    On several cases, it is just that gcc 7.1 is not capable of
    understanding the comment, but on other places, we need an
    annotation.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

21 Apr, 2017

1 commit


25 Dec, 2016

1 commit


21 Oct, 2016

1 commit

  • Due to the 80-cols restrictions, and latter due to checkpatch
    warnings, several strings were broken into multiple lines. This
    is not considered a good practice anymore, as it makes harder
    to grep for strings at the source code.

    As we're right now fixing other drivers due to KERN_CONT, we need
    to be able to identify what printk strings don't end with a "\n".
    It is a way easier to detect those if we don't break long lines.

    So, join those continuation lines.

    The patch was generated via the script below, and manually
    adjusted if needed.

    use Text::Tabs;
    while (<>) {
    if ($next ne "") {
    $c=$_;
    if ($c =~ /^\s+\"(.*)/) {
    $c2=$1;
    $next =~ s/\"\n$//;
    $n = expand($next);
    $funpos = index($n, '(');
    $pos = index($c2, '",');
    if ($funpos && $pos > 0) {
    $s1 = substr $c2, 0, $pos + 2;
    $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
    $s2 =~ s/^\s+//;

    $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");

    print unexpand("$next$s1\n");
    print unexpand("$s2\n") if ($s2 ne "");
    } else {
    print "$next$c2\n";
    }
    $next="";
    next;
    } else {
    print $next;
    }
    $next="";
    } else {
    if (m/\"$/) {
    if (!m/\\n\"$/) {
    $next=$_;
    next;
    }
    }
    }
    print $_;
    }

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

20 Sep, 2016

1 commit

  • Check for vb2_ops structures that are only stored in the ops field of a
    vb2_queue structure. That field is declared const, so vb2_ops structures
    that have this property can be declared as const also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct vb2_ops i@p = { ... };

    @ok@
    identifier r.i;
    struct vb2_queue e;
    position p;
    @@
    e.ops = &i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct vb2_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct vb2_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     

24 Aug, 2016

1 commit


09 Jul, 2016

2 commits

  • The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:

    drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
    drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]

    This moves the unused label and code inside another #ifdef to
    get rid of the warning.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     
  • Make this a proper typed array. Drop the old allocate context code since
    that is no longer used.

    Note that the memops functions now get a struct device pointer instead of
    the struct device ** that was there initially (actually a void pointer to
    a struct containing only a struct device pointer).

    This code is now a lot cleaner.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

01 Feb, 2016

1 commit


18 Dec, 2015

2 commits

  • Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer
    for common use, and change its type to u64 in order to handling
    y2038 problem. This patch also includes all device drivers' changes related to
    this restructuring.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • The queue_setup callback has a void pointer that is just for V4L2
    and is the pointer to the v4l2_format struct that was passed to
    VIDIOC_CREATE_BUFS. The idea was that drivers would use the information
    from that struct to buffers suitable for the requested format.

    After the vb2 split series this pointer is now a void pointer,
    which is ugly, and the reality is that all existing drivers will
    effectively just look at the sizeimage field of v4l2_format.

    To make this more generic the queue_setup callback is changed:
    the void pointer is dropped, instead if the *num_planes argument
    is 0, then use the current format size, if it is non-zero, then
    it contains the number of requested planes and the sizes array
    contains the requested sizes. If either is unsupported, then return
    -EINVAL, otherwise use the requested size(s).

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

21 Oct, 2015

1 commit

  • Replace struct v4l2_format * with void * to make queue_setup()
    for common use.
    And then, modify all device drivers related with this change.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    [hans.verkuil@cisco.com: fix missing const in fimc-lite.c]

    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     

01 Oct, 2015

1 commit

  • Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

    Add new member variables - bytesused, length, offset, userptr, fd,
    data_offset - to struct vb2_plane in order to cover all information
    of v4l2_plane.
    struct vb2_plane {

    unsigned int bytesused;
    unsigned int length;
    union {
    unsigned int offset;
    unsigned long userptr;
    int fd;
    } m;
    unsigned int data_offset;
    }

    Replace v4l2_buf with new member variables - index, type, memory - which
    are common fields for buffer management.
    struct vb2_buffer {

    unsigned int index;
    unsigned int type;
    unsigned int memory;
    unsigned int num_planes;
    struct vb2_plane planes[VIDEO_MAX_PLANES];

    };

    v4l2 specific fields - flags, field, timestamp, timecode,
    sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
    struct vb2_v4l2_buffer {
    struct vb2_buffer vb2_buf;

    __u32 flags;
    __u32 field;
    struct timeval timestamp;
    struct v4l2_timecode timecode;
    __u32 sequence;
    };

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     

30 Jan, 2015

1 commit

  • If start_streaming fails, then the buffers must be given back to vb2 with state
    QUEUED, not ERROR. Otherwise a WARN_ON will be generated.

    In the disconnect it is pointless to call pwc_cleanup_queued_bufs() as stop_streaming()
    will be called anyway.

    Signed-off-by: Hans Verkuil
    Tested-by: Hans Verkuil
    Signed-off-by: Hans de Goede
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

03 Sep, 2014

1 commit


05 Jul, 2014

1 commit


23 Apr, 2014

1 commit

  • The vb2 core ignores any return code from the stop_streaming op.
    And there really isn't anything it can do anyway in case of an error.
    So change the return type to void and update any drivers that implement it.

    The int return gave drivers the idea that this operation could actually
    fail, but that's really not the case.

    The pwc amd sdr-msi3101 drivers both had this construction:

    if (mutex_lock_interruptible(&s->v4l2_lock))
    return -ERESTARTSYS;

    This has been updated to just call mutex_lock(). The stop_streaming op
    expects this to really stop streaming and I very much doubt this will
    work reliably if stop_streaming just returns without really stopping the
    DMA.

    Signed-off-by: Hans Verkuil
    Acked-by: Pawel Osciak
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

11 Mar, 2014

2 commits


06 Mar, 2014

1 commit


07 Jan, 2014

1 commit


30 Nov, 2013

1 commit

  • Fix various spelling errors in strings and comments throughout the media
    tree. The majority of these were found using Lucas De Marchi's codespell
    tool.

    [m.chehab@samsung.com: discard hunks with conflicts]

    Signed-off-by: Jonathan McCrohan
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Jonathan McCrohan
     

07 May, 2013

1 commit

  • With all the changes to handle the locking in the v4l2-core rather then at
    the driver level, the order in which the 2 pwc locks need to be taken has
    changed, update the comment in the header file to correctly reflect this.

    Signed-off-by: Hans de Goede
    Signed-off-by: Mauro Carvalho Chehab

    Hans de Goede
     

06 Mar, 2013

1 commit

  • Not all drivers use monotonic timestamps. This patch adds a way to set the
    timestamp type per every queue.
    In addition, set proper timestamp type in drivers that I am sure that use
    either MONOTONIC or COPY timestamps. Other drivers will correctly report
    UNKNOWN timestamp type instead of assuming that all drivers use monotonic
    timestamps.

    Signed-off-by: Kamil Debski
    Signed-off-by: Kyungmin Park
    Reviewed-by: Sylwester Nawrocki
    Acked-by: Hans Verkuil
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Kamil Debski
     

06 Feb, 2013

1 commit


28 Dec, 2012

1 commit

  • This kind of memcpy() is error-prone. Its replacement with a struct
    assignment is prefered because it's type-safe and much easier to read.
    Found by coccinelle. Hand patched and reviewed.
    Tested by compilation only.
    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)
    //
    @@
    identifier struct_name;
    struct struct_name to;
    struct struct_name from;
    expression E;
    @@
    -memcpy(&(to), &(from), E);
    +to = from;
    //

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Mauro Carvalho Chehab

    Ezequiel Garcia
     

21 Dec, 2012

1 commit


21 Nov, 2012

1 commit


28 Oct, 2012

2 commits


14 Sep, 2012

2 commits


17 Aug, 2012

1 commit

  • On a few places, := were using instead of +=, causing drivers to
    not compile.

    While here, standardize the usage of += on all cases where multiple
    lines are needed, and for obj-y/obj-m targets, and := when just one
    line is needed, on -obj rules.

    Reported-by: Hans Verkuil
    Identified-by: Antti Polosaari
    Tested-by: Antti Palosaari
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

16 Aug, 2012

1 commit