1. 29 1月, 2022 8 次提交
    • S
      media: hi847: Add support for Hi-847 sensor · da15b409
      Shawn Tu 提交于
      Add a V4L2 sub-device driver for Hynix Hi-847 image sensor.
      This is a camera sensor using the I2C bus for control and the
      CSI-2 bus for data.
      
      This driver supports following features:
      - manual exposure and analog/digital gain control support
      - vblank/hblank control support
      - test pattern support
      - media controller support
      - runtime PM support
      - vflip/hflip control support
        - keep SGRBG10 Bayer order output
      - support following resolutions:
        + 3264x2448 at 30FPS
        + 1632x1224 at 60FPS
      
      [Sakari Ailus: Wrapped a few long lines.]
      Signed-off-by: NShawn Tu <shawnx.tu@intel.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      da15b409
    • S
      media: ov8865: Fix indentation in set_selection callback · ff44cc4c
      Sakari Ailus 提交于
      Fixed wrong indentation in set_selection callback.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      ff44cc4c
    • S
      media: ov5648: Don't pack controls struct · edd4fbff
      Sakari Ailus 提交于
      Don't pack the driver specific struct containing control pointers. This
      lead to potential alignment issues when working with the pointers.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Fixes: e43ccb0a ("media: i2c: Add support for the OV5648 image sensor")
      Reviewed-by: NPaul Kocialkowski <paul.kocialkowski@bootlin.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      edd4fbff
    • S
      media: v4l: Avoid unaligned access warnings when printing 4cc modifiers · 24bb30c8
      Sakari Ailus 提交于
      Pointers V4L2 pixelformat and dataformat fields in a few packed structs
      are directly passed to printk family of functions. This could result in an
      unaligned access albeit no such possibility appears to exist at the
      moment i.e. this clang warning appears to be a false positive.
      
      Address the warning by copying the pixelformat or dataformat value to a
      local variable first.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Fixes: e927e1e0 ("v4l: ioctl: Use %p4cc printk modifier to print FourCC codes")
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      24bb30c8
    • J
      media: ov6650: Fix missing frame interval enumeration support · c748f10c
      Janusz Krzysztofik 提交于
      According to v4l2-compliance utility, a video device which supports
      V4L2_CAP_TIMEPERFRAME via .vidioc_s_parm() operation should also
      support .vidioc_enum_frameintervals().  If the former is implemented
      via a call to v4l2_s_parm_cap() which in turn calls a subdevice
      .s_frame_interval() pad operation, the video device may want to
      implement the latter by passing frame interval enumeration requests to
      the subdevice .enum_frame_intervals() video operation.  If that
      operation is not supported by the subdevice and failure is returned by
      the video device, the compliance test issues a warning.
      
      Implement the missing pad operation.  Enumerate frame intervals
      possible to be set via pixel clock adjustment, as implemented by
      .s_frame_interval(), but not exceeding a reasonable maximum of 1
      second.
      
      [Sakari Ailus: Rebased on mbus config pad op patches]
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      c748f10c
    • J
      media: ov6650: Fix crop rectangle affected by set format · 985d2d7a
      Janusz Krzysztofik 提交于
      According to subdevice interface specification found in V4L2 API
      documentation, set format pad operations should not affect image
      geometry set in preceding image processing steps. Unfortunately, that
      requirement is not respected by the driver implementation of set format
      as it was not the case when that code was still implementing a pair of
      now obsolete .s_mbus_fmt() / .try_mbus_fmt() video operations before
      they have been merged and reused as an implementation of .set_fmt() pad
      operation by commit 717fd5b4 ("[media] v4l2: replace try_mbus_fmt
      by set_fmt").
      
      Exclude non-compliant crop rectangle adjustments from set format try,
      as well as a call to .set_selection() from set format active processing
      path, so only frame scaling is applied as needed and crop rectangle is
      no longer modified.
      
      [Sakari Ailus: Rebase on subdev state patches]
      
      Fixes: 717fd5b4 ("[media] v4l2: replace try_mbus_fmt by set_fmt")
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      985d2d7a
    • J
      media: ov6650: Add try support to selection API operations · c7405264
      Janusz Krzysztofik 提交于
      Try requests are now only supported by format processing pad operations
      implemented by the driver.  The driver selection API operations
      currently respond to them with -EINVAL.  While that is correct, it
      constraints video device drivers to not use subdevice cropping at all
      while processing user requested active frame size, otherwise their set
      try format results might differ from active.  As a consequence, we
      can't fix set format pad operation as not to touch crop rectangle since
      that would affect users not being able to set arbitrary frame sizes.
      Moreover, without a working set try selection support we are not able
      to use pad config crop rectangle as a reference while processing set
      try format requests.
      
      Implement missing try selection support.  Moreover, as it will be now
      possible to maintain the pad config crop rectangle via selection API,
      start using it instead of the active one as a reference while
      processing set try format requests.
      
      is_unscaled_ok() helper, now also called from set selection operation,
      has been just moved up in the source file to avoid a prototype, with no
      functional changes.
      
      [Sakari Ailus: Rebase on subdev state patches]
      
      Fixes: 717fd5b4 ("[media] v4l2: replace try_mbus_fmt by set_fmt")
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      c7405264
    • J
      media: ov6650: Fix set format try processing path · 1f6f1e95
      Janusz Krzysztofik 提交于
      According to subdevice interface specification found in V4L2 API
      documentation, set format pad operations should not affect image
      geometry set in preceding image processing steps. Unfortunately, that
      requirement is not respected by the driver implementation of set format
      as it was not the case when that code was still implementing a pair of
      now obsolete .s_mbus_fmt() / .try_mbus_fmt() video operations before
      they have been merged and reused as an implementation of .set_fmt() pad
      operation by commit 717fd5b4 ("[media] v4l2: replace try_mbus_fmt
      by set_fmt").
      
      In case of set format active processing path the issue can be fixed
      easily by excluding a call to set active selection from that path. That
      will effectively limit frame size processing to optimal frame scaling
      against active crop rectangle without touching it.  Users can just call
      set active selection themselves to obtain desired frame size.  However,
      set format try processing path needs more work.
      
      First of all, the driver should be extended with set try selection
      support.  Lack of it constraints video device drivers to not use
      subdevice cropping at all while processing user requested active frame
      size, otherwise their set try format results might differ from active.
      
      Next, set format try processing path should use pad config crop
      rectangle as a reference, not the active one as it does now.  That
      issue can be resolved easily as soon as set try selection support is
      added to the driver so pad config crop rectangle can be maintained by
      users via selection API.
      
      Last, set format try processing path should give the same results as
      active in respect to active vs. pad config crop rectangle geometry.
      Both rectangles should be either not touched by set format (that's what
      we are going to achieve) or modified the same way, otherwise users
      won't be able to obtain equal results from both paths while iterating
      through set format and set selection operations in order to obtain
      desired frame size.
      
      We can't begin with modifying set format pad operation as not to touch
      crop rectangle since that depends on availability of set try selection
      for symmetry.  Neither can we begin with adding set try selection since
      that in turn depends on equal handling of active and pad config crop
      rectangles by set format.  We can either implement all required
      modifications in a single patch, or begin with fixing current set
      format try processing path to appropriately handle pad config crop
      rectangle.  This patch implements the latter approach as believed to
      be more readable.
      
      Move crop rectangle adjustments code from a helper (the former
      implementation of .s_fmt(), now called from set format active
      processing path) to the body of set format pad operation function
      where it can be also used for processing try requests for symmetry with
      active ones.  As the helper no longer processes frame geometry, only
      frame format and half scaling, simplify its API accordingly and update
      its users.
      
      Moreover, extract code that applies crop rectangle hardware limits
      (now a part of .set_selection() operation which is called from set
      format active processing path) to a new helper and call that helper
      from set format try processing path as well for symmetry with active.
      
      [Sakari Ailus: Rebase on subdev state patches]
      
      Fixes: 717fd5b4 ("[media] v4l2: replace try_mbus_fmt by set_fmt")
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
      1f6f1e95
  2. 28 1月, 2022 32 次提交