1. 22 Feb, 2022 7 commits
    • Jammy Huang's avatar
      media: aspeed: Use full swing as JFIF to fix incorrect color · 61b31d78
      Jammy Huang authored
      Current settings for video capture rgb-2-yuv is BT.601(studio swing),
      but JFIF uses BT.601(full swing) to deocde. This mismatch will lead
      to incorrect color. For example, input RGB value, (0, 0, 255), will
      become (16, 16, 235) after jpg decoded.
      
      Add an enum, aspeed_video_capture_format, to define VR008[7:6]
      capture format and correct default settings for video capture to fix
      the problem.
      
      VR008[7:6] decides the data format for video capture as below:
      * 00: CCIR601 studio swing compliant YUV format
      * 01: CCIR601 full swing compliant YUV format
      * 10: RGB format
      * 11: Gray color mode
      Signed-off-by: default avatarJammy Huang <jammy_huang@aspeedtech.com>
      Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      61b31d78
    • Jammy Huang's avatar
      media: aspeed: Fix unstable timing detection · 22443acc
      Jammy Huang authored
      Using stable-signal in resolution detection, and try detection again
      if unstable.
      
      VE_MODE_DETECT_EXTSRC_ADC: 1 if video source is from ADC output.
      VE_MODE_DETECT_H_STABLE: 1 if horizontal signal detection is stable.
      VE_MODE_DETECT_V_STABLE: 1 if vertical signal detection is stable.
      Signed-off-by: default avatarJammy Huang <jammy_huang@aspeedtech.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      22443acc
    • Jammy Huang's avatar
      media: aspeed: Add macro for the fields of the mode-detect registers · d6f9a60f
      Jammy Huang authored
      VE_MODE_DT_HOR_TOLER: the tolerance in detecting for stable horizontal
      signal.
      VE_MODE_DT_VER_TOLER: the tolerance in detecting for stable vertical
      signal.
      VE_MODE_DT_HOR_STABLE: the minimum required count in detecting stable
      HSYNC signal to set mode detection horizontal signal stable.
      VE_MODE_DT_VER_STABLE: the minimum required count in detecting stable
      VSYNC signal to set mode detection vertical signal stable.
      Signed-off-by: default avatarJammy Huang <jammy_huang@aspeedtech.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      d6f9a60f
    • Jammy Huang's avatar
      media: aspeed: add comments and macro · a12403af
      Jammy Huang authored
      Add comments to describe video-stat and 'struct aspeed_video'.
      Add macro, ASPEED_VIDEO_V4L2_MIN_BUF_REQ, to describe the buffers
      needed.
      Signed-off-by: default avatarJammy Huang <jammy_huang@aspeedtech.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      [hverkuil: drop docbook tags, not needed]
      a12403af
    • Niklas Söderlund's avatar
      media: rcar-{csi2,vin}: Move to full Virtual Channel routing per CSI-2 IP · 3e52419e
      Niklas Söderlund authored
      When Gen3 support was first added to this R-Car VIN and CSI-2 driver the
      routing was centred around the CHSEL register which multiplexes the
      different parallel buses that sit between the CSI-2 receivers source
      side and the VIN dma engines. This was a bad design as the multiplexing
      do allow for only a few combinations and do not play nice with many
      video streams in the system.
      
      For example it's only possible for CSI-2 Virtual Channels 0 and 1 of any
      given CSI-2 receiver to be used together with the scaler.
      
      Later datasheets have expanded the documentation and it is now possible
      to improve on this design by allowing any Virtual Channel to be routed
      to any R-Car VIN instance, provided that there exists a parallel bus
      between them. This increases the flexibility as all Virtual Channels can
      now be used together with the scaler for example.
      
      The redesign is not however perfect. While the new design allows for
      many more routes, two constrains limit a small portion of routes that
      was possible in the old design but are no more.
      
      - It is no longer possible to route the same CSI-2 and VC to more then
        one VIN at a time. This was theoretically possible before if the
        specific SoC allowed for the same CSI-2 and VC to be routed to two
        different VIN capture groups.
      
      - It is no longer possible to simultaneously mix links from two CSI-2 IP
        blocks to the same VIN capture group.
      
        For example if VIN2 is capturing from CSI40 then VIN{0,1,3} must also
        capture from CSI40. While VIN{4,5,6,7} is still free to capture from
        any other CSI-2 IP in the system. Once all VIN{0,1,2,3} links to CSI40
        are disabled that VIN capture group is free again to capture from any
        other CSI-2 IP it is connected to.
      
      At the core of the redesign is greater cooperator of the R-Car VIN and
      CSI-2 drivers in configuring the routing. The VIN driver is after this
      change only responsible to configure the full VIN capture groups
      parallel buses to be to a particular CSI-2 IP. While the configuration
      of which CSI-2 Virtual Channel is outputted on which of the R-Car CSI-2
      IP output ports is handled by the CSI-2 driver.
      
      Before this change the CSI-2 Virtual Channel to output port was static
      in the CSI-2 driver and the different links only manipulated the VIN
      capture groups CHSEL register. With this change both the CHSEl register
      and the CSI-2 routing VCDT registers are modified for greater
      flexibility.
      
      This change touches both the R-Car VIN and R-Car CSI-2 drivers in the
      same commit as both drivers cooperate closely and one change without the
      other would more or less break video capture.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Tested-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      [hverkuil: fix two trivial checkpatch whitespace issues]
      3e52419e
    • Niklas Söderlund's avatar
      media: rcar-vin: Breakout media link creation · 624e8b62
      Niklas Söderlund authored
      In preparation of creating more links to allow for full Virtual Channel
      routing within the CSI-2 block break out the link creation logic to a
      helper function as the logic will grow in future work.
      
      There is no functional change.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Tested-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
      Reviewed-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      624e8b62
    • Niklas Söderlund's avatar
      media: rcar-vin: Refactor link notify · 344cadc5
      Niklas Söderlund authored
      The code has grown organically and a lot of checks are performed for
      the CSI-2 use-case even if the link notify is for a subdevice connected
      to the parallel interface.
      
      Before reworking the CSI-2 routing logic split the CSI-2 and parallel
      link notify code in two separate blocks to make it clearer. There is no
      functional change.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Tested-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      344cadc5
  2. 17 Feb, 2022 19 commits
  3. 16 Feb, 2022 4 commits
  4. 08 Feb, 2022 10 commits