• Sergey Senozhatsky's avatar
    media: videobuf2: rework vb2_mem_ops API · a4b83deb
    Sergey Senozhatsky authored
    With the new DMA API we need an extension of the videobuf2 API.
    Previously, videobuf2 core would set the non-coherent DMA bit
    in the vb2_queue dma_attr field (if user-space would pass a
    corresponding memory hint); the vb2 core then would pass the
    vb2_queue dma_attrs to the vb2 allocators. The vb2 allocator
    would use the queue's dma_attr and the DMA API would allocate
    either coherent or non-coherent memory.
    
    But we cannot do this anymore, since there is no corresponding DMA
    attr flag and, hence, there is no way for the allocator to become
    aware of what type of allocation user-space has requested. So we
    need to pass more context from videobuf2 core to the allocators.
    
    Fix this by changing the call_ptr_memop() macro to pass the
    vb2 pointer to the corresponding op callbacks.
    Signed-off-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    a4b83deb
videobuf2-dma-contig.c 18.3 KB