1. 27 2月, 2013 2 次提交
  2. 18 1月, 2013 1 次提交
  3. 20 12月, 2012 1 次提交
  4. 27 9月, 2012 1 次提交
  5. 15 6月, 2012 1 次提交
  6. 25 5月, 2012 3 次提交
    • S
      dma-buf: minor documentation fixes. · 12c4727e
      Sumit Semwal 提交于
      Some minor inline documentation fixes for gaps resulting from new patches.
      Signed-off-by: NSumit Semwal <sumit.semwal@ti.com>
      Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
      12c4727e
    • D
      dma-buf: add vmap interface · 98f86c9e
      Dave Airlie 提交于
      The main requirement I have for this interface is for scanning out
      using the USB gpu devices. Since these devices have to read the
      framebuffer on updates and linearly compress it, using kmaps
      is a major overhead for every update.
      
      v2: fix warn issues pointed out by Sylwester Nawrocki.
      
      v3: fix compile !CONFIG_DMA_SHARED_BUFFER and add _GPL for now
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NRob Clark <rob.clark@linaro.org>
      Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
      98f86c9e
    • D
      dma-buf: mmap support · 4c78513e
      Daniel Vetter 提交于
      Compared to Rob Clark's RFC I've ditched the prepare/finish hooks
      and corresponding ioctls on the dma_buf file. The major reason for
      that is that many people seem to be under the impression that this is
      also for synchronization with outstanding asynchronous processsing.
      I'm pretty massively opposed to this because:
      
      - It boils down reinventing a new rather general-purpose userspace
        synchronization interface. If we look at things like futexes, this
        is hard to get right.
      - Furthermore a lot of kernel code has to interact with this
        synchronization primitive. This smells a look like the dri1 hw_lock,
        a horror show I prefer not to reinvent.
      - Even more fun is that multiple different subsystems would interact
        here, so we have plenty of opportunities to create funny deadlock
        scenarios.
      
      I think synchronization is a wholesale different problem from data
      sharing and should be tackled as an orthogonal problem.
      
      Now we could demand that prepare/finish may only ensure cache
      coherency (as Rob intended), but that runs up into the next problem:
      We not only need mmap support to facilitate sw-only processing nodes
      in a pipeline (without jumping through hoops by importing the dma_buf
      into some sw-access only importer), which allows for a nicer
      ION->dma-buf upgrade path for existing Android userspace. We also need
      mmap support for existing importing subsystems to support existing
      userspace libraries. And a loot of these subsystems are expected to
      export coherent userspace mappings.
      
      So prepare/finish can only ever be optional and the exporter /needs/
      to support coherent mappings. Given that mmap access is always
      somewhat fallback-y in nature I've decided to drop this optimization,
      instead of just making it optional. If we demonstrate a clear need for
      this, supported by benchmark results, we can always add it in again
      later as an optional extension.
      
      Other differences compared to Rob's RFC is the above mentioned support
      for mapping a dma-buf through facilities provided by the importer.
      Which results in mmap support no longer being optional.
      
      Note that this dma-buf mmap patch does _not_ support every possible
      insanity an existing subsystem could pull of with mmap: Because it
      does not allow to intercept pagefaults and shoot down ptes importing
      subsystems can't add some magic of their own at these points (e.g. to
      automatically synchronize with outstanding rendering or set up some
      special resources). I've done a cursory read through a few mmap
      implementions of various subsytems and I'm hopeful that we can avoid
      this (and the complexity it'd bring with it).
      
      Additonally I've extended the documentation a bit to explain the hows
      and whys of this mmap extension.
      
      In case we ever want to add support for explicitly cache maneged
      userspace mmap with a prepare/finish ioctl pair, we could specify that
      userspace needs to mmap a different part of the dma_buf, e.g. the
      range starting at dma_buf->size up to dma_buf->size*2. This works
      because the size of a dma_buf is invariant over it's lifetime. The
      exporter would obviously need to fall back to coherent mappings for
      both ranges if a legacy clients maps the coherent range and the
      architecture cannot suppor conflicting caching policies. Also, this
      would obviously be optional and userspace needs to be able to fall
      back to coherent mappings.
      
      v2:
      - Spelling fixes from Rob Clark.
      - Compile fix for !DMA_BUF from Rob Clark.
      - Extend commit message to explain how explicitly cache managed mmap
        support could be added later.
      - Extend the documentation with implementations notes for exporters
        that need to manually fake coherency.
      
      v3:
      - dma_buf pointer initialization goof-up noticed by Rebecca Schultz
        Zavin.
      
      Cc: Rob Clark <rob.clark@linaro.org>
      Cc: Rebecca Schultz Zavin <rebecca@android.com>
      Acked-by: NRob Clark <rob.clark@linaro.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
      4c78513e
  7. 19 4月, 2012 1 次提交
    • R
      driver core: fix dma-buf.c kernel-doc warnings · efb4df82
      Randy Dunlap 提交于
      Fix kernel-doc warnings in dma-buf.c:
      
      Warning(drivers/base/dma-buf.c:305): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:305): Excess function parameter 'dma_buf' description in 'dma_buf_begin_cpu_access'
      Warning(drivers/base/dma-buf.c:332): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:332): Excess function parameter 'dma_buf' description in 'dma_buf_end_cpu_access'
      Warning(drivers/base/dma-buf.c:350): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:350): Excess function parameter 'dma_buf' description in 'dma_buf_kmap_atomic'
      Warning(drivers/base/dma-buf.c:367): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:367): Excess function parameter 'dma_buf' description in 'dma_buf_kunmap_atomic'
      Warning(drivers/base/dma-buf.c:385): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:385): Excess function parameter 'dma_buf' description in 'dma_buf_kmap'
      Warning(drivers/base/dma-buf.c:402): No description found for parameter 'dmabuf'
      Warning(drivers/base/dma-buf.c:402): Excess function parameter 'dma_buf' description in 'dma_buf_kunmap'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      efb4df82
  8. 26 3月, 2012 4 次提交
  9. 19 3月, 2012 4 次提交
  10. 06 1月, 2012 1 次提交
    • S
      dma-buf: Introduce dma buffer sharing mechanism · d15bd7ee
      Sumit Semwal 提交于
      This is the first step in defining a dma buffer sharing mechanism.
      
      A new buffer object dma_buf is added, with operations and API to allow easy
      sharing of this buffer object across devices.
      
      The framework allows:
      - creation of a buffer object, its association with a file pointer, and
         associated allocator-defined operations on that buffer. This operation is
         called the 'export' operation.
      - different devices to 'attach' themselves to this exported buffer object, to
        facilitate backing storage negotiation, using dma_buf_attach() API.
      - the exported buffer object to be shared with the other entity by asking for
         its 'file-descriptor (fd)', and sharing the fd across.
      - a received fd to get the buffer object back, where it can be accessed using
         the associated exporter-defined operations.
      - the exporter and user to share the scatterlist associated with this buffer
         object using map_dma_buf and unmap_dma_buf operations.
      
      Atleast one 'attach()' call is required to be made prior to calling the
      map_dma_buf() operation.
      
      Couple of building blocks in map_dma_buf() are added to ease introduction
      of sync'ing across exporter and users, and late allocation by the exporter.
      
      For this first version, this framework will work with certain conditions:
      - *ONLY* exporter will be allowed to mmap to userspace (outside of this
         framework - mmap is not a buffer object operation),
      - currently, *ONLY* users that do not need CPU access to the buffer are
         allowed.
      
      More details are there in the documentation patch.
      
      This is based on design suggestions from many people at the mini-summits[1],
      most notably from Arnd Bergmann <arnd@arndb.de>, Rob Clark <rob@ti.com> and
      Daniel Vetter <daniel@ffwll.ch>.
      
      The implementation is inspired from proof-of-concept patch-set from
      Tomasz Stanislawski <t.stanislaws@samsung.com>, who demonstrated buffer sharing
      between two v4l2 devices. [2]
      
      [1]: https://wiki.linaro.org/OfficeofCTO/MemoryManagement
      [2]: http://lwn.net/Articles/454389Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
      Signed-off-by: NSumit Semwal <sumit.semwal@ti.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-and-Tested-by: NRob Clark <rob.clark@linaro.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d15bd7ee