1. 23 2月, 2011 1 次提交
    • C
      drm: Trim the GEM mmap offset hashtab · 4cb81ac2
      Chris Wilson 提交于
      Using an order 19 drm_ht for the mmap offsets is a little obscene. That
      means that will a fully populated GTT with every single object mmaped at
      least once in its lifetime, there will be exactly one object in each
      bucket.
      
      Typically systems only have at most a few thousand objects, though you
      may see a KDE desktop hit 50000. And most of those should never be
      mapped... On my systems, just using an order 10 ht would still have an
      average occupancy less than 1, so apply a small safety factor and
      use an order 12 ht, like the other mmap offset ht.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4cb81ac2
  2. 07 2月, 2011 1 次提交
    • D
      drm: dumb scanout create/mmap for intel/radeon (v3) · ff72145b
      Dave Airlie 提交于
      This is just an idea that might or might not be a good idea,
      it basically adds two ioctls to create a dumb and map a dumb buffer
      suitable for scanout. The handle can be passed to the KMS ioctls to create
      a framebuffer.
      
      It looks to me like it would be useful in the following cases:
      a) in development drivers - we can always provide a shadowfb fallback.
      b) libkms users - we can clean up libkms a lot and avoid linking
      to libdrm_*.
      c) plymouth via libkms is a lot easier.
      
      Userspace bits would be just calls + mmaps. We could probably
      mark these handles somehow as not being suitable for acceleartion
      so as top stop people who are dumber than dumb.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ff72145b
  3. 01 10月, 2010 3 次提交
  4. 28 9月, 2010 1 次提交
  5. 30 8月, 2010 1 次提交
  6. 10 8月, 2010 1 次提交
  7. 02 8月, 2010 1 次提交
    • C
      drm: Free the idr layers before calling idr_destroy() · ddd3d069
      Chris Wilson 提交于
      /* A typical clean-up sequence for objects stored in an idr tree, will
       * use idr_for_each() to free all objects, if necessary, then
       * idr_remove_all() to remove all ids, and idr_destroy() to free
       * up the cached idr_layers.
       */
      
      We were missing the vital idr_rmove_all() step and so were leaking
      the used layers for every dri client:
      
      unreferenced object 0xf32133c0 (size 148):
        comm "plymouthd", pid 131, jiffies 4294678490 (age 2308.030s)
        hex dump (first 32 bytes):
          04 00 00 00 00 00 00 00 00 00 00 00 00 40 19 f3  .............@..
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<c04e5657>] create_object+0x124/0x1f1
          [<c07cf100>] kmemleak_alloc+0x4c/0x90
          [<c04db6a9>] kmem_cache_alloc+0xee/0x13c
          [<c05c3d25>] idr_pre_get+0x24/0x61
          [<f8315c9c>] drm_gem_handle_create+0x27/0x7f [drm]
          [<f89925b2>] i915_gem_create_ioctl+0x4f/0x71 [i915]
          [<f83148ac>] drm_ioctl+0x272/0x356 [drm]
          [<c04f27c4>] vfs_ioctl+0x33/0x91
          [<c04f31cf>] do_vfs_ioctl+0x46b/0x496
          [<c04f3240>] sys_ioctl+0x46/0x66
          [<c040325f>] sysenter_do_call+0x12/0x38
          [<ffffffff>] 0xffffffff
      
      Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15803Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ddd3d069
  8. 01 6月, 2010 1 次提交
  9. 20 4月, 2010 2 次提交
  10. 11 2月, 2010 2 次提交
  11. 28 1月, 2010 1 次提交
    • C
      drm/i915: Selectively enable self-reclaim · 4bdadb97
      Chris Wilson 提交于
      Having missed the ENOMEM return via i915_gem_fault(), there are probably
      other paths that I also missed. By not enabling NORETRY by default these
      paths can run the shrinker and take memory from the system (but not from
      our own inactive lists because our shrinker can not run whilst we hold
      the struct mutex) and this may allow the system to survive a little longer
      whilst our drivers consume all available memory.
      
      References:
        OOM killer unexpectedly called with kernel 2.6.32
        http://bugzilla.kernel.org/show_bug.cgi?id=14933
      
      v2: Pass gfp into page mapping.
      v3: Use new read_cache_page_gfp() instead of open-coding.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4bdadb97
  12. 24 11月, 2009 1 次提交
  13. 18 9月, 2009 1 次提交
    • C
      drm/i915: Improve behaviour under memory pressure · 07f73f69
      Chris Wilson 提交于
      Due to the necessity of having to take the struct_mutex, the i915
      shrinker can not free the inactive lists if we fail to allocate memory
      whilst processing a batch buffer, triggering an OOM and an ENOMEM that
      is reported back to userspace. In order to fare better under such
      circumstances we need to manually retry a failed allocation after
      evicting inactive buffers.
      
      To do so involves 3 steps:
      1. Marking the backing shm pages as NORETRY.
      2. Updating the get_pages() callers to evict something on failure and then
         retry.
      3. Revamping the evict something logic to be smarter about the required
         buffer size and prefer to use volatile or clean inactive pages.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      07f73f69
  14. 27 8月, 2009 1 次提交
  15. 15 7月, 2009 1 次提交
  16. 19 6月, 2009 1 次提交
  17. 11 6月, 2009 1 次提交
  18. 03 4月, 2009 1 次提交
  19. 13 3月, 2009 1 次提交
    • B
      drm: Split drm_map and drm_local_map · f77d390c
      Benjamin Herrenschmidt 提交于
      Once upon a time, the DRM made the distinction between the drm_map
      data structure exchanged with user space and the drm_local_map used
      in the kernel.
      
      For some reasons, while the BSD port still has that "feature", the
      linux part abused drm_map for kernel internal usage as the local
      map only existed as a typedef of the struct drm_map.
      
      This patch fixes it by declaring struct drm_local_map separately
      (though its content is currently identical to the userspace variant),
      and changing the kernel code to only use that, except when it's a
      user<->kernel interface (ie. ioctl).
      
      This allows subsequent changes to the in-kernel format
      
      I've also replaced the use of drm_local_map_t with struct drm_local_map
      in a couple of places. Mostly by accident but they are the same (the
      former is a typedef of the later) and I have some remote plans and
      half finished patch to completely kill the drm_local_map_t typedef
      so I left those bits in.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      f77d390c
  20. 20 2月, 2009 4 次提交
  21. 01 2月, 2009 1 次提交
    • L
      Stop playing silly games with the VM_ACCOUNT flag · fc8744ad
      Linus Torvalds 提交于
      The mmap_region() code would temporarily set the VM_ACCOUNT flag for
      anonymous shared mappings just to inform shmem_zero_setup() that it
      should enable accounting for the resulting shm object.  It would then
      clear the flag after calling ->mmap (for the /dev/zero case) or doing
      shmem_zero_setup() (for the MAP_ANON case).
      
      This just resulted in vma merge issues, but also made for just
      unnecessary confusion.  Use the already-existing VM_NORESERVE flag for
      this instead, and let shmem_{zero|file}_setup() just figure it out from
      that.
      
      This also happens to make it obvious that the new DRI2 GEM layer uses a
      non-reserving backing store for its object allocation - which is quite
      possibly not intentional.  But since I didn't want to change semantics
      in this patch, I left it alone, and just updated the caller to use the
      new flag semantics.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fc8744ad
  22. 29 12月, 2008 2 次提交
  23. 18 10月, 2008 2 次提交