staging: vc04_services: Add new vc-sm-cma driver
Add Broadcom VideoCore Shared Memory support. This new driver allows contiguous memory blocks to be imported into the VideoCore VPU memory map, and manages the lifetime of those objects, only releasing the source dmabuf once the VPU has confirmed it has finished with it. Signed-off-by:Dave Stevenson <dave.stevenson@raspberrypi.com> staging: vcsm-cma: Fix memory leak from not detaching dmabuf When importing there was a missing call to detach the buffer, so each import leaked the sg table entry. Actually the release process for both locally allocated and imported buffers is identical, so fix them to both use the same function. Signed-off-by:
Dave Stevenson <dave.stevenson@raspberrypi.com> staging/vc-sm-cma: Avoid log spamming on Pi0/1 over cache alias. Pi 0/1 use the 0x80000000 cache alias as the ARM also sees the world through the VPU L2 cache. vc-sm-cma was trying to ensure it was in an uncached alias (0xc), and complaining on every allocation if it weren't. Reduce this logging. Signed-off-by:
Dave Stevenson <dave.stevenson@raspberrypi.com> vc-sm-cma: Restore correct cache maintainance operations We have been using the more expensive flush operations rather than invalidate and clean since kernel rpi-5.9.y These are exposed with: 52f14535 Re-expose some dmi APIs for use in VCSM But I believe that commit was dropped when (non-cma) vc-sm was dropped, and didn't get updated when the commit was restored Signed-off-by:
Dom Cobley <popcornmix@gmail.com> staging: vc04_services: Fix clang14 warning Insert a break to fix a fallthrough warning from clang14. Since the fallthrough was to another break, this is a cosmetic change. See: https://github.com/raspberrypi/linux/issues/5078 Signed-off-by:
Phil Elwell <phil@raspberrypi.com> vc04_services/vc-sm-cma: Handle upstream require vchiq_instance to be passed around vc04_services/vc-sm-cma: Switch one-bit bitfields to bool Clang 16 warns: ../drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:816:19: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] buffer->imported = 1; ^ ~ ../drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:822:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] buffer->in_use = 1; ^ ~ 2 warnings generated. Signed-off-by:
Alexander Winkowski <dereference23@outlook.com> vc04_services: vcsm-cma: Detach from the correct dmabuf Commit d3292dae ("dma-buf: Make locking consistent in dma_buf_detach()") added checking that the same dmabuf for which dma_buf_attach was called is passed into dma_buf_detach, which flagged up that vcsm-cma was passing in the wrong dmabuf. Correct this so that we don't get the WARN on every dma_buf release. Signed-off-by:
Dave Stevenson <dave.stevenson@raspberrypi.com>
-
mentioned in commit ef1424a4
-
mentioned in commit 948ca642
-
mentioned in commit 6ddc5393
-
mentioned in commit 2e908cd0
-
mentioned in commit b4982d83
-
mentioned in commit 5d51649a
-
mentioned in commit 51d1d6cd
-
mentioned in commit 333b471a
-
mentioned in commit 1f7cbf2f
-
mentioned in commit e5cfcb61
-
mentioned in commit b57cf051
-
mentioned in commit 03cc613b
-
mentioned in commit dc7464f8
-
mentioned in commit 40f038ed
-
mentioned in commit 815491cf
-
mentioned in commit 663045b4
-
mentioned in commit 1609ee2f
-
mentioned in commit 2e052687
-
mentioned in commit 7ea25550
-
mentioned in commit b37fc699
-
mentioned in commit 797afd0a
-
mentioned in commit d93b5412
-
mentioned in commit e51a4ad6
-
mentioned in commit 888344e3
-
mentioned in commit b09303d1
-
mentioned in commit 01d35dab
-
mentioned in commit da0f6123
-
mentioned in commit 2a1ec3fe
-
mentioned in commit 6cfaeed6
-
mentioned in commit 5055e187
-
mentioned in commit 93effac2
-
mentioned in commit 8d6ae5db
-
mentioned in commit 1acf5e66
-
mentioned in commit 20d29798