All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/14] CSI2RX support on J721E
@ 2022-01-21 14:28 Pratyush Yadav
  2022-01-21 14:28 ` [PATCH v6 01/14] media: cadence: csi2rx: Unregister v4l2 async notifier Pratyush Yadav
                   ` (14 more replies)
  0 siblings, 15 replies; 24+ messages in thread
From: Pratyush Yadav @ 2022-01-21 14:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Pratyush Yadav, Laurent Pinchart, Nikhil Devshatwar,
	Tomi Valkeinen, Benoit Parrot, Maxime Ripard, Rob Herring,
	Sakari Ailus, Niklas Söderlund, devicetree, linux-kernel,
	linux-media

Hi,

This series adds support for CSI2 capture on J721E. It includes some
fixes to the Cadence CSI2RX driver, re-structures the TI platform
drivers, and finally adds the TI CSI2RX wrapper driver.

This series used to include the DPHY and DMA engine patches as well, but
they have been split off to facilitate easier merging.

Tested on TI's J721E with OV5640 sensor.

The branch with all the patches needed to enable testing (dts nodes,
OV5640 dropped patch, etc.) can be found here at
https://github.com/prati0100/linux-next/ branch "capture".

Changes in v6:
- Move the lock around the dereference for framefmt in
  csi2rx_{get,set}_fmt() instead of when we get the pointer.
- Do not return an error when an unsupported format is set. Instead
  adjust the code to the first format in the list.
- Drop variable bpp and use fmt->bpp directly.
- Drop variable got_pm. Call phy_pm_runtime_put() unconditionally since
  it will just return an error if runtime PM is not enabled.
- Drop transcoding from the commit message.
- Make csi2rx_media_ops const.

Changes in v5:
- Cleanup notifier in csi2rx_parse_dt() after the call to
  v4l2_async_nf_add_fwnode_remote().
- Use YUV 1X16 formats instead of 2X8.
- Only error out when phy_pm_runtime_get_sync() returns a negative
  value. A positive value can be returned if the phy was already
  resumed.
- Do not query the source subdev for format. Use the newly added
  internal format instead.
- Make i unsigned.
- Change %d to %u
- Add dependency on PHY_CADENCE_DPHY_RX instead of PHY_CADENCE_DPHY
  since the Rx mode DPHY now has a separate driver.
- Drop ti_csi2rx_validate_pipeline(). Pipeline validation should be done
  at media_pipeline_start().
- Do not assign flags.
- Fix error handling in ti_csi2rx_start_streaming(). Free up vb2 buffers
  when media_pipeline_start() fails.
- Move clock description in comments under the clocks property.
- Make ports required.
- Add link validation to cdns-csi2rx driver.

Changes in v4:
- Drop the call to set PHY submode. It is now being done via compatible
  on the DPHY side.
- Acquire the media device's graph_mutex before starting the graph walk.
- Call media_graph_walk_init() and media_graph_walk_cleanup() when
  starting and ending the graph walk respectively.
- Reduce max frame height and width in enum_framesizes. Currently they
  are set to UINT_MAX but they must be a multiple of step_width, so they
  need to be rounded down. Also, these values are absurdly large which
  causes some userspace applications like gstreamer to trip up. While it
  is not generally right to change the kernel for an application bug, it
  is not such a big deal here. This change is replacing one set of
  absurdly large arbitrary values with another set of smaller but still
  absurdly large arbitrary values. Both limits are unlikely to be hit in
  practice.
- Add power-domains property.
- Drop maxItems from clock-names.
- Drop the type for data-lanes.
- Drop uniqueItems from data-lanes. Move it to video-interfaces.yaml
  instead.
- Drop OV5640 runtime pm patch. It seems to be a bit complicated and it
  is not exactly necessary for this series. Any CSI-2 camera will work
  just fine, OV5640 just happens to be the one I tested with. I don't
  want it to block this series. I will submit it as a separate patch
  later.

Changes in v3:
- Use v4l2_get_link_freq() to calculate pixel clock.
- Move DMA related fields in struct ti_csi2rx_dma.
- Protect DMA buffer queue with a spinlock to make sure the queue buffer
  and DMA callback don't race on it.
- Track the current DMA state. It might go idle because of a lack of
  buffers. This state can be used to restart it if needed.
