1. 20 5月, 2009 1 次提交
    • J
      drm/i915: allocate large pointer arrays with vmalloc · 8e7d2b2c
      Jesse Barnes 提交于
      For awhile now, many of the GEM code paths have allocated page or
      object arrays with the slab allocator.  This is nice and fast, but
      won't work well if memory is fragmented, since the slab allocator works
      with physically contiguous memory (i.e. order > 2 allocations are
      likely to fail fairly early after booting and doing some work).
      
      This patch works around the issue by falling back to vmalloc for
      >PAGE_SIZE allocations.  This is ugly, but much less work than chaining
      a bunch of pages together by hand (suprisingly there's not a bunch of
      generic kernel helpers for this yet afaik).  vmalloc space is somewhat
      precious on 32 bit kernels, but our allocations shouldn't be big enough
      to cause problems, though they're routinely more than a page.
      
      Note that this patch doesn't address the unchecked
      alloc-based-on-ioctl-args in GEM; that needs to be fixed in a separate
      patch.
      
      Also, I've deliberately ignored the DRM's "area" junk.  I don't think
      anyone actually uses it anymore and I'm hoping it gets ripped out soon.
      
      [Updated: removed size arg to new free function.  We could unify the
      free functions as well once the DRM mem tracking is ripped out.]
      
      fd.o bug #20152 (part 1/3)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      8e7d2b2c
  2. 15 5月, 2009 1 次提交
    • J
      drm/i915: sanity check IER at wait_request time · 802c7eb6
      Jesse Barnes 提交于
      We might sleep here anyway so I hope an extra uncached read is ok to
      add.
      
      In #20896 we found that vbetool clobbers the IER.  In KMS mode this is
      particularly bad since we don't set the interrupt regs late (in
      EnterVT), so we'd fail to get *any* interrupts at all after X started
      (since some distros have scripts that call vbetool at X startup
      apparently).
      
      So this patch checks IER at wait_request time, and re-enables
      interrupts if it's been clobbered.  In a proper config this check
      should never be triggered.
      
      This is really a distro issue, but having a sanity check is nice, as
      long as it doesn't have a real performance hit.
      Tested-by: NMateusz Kaduk <mateusz.kaduk@gmail.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [anholt: Moved the check inside of the sleeping case to avoid perf cost]
      Signed-off-by: NEric Anholt <eric@anholt.net>
      802c7eb6
  3. 22 4月, 2009 1 次提交
  4. 15 4月, 2009 1 次提交
  5. 09 4月, 2009 4 次提交
    • E
      drm/i915: Allow tiling of objects with bit 17 swizzling by the CPU. · 280b713b
      Eric Anholt 提交于
      Save the bit 17 state of the pages when freeing the page list, and
      reswizzle them if necessary when rebinding the pages (in case they were
      swapped out).  Since we have userland with expectations that the swizzle
      enums let it pread and pwrite contents accurately, we can't expose a new
      swizzle enum for bit 17 (which it would have to GTT map to handle), so we
      handle it down in pread and pwrite by swizzling the copy when bit 17 of the
      page address is set.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      280b713b
    • E
      drm/i915: Correctly set the write flag for get_user_pages in pread. · e5e9ecde
      Eric Anholt 提交于
      Otherwise, the results of our read didn't show up when we were faulting in
      the page being read into (as happened with a testcase reading into a big
      stack area).  Likely accounts for some conformance test failures.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      e5e9ecde
    • F
      drm/i915: Fix use of uninitialized var in 40a5f0de · 2bc43b5c
      Florian Mickler 提交于
      i915_gem_put_relocs_to_user returned an uninitialized value which
      got returned to userspace. This caused libdrm in my setup to never
      get out of a do{}while() loop retrying i915_gem_execbuffer.
      
      result was hanging X, overheating of cpu and 2-3gb of logfile-spam.
      
      This patch adresses the issue by
       1. initializing vars in this file where necessary
       2. correcting wrongly interpreted return values of copy_[from/to]_user
      Signed-off-by: NFlorian Mickler <florian@mickler.org>
      [anholt: cleanups of unnecessary changes, consistency in APIs]
      Signed-off-by: NEric Anholt <eric@anholt.net>
      2bc43b5c
    • B
      drm/i915: Implement batch and ring buffer dumping · 6911a9b8
      Ben Gamari 提交于
      We create a debugfs node (i915_ringbuffer_data) to expose a hex dump
      of the ring buffer itself.  We also expose another debugfs node
      (i915_ringbuffer_info) with information on the state (i.e. head, tail
      addresses) of the ringbuffer.
      
      For batchbuffer dumping, we look at the device's active_list, dumping
      each object which has I915_GEM_DOMAIN_COMMAND in its read
      domains. This is all exposed through the dri/i915_batchbuffers debugfs
      file with a header for each object (giving the objects gtt_offset so
      that it can be matched against the offset given in the
      BATCH_BUFFER_START command.
      Signed-off-by: NBen Gamari <bgamari@gmail.com>
      Signed-off-by: NCarl Worth <cworth@cworth.org>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      6911a9b8
  6. 02 4月, 2009 3 次提交
  7. 29 3月, 2009 1 次提交
  8. 28 3月, 2009 7 次提交
  9. 13 3月, 2009 2 次提交
    • O
      i915/drm: Remove two redundant agp_chipset_flushes · 995e37ca
      Owain G. Ainsworth 提交于
      agp_chipset_flush() is for flushing the intel GMCH write cache via the
      IFP, these two uses are for when we're getting the object into the cpu
      READ domain, and thus should not be needed. This confused me when I was
      getting my head around the code.
      
      With thanks to airlied for helping me check my mental picture of how the
      flushes and clflushes are supposed to be used.
      Signed-off-by: NOwain G. Ainsworth <oga@openbsd.org>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      995e37ca
    • 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
  10. 12 3月, 2009 2 次提交
  11. 11 3月, 2009 5 次提交
  12. 02 3月, 2009 1 次提交
    • I
      x86, mm: dont use non-temporal stores in pagecache accesses · f1800536
      Ingo Molnar 提交于
      Impact: standardize IO on cached ops
      
      On modern CPUs it is almost always a bad idea to use non-temporal stores,
      as the regression in this commit has shown it:
      
        30d697fa: x86: fix performance regression in write() syscall
      
      The kernel simply has no good information about whether using non-temporal
      stores is a good idea or not - and trying to add heuristics only increases
      complexity and inserts fragility.
      
      The regression on cached write()s took very long to be found - over two
      years. So dont take any chances and let the hardware decide how it makes
      use of its caches.
      
      The only exception is drivers/gpu/drm/i915/i915_gem.c: there were we are
      absolutely sure that another entity (the GPU) will pick up the dirty
      data immediately and that the CPU will not touch that data before the
      GPU will.
      
      Also, keep the _nocache() primitives to make it easier for people to
      experiment with these details. There may be more clear-cut cases where
      non-cached copies can be used, outside of filemap.c.
      
      Cc: Salman Qazi <sqazi@google.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f1800536
  13. 25 2月, 2009 2 次提交
  14. 24 2月, 2009 1 次提交
  15. 23 2月, 2009 5 次提交
  16. 20 2月, 2009 3 次提交