• Donald Robson's avatar
    drm/imagination: Add GEM and VM related code · ff5f643d
    Donald Robson authored
    Add a GEM implementation based on drm_gem_shmem, and support code for the
    PowerVR GPU MMU. The GPU VA manager is used for address space management.
    
    Changes since v8:
    - Updated for changes to drm_gpuvm
    - Switched to dma_resv locking for vm ops
    - Removed linked lists for collecting BOs in vm_context and for freeing
      after ops. This is now done internally in drm_gpuvm
    - Corrected license identifiers
    
    Changes since v7:
    - kernel-doc fixes
    - Remove prefixes from DRM_PVR_BO_* flags
    - CREATE_BO ioctl now returns an error if provided size isn't page aligned
    - Optimised MMU flushes
    
    Changes since v6:
    - Don't initialise kernel_vm_ctx when using MIPS firmware processor
    - Rename drm_gpuva_manager uses to drm_gpuvm
    - Sync GEM object to device on creation
    
    Changes since v5:
    - Use WRITE_ONCE() when writing to page tables
    - Add memory barriers to page table insertion
    - Fixed double backing page alloc on page table objects
    - Fix BO mask checks in DRM_IOCTL_PVR_CREATE_BO handler
    - Document use of pvr_page_table_*_idx when preallocing page table objs
    - Remove pvr_vm_gpuva_mapping_init()
    - Remove NULL check for unmap op in remap function
    - Protect gem object with mutex during drm_gpuva_link/unlink
    - Defer free or release of page table pages until after TLB flush
    - Use drm_gpuva_op_remap_get_unmap_range() helper
    
    Changes since v4:
    - Correct sync function in vmap/vunmap function documentation
    - Update for upstream GPU VA manager
    - Fix missing frees when unmapping drm_gpuva objects
    - Always zero GEM BOs on creation
    
    Changes since v3:
    - Split MMU and VM code
    - Register page table allocations with kmemleak
    - Use drm_dev_{enter,exit}
    
    Changes since v2:
    - Use GPU VA manager
    - Use drm_gem_shmem
    Co-developed-by: default avatarMatt Coster <matt.coster@imgtec.com>
    Signed-off-by: default avatarMatt Coster <matt.coster@imgtec.com>
    Co-developed-by: default avatarDonald Robson <donald.robson@imgtec.com>
    Signed-off-by: default avatarDonald Robson <donald.robson@imgtec.com>
    Signed-off-by: default avatarSarah Walker <sarah.walker@imgtec.com>
    Link: https://lore.kernel.org/r/3c96dd170efe759b73897e3675d7310a7c4b06d0.1700668843.git.donald.robson@imgtec.comSigned-off-by: default avatarMaxime Ripard <mripard@kernel.org>
    ff5f643d
pvr_device.h 16.6 KB