- Do not include the current buffer in the pending queue. It is slightly
  better modelling than leaving it at the head of the pending queue.
- Use the buffer as the callback argument, and add a reference to csi in it.
- If queueing a buffer to DMA fails, the buffer gets leaked and DMA gets
  stalled with. Instead, report the error to vb2 and queue the next
  buffer in the pending queue.
- DMA gets stalled if we run out of buffers since the callback is the
  only one that fires subsequent transfers and it is no longer being
  called. Check for that when queueing buffers and restart DMA if
  needed.
- Do not put of node until we are done using the fwnode.
- Set inital format to UYVY 640x480.
- Add compatible: contains: const: cdns,csi2rx to allow SoC specific
  compatible.
- Add more constraints for data-lanes property.

Changes in v2:
- Use phy_pm_runtime_get_sync() and phy_pm_runtime_put() before making
  calls to set PHY mode, etc. to make sure it is ready.
- Use dmaengine_get_dma_device() instead of directly accessing
  dma->device->dev.
- Do not set dst_addr_width when configuring slave DMA.
- Move to a separate subdir and rename to j721e-csi2rx.c
- Convert compatible to ti,j721e-csi2rx.
- Move to use Media Controller centric APIs.
- Improve cleanup in probe when one of the steps fails.
- Add colorspace to formats database.
- Set hw_revision on media_device.
- Move video device initialization to probe time instead of register time.
- Rename to ti,j721e-csi2rx.yaml
- Add an entry in MAINTAINERS.
- Add a description for the binding.
- Change compatible to ti,j721e-csi2rx to make it SoC specific.
- Remove description from dmas, reg, power-domains.
- Remove a limit of 2 from #address-cells and #size-cells.
- Fix add ^ to csi-bridge subnode regex.
- Make ranges mandatory.
- Add unit address in example.
- Add a reference to cdns,csi2rx in csi-bridge subnode.
- Expand the example to include the csi-bridge subnode as well.
- Re-order subject prefixes.
- Convert OV5640 to use runtime PM and drop Cadence CSI2RX s_power patch.
- Drop subdev call wrappers from cdns-csi2rx.
- Move VPE and CAL to a separate subdir.
- Rename ti-csi2rx.c to j721e-csi2rx.c

Pratyush Yadav (14):
  media: cadence: csi2rx: Unregister v4l2 async notifier
  media: cadence: csi2rx: Cleanup media entity properly
  media: cadence: csi2rx: Add get_fmt and set_fmt pad ops
  media: cadence: csi2rx: Add external DPHY support
  media: cadence: csi2rx: Soft reset the streams before starting capture
  media: cadence: csi2rx: Set the STOP bit when stopping a stream
  media: cadence: csi2rx: Fix stream data configuration
  media: cadence: csi2rx: Populate subdev devnode
  media: cadence: csi2rx: Add link validation
  media: Re-structure TI platform drivers
  media: ti: Add CSI2RX support for J721E
  media: dt-bindings: Make sure items in data-lanes are unique
  media: dt-bindings: Add DT bindings for TI J721E CSI2RX driver
  media: dt-bindings: Convert Cadence CSI2RX binding to YAML

 .../devicetree/bindings/media/cdns,csi2rx.txt | 100 --
 .../bindings/media/cdns,csi2rx.yaml           | 176 ++++
 .../bindings/media/ti,j721e-csi2rx.yaml       | 101 ++
 .../bindings/media/video-interfaces.yaml      |   1 +
 MAINTAINERS                                   |  10 +-
 drivers/media/platform/Kconfig                |  12 +
 drivers/media/platform/Makefile               |   2 +-
 drivers/media/platform/cadence/cdns-csi2rx.c  | 274 +++++-
 drivers/media/platform/ti/Makefile            |   4 +
 drivers/media/platform/ti/cal/Makefile        |   3 +
 .../{ti-vpe => ti/cal}/cal-camerarx.c         |   0
 .../platform/{ti-vpe => ti/cal}/cal-video.c   |   0
 .../media/platform/{ti-vpe => ti/cal}/cal.c   |   0
 .../media/platform/{ti-vpe => ti/cal}/cal.h   |   0
 .../platform/{ti-vpe => ti/cal}/cal_regs.h    |   0
 .../media/platform/ti/j721e-csi2rx/Makefile   |   2 +
 .../platform/ti/j721e-csi2rx/j721e-csi2rx.c   | 913 ++++++++++++++++++
 .../platform/{ti-vpe => ti/vpe}/Makefile      |   4 -
 .../media/platform/{ti-vpe => ti/vpe}/csc.c   |   0
 .../media/platform/{ti-vpe => ti/vpe}/csc.h   |   0
 .../media/platform/{ti-vpe => ti/vpe}/sc.c    |   0
 .../media/platform/{ti-vpe => ti/vpe}/sc.h    |   0
 .../platform/{ti-vpe => ti/vpe}/sc_coeff.h    |   0
 .../media/platform/{ti-vpe => ti/vpe}/vpdma.c |   0
 .../media/platform/{ti-vpe => ti/vpe}/vpdma.h |   0
 .../platform/{ti-vpe => ti/vpe}/vpdma_priv.h  |   0
 .../media/platform/{ti-vpe => ti/vpe}/vpe.c   |   0
 .../platform/{ti-vpe => ti/vpe}/vpe_regs.h    |   0
 28 files changed, 1481 insertions(+), 121 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/media/cdns,csi2rx.txt
 create mode 100644 Documentation/devicetree/bindings/media/cdns,csi2rx.yaml
 create mode 100644 Documentation/devicetree/bindings/media/ti,j721e-csi2rx.yaml
 create mode 100644 drivers/media/platform/ti/Makefile
 create mode 100644 drivers/media/platform/ti/cal/Makefile
 rename drivers/media/platform/{ti-vpe => ti/cal}/cal-camerarx.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/cal}/cal-video.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/cal}/cal.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/cal}/cal.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/cal}/cal_regs.h (100%)
 create mode 100644 drivers/media/platform/ti/j721e-csi2rx/Makefile
 create mode 100644 drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
 rename drivers/media/platform/{ti-vpe => ti/vpe}/Makefile (78%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/csc.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/csc.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/sc.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/sc.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/sc_coeff.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/vpdma.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/vpdma.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/vpdma_priv.h (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/vpe.c (100%)
 rename drivers/media/platform/{ti-vpe => ti/vpe}/vpe_regs.h (100%)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH v6 10/14] media: Re-structure TI platform drivers
@ 2022-01-29 12:37 kernel test robot
  0 siblings, 0 replies; 24+ messages in thread
From: kernel test robot @ 2022-01-29 12:37 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 22615 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220121142904.4091481-11-p.yadav@ti.com>
References: <20220121142904.4091481-11-p.yadav@ti.com>
TO: Pratyush Yadav <p.yadav@ti.com>

Hi Pratyush,

I love your patch! Perhaps something to improve:

[auto build test WARNING on media-tree/master]
[also build test WARNING on robh/for-next linus/master v5.17-rc1 next-20220128]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Pratyush-Yadav/CSI2RX-support-on-J721E/20220121-223208
base:   git://linuxtv.org/media_tree.git master
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: riscv-randconfig-c006-20220125 (https://download.01.org/0day-ci/archive/20220129/202201292035.IqhSdC31-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f32dccb9a43b02ce4e540d6ba5dbbdb188f2dc7d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/3e49ebcb767893f74b04baf777762343d75d36b4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Pratyush-Yadav/CSI2RX-support-on-J721E/20220121-223208
        git checkout 3e49ebcb767893f74b04baf777762343d75d36b4
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   drivers/media/dvb-frontends/bcm3510.c:818:7: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [clang-analyzer-deadcode.DeadStores]
           if ((ret = bcm3510_readB(state,0xe0,&v)) < 0)
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/bcm3510.c:818:7: note: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
           if ((ret = bcm3510_readB(state,0xe0,&v)) < 0)
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   drivers/media/dvb-frontends/cx24123.c:518:2: warning: Value stored to 'vco_div' is never read [clang-analyzer-deadcode.DeadStores]
           vco_div = cx24123_bandselect_vals[0].VCOdivider;
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/cx24123.c:518:2: note: Value stored to 'vco_div' is never read
           vco_div = cx24123_bandselect_vals[0].VCOdivider;
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:73:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_clk_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:73:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:77:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_data_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:77:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:92:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_clk_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:92:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:96:2: warning: Value stored to 'temp' is never read [clang-analyzer-deadcode.DeadStores]
           temp = RREG32(rec->mask_data_reg);
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:96:2: note: Value stored to 'temp' is never read
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:312:3: warning: 4th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
                   ^
   include/drm/drm_print.h:526:2: note: expanded from macro 'DRM_DEBUG'
           __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:371:2: note: 'val' declared without an initial value
           u8 val;
           ^~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:373:6: note: Assuming field 'cd_valid' is true
           if (!amdgpu_connector->router.cd_valid)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:373:2: note: Taking false branch
           if (!amdgpu_connector->router.cd_valid)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:376:6: note: Assuming field 'router_bus' is non-null
           if (!amdgpu_connector->router_bus)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:376:2: note: Taking false branch
           if (!amdgpu_connector->router_bus)
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:379:2: note: Calling 'amdgpu_i2c_get_byte'
           amdgpu_i2c_get_byte(amdgpu_connector->router_bus,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:308:6: note: Assuming the condition is false
           if (i2c_transfer(&i2c_bus->adapter, msgs, 2) == 2) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:308:2: note: Taking false branch
           if (i2c_transfer(&i2c_bus->adapter, msgs, 2) == 2) {
           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c:312:3: note: 4th function call argument is an uninitialized value
                   DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
                   ^
   include/drm/drm_print.h:526:2: note: expanded from macro 'DRM_DEBUG'
           __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__)
           ^                             ~~~~~~~~~~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
>> drivers/media/platform/ti/cal/cal-video.c:213:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = 0;
           ^     ~
   drivers/media/platform/ti/cal/cal-video.c:213:2: note: Value stored to 'ret' is never read
           ret = 0;
           ^     ~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/media/platform/ti/vpe/vpe.c:2589:2: warning: Value stored to 'func' is never read [clang-analyzer-deadcode.DeadStores]
           func = read_field_reg(dev, VPE_PID, VPE_PID_FUNC_MASK,
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:2589:2: note: Value stored to 'func' is never read
           func = read_field_reg(dev, VPE_PID, VPE_PID_FUNC_MASK,
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/log2.h:57:13: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           return 1UL << fls_long(n - 1);
                      ^
   drivers/media/platform/ti/vpe/vpe.c:1788:8: note: Calling 'vpe_try_fmt'
           ret = vpe_try_fmt(file, priv, f);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:166:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE         \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OVERLAY
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:167:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY               \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:168:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY        \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VBI_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:169:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VBI_OUTPUT                  \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:170:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT           \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_SDR_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:171:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_SDR_OUTPUT                  \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))

vim +/ret +213 drivers/media/platform/ti/cal/cal-video.c

9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  191  
e6a800d63a1239 drivers/media/platform/ti-vpe/cal-video.c Tomi Valkeinen   2021-06-14  192  static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv,
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  193  				      struct v4l2_format *f)
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  194  {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  195  	struct cal_ctx *ctx = video_drvdata(file);
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  196  	const struct cal_format_info *fmtinfo;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  197  	struct v4l2_subdev_frame_size_enum fse;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  198  	int ret, found;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  199  
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  200  	fmtinfo = find_format_by_pix(ctx, f->fmt.pix.pixelformat);
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  201  	if (!fmtinfo) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  202  		ctx_dbg(3, ctx, "Fourcc format (0x%08x) not found.\n",
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  203  			f->fmt.pix.pixelformat);
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  204  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  205  		/* Just get the first one enumerated */
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  206  		fmtinfo = ctx->active_fmt[0];
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  207  		f->fmt.pix.pixelformat = fmtinfo->fourcc;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  208  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  209  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  210  	f->fmt.pix.field = ctx->v_fmt.fmt.pix.field;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  211  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  212  	/* check for/find a valid width/height */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06 @213  	ret = 0;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  214  	found = false;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  215  	fse.pad = 0;
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  216  	fse.code = fmtinfo->code;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  217  	fse.which = V4L2_SUBDEV_FORMAT_ACTIVE;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  218  	for (fse.index = 0; ; fse.index++) {
27f86b9bff79e1 drivers/media/platform/ti-vpe/cal-video.c Tomi Valkeinen   2021-06-14  219  		ret = v4l2_subdev_call(ctx->phy->source, pad, enum_frame_size,
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  220  				       NULL, &fse);
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  221  		if (ret)
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  222  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  223  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  224  		if ((f->fmt.pix.width == fse.max_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  225  		    (f->fmt.pix.height == fse.max_height)) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  226  			found = true;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  227  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  228  		} else if ((f->fmt.pix.width >= fse.min_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  229  			 (f->fmt.pix.width <= fse.max_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  230  			 (f->fmt.pix.height >= fse.min_height) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  231  			 (f->fmt.pix.height <= fse.max_height)) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  232  			found = true;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  233  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  234  		}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  235  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  236  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  237  	if (!found) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  238  		/* use existing values as default */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  239  		f->fmt.pix.width = ctx->v_fmt.fmt.pix.width;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  240  		f->fmt.pix.height =  ctx->v_fmt.fmt.pix.height;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  241  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  242  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  243  	/*
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  244  	 * Use current colorspace for now, it will get
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  245  	 * updated properly during s_fmt
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  246  	 */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  247  	f->fmt.pix.colorspace = ctx->v_fmt.fmt.pix.colorspace;
455466400c4164 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  248  	cal_calc_format_size(ctx, fmtinfo, f);
455466400c4164 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  249  	return 0;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  250  }
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  251  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH v6 10/14] media: Re-structure TI platform drivers
@ 2022-01-30 22:28 kernel test robot
  0 siblings, 0 replies; 24+ messages in thread
From: kernel test robot @ 2022-01-30 22:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 20809 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220121142904.4091481-11-p.yadav@ti.com>
References: <20220121142904.4091481-11-p.yadav@ti.com>
TO: Pratyush Yadav <p.yadav@ti.com>

Hi Pratyush,

I love your patch! Perhaps something to improve:

[auto build test WARNING on media-tree/master]
[also build test WARNING on robh/for-next linus/master v5.17-rc1 next-20220128]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Pratyush-Yadav/CSI2RX-support-on-J721E/20220121-223208
base:   git://linuxtv.org/media_tree.git master
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: riscv-randconfig-c006-20220125 (https://download.01.org/0day-ci/archive/20220131/202201310557.YHxquGd1-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f32dccb9a43b02ce4e540d6ba5dbbdb188f2dc7d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/3e49ebcb767893f74b04baf777762343d75d36b4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Pratyush-Yadav/CSI2RX-support-on-J721E/20220121-223208
        git checkout 3e49ebcb767893f74b04baf777762343d75d36b4
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/mux/mmio.c:47:2: note: Taking false branch
           if (of_device_is_compatible(np, "mmio-mux"))
           ^
   drivers/mux/mmio.c:50:12: note: '?' condition is true
                   regmap = dev_get_regmap(dev->parent, NULL) ?: ERR_PTR(-ENODEV);
                            ^
   drivers/mux/mmio.c:51:6: note: Calling 'IS_ERR'
           if (IS_ERR(regmap)) {
               ^~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mux/mmio.c:51:6: note: Returning from 'IS_ERR'
           if (IS_ERR(regmap)) {
               ^~~~~~~~~~~~~~
   drivers/mux/mmio.c:51:2: note: Taking false branch
           if (IS_ERR(regmap)) {
           ^
   drivers/mux/mmio.c:58:6: note: Assuming 'ret' is not equal to 0
           if (ret == 0 || ret % 2)
               ^~~~~~~~
   drivers/mux/mmio.c:58:6: note: Left side of '||' is false
   drivers/mux/mmio.c:58:18: note: Assuming the condition is false
           if (ret == 0 || ret % 2)
                           ^~~~~~~
   drivers/mux/mmio.c:58:2: note: Taking false branch
           if (ret == 0 || ret % 2)
           ^
   drivers/mux/mmio.c:60:6: note: Assuming 'ret' is >= 0
           if (ret < 0) {
               ^~~~~~~
   drivers/mux/mmio.c:60:2: note: Taking false branch
           if (ret < 0) {
           ^
   drivers/mux/mmio.c:69:6: note: Calling 'IS_ERR'
           if (IS_ERR(mux_chip))
               ^~~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mux/mmio.c:69:6: note: Returning from 'IS_ERR'
           if (IS_ERR(mux_chip))
               ^~~~~~~~~~~~~~~~
   drivers/mux/mmio.c:69:2: note: Taking false branch
           if (IS_ERR(mux_chip))
           ^
   drivers/mux/mmio.c:74:14: note: Assuming 'i' is < 'num_fields'
           for (i = 0; i < num_fields; i++) {
                       ^~~~~~~~~~~~~~
   drivers/mux/mmio.c:74:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < num_fields; i++) {
           ^
   drivers/mux/mmio.c:76:3: note: 'field' initialized here
                   struct reg_field field;
                   ^~~~~~~~~~~~~~~~~~~~~~
   drivers/mux/mmio.c:83:7: note: Assuming 'ret' is 0
                   if (!ret)
                       ^~~~
   drivers/mux/mmio.c:83:3: note: Taking true branch
                   if (!ret)
                   ^
   drivers/mux/mmio.c:86:7: note: Assuming 'ret' is >= 0
                   if (ret < 0) {
                       ^~~~~~~
   drivers/mux/mmio.c:86:3: note: Taking false branch
                   if (ret < 0) {
                   ^
   drivers/mux/mmio.c:96:7: note: Assuming the condition is false
                   if (mask != GENMASK(field.msb, field.lsb)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mux/mmio.c:96:3: note: Taking false branch
                   if (mask != GENMASK(field.msb, field.lsb)) {
                   ^
   drivers/mux/mmio.c:102:15: note: Passed-by-value struct argument contains uninitialized data (e.g., field: 'id_size')
                   fields[i] = devm_regmap_field_alloc(dev, regmap, field);
                               ^                                    ~~~~~
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
>> drivers/media/platform/ti/cal/cal-video.c:213:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = 0;
           ^     ~
   drivers/media/platform/ti/cal/cal-video.c:213:2: note: Value stored to 'ret' is never read
           ret = 0;
           ^     ~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/media/platform/ti/vpe/vpe.c:2589:2: warning: Value stored to 'func' is never read [clang-analyzer-deadcode.DeadStores]
           func = read_field_reg(dev, VPE_PID, VPE_PID_FUNC_MASK,
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:2589:2: note: Value stored to 'func' is never read
           func = read_field_reg(dev, VPE_PID, VPE_PID_FUNC_MASK,
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/log2.h:57:13: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           return 1UL << fls_long(n - 1);
                      ^
   drivers/media/platform/ti/vpe/vpe.c:1788:8: note: Calling 'vpe_try_fmt'
           ret = vpe_try_fmt(file, priv, f);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:166:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE         \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OVERLAY
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:167:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY               \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:168:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY        \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_VBI_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:169:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_VBI_OUTPUT                  \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:170:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT           \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:165:3: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
           ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
            ^
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Assuming field 'type' is not equal to V4L2_BUF_TYPE_SDR_OUTPUT
           if (V4L2_TYPE_IS_OUTPUT(f->type))
               ^
   include/uapi/linux/videodev2.h:171:6: note: expanded from macro 'V4L2_TYPE_IS_OUTPUT'
            || (type) == V4L2_BUF_TYPE_SDR_OUTPUT                  \
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/ti/vpe/vpe.c:1725:6: note: Left side of '||' is false
           if (V4L2_TYPE_IS_OUTPUT(f->type))

vim +/ret +213 drivers/media/platform/ti/cal/cal-video.c

9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  191  
e6a800d63a1239 drivers/media/platform/ti-vpe/cal-video.c Tomi Valkeinen   2021-06-14  192  static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv,
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  193  				      struct v4l2_format *f)
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  194  {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  195  	struct cal_ctx *ctx = video_drvdata(file);
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  196  	const struct cal_format_info *fmtinfo;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  197  	struct v4l2_subdev_frame_size_enum fse;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  198  	int ret, found;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  199  
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  200  	fmtinfo = find_format_by_pix(ctx, f->fmt.pix.pixelformat);
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  201  	if (!fmtinfo) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  202  		ctx_dbg(3, ctx, "Fourcc format (0x%08x) not found.\n",
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  203  			f->fmt.pix.pixelformat);
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  204  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  205  		/* Just get the first one enumerated */
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  206  		fmtinfo = ctx->active_fmt[0];
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  207  		f->fmt.pix.pixelformat = fmtinfo->fourcc;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  208  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  209  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  210  	f->fmt.pix.field = ctx->v_fmt.fmt.pix.field;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  211  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  212  	/* check for/find a valid width/height */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06 @213  	ret = 0;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  214  	found = false;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  215  	fse.pad = 0;
51e8c97df58fcf drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  216  	fse.code = fmtinfo->code;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  217  	fse.which = V4L2_SUBDEV_FORMAT_ACTIVE;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  218  	for (fse.index = 0; ; fse.index++) {
27f86b9bff79e1 drivers/media/platform/ti-vpe/cal-video.c Tomi Valkeinen   2021-06-14  219  		ret = v4l2_subdev_call(ctx->phy->source, pad, enum_frame_size,
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  220  				       NULL, &fse);
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  221  		if (ret)
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  222  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  223  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  224  		if ((f->fmt.pix.width == fse.max_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  225  		    (f->fmt.pix.height == fse.max_height)) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  226  			found = true;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  227  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  228  		} else if ((f->fmt.pix.width >= fse.min_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  229  			 (f->fmt.pix.width <= fse.max_width) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  230  			 (f->fmt.pix.height >= fse.min_height) &&
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  231  			 (f->fmt.pix.height <= fse.max_height)) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  232  			found = true;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  233  			break;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  234  		}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  235  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  236  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  237  	if (!found) {
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  238  		/* use existing values as default */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  239  		f->fmt.pix.width = ctx->v_fmt.fmt.pix.width;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  240  		f->fmt.pix.height =  ctx->v_fmt.fmt.pix.height;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  241  	}
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  242  
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  243  	/*
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  244  	 * Use current colorspace for now, it will get
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  245  	 * updated properly during s_fmt
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  246  	 */
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  247  	f->fmt.pix.colorspace = ctx->v_fmt.fmt.pix.colorspace;
455466400c4164 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  248  	cal_calc_format_size(ctx, fmtinfo, f);
455466400c4164 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-12-07  249  	return 0;
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  250  }
9d551891473e35 drivers/media/platform/ti-vpe/cal-video.c Laurent Pinchart 2020-07-06  251  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-03-14 12:26 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 14:28 [PATCH v6 00/14] CSI2RX support on J721E Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 01/14] media: cadence: csi2rx: Unregister v4l2 async notifier Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 02/14] media: cadence: csi2rx: Cleanup media entity properly Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 03/14] media: cadence: csi2rx: Add get_fmt and set_fmt pad ops Pratyush Yadav
2022-01-23 15:13   ` Laurent Pinchart
2022-01-21 14:28 ` [PATCH v6 04/14] media: cadence: csi2rx: Add external DPHY support Pratyush Yadav
2022-01-28  4:29   ` kernel test robot
2022-01-21 14:28 ` [PATCH v6 05/14] media: cadence: csi2rx: Soft reset the streams before starting capture Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 06/14] media: cadence: csi2rx: Set the STOP bit when stopping a stream Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 07/14] media: cadence: csi2rx: Fix stream data configuration Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 08/14] media: cadence: csi2rx: Populate subdev devnode Pratyush Yadav
2022-01-21 14:28 ` [PATCH v6 09/14] media: cadence: csi2rx: Add link validation Pratyush Yadav
2022-01-21 14:29 ` [PATCH v6 10/14] media: Re-structure TI platform drivers Pratyush Yadav
2022-01-21 14:29 ` [PATCH v6 11/14] media: ti: Add CSI2RX support for J721E Pratyush Yadav
2022-01-23 18:25   ` Laurent Pinchart
2022-05-11  9:54     ` Pratyush Yadav
2022-01-24  9:00   ` Sakari Ailus
2022-01-21 14:29 ` [PATCH v6 12/14] media: dt-bindings: Make sure items in data-lanes are unique Pratyush Yadav
2022-01-21 14:29 ` [PATCH v6 13/14] media: dt-bindings: Add DT bindings for TI J721E CSI2RX driver Pratyush Yadav
2022-01-21 14:29 ` [PATCH v6 14/14] media: dt-bindings: Convert Cadence CSI2RX binding to YAML Pratyush Yadav
2022-11-09 16:57 ` [PATCH v6 00/14] CSI2RX support on J721E Martyn Welch
2023-03-14 12:19   ` Vaishnav Achath
2022-01-29 12:37 [PATCH v6 10/14] media: Re-structure TI platform drivers kernel test robot
2022-01-30 22:28 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.