[PATCH 0/6] DRM: Unified VMA Offset Manager

Daniel Vetter daniel at ffwll.ch
Mon Jul 1 12:47:48 PDT 2013


On Mon, Jul 01, 2013 at 08:32:57PM +0200, David Herrmann wrote:
> Hi
> 
> I picked up the initial work from Dave [1], fixed several bugs, rewrote the
> drm_mm node handling and adjusted the different drivers.
> The series tries to replace the VMA-offset managers from GEM and TTM with a
> single unified implementation. It uses the TTM RBTree idea to allow sub-mappings
> (which wouldn't be feasible with hashtables).
> 
> Changes to Dave's v1:
>  * Fixed a ref-count bug in TTM during object lookup
>  * Use embedded drm_mm_node objects to avoid allocations
>  * Document drm_vma_* API
>  * Reviewed TTM locking
>  * Fixed all new drivers
>  * Use node->vm_pages instead of obj->size for GEM size calculations
> 
> Notes:
>  * Tested on nouveau only! I will try to test i915 this week. However, the
>    gem changes seem pretty trivial.
>  * I couldn't even compile-test the ARM drivers. However, the omapdrm diffs
>    are the only changes that are non-trivial. Is there any ongoing work to
>    remove the arch-deps in DRM drivers?
>  * _DRM_GEM is no longer used, but I guess we need to keep it for backwards
>    compat?

I seriously hope no piece of userspace ever used that. So if you can do
some history digging and that indeed turns out to be the case, then I'd
vote to kill _DRM_GEM. Makes it much clearer where the dri1 dungeons are
if there's no new-world stuff interspersed by accident ;-)
-Daniel

>  * If we replace node_list in drm_mm with an rbtree, we can drop it from
>    drm_vma_offset_manager completely. However, I wanted to avoid heavy drm_mm
>    changes and left this for follow up patches.
>  * This is currently based on linux-3.10 from today. Next series will be
>    rebased on drm-next/linux-next, but the current -next trees continously break
>    my machines..
>    But the only changes should be to fix additional drivers. I didn't see any
>    other things to fix for drm-next.
> 
> Another series, which I will send later, adds "struct file" lists for each
> drm-vma-offset so we can get access control over gem objects. Also, I have an
> experimental series to remove the allocation helpers in drm_mm and let drivers
> embed drm_mm_node instead. Lets see how that works out.
> 
> Comments welcome!
> Cheers
> David
> 
> [1]: http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-vma-manager
> 
> David Herrmann (6):
>   drm: make drm_mm_init() return void
>   drm: mm: add drm_mm_node_linked() helper
>   drm: add unified vma offset manager
>   drm: gem: convert to new unified vma manager
>   drm: ttm: convert to unified vma offset manager
>   drm: provide generic drm_vma_node_unmap() helper
> 
>  drivers/gpu/drm/Makefile                   |   2 +-
>  drivers/gpu/drm/ast/ast_main.c             |   2 +-
>  drivers/gpu/drm/cirrus/cirrus_main.c       |   2 +-
>  drivers/gpu/drm/drm_gem.c                  |  93 ++----------
>  drivers/gpu/drm/drm_gem_cma_helper.c       |   9 +-
>  drivers/gpu/drm/drm_mm.c                   |   5 +-
>  drivers/gpu/drm/drm_vma_manager.c          | 224 +++++++++++++++++++++++++++++
>  drivers/gpu/drm/exynos/exynos_drm_gem.c    |   7 +-
>  drivers/gpu/drm/gma500/gem.c               |   8 +-
>  drivers/gpu/drm/i915/i915_gem.c            |  13 +-
>  drivers/gpu/drm/mgag200/mgag200_main.c     |   2 +-
>  drivers/gpu/drm/nouveau/nouveau_display.c  |   2 +-
>  drivers/gpu/drm/nouveau/nouveau_gem.c      |   2 +-
>  drivers/gpu/drm/omapdrm/omap_gem.c         |  11 +-
>  drivers/gpu/drm/omapdrm/omap_gem_helpers.c |  49 +------
>  drivers/gpu/drm/qxl/qxl_object.h           |   2 +-
>  drivers/gpu/drm/qxl/qxl_release.c          |   2 +-
>  drivers/gpu/drm/radeon/radeon_object.h     |   5 +-
>  drivers/gpu/drm/ttm/ttm_bo.c               |  82 ++---------
>  drivers/gpu/drm/ttm/ttm_bo_manager.c       |   8 +-
>  drivers/gpu/drm/ttm/ttm_bo_util.c          |   3 +-
>  drivers/gpu/drm/ttm/ttm_bo_vm.c            |  81 ++++-------
>  drivers/gpu/drm/udl/udl_gem.c              |   6 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |   4 +-
>  include/drm/drmP.h                         |   7 +-
>  include/drm/drm_mm.h                       |  11 +-
>  include/drm/drm_vma_manager.h              | 122 ++++++++++++++++
>  include/drm/ttm/ttm_bo_api.h               |  15 +-
>  include/drm/ttm/ttm_bo_driver.h            |   7 +-
>  include/uapi/drm/drm.h                     |   2 +-
>  30 files changed, 464 insertions(+), 324 deletions(-)
>  create mode 100644 drivers/gpu/drm/drm_vma_manager.c
>  create mode 100644 include/drm/drm_vma_manager.h
> 
> -- 
> 1.8.3.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list