1. 10 9月, 2013 1 次提交
  2. 06 9月, 2013 2 次提交
    • M
      drm/i915: include hangcheck action and score in error_state · da661464
      Mika Kuoppala 提交于
      Score and action reveals what all the rings were doing
      and why hang was declared. Add idle state so that
      we can distinguish between waiting and idle ring.
      
      v2: - add idle as a hangcheck action
          - consensed hangcheck status to single line (Chris)
          - mark active explicitly when we are making progress (Chris)
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      da661464
    • M
      drm/i915: ban badly behaving contexts · be62acb4
      Mika Kuoppala 提交于
      Now when we have mechanism in place to track which context
      was guilty of hanging the gpu, it is possible to punish
      for bad behaviour.
      
      If context has recently submitted a faulty batchbuffers guilty of
      gpu hang and submits another batch which hangs gpu in quick
      succession, ban it permanently. If ctx is banned, no more
      batchbuffers will be queued for execution.
      
      There is no need for global wedge machinery anymore and
      it would be unwise to wedge the whole gpu if we have multiple
      hanging batches queued for execution. Instead just ban
      the guilty ones and carry on.
      
      v2: Store guilty ban status bool in gpu_error instead of pointers
          that might become danling before hang is declared.
      
      v3: Use return value for banned status instead of stashing state
          into gpu_error (Chris Wilson)
      
      v4: - rebase on top of fixed hang stats api
          - add define for ban period
          - rename commit and improve commit msg
      
      v5: - rely context banning instead of wedging the gpu
          - beautification and fix for ban calculation (Chris)
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be62acb4
  3. 05 9月, 2013 1 次提交
  4. 04 9月, 2013 10 次提交
    • J
      drm/i915: add opregion function to notify bios of adapter power state · ecbc5cf3
      Jani Nikula 提交于
      Notifying the bios lets it enter power saving states.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ecbc5cf3
    • J
      drm/i915: add opregion function to notify bios of encoder enable/disable · 9c4b0a68
      Jani Nikula 提交于
      The bios interface seems messy, and it's hard to tell what the bios
      really wants. At first, only add support for DDI based machines (hsw+),
      and see how it turns out.
      
      The spec says to notify prior to power down and after power up. It is
      unclear whether it makes a difference.
      
      v2:
       - squash notification function and callers patches together (Daniel)
       - move callers to haswell_crtc_{enable,disable} (Daniel)
       - rename notification function (Chris)
      
      v3:
       - separate notification function and callers again, as it's not clear
         whether the display power state notification is the right thing to do
         after all
      
      v4: per Paulo's review:
       - drop LVDS
       - WARN on unsupported encoder types
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9c4b0a68
    • J
      drm/i915: add plumbing for SWSCI · ebde53c7
      Jani Nikula 提交于
      SWSCI is a driver to bios call interface.
      
      This checks for SWSCI availability and bios requested callbacks, and
      filters out any calls that shouldn't happen. This way the callers don't
      need to do the checks all over the place.
      
      v2: silence some checkpatch nagging
      
      v3: set PCI_SWSCI bit 0 to trigger interrupt (Mengdong Lin)
      
      v4: remove an extra #define (Jesse)
      
      v5: spec says s/w is responsible for clearing PCI_SWSCI bit 0 too
      
      v6: per Paulo's review and more:
       - fix sub-function mask
       - add exit parameter
       - add define for set panel details call
       - return more errors from swsci
       - clean up the supported/requested callbacks bit masks mess
       - use DSLP for timeout
       - fix build for CONFIG_ACPI=n
      
      v7: tiny adjustment of requested vs. supported SBCB callbacks handling (Paulo)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ebde53c7
    • B
      drm/i915: Restore the preliminary HW check. · b833d685
      Ben Widawsky 提交于
      We still maintain code internally that cares about preliminary support.
      Leaving the check here doesn't hurt anyone, and should keep things more
      in line.
      
      This time around, stick the info in the intel_info structure, and also
      change the error from DRM_ERROR->DRM_INFO.
      
      This is a partial revert of:
      commit 590e4df8
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Wed May 8 10:45:15 2013 -0700
      
          drm/i915: VLV support is no longer preliminary
      
      Daniel, I'll provide the fix ups for internal too if/when you merge
      this (if you want).
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b833d685
    • R
      drm/i915: Report enabled slices on Haswell GT3 · 9435373e
      Rodrigo Vivi 提交于
      Batchbuffers constructed by userspace can conditionalise their URB
      allocations through the use of the MI_SET_PREDICATE command. This
      command can read the MI_PREDICATE_RESULT_2 register to see how many
      slices are enabled on GT3, and by virtue of the result, scale their
      memory allocations to fit enabled memory.
      
      Of course, this only works if the kernel sets the appropriate bit in the
      register first.
      
      v2: Better commit subject and message by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Credits-to: Yejun Guo <yejun.guo@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9435373e
    • S
      drm/i915: Parse the MIPI related VBT Block and store relevant info · d17c5443
      Shobhit Kumar 提交于
      Initial parsing of the VBT MIPI block. For now, just store the panel id
      if found.
      
      Note: Again there seems to be no documentation for this piece of lore.
      The doc situation for byt+ is just a bad joke :(
      Signed-off-by: NShobhit Kumar <shobhit.kumar@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d17c5443
    • J
      drm/i915: add more VLV IOSF sideband ports accessors · e9f882a3
      Jani Nikula 提交于
      For GPIO NC, CCK, CCU, and GPS CORE.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NShobhit Kumar <shobhit.kumar@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e9f882a3
    • D
      drm/i915: inline vma_create into lookup_or_create_vma · e656a6cb
      Daniel Vetter 提交于
      In the execbuf code we don't clean up any vmas which ended up not
      getting bound for code simplicity. To make sure that we don't end up
      creating multiple vma for the same vm kill the somewhat dangerous
      vma_create function and inline it into lookup_or_create.
      
      This is just a safety measure to prevent surprises in the future.
      
      Also update the somewhat confused comment in the execbuf code and
      clarify what kind of magic is going on with a new one.
      
      v2: Keep the function separate as requested by Chris. But give it a __
      prefix for paranoia and move it tighter together with the other vma
      stuff.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e656a6cb
    • B
      drm/i915: Convert execbuf code to use vmas · 27173f1f
      Ben Widawsky 提交于
      In order to transition more of our code over to using a VMA instead of
      an <OBJ, VM> pair - we must have the vma accessible at execbuf time. Up
      until now, we've only had a VMA when actually binding an object.
      
      The previous patch helped handle the distinction on bound vs. unbound.
      This patch will help us catch leaks, and other issues before we actually
      shuffle a bunch of stuff around.
      
      This attempts to convert all the execbuf code to speak in vmas. Since
      the execbuf code is very self contained it was a nice isolated
      conversion.
      
      The meat of the code is about turning eb_objects into eb_vma, and then
      wiring up the rest of the code to use vmas instead of obj, vm pairs.
      
      Unfortunately, to do this, we must move the exec_list link from the obj
      structure. This list is reused in the eviction code, so we must also
      modify the eviction code to make this work.
      
      WARNING: This patch makes an already hotly profiled path slower. The cost is
      unavoidable. In reply to this mail, I will attach the extra data.
      
      v2: Release table lock early, and two a 2 phase vma lookup to avoid
      having to use a GFP_ATOMIC. (Chris)
      
      v3: s/obj_exec_list/obj_exec_link/
      Updates to address
      commit 6d2b8885
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Aug 7 18:30:54 2013 +0100
      
          drm/i915: List objects allocated from stolen memory in debugfs
      
      v4: Use obj = vma->obj for neatness in some places (Chris)
      need_reloc_mappable() should return false if ppgtt (Chris)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Split out prep patches. Also remove a FIXME comment which is
      now taken care of.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      27173f1f
    • D
      drm/i915: fix hpd work vs. flush_work in the pageflip code deadlock · 645416f5
      Daniel Vetter 提交于
      Historically we've run our own driver hotplug handling in our own
      work-queue, which then launched the drm core hotplug handling in the
      system workqueue. This is important since we flush our own driver
      workqueue in the pageflip code while hodling modeset locks, and only
      the drm hotplug code grabbed these locks. But with
      
      commit 69787f7d
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Oct 23 18:23:34 2012 +0000
      
          drm: run the hpd irq event code directly
      
      this was changed and now we could deadlock in our flip handler if
      there's a hotplug work blocking the progress of the crucial unpin
      works. So this broke the careful deadlock avoidance implemented in
      
      commit b4a98e57
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Nov 1 09:26:26 2012 +0000
      
          drm/i915: Flush outstanding unpin tasks before pageflipping
      
      Since the rule thus far has been that work items on our own workqueue
      may never grab modeset locks simply restore that rule again.
      
      v2: Add a comment to the declaration of dev_priv->wq to warn readers
      about the tricky implications of using it. Suggested by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Stuart Abercrombie <sabercrombie@chromium.org>
      Reported-by: NStuart Abercrombie <sabercrombie@chromium.org>
      References: http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/26239
      Cc: stable@vger.kernel.org
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Squash in a comment at the place where we schedule the work.
      Requested after-the-fact by Chris on irc since the hpd work isn't the
      only place we botch this.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      645416f5
  5. 30 8月, 2013 1 次提交
  6. 23 8月, 2013 6 次提交
    • P
      drm/i915: add i915.pc8_timeout function · 90058745
      Paulo Zanoni 提交于
      We currently only enter PC8+ after all its required conditions are
      met, there's no rendering, and we stay like that for at least 5
      seconds.
      
      I chose "5 seconds" because this value is conservative and won't make
      us enter/leave PC8+ thousands of times after the screen is off: some
      desktop environments have applications that wake up and do rendering
      every 1-3 seconds, even when the screen is off and the machine is
      completely idle.
      
      But when I was testing my PC8+ patches I set the default value to
      100ms so I could use the bad-behaving desktop environments to
      stress-test my patches. I also thought it would be a good idea to ask
      our power management team to test different values, but I'm pretty
      sure they would ask me for an easy way to change the timeout. So to
      help these 2 cases I decided to create an option that would make it
      easier to change the default value. I also expect people making
      specific products that use our driver could try to find the perfect
      timeout for them.
      
      Anyway, fixing the bad-behaving applications will always lead to
      better power savings than just changing the timeout value: you need to
      stop waking the Kernel, not quickly put it back to sleep again after
      you wake it for nothing. Bad sleep leads to bad mood!
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      90058745
    • P
      drm/i915: allow package C8+ states on Haswell (disabled) · c67a470b
      Paulo Zanoni 提交于
      This patch allows PC8+ states on Haswell. These states can only be
      reached when all the display outputs are disabled, and they allow some
      more power savings.
      
      The fact that the graphics device is allowing PC8+ doesn't mean that
      the machine will actually enter PC8+: all the other devices also need
      to allow PC8+.
      
      For now this option is disabled by default. You need i915.allow_pc8=1
      if you want it.
      
      This patch adds a big comment inside i915_drv.h explaining how it
      works and how it tracks things. Read it.
      
      v2: (this is not really v2, many previous versions were already sent,
           but they had different names)
          - Use the new functions to enable/disable GTIMR and GEN6_PMIMR
          - Rename almost all variables and functions to names suggested by
            Chris
          - More WARNs on the IRQ handling code
          - Also disable PC8 when there's GPU work to do (thanks to Ben for
            the help on this), so apps can run caster
          - Enable PC8 on a delayed work function that is delayed for 5
            seconds. This makes sure we only enable PC8+ if we're really
            idle
          - Make sure we're not in PC8+ when suspending
      v3: - WARN if IRQs are disabled on __wait_seqno
          - Replace some DRM_ERRORs with WARNs
          - Fix calls to restore GT and PM interrupts
          - Use intel_mark_busy instead of intel_ring_advance to disable PC8
      v4: - Use the force_wake, Luke!
      v5: - Remove the "IIR is not zero" WARNs
          - Move the force_wake chunk to its own patch
          - Only restore what's missing from RC6, not everything
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c67a470b
    • P
      drm/i915: add dev_priv->pm_irq_mask · 605cd25b
      Paulo Zanoni 提交于
      Just like irq_mask and gt_irq_mask, use it to track the status of
      GEN6_PMIMR so we don't need to read it again every time we call
      snb_update_pm_irq.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      605cd25b
    • D
      drm: Remove IS_IRONLAKE_D() · 3abdb334
      Damien Lespiau 提交于
      This define hasn't been used since:
      
        commit cfdf1fa2
        Author: Kristian Høgsberg <krh@bitplanet.net>
        Date:   Wed Dec 16 15:16:16 2009 -0500
      
            drm/i915: Implement IS_* macros using static tables
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3abdb334
    • D
      drm/i915: Remove HAS_PIPE_CONTROL() · fdaa930b
      Damien Lespiau 提交于
      The code using this was removed in:
      
        commit 88f23b8f
        Author: Chris Wilson <chris@chris-wilson.co.uk>
        Date:   Sun Dec 5 15:08:31 2010 +0000
      
            drm/i915: Avoid using PIPE_CONTROL on Ironlake
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fdaa930b
    • D
      drm/i915: Remove DSPARB_HWCONTROL() · 82548600
      Damien Lespiau 提交于
      This define hasn't been used since:
      
        commit 652c393a
        Author: Jesse Barnes <jbarnes@virtuousgeek.org>
        Date:   Mon Aug 17 13:31:43 2009 -0700
      
            drm/i915: add dynamic clock frequency control
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      82548600
  7. 22 8月, 2013 6 次提交
  8. 10 8月, 2013 2 次提交
    • C
      drm/i915: Update rules for writing through the LLC with the cpu · 2c22569b
      Chris Wilson 提交于
      As mentioned in the previous commit, reads and writes from both the CPU
      and GPU go through the LLC. This gives us coherency between the CPU and
      GPU irrespective of the attribute settings either device sets. We can
      use to avoid having to clflush even uncached memory.
      
      Except for the scanout.
      
      The scanout resides within another functional block that does not use
      the LLC but reads directly from main memory. So in order to maintain
      coherency with the scanout, writes to uncached memory must be flushed.
      In order to optimize writes elsewhere, we start tracking whether an
      framebuffer is attached to an object.
      
      v2: Use pin_display tracking rather than fb_count (to ensure we flush
      cursors as well etc) and only force the clflush along explicit writes to
      the scanout paths (i.e. pin_to_display_plane and pwrite into scanout).
      
      v3: Force the flush after hitting the slowpath in pwrite, as after
      dropping the lock the object's cache domain may be invalidated. (Ville)
      
      Based on a patch by Ville Syrjälä.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2c22569b
    • C
      drm/i915: Track when an object is pinned for use by the display engine · cc98b413
      Chris Wilson 提交于
      The display engine has unique coherency rules such that it requires
      special handling to ensure that all writes to cursors, scanouts and
      sprites are clflushed. This patch introduces the infrastructure to
      simply track when an object is being accessed by the display engine.
      
      v2: Explain the is_pin_display() magic as the sources for obj->pin_count
      and their individual rules is not obvious. (Ville)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cc98b413
  9. 09 8月, 2013 3 次提交
  10. 08 8月, 2013 7 次提交
    • V
      drm/i915: Pass plane and crtc to intel_update_sprite_watermarks · adf3d35e
      Ville Syrjälä 提交于
      We're going to want to know the crtc in the watermark code to avoid
      doing more work than we have to. We should also pass the plane we're
      disabling so that we know where to stick our watermark parameters
      without having to go look the plane up.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      adf3d35e
    • V
      drm/i915: Rename hsw_lp_wm_result to intel_wm_level · 1fd527cc
      Ville Syrjälä 提交于
      Let's call hsw_lp_wm_result intel_wm_level from now on and move it to
      i915_drv.h for later use.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1fd527cc
    • B
      drm/i915: Update error capture for VMs · 95f5301d
      Ben Widawsky 提交于
      formerly: "drm/i915: Create VMAs (part 4) - Error capture"
      
      Since the active/inactive lists are per VM, we need to modify the error
      capture code to be aware of this, and also extend it to capture the
      buffers from all the VMs. For now all the code assumes only 1 VM, but it
      will become more generic over the next few patches.
      
      NOTE: If the number of VMs in a real world system grows significantly
      we'll have to focus on only capturing the guilty VM, or else it's likely
      there won't be enough space for error capture.
      
      v2: Squashed in the "part 6" which had dependencies on the mm_list
      change. Since I've moved the mm_list change to an earlier point in the
      series, we were able to accomplish it here and now.
      
      v3: Rebased over new error capture
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      95f5301d
    • B
      drm/i915: mm_list is per VMA · ca191b13
      Ben Widawsky 提交于
      formerly: "drm/i915: Create VMAs (part 5) - move mm_list"
      
      The mm_list is used for the active/inactive LRUs. Since those LRUs are
      per address space, the link should be per VMx .
      
      Because we'll only ever have 1 VMA before this point, it's not incorrect
      to defer this change until this point in the patch series, and doing it
      here makes the change much easier to understand.
      
      Shamelessly manipulated out of Daniel:
      "active/inactive stuff is used by eviction when we run out of address
      space, so needs to be per-vma and per-address space. Bound/unbound otoh
      is used by the shrinker which only cares about the amount of memory used
      and not one bit about in which address space this memory is all used in.
      Of course to actual kick out an object we need to unbind it from every
      address space, but for that we have the per-object list of vmas."
      
      v2: only bump GGTT LRU in i915_gem_object_set_to_gtt_domain (Chris)
      
      v3: Moved earlier in the series
      
      v4: Add dropped message from v3
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Frob patch to apply and use vma->node.size directly as
      discused with Ben. Also drop a needles BUG_ON before move_to_inactive,
      the function itself has the same check.]
      [danvet 2nd: Rebase on top of the lost "drm/i915: Cleanup more of VMA
      in destroy", specifically unlink the vma from the mm_list in
      vma_unbind (to keep it symmetric with bind_to_vm) instead of
      vma_destroy.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ca191b13
    • V
      drm/i915: Rename hsw_data_buf_partitioning to intel_ddb_partitioning · 77c122bc
      Ville Syrjälä 提交于
      We're going to use the 1/2 vs. 5/6 split option already on IVB so the
      HSW name is not proper. Just give it an intel_ prefix and move it to
      i915_drv.h so that we can use it there later.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      77c122bc
    • B
      drm/i915: Use new bind/unbind in eviction code · f6cd1f15
      Ben Widawsky 提交于
      Eviction code, like the rest of the converted code needs to be aware of
      the address space for which it is evicting (or the everything case, all
      addresses). With the updated bind/unbind interfaces of the last patch,
      we can now safely move the eviction code over.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f6cd1f15
    • B
      drm/i915: plumb VM into bind/unbind code · 07fe0b12
      Ben Widawsky 提交于
      As alluded to in several patches, and it will be reiterated later... A
      VMA is an abstraction for a GEM BO bound into an address space.
      Therefore it stands to reason, that the existing bind, and unbind are
      the ones which will be the most impacted. This patch implements this,
      and updates all callers which weren't already updated in the series
      (because it was too messy).
      
      This patch represents the bulk of an earlier, larger patch. I've pulled
      out a bunch of things by the request of Daniel. The history is preserved
      for posterity with the email convention of ">" One big change from the
      original patch aside from a bunch of cropping is I've created an
      i915_vma_unbind() function. That is because we always have the VMA
      anyway, and doing an extra lookup is useful. There is a caveat, we
      retain an i915_gem_object_ggtt_unbind, for the global cases which might
      not talk in VMAs.
      
      > drm/i915: plumb VM into object operations
      >
      > This patch was formerly known as:
      > "drm/i915: Create VMAs (part 3) - plumbing"
      >
      > This patch adds a VM argument, bind/unbind, and the object
      > offset/size/color getters/setters. It preserves the old ggtt helper
      > functions because things still need, and will continue to need them.
      >
      > Some code will still need to be ported over after this.
      >
      > v2: Fix purge to pick an object and unbind all vmas
      > This was doable because of the global bound list change.
      >
      > v3: With the commit to actually pin/unpin pages in place, there is no
      > longer a need to check if unbind succeeded before calling put_pages().
      > Make put_pages only BUG() after checking pin count.
      >
      > v4: Rebased on top of the new hangcheck work by Mika
      > plumbed eb_destroy also
      > Many checkpatch related fixes
      >
      > v5: Very large rebase
      >
      > v6:
      > Change BUG_ON to WARN_ON (Daniel)
      > Rename vm to ggtt in preallocate stolen, since it is always ggtt when
      > dealing with stolen memory. (Daniel)
      > list_for_each will short-circuit already (Daniel)
      > remove superflous space (Daniel)
      > Use per object list of vmas (Daniel)
      > Make obj_bound_any() use obj_bound for each vm (Ben)
      > s/bind_to_gtt/bind_to_vm/ (Ben)
      >
      > Fixed up the inactive shrinker. As Daniel noticed the code could
      > potentially count the same object multiple times. While it's not
      > possible in the current case, since 1 object can only ever be bound into
      > 1 address space thus far - we may as well try to get something more
      > future proof in place now. With a prep patch before this to switch over
      > to using the bound list + inactive check, we're now able to carry that
      > forward for every address space an object is bound into.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Rebase on top of the loss of "drm/i915: Cleanup more of VMA
      in destroy".]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      07fe0b12
  11. 07 8月, 2013 1 次提交