1. 02 Aug, 2018 6 commits
  2. 30 Jul, 2018 29 commits
  3. 27 Jul, 2018 5 commits
    • Sylwester Nawrocki's avatar
      media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions · 4faeaf9c
      Sylwester Nawrocki authored
      Look up of buffers in s5p_mfc_handle_frame_new, s5p_mfc_handle_frame_copy_time
      functions is not working properly for DMA addresses above 2 GiB. As a result
      flags and timestamp of returned buffers are not set correctly and it breaks
      operation of GStreamer/OMX plugins which rely on the CAPTURE buffer queue
      flags.
      
      Due to improper return type of the get_dec_y_adr, get_dspl_y_adr callbacks
      and sign bit extension these callbacks return incorrect address values,
      e.g. 0xfffffffffefc0000 instead of 0x00000000fefc0000. Then the statement:
      
      "if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0) == dec_y_addr)"
      
      is always false, which breaks looking up capture queue buffers.
      
      To ensure proper matching by address u32 type is used for the DMA
      addresses. This should work on all related SoCs, since the MFC DMA
      address width is not larger than 32-bit.
      
      Changes done in this patch are minimal as there is a larger patch series
      pending refactoring the whole driver.
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      4faeaf9c
    • Ezequiel Garcia's avatar
      media: v4l2-mem2mem: Fix missing v4l2_m2m_try_run call · 9db3bbf5
      Ezequiel Garcia authored
      Commit 34dbb848 ("media: mem2mem: Remove excessive try_run call")
      removed a redundant call to v4l2_m2m_try_run but instead introduced
      a bug. Consider the following case:
      
       1) Context A schedules, queues and runs job A.
       2) While the m2m device is running, context B schedules
          and queues job B. Job B cannot run, because it has to
          wait for job A.
       3) Job A completes, calls v4l2_m2m_job_finish, and tries
          to queue a job for context A, but since the context is
          empty it won't do anything.
      
      In this scenario, queued job B will never run. Fix this by calling
      v4l2_m2m_try_run from v4l2_m2m_try_schedule.
      
      While here, add more documentation to these functions.
      
      Fixes: 34dbb848 ("media: mem2mem: Remove excessive try_run call")
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      [hans.verkuil@cisco.com: split >80 cols line]
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      9db3bbf5
    • Luca Ceresoli's avatar
      media: imx274: add cropping support via SELECTION API · 39dd23dc
      Luca Ceresoli authored
      Currently this driver does not support cropping. The supported modes
      are the following, all capturing the entire area:
      
       - 3840x2160, 1:1 binning (native sensor resolution)
       - 1920x1080, 2:1 binning
       - 1280x720,  3:1 binning
      
      The VIDIOC_SUBDEV_S_FMT ioctl chooses among these 3 configurations the
      one that matches the requested format.
      
      Add cropping support via VIDIOC_SUBDEV_S_SELECTION: with target
      V4L2_SEL_TGT_CROP to choose the captured area, with
      V4L2_SEL_TGT_COMPOSE to choose the output resolution.
      
      To maintain backward compatibility we also allow setting the compose
      format via VIDIOC_SUBDEV_S_FMT. To obtain this, compose rect and
      output format are computed in the common helper function
      __imx274_change_compose(), which sets both to the same width/height
      values.
      
      Cropping also calls __imx274_change_compose() whenever cropping rect
      size changes in order to reset the compose rect (and output format
      size) for 1:1 binning.
      
      Also rename enum imx274_mode to imx274_binning (and its values from
      IMX274_MODE_BINNING_* to IMX274_BINNING_*). Without cropping, the two
      naming are equivalent. With cropping, the resolution could be
      different, e.g. using 2:1 binning mode to crop 1200x960 and output a
      600x480 format. Using binning in the names avoids any
      misunderstanding. For the same reason, replace the 'size' field in
      struct imx274_frmfmt with 'bin_ratio'.
      
      [Sakari Ailus: Remove leftover condition in imx274_apply_trimming]
      Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      39dd23dc
    • Luca Ceresoli's avatar
      media: imx274: use regmap_bulk_write to write multybyte registers · 279b4b9a
      Luca Ceresoli authored
      Currently 2-bytes and 3-bytes registers are set by very similar
      functions doing the needed shift & mask manipulation, followed by very
      similar for loops setting one byte at a time over I2C.
      
      Replace all of this code by a unique helper function that calls
      regmap_bulk_write(), which has two advantages:
       - sets all the bytes in a unique I2C transaction
       - removes lots of now unused code.
      Signed-off-by: default avatarLuca Ceresoli <luca@lucaceresoli.net>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      279b4b9a
    • Rui Miguel Silva's avatar
      media: ov2680: Add Omnivision OV2680 sensor driver · 3ee47cad
      Rui Miguel Silva authored
      This patch adds V4L2 sub-device driver for OV2680 image sensor.
      The OV2680 is a 1/5" CMOS color sensor from Omnivision.
      Supports output format: 10-bit Raw RGB.
      The OV2680 has a single lane MIPI interface.
      
      The driver exposes following V4L2 controls:
      - auto/manual exposure,
      - exposure,
      - auto/manual gain,
      - gain,
      - horizontal/vertical flip,
      - test pattern menu.
      Supported resolution are only: QUXGA, 720P, UXGA.
      
      [Sakari Ailus: Drop "-level" from Kconfig help text]
      Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      3ee47cad