1. 31 1月, 2013 1 次提交
    • D
      drm/i915: vfuncs for gtt_clear_range/insert_entries · 7faf1ab2
      Daniel Vetter 提交于
      We have a few too many differences here, so finally take the prepared
      abstraction and run with it. A few smaller changes are required to get
      things into shape:
      
      - move i915_cache_level up since we need it in the gt funcs
      - split up i915_ggtt_clear_range and move the two functions down to
        where the relevant insert_entries functions are
      - adjustments to a few function parameter lists
      
      Now we have 2 functions which deal with the gen6+ global gtt
      (gen6_ggtt_ prefix) and 2 functions which deal with the legacy gtt
      code in the intel-gtt.c fake agp driver (i915_ggtt_ prefix).
      
      Init is still a bit a mess, but honestly I don't care about that.
      
      One thing I've thought about while deciding on the exact interfaces is
      a flag parameter for ->clear_range: We could use that to decide
      between writing invalid pte entries or scratch pte entries. In case we
      ever get around to fixing all our bugs which currently prevent us from
      filling the gtt with empty ptes for the truly unused ranges ...
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      [bwidawsk: Moved functions to the gtt struct]
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7faf1ab2
  2. 20 1月, 2013 4 次提交
    • B
      drm/i915: Needs_dmar, not · 8d2e6308
      Ben Widawsky 提交于
      The reasoning behind our code taking two paths depending upon whether or
      not we may have been configured for IOMMU isn't clear to me. It should
      always be safe to use the pci mapping functions as they are designed to
      abstract the decision we were handling in i915.
      
      Aside from simpler code, removing another member for the intel_gtt
      struct is a nice motivation.
      
      I ran this by Chris, and he wasn't concerned about the extra kzalloc,
      and memory references vs. page_to_phys calculation in the case without
      IOMMU.
      
      v2: Update commit message
      
      v3: Remove needs_dmar addition from Zhenyu upstream
      
      This reverts (and then other stuff)
      commit 20652097
      Author: Zhenyu Wang <zhenyuw@linux.intel.com>
      Date:   Thu Dec 13 23:47:47 2012 +0800
      
          drm/i915: Fix missed needs_dmar setting
      
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2)
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Squash in follow-up fix to remove the bogus hunk which
      deleted the dma_mask configuration for gen6+.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8d2e6308
    • B
      drm/i915: Remove scratch page from shared · 9c61a32d
      Ben Widawsky 提交于
      We already had a mapping in both (minus the phys_addr in AGP).
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9c61a32d
    • B
      drm/i915: Cut out the infamous ILK w/a from AGP layer · a81cc00c
      Ben Widawsky 提交于
      And, move it to where the rest of the logic is.
      
      There is some slight functionality changes. There was extra paranoid
      checks in AGP code making sure we never do idle maps on gen2 parts. That
      was not duplicated as the simple PCI id check should do the right thing.
      
      v2: use IS_GEN5 && IS_MOBILE check instead. For now, this is the same as
      IS_IRONLAKE_M but is more future proof. The workaround docs hint that
      more than one platform may be effected, but we've never seen such a
      platform in the wild. (Rodrigo, Daniel)
      
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a81cc00c
    • B
      drm/i915: Remove use of gtt_mappable_entries · 93d18799
      Ben Widawsky 提交于
      Mappable_end, ie. size is almost always what you want as opposed to the
      number of entries. Since we already have that information, we can scrap
      the number of entries and only calculate it when needed.
      
      If gtt_start is !0, this will have slightly different behavior. This
      difference can only occur in DRI1, and exists when we try to kick out
      the firmware fb. The new code seems like a bugfix to me.
      
      The other case where we've changed the behavior is during init we check
      the mappable region against our current known upper and lower limits
      (64MB, and 512MB). This now matches the comment, and makes things more
      convenient after removing gtt_mappable_entries.
      
      Also worth noting is the setting of mappable_end is taken out of setup
      because we do it earlier now in the DRI2 case and therefore need to add
      that tiny hunk to support the DRI1 IOCTL.
      
      v2: Move up mappable end to before legacy AGP init
      
      v3: Add the dev_priv inclusion here from previous rebase error in patch
      5
      
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: squash in fix for a printk format flag mismatch warning.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      93d18799
  3. 18 1月, 2013 5 次提交
  4. 20 12月, 2012 3 次提交
  5. 19 12月, 2012 1 次提交
  6. 14 12月, 2012 1 次提交
  7. 01 12月, 2012 1 次提交
  8. 29 11月, 2012 1 次提交
    • B
      drm/i915: Fix pte updates in ggtt clear range · 2ff4aeac
      Ben Widawsky 提交于
      This bug was introduced by me:
      commit e76e9aeb
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Sun Nov 4 09:21:27 2012 -0800
      
          drm/i915: Stop using AGP layer for GEN6+
      
      The existing code uses memset_io which follows memset semantics in only
      guaranteeing a write of individual bytes. Since a PTE entry is 4 bytes,
      this can only be correct if the scratch page address is 0.
      
      This caused unsightly errors when we clear the range at load time,
      though I'm not really sure what the heck is referencing that memory
      anyway. I caught this is because I believe we have some other bug where
      the display is doing reads of memory we feel should be cleared (or we
      are relying on scratch pages to be a specific value).
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2ff4aeac
  9. 22 11月, 2012 1 次提交
  10. 13 11月, 2012 1 次提交
  11. 12 11月, 2012 10 次提交
  12. 03 10月, 2012 2 次提交
  13. 20 9月, 2012 2 次提交
    • C
      drm/i915: Convert the dmabuf object to use the new i915_gem_object_ops · 2f745ad3
      Chris Wilson 提交于
      By providing a callback for when we need to bind the pages, and then
      release them again later, we can shorten the amount of time we hold the
      foreign pages mapped and pinned, and importantly the dmabuf objects then
      behave as any other normal object with respect to the shrinker and
      memory management.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2f745ad3
    • C
      drm/i915: Replace the array of pages with a scatterlist · 9da3da66
      Chris Wilson 提交于
      Rather than have multiple data structures for describing our page layout
      in conjunction with the array of pages, we can migrate all users over to
      a scatterlist.
      
      One major advantage, other than unifying the page tracking structures,
      this offers is that we replace the vmalloc'ed array (which can be up to
      a megabyte in size) with a chain of individual pages which helps reduce
      memory pressure.
      
      The disadvantage is that we then do not have a simple array to iterate,
      or to access randomly. The common case for this is in the relocation
      processing, which will typically fit within a single scatterlist page
      and so be almost the same cost as the simple array. For iterating over
      the array, the extra function call could be optimised away, but in
      reality is an insignificant cost of either binding the pages, or
      performing the pwrite/pread.
      
      v2: Fix drm_clflush_sg() to not invoke wbinvd as well! And fix the
      trivial compile error from rebasing.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9da3da66
  14. 24 8月, 2012 1 次提交
  15. 21 8月, 2012 1 次提交
    • C
      drm/i915: Track unbound pages · 6c085a72
      Chris Wilson 提交于
      When dealing with a working set larger than the GATT, or even the
      mappable aperture when touching through the GTT, we end up with evicting
      objects only to rebind them at a new offset again later. Moving an
      object into and out of the GTT requires clflushing the pages, thus
      causing a double-clflush penalty for rebinding.
      
      To avoid having to clflush on rebinding, we can track the pages as they
      are evicted from the GTT and only relinquish those pages on memory
      pressure.
      
      As usual, if it were not for the handling of out-of-memory condition and
      having to manually shrink our own bo caches, it would be a net reduction
      of code. Alas.
      
      Note: The patch also contains a few changes to the last-hope
      evict_everything logic in i916_gem_execbuffer.c - we no longer try to
      only evict the purgeable stuff in a first try (since that's superflous
      and only helps in OOM corner-cases, not fragmented-gtt trashing
      situations).
      
      Also, the extraction of the get_pages retry loop from bind_to_gtt (and
      other callsites) to get_pages should imo have been a separate patch.
      
      v2: Ditch the newly added put_pages (for unbound objects only) in
      i915_gem_reset. A quick irc discussion hasn't revealed any important
      reason for this, so if we need this, I'd like to have a git blame'able
      explanation for it.
      
      v3: Undo the s/drm_malloc_ab/kmalloc/ in get_pages that Chris noticed.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Split out code movements and rant a bit in the commit message
      with a few Notes. Done v2]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6c085a72
  16. 17 8月, 2012 1 次提交
  17. 06 8月, 2012 1 次提交
  18. 26 7月, 2012 1 次提交
    • C
      drm/i915: Segregate memory domains in the GTT using coloring · 42d6ab48
      Chris Wilson 提交于
      Several functions of the GPU have the restriction that differing memory
      domains cannot be placed next to each other (as the GPU may prefetch
      beyond the end of one domain and hang as it crosses into the other
      domain). We use the facility of the drm_mm to mark ranges with a
      particular color that corresponds to the cache attributes of those pages
      in order to prevent allocating adjacent blocks of differing memory
      types.
      
      v2: Rebase ontop of drm_mm coloring v2.
      v3: Fix rebinding existing gtt_space and add a verification routine.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      42d6ab48
  19. 23 5月, 2012 1 次提交
    • D
      i915: add dmabuf/prime buffer sharing support. · 1286ff73
      Daniel Vetter 提交于
      This adds handle->fd and fd->handle support to i915, this is to allow
      for offloading of rendering in one direction and outputs in the other.
      
      v2 from Daniel Vetter:
      - fixup conflicts with the prepare/finish gtt prep work.
      - implement ppgtt binding support.
      
      Note that we have squat i-g-t testcoverage for any of the lifetime and
      access rules dma_buf/prime support brings along. And there are quite a
      few intricate situations here.
      
      Also note that the integration with the existing code is a bit
      hackish, especially around get_gtt_pages and put_gtt_pages. It imo
      would be easier with the prep code from Chris Wilson's unbound series,
      but that is for 3.6.
      
      Also note that I didn't bother to put the new prepare/finish gtt hooks
      to good use by moving the dma_buf_map/unmap_attachment calls in there
      (like we've originally planned for).
      
      Last but not least this patch is only compile-tested, but I've changed
      very little compared to Dave Airlie's version. So there's a decent
      chance v2 on drm-next works as well as v1 on 3.4-rc.
      
      v3: Right when I've hit sent I've noticed that I've screwed up one
      obj->sg_list (for dmar support) and obj->sg_table (for prime support)
      disdinction. We should be able to merge these 2 paths, but that's
      material for another patch.
      
      v4: fix the error reporting bugs pointed out by ickle.
      
      v5: fix another error, and stop non-gtt mmaps on shared objects
      stop pread/pwrite on imported objects, add fake kmap
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1286ff73
  20. 03 5月, 2012 1 次提交
    • B
      drm/i915: remove do_retire from i915_wait_request · b2da9fe5
      Ben Widawsky 提交于
      This originates from a hack by me to quickly fix a bug in an earlier
      patch where we needed control over whether or not waiting on a seqno
      actually did any retire list processing. Since the two operations aren't
      clearly related, we should pull the parameter out of the wait function,
      and make the caller responsible for retiring if the action is desired.
      
      The only function call site which did not get an explicit retire_request call
      (on purpose) is i915_gem_inactive_shrink(). That code was already calling
      retire_request a second time.
      
      v2: don't modify any behavior excepit i915_gem_inactive_shrink(Daniel)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b2da9fe5