1. 09 Apr, 2021 29 commits
  2. 08 Apr, 2021 2 commits
    • Mauro Carvalho Chehab's avatar
      media: venus: don't de-reference NULL pointers at IRQ time · 686ee9b6
      Mauro Carvalho Chehab authored
      Smatch is warning that:
      	drivers/media/platform/qcom/venus/hfi_venus.c:1100 venus_isr() warn: variable dereferenced before check 'hdev' (see line 1097)
      
      The logic basically does:
      	hdev = to_hfi_priv(core);
      
      with is translated to:
      	hdev = core->priv;
      
      If the IRQ code can receive a NULL pointer for hdev, there's
      a bug there, as it will first try to de-reference the pointer,
      and then check if it is null.
      
      After looking at the code, it seems that this indeed can happen:
      Basically, the venus IRQ thread is started with:
      	devm_request_threaded_irq()
      So, it will only be freed after the driver unbinds.
      
      In order to prevent the IRQ code to work with freed data,
      the logic at venus_hfi_destroy() sets core->priv to NULL,
      which would make the IRQ code to ignore any pending IRQs.
      
      There is, however a race condition, as core->priv is set
      to NULL only after being freed. So, we need also to move the
      core->priv = NULL to happen earlier.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      686ee9b6
    • Mauro Carvalho Chehab's avatar
      media: venus: use NULL instead of zero for pointers · b6f13994
      Mauro Carvalho Chehab authored
      As reported by sparse:
      
      	drivers/media/platform/qcom/venus/core.c:227:41: warning: Using plain integer as NULL pointer
      	drivers/media/platform/qcom/venus/core.c:228:34: warning: Using plain integer as NULL pointer
      
      Two vars are using zero instead of NULL for pointers. Not really
      an issue, but using NULL makes it clearer that the init data is
      expecting a pointer.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b6f13994
  3. 07 Apr, 2021 2 commits
  4. 06 Apr, 2021 7 commits
    • Sylwester Nawrocki's avatar
      media: s5p-mfc: Fix kernel-doc entries in s5p_mfc_common.h · 7acc54ed
      Sylwester Nawrocki authored
      Fixes scripts/kernel-doc warnings:
      
      s5p_mfc_common.h:343: warning: Function parameter or member 'fw_buf' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_size' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_base' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_bitmap' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_virt' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'dma_base' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'watchdog_timer' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'fw_get_done' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'risc_on' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:714: warning: Function parameter or member 'src_bufs_cnt' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'dst_bufs_cnt' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'pb_count' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'force_frame_type' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'slice_mode' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'slice_size' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'frame_tag' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'scratch_buf_size' not described in 's5p_mfc_ctx'
      Reported-by: default avatarHans verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      7acc54ed
    • Sylwester Nawrocki's avatar
      media: exynos4-is: Fix kernel-doc entries in fimc-is.h · 08874fdd
      Sylwester Nawrocki authored
      Fixes scripts/kernel-doc warnings:
      
      fimc-is.h:286: warning: Function parameter or member 'fw' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'memory' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'f_w' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'isp' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'sensor' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'setfile' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'ctrl_handler' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'irq' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'sensor_index' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'i2h_cmd' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'h2i_cmd' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'fd_header' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'config' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'config_index' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_p_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_dma_p_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_shared_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'af' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'debugfs_entry' not described in 'fimc_is'
      
      The f_w field is unused so remove it.
      Reported-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      08874fdd
    • Hans Verkuil's avatar
      media: adv7511-v4l2: correctly report EDIDs of 1 block · b24bc3ab
      Hans Verkuil authored
      If the EDID has an odd number of blocks (usually just 1, but the
      same problem occurs with 3 blocks), then VIDIOC_G_EDID reported 2
      (or 4) blocks. Fix this.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b24bc3ab
    • Hans Verkuil's avatar
      media: adv7604: support EDIDs up to 4 blocks · c730ff32
      Hans Verkuil authored
      While the adv7604/11/12 hardware supported EDIDs up to 4 blocks, the
      driver didn't. This patch adds support for this. It also improves support
      for EDIDs that do not have a Source Physical Address: in that case the
      spa location is set to the first byte of the second block, and the
      'physical address' is just the two bytes at that location. This is per
      the suggestion in the adv76xx documentation for such EDIDs.
      
      Tested with an adv7604 and adv7612.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c730ff32
    • Hans Verkuil's avatar
      media: adv7604: fix HPD support for adv7611/12 · 1cf233d8
      Hans Verkuil authored
      For the adv7604 the hotplug detect pin is controlled through gpio pins from
      the SoC, but the adv7611 and adv7612 control the hotplug detect pin
      themselves.
      
      But the driver had no support for this, so the HPD was always high, even
      when changing the EDID. Add proper support for this to the driver.
      
      Tested with an adv7612.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      1cf233d8
    • Daniel Almeida's avatar
      media: rkvdec: Do not require all controls to be present in every request · 54676d5f
      Daniel Almeida authored
      According to the v4l2 api, it is allowed to skip
      setting a control if its contents haven't changed for performance
      reasons: userspace should only update the controls that changed from
      last frame rather then updating them all. Still some ancient code
      that checks for mandatory controls has been left in this driver.
      
      Remove it.
      
      Fixes: cd33c830 ("media: rkvdec: Add the rkvdec driver")
      Signed-off-by: default avatarDaniel Almeida <daniel.almeida@collabora.com>
      Reviewed-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      54676d5f
    • Geert Uytterhoeven's avatar
      media: VIDEO_IMX8_JPEG should depend on ARCH_MXC and not default to m · 4cd15d84
      Geert Uytterhoeven authored
      The i.MX8 QXP/QM integrated JPEG encoder/decoder is only present on
      Freescale/NXP i.MX8 QXP and QM SoCs.  Hence add a dependency on
      ARCH_MXC, to prevent asking the user about this driver when configuring
      a kernel without i.MX8 support.
      
      Drop the "default m" (which means "default y" if CONFIG_MODULES is not
      enabled), as merely enabling CONFIG_COMPILE_TEST should not enable
      additional code.
      
      Fixes: 2db16c6e ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      4cd15d84