19 Feb, 2019

40 commits

  • This commit changes the return type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    which currently return void pointer.

    In every case, the actual return type is a struct vb2_v4l2_buffer
    pointer. Change the return type of the listed functions,
    so type checking can be properly used.

    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Hans Verkuil
    [hverkuil-cisco@xs4all.nl: clean up line-too-long checkpatch warnings]
    Signed-off-by: Mauro Carvalho Chehab

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Fix the assigned type of mem2mem buffer handling API.
    Namely, these functions:

    v4l2_m2m_next_buf
    v4l2_m2m_last_buf
    v4l2_m2m_buf_remove
    v4l2_m2m_next_src_buf
    v4l2_m2m_next_dst_buf
    v4l2_m2m_last_src_buf
    v4l2_m2m_last_dst_buf
    v4l2_m2m_src_buf_remove
    v4l2_m2m_dst_buf_remove

    return a struct vb2_v4l2_buffer, and not a struct vb2_buffer.

    Fixing this is necessary to fix the mem2mem buffer handling API,
    changing the return to the correct struct vb2_v4l2_buffer instead
    of a void pointer.

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

    Ezequiel Garcia
     
  • Since the removal of the stale soc_camera headers, Migo-R board fails to
    build due to missing dma-mapping include directive.

    Include missing dma-mapping.h header in Migo-R board file to fix the build
    error.

    Fixes: a50c7738e8ae ("media: sh: migor: Remove stale soc_camera include")

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

    Jacopo Mondi
     
  • set_edid never wrote the new EDID to state->edid.edid, it was only
    written to the hardware. Since get_edid returned state->edid.edid,
    it was never returning the right EDID.

    Signed-off-by: Tim Harvey
    Signed-off-by: Hans Verkuil
    [hverkuil-cisco@xs4all.nl: added missing commit log]
    Signed-off-by: Mauro Carvalho Chehab

    Tim Harvey
     
  • The CSI controller can take raw data from the data bus and output it
    directly to capture buffers. This can be used to support the JPEG media
    bus format.

    While the controller can report minimum and maximum bytes per line, it
    has no way to report how many lines were captured in the last frame.
    Thus, even when the on-bus data is framed correctly, we have no way to
    accertain the actual amount of data captured, unless we scan the buffer
    for JPEG EOI markers, or sequential zeros. For now we leave bytesused
    alone, and leave it up to userspace applications to parse the data.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Chen-Yu Tsai
     
  • The CSI controller can take raw data from the data bus and output RGB565
    format. The controller does not distinguish between RGB565 LE and BE.
    Instead this is determined by the media bus format, i.e. the format or
    order the sensor is sending data in.

    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Chen-Yu Tsai
     
  • max_register is currently set to 0x1000. This is beyond the mapped
    address range of the hardware, so attempts to dump the regmap from
    debugfs would trigger a kernel exception.

    Furthermore, the useful registers only occupy a small section at the
    beginning of the full range. Change the value to 0x9c, the last known
    register on the V3s and H3.

    On the A31, the register range is extended to support additional
    capture channels. Since this is not yet supported, ignore it for now.

    Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")

    Cc:
    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Chen-Yu Tsai
     
  • Document RZ/G2 support.

    Signed-off-by: Fabrizio Castro
    Signed-off-by: Laurent Pinchart
    Reviewed-by: Simon Horman
    Signed-off-by: Mauro Carvalho Chehab

    Fabrizio Castro
     
  • Document RZ/G1 and RZ/G2 support.

    Signed-off-by: Fabrizio Castro
    Signed-off-by: Laurent Pinchart
    Reviewed-by: Simon Horman
    Signed-off-by: Mauro Carvalho Chehab

    Fabrizio Castro
     
  • drivers/media/platform/vsp1/vsp1_drm.c: drivers/media/platform/vsp1/vsp1_drm.c:336 vsp1_du_pipeline_setup_brx() error: we previously assumed 'pipe->brx' could be null (see line 244)

    smatch missed that if pipe->brx was NULL, then later on it will be
    set with a non-NULL value. But it is easier to just use the brx pointer
    so smatch doesn't get confused.

    Tested-on: Salvator-XS-ES2.0, Salvator-XS-M3N

    Signed-off-by: Hans Verkuil
    Reviewed-by: Kieran Bingham
    Tested-by: Kieran Bingham
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The uvc driver uses this function to fill in bus_info for VIDIOC_QUERYCAP,
    so use the same function when filling in the bus_info for the media device.

    The current implementation only fills in part of the info. E.g. if the full
    bus_info is usb-0000:01:00.0-1.4.2, then the media bus_info only has 1.4.2.

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

    Hans Verkuil
     
  • drivers/media/usb/uvc/uvc_video.c: drivers/media/usb/uvc/uvc_video.c:1893 uvc_video_start_transfer() warn: argument 2 to %u specifier is cast from pointer

    Signed-off-by: Hans Verkuil
    Reviewed-by: Kieran Bingham
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Language improvements, fix entity naming, make pipeline a graph and move
    device usage documentation to device documentation ipu3.rst.

    Signed-off-by: Yong Zhi
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Yong Zhi
     
  • CSI block in Allwinner A64 has similar features as like in H3,
    but the default CSI_SCLK rate cannot work properly to drive the
    connected sensor interface.

    The tested mod cock rate is 300 MHz and BSP vfe media driver is also
    using the same rate. Unfortunately there is no valid information about
    clock rate in manual or any other sources except the BSP driver. so more
    faith on BSP code, because same has tested in mainline.

    So, add support for A64 CSI block by setting updated mod clock rate.

    Signed-off-by: Jagan Teki
    Acked-by: Maxime Ripard
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Jagan Teki
     
  • Allwinner A64 CSI is a single channel time-multiplexed BT.656
    protocol interface.

    Add separate compatible string for A64 since it require explicit
    change in sun6i_csi driver to update default CSI_SCLK rate.

    Signed-off-by: Jagan Teki
    Reviewed-by: Rob Herring
    Acked-by: Maxime Ripard
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Jagan Teki
     
  • The extended-controls.rst file had become too big. Split it up: each
    control class reference gets its own rst file, and this file just
    describes the Extended Control API.

    Each control class reference is also moved up one level into the
    table of contents to make it easier to find e.g. the codec control
    reference.

    Finally I rearranged the order so that all camera-related control
    classes are grouped together, ditto for codec/jpeg and fm-rx/tx.

    The ext-ctrls-codec.rst is still pretty big and it is a candidate
    to split up further in the future, possibly per codec.

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

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in dvb_demux_poll(), dvb_dvr_poll() and
    dvb_ca_en50221_io_poll(). Fix this, otherwise epoll()
    can timeout when it shouldn't.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in videobuf_poll_stream(). Fix this, otherwise
    epoll() would timeout when it shouldn't.

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

    Hans Verkuil
     
  • The v4l2_m2m_poll function didn't check whether q->error
    was set for either of the two queues. Add support for this.

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

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in v4l2_m2m_poll(). Fix this, otherwise
    epoll() would timeout when it shouldn't.

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

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in v4l2_ctrl_poll(). Fix this, otherwise epoll()
    would timeout when it shouldn't.

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

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in vb2_core_poll() and vb2_poll(). Fix this,
    otherwise epoll() would timeout when it shouldn't.

    Signed-off-by: Hans Verkuil
    Reported-by: Yi Qingliang
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in media_request_poll(). Fix this, otherwise
    epoll() would timeout when it shouldn't.

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

    Hans Verkuil
     
  • The epoll function expects that whenever the poll file op is
    called, the poll_wait function is also called. That didn't
    always happen in cec_poll(). Fix this, otherwise epoll()
    would timeout when it shouldn't.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • If a stream is stopped, or if a USERPTR/DMABUF buffer is queued
    backed by a different user address or dmabuf fd, then the timestamp
    should be skipped by vb2_find_timestamp since the memory it refers
    to is no longer valid.

    So keep track of a 'copied_timestamp' state: it is set when the
    timestamp is copied from an output to a capture buffer, and is
    cleared when it is no longer valid.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Paul Kocialkowski
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The bool type is not recommended for use in structs, so replace these
    by bitfields.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Paul Kocialkowski
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Buffers generated with YUV32 format seems to be incorrect, hence use
    VUYA32 instead.

    Changes from v1:
    Add both formats VUYA32 and VUYX32 but associate only VUYX32 to the
    output queue as the alpha channel of buffers is ignored on this queue.

    Signed-off-by: Vivek Kasireddy
    Reviewed-by: Philipp Zabel
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Vivek Kasireddy
     
  • Enable vivid to make use of the following formats:
    V4L2_PIX_FMT_AYUV32
    V4L2_PIX_FMT_XYUV32
    V4L2_PIX_FMT_VUYA32
    V4L2_PIX_FMT_VUYX32

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

    Vivek Kasireddy
     
  • Add support for the following formats to tpg:
    V4L2_PIX_FMT_AYUV32
    V4L2_PIX_FMT_XYUV32
    V4L2_PIX_FMT_VUYA32
    V4L2_PIX_FMT_VUYX32

    Changes from v1:
    Remove the duplicate case value

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

    Vivek Kasireddy
     
  • The formats added in this patch include:
    V4L2_PIX_FMT_AYUV32
    V4L2_PIX_FMT_XYUV32
    V4L2_PIX_FMT_VUYA32
    V4L2_PIX_FMT_VUYX32

    These formats enable the trasmission of alpha channel data to other
    drivers and userspace applications in addition to YUV data. For
    example, buffers generated by drivers in one of these formats
    can be used by the Weston compositor to display as a texture or
    flipped directly onto the overlay planes with the help of a DRM
    driver.

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

    Vivek Kasireddy
     
  • Without this, we get failures like this when the kernel attempts to
    initialize a cx231xx device:

    [16046.153653] cx231xx 3-1.2:1.1: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:c200) with 6 interfaces
    [16046.153900] cx231xx 3-1.2:1.1: can't change interface 3 alt no. to 3: Max. Pkt size = 0
    [16046.153907] cx231xx 3-1.2:1.1: Identified as Hauppauge USB Live 2 (card=9)
    [16046.154350] i2c i2c-11: Added multiplexed i2c bus 13
    [16046.154379] i2c i2c-11: Added multiplexed i2c bus 14
    [16046.267194] cx25840 10-0044: cx23102 A/V decoder found @ 0x88 (cx231xx #0-0)
    [16048.424551] cx25840 10-0044: loaded v4l-cx231xx-avcore-01.fw firmware (16382 bytes)
    [16048.463224] cx231xx 3-1.2:1.1: v4l2 driver version 0.0.3
    [16048.567878] cx231xx 3-1.2:1.1: Registered video device video2 [v4l2]
    [16048.568001] cx231xx 3-1.2:1.1: Registered VBI device vbi0
    [16048.568419] cx231xx 3-1.2:1.1: audio EndPoint Addr 0x83, Alternate settings: 3
    [16048.568425] cx231xx 3-1.2:1.1: video EndPoint Addr 0x84, Alternate settings: 5
    [16048.568431] cx231xx 3-1.2:1.1: VBI EndPoint Addr 0x85, Alternate settings: 2
    [16048.568436] cx231xx 3-1.2:1.1: sliced CC EndPoint Addr 0x86, Alternate settings: 2
    [16048.568448] usb 3-1.2: couldn't get decoder output pad for V4L I/O
    [16048.568453] cx231xx 3-1.2:1.1: V4L2 device vbi0 deregistered
    [16048.568579] cx231xx 3-1.2:1.1: V4L2 device video2 deregistered
    [16048.569001] cx231xx: probe of 3-1.2:1.1 failed with error -22

    Likely a regession since Commit 9d6d20e652c0
    ("media: v4l2-mc: switch it to use the new approach to setup pipelines")
    (v4.19-rc1-100-g9d6d20e652c0), which introduced the use of
    PAD_SIGNAL_DV within v4l2_mc_create_media_graph().

    This also modifies cx25840 to remove the VBI pad, matching the action
    taken in Commit 092a37875a22 ("media: v4l2: remove VBI output pad").

    Fixes: 9d6d20e652c0 ("media: v4l2-mc: switch it to use the new approach to setup pipelines")

    Cc: stable@vger.kernel.org
    Signed-off-by: Cody P Schafer
    Tested-by: Hans Verkuil
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Cody P Schafer
     
  • There is a spelling mistake in a fmdbg debug message. Fix it.

    Signed-off-by: Colin Ian King
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Colin Ian King