• Michael Tretter's avatar
    media: rockchip: rga: allocate DMA descriptors per buffer · 6040702a
    Michael Tretter authored
    The RGA driver allocates two buffers for the DMA descriptors of the
    input and output buffers. Whenever a new job is processed, the
    descriptor list is updated for the current buffers.
    
    By updating the descriptor list during buf_prepare, it is possible to
    correctly fail DMABUF imports if the buffers that shall be imported are
    not within the 32 bit address range that can be addressed by the RGA.
    
    Managing the DMA descriptor list with the buffer also makes it easier to
    track the buffer mapping and the plane offsets into this mapping.
    
    The cost is that the driver now requires DMA coherent memory per buffer
    for the descriptor list. However, the size scales with the size of the
    video buffers and is not allocated if the RGA is not used.
    
    While at it, use dma_alloc_coherent to allocate the descriptors and get
    rid of the virt_to_phys calls to get the physical addresses.
    Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    6040702a
rga-buf.c 3.99 KB