1. 03 10月, 2014 1 次提交
  2. 24 9月, 2014 1 次提交
  3. 19 9月, 2014 1 次提交
  4. 11 9月, 2014 1 次提交
  5. 02 9月, 2014 1 次提交
  6. 27 8月, 2014 1 次提交
  7. 11 8月, 2014 2 次提交
    • C
      drm/radeon: add userptr flag to limit it to anonymous memory v2 · ddd00e33
      Christian König 提交于
      Avoid problems with writeback by limiting userptr to anonymous memory.
      
      v2: add commit and code comments
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      ddd00e33
    • C
      drm/radeon: add userptr support v8 · f72a113a
      Christian König 提交于
      This patch adds an IOCTL for turning a pointer supplied by
      userspace into a buffer object.
      
      It imposes several restrictions upon the memory being mapped:
      
      1. It must be page aligned (both start/end addresses, i.e ptr and size).
      
      2. It must be normal system memory, not a pointer into another map of IO
      space (e.g. it must not be a GTT mmapping of another object).
      
      3. The BO is mapped into GTT, so the maximum amount of memory mapped at
      all times is still the GTT limit.
      
      4. The BO is only mapped readonly for now, so no write support.
      
      5. List of backing pages is only acquired once, so they represent a
      snapshot of the first use.
      
      Exporting and sharing as well as mapping of buffer objects created by
      this function is forbidden and results in an -EPERM.
      
      v2: squash all previous changes into first public version
      v3: fix tabs, map readonly, don't use MM callback any more
      v4: set TTM_PAGE_FLAG_SG so that TTM never messes with the pages,
          pin/unpin pages on bind/unbind instead of populate/unpopulate
      v5: rebased on 3.17-wip, IOCTL renamed to userptr, reject any unknown
          flags, better handle READONLY flag, improve permission check
      v6: fix ptr cast warning, use set_page_dirty/mark_page_accessed on unpin
      v7: add warning about it's availability in the API definition
      v8: drop access_ok check, fix VM mapping bits
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v4)
      Reviewed-by: Jérôme Glisse <jglisse@redhat.com> (v4)
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f72a113a
  8. 05 8月, 2014 2 次提交
  9. 16 3月, 2014 2 次提交
    • D
      drm: init TTM dev_mapping in ttm_bo_device_init() · 44d847b7
      David Herrmann 提交于
      With dev->anon_inode we have a global address_space ready for operation
      right from the beginning. Therefore, there is no need to do a delayed
      setup with TTM. Instead, set dev_mapping during initialization in
      ttm_bo_device_init() and remove any "if (dev_mapping)" conditions.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      44d847b7
    • D
      drm: use anon-inode instead of relying on cdevs · 6796cb16
      David Herrmann 提交于
      DRM drivers share a common address_space across all character-devices of a
      single DRM device. This allows simple buffer eviction and mapping-control.
      However, DRM core currently waits for the first ->open() on any char-dev
      to mark the underlying inode as backing inode of the device. This delayed
      initialization causes ugly conditions all over the place:
        if (dev->dev_mapping)
          do_sth();
      
      To avoid delayed initialization and to stop reusing the inode of the
      char-dev, we allocate an anonymous inode for each DRM device and reset
      filp->f_mapping to it on ->open().
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      6796cb16
  10. 07 3月, 2014 2 次提交
    • P
      drm/radeon: silence GCC warning on 32 bit · 0d997b68
      Paul Bolle 提交于
      Building radeon_ttm.o on 32 bit x86 triggers a warning:
          In file included from include/asm-generic/bug.h:13:0,
                           from [...]/arch/x86/include/asm/bug.h:38,
                           from include/linux/bug.h:4,
                           from include/drm/drm_mm.h:39,
                           from include/drm/drm_vma_manager.h:26,
                           from include/drm/ttm/ttm_bo_api.h:35,
                           from drivers/gpu/drm/radeon/radeon_ttm.c:32:
          drivers/gpu/drm/radeon/radeon_ttm.c: In function 'radeon_ttm_gtt_read':
          include/linux/kernel.h:712:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
            (void) (&_min1 == &_min2);  \
                           ^
          drivers/gpu/drm/radeon/radeon_ttm.c:938:22: note: in expansion of macro 'min'
             ssize_t cur_size = min(size, PAGE_SIZE - off);
                                ^
      
      Silence this warning by using min_t(). Since cur_size will never be
      negative and its upper bound is PAGE_SIZE, we can change its type to
      size_t and use min_t(size_t, [...]) here.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      0d997b68
    • L
      drm/radeon: TTM must be init with cpu-visible VRAM, v2 · 14eedc32
      Lauri Kasanen 提交于
      Without this, a bo may get created in the cpu-inaccessible vram.
      Before the CP engines get setup, all copies are done via cpu memcpy.
      
      This means that the cpu tries to read from inaccessible memory, fails,
      and the radeon module proceeds to disable acceleration.
      
      Doing this has no downsides, as the real VRAM size gets set as soon as the
      CP engines get init.
      
      This is a candidate for 3.14 fixes.
      
      v2: Add comment on why the function is used
      Signed-off-by: NLauri Kasanen <cand@gmx.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Cc: stable@vger.kernel.org
      14eedc32
  11. 03 3月, 2014 1 次提交
  12. 25 12月, 2013 3 次提交
  13. 18 12月, 2013 1 次提交
  14. 27 8月, 2013 1 次提交
    • D
      drm: verify vma access in TTM+GEM drivers · acb46527
      David Herrmann 提交于
      GEM does already a good job in tracking access to gem buffers via handles
      and drm_vma access management. However, TTM drivers currently do not
      verify this during mmap().
      
      TTM provides the verify_access() callback to test this. So fix all drivers
      to actually call into gem+vma to verify access instead of always returning
      0.
      
      All drivers assume that user-space can only get access to TTM buffers via
      GEM handles. So whenever the verify_access() callback is called from
      ttm_bo_mmap(), the buffer must have a valid embedded gem object. This is
      true for all TTM+GEM drivers. But that's why this patch doesn't touch pure
      TTM drivers (ie, vmwgfx).
      
      v2: Switch to drm_vma_node_verify_access() to correctly return -EACCES if
          access was denied.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      acb46527
  15. 20 5月, 2013 1 次提交
  16. 15 2月, 2013 1 次提交
  17. 05 2月, 2013 1 次提交
  18. 10 12月, 2012 1 次提交
    • M
      drm/ttm: remove no_wait_reserve, v3 · 97a875cb
      Maarten Lankhorst 提交于
      All items on the lru list are always reservable, so this is a stupid
      thing to keep. Not only that, it is used in a way which would
      guarantee deadlocks if it were ever to be set to block on reserve.
      
      This is a lot of churn, but mostly because of the removal of the
      argument which can be nested arbitrarily deeply in many places.
      
      No change of code in this patch except removal of the no_wait_reserve
      argument, the previous patch removed the use of no_wait_reserve.
      
      v2:
       - Warn if -EBUSY is returned on reservation, all objects on the list
         should be reservable. Adjusted patch slightly due to conflicts.
      v3:
       - Focus on no_wait_reserve removal only.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      97a875cb
  19. 20 11月, 2012 2 次提交
  20. 21 9月, 2012 1 次提交
  21. 25 7月, 2012 1 次提交
    • I
      drm: track dev_mapping in more robust and flexible way · 949c4a34
      Ilija Hadzic 提交于
      Setting dev_mapping (pointer to the address_space structure
      used for memory mappings) to the address_space of the first
      opener's inode and then failing if other openers come in
      through a different inode has a few restrictions that are
      eliminated by this patch.
      
      If we already have valid dev_mapping and we spot an opener
      with different i_node, we force its i_mapping pointer to the
      already established address_space structure (first opener's
      inode). This will make all mappings from drm device hang off
      the same address_space object.
      
      Some benefits (things that now work and didn't work
      before) of this patch are:
      
       * user space can mknod and use any number of device
         nodes and they will all work fine as long as the major
         device number is that of the drm module.
       * user space can even remove the first opener's device
         nodes and mknod the new one and the applications and
         windowing system will still work.
       * GPU drivers can safely assume that dev->dev_mapping is
         correct address_space and just blindly copy it
         into their (private) bdev.dev_mapping
      
      For reference, some discussion that lead to this patch can
      be found here:
      
      http://lists.freedesktop.org/archives/dri-devel/2012-April/022283.htmlSigned-off-by: NIlija Hadzic <ihadzic@research.bell-labs.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      949c4a34
  22. 21 6月, 2012 3 次提交
  23. 23 5月, 2012 1 次提交
  24. 10 5月, 2012 1 次提交
  25. 03 5月, 2012 1 次提交
  26. 29 2月, 2012 1 次提交
  27. 06 1月, 2012 2 次提交
  28. 21 12月, 2011 3 次提交