1. 14 Jan, 2021 13 commits
  2. 13 Jan, 2021 20 commits
  3. 12 Jan, 2021 7 commits
    • Alexandre Courbot's avatar
      media: venus: preserve DRC state across seeks · d5ee32d7
      Alexandre Courbot authored
      DRC events can happen virtually at anytime, including when we are
      starting a seek. Should this happen, we must make sure to return to the
      DRC state, otherwise the firmware will expect buffers of the new
      resolution whereas userspace will still work with the old one.
      
      Returning to the DRC state upon resume for seeking makes sure that the
      client will get the DRC event and will reallocate the buffers to fit the
      firmware's expectations.
      Signed-off-by: default avatarAlexandre Courbot <acourbot@chromium.org>
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      d5ee32d7
    • Stanimir Varbanov's avatar
      media: venus: helpers: Lock outside of buffer queue helper · 21560ddf
      Stanimir Varbanov authored
      After adding more logic in vdec buf_queue vb2 op it is not
      practical to have two lock/unlock for one decoder buf_queue.
      So move the instance lock in encoder and decoder vb2 buf_queue
      operations.
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      21560ddf
    • Stanimir Varbanov's avatar
      media: venus: vdec: Make decoder return LAST flag for sufficient event · a4ca67af
      Stanimir Varbanov authored
      This makes the decoder to behaives equally for sufficient and
      insufficient events. After this change the LAST buffer flag will be set
      when the new resolution (in dynamic-resolution-change state) is smaller
      then the old bitstream resolution.
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      a4ca67af
    • Stanimir Varbanov's avatar
      media: venus: vdec: Fix non reliable setting of LAST flag · acf8a57d
      Stanimir Varbanov authored
      In real use of dynamic-resolution-change it is observed that the
      LAST buffer flag (which marks the last decoded buffer with the
      resolution before the resolution-change event) is not reliably set.
      
      Fix this by set the LAST buffer flag on next queued capture buffer
      after the resolution-change event.
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      acf8a57d
    • Alexandre Courbot's avatar
      media: venus: use contig vb2 ops · cc82fd69
      Alexandre Courbot authored
      This driver uses the SG vb2 ops, but effectively only ever accesses the
      first entry of the SG table, indicating that it expects a flat layout.
      Switch it to use the contiguous ops to make sure this expected invariant
      is always enforced. Since the device is supposed to be behind an IOMMU
      this should have little to none practical consequences beyond making the
      driver not rely on a particular behavior of the SG implementation.
      Reported-by: default avatarTomasz Figa <tfiga@chromium.org>
      Signed-off-by: default avatarAlexandre Courbot <acourbot@chromium.org>
      Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      cc82fd69
    • Zhang Changzhong's avatar
      media: aspeed: fix error return code in aspeed_video_setup_video() · d497fcda
      Zhang Changzhong authored
      Fix to return a negative error code from the error handling
      case instead of 0, as done elsewhere in this function.
      
      Fixes: d2b4387f ("media: platform: Add Aspeed Video Engine driver")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      d497fcda
    • Matwey V. Kornilov's avatar
      media: pwc: Use correct device for DMA · 69c9e825
      Matwey V. Kornilov authored
      This fixes the following newly introduced warning:
      
      [   15.518253] ------------[ cut here ]------------
      [   15.518941] WARNING: CPU: 0 PID: 246 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x1a8/0x1d0
      [   15.520634] Modules linked in: pwc videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc efivarfs
      [   15.522335] CPU: 0 PID: 246 Comm: v4l2-test Not tainted 5.11.0-rc1+ #1
      [   15.523281] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      [   15.524438] RIP: 0010:dma_map_page_attrs+0x1a8/0x1d0
      [   15.525135] Code: 10 5b 5d 41 5c 41 5d c3 4d 89 d0 eb d7 4d 89 c8 89 e9 48 89 da e8 68 29 00 00 eb d1 48 89 f2 48 2b 50 18 48 89 d0 eb 83 0f 0b <0f> 0b 48 c7 c0 ff ff ff ff eb b8 48 89 d9 48 8b 40 40 e8 61 69 d2
      [   15.527938] RSP: 0018:ffffa2694047bca8 EFLAGS: 00010246
      [   15.528716] RAX: 0000000000000000 RBX: 0000000000002580 RCX: 0000000000000000
      [   15.529782] RDX: 0000000000000000 RSI: ffffcdce000ecc00 RDI: ffffa0b4bdb888a0
      [   15.530849] RBP: 0000000000000002 R08: 0000000000000002 R09: 0000000000000000
      [   15.531881] R10: 0000000000000004 R11: 000000000002d8c0 R12: 0000000000000000
      [   15.532911] R13: ffffa0b4bdb88800 R14: ffffa0b483820000 R15: ffffa0b4bdb888a0
      [   15.533942] FS:  00007fc5fbb5e4c0(0000) GS:ffffa0b4fc000000(0000) knlGS:0000000000000000
      [   15.535141] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   15.535988] CR2: 00007fc5fb6ea138 CR3: 0000000003812000 CR4: 00000000001506f0
      [   15.537025] Call Trace:
      [   15.537425]  start_streaming+0x2e9/0x4b0 [pwc]
      [   15.538143]  vb2_start_streaming+0x5e/0x110 [videobuf2_common]
      [   15.538989]  vb2_core_streamon+0x107/0x140 [videobuf2_common]
      [   15.539831]  __video_do_ioctl+0x18f/0x4a0 [videodev]
      [   15.540670]  video_usercopy+0x13a/0x5b0 [videodev]
      [   15.541349]  ? video_put_user+0x230/0x230 [videodev]
      [   15.542096]  ? selinux_file_ioctl+0x143/0x200
      [   15.542752]  v4l2_ioctl+0x40/0x50 [videodev]
      [   15.543360]  __x64_sys_ioctl+0x89/0xc0
      [   15.543930]  do_syscall_64+0x33/0x40
      [   15.544448]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   15.545236] RIP: 0033:0x7fc5fb671587
      [   15.545780] Code: b3 66 90 48 8b 05 11 49 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 48 2c 00 f7 d8 64 89 01 48
      [   15.548486] RSP: 002b:00007fff0f71f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [   15.549578] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc5fb671587
      [   15.550664] RDX: 00007fff0f71f060 RSI: 0000000040045612 RDI: 0000000000000003
      [   15.551706] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
      [   15.552738] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff0f71f060
      [   15.553817] R13: 00007fff0f71f1d0 R14: 0000000000de1270 R15: 0000000000000000
      [   15.554914] ---[ end trace 7be03122966c2486 ]---
      
      Fixes: 1161db67 ("media: usb: pwc: Don't use coherent DMA buffers for ISO transfer")
      Signed-off-by: default avatarMatwey V. Kornilov <matwey@sai.msu.ru>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      69c9e825