1. 18 3月, 2015 2 次提交
    • D
      drm/i915: Make for_each_plane() take dev_priv as argument · dd740780
      Damien Lespiau 提交于
      Implicit usage of local variables in macros isn't exactly the greatest
      thing in the world, especially when that variable is the drm device and
      we want to move towards a broader use of the i915 device structure.
      
      Let's make for_each_plane() take dev_priv as its first argument then.
      Suggested-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: Chris Wilson <chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dd740780
    • M
      drm/i915: Kill intel_crtc->cursor_{width, height} (v2) · 3dd512fb
      Matt Roper 提交于
      The cursor size fields in intel_crtc just duplicate the data from
      cursor->state.crtc_{w,h} so we don't need them any more.  Worse, their
      use in the watermark code actually introduces a subtle bug since they
      don't get updated to mirror the state values until the plane commit
      stage, which is *after* we've already used them to calculate new
      watermark values.  This happens because we had to move watermark updates
      slightly earlier (outside vblank evasion) in commit
      
              commit 32b7eeec
              Author: Matt Roper <matthew.d.roper@intel.com>
              Date:   Wed Dec 24 07:59:06 2014 -0800
      
                  drm/i915: Refactor work that can sleep out of commit (v7)
      
      Dropping the intel_crtc fields and just using the state values (which
      are properly updated by the time watermark updates happen) should solve
      the problem.
      
      Aside from the actual removal of the struct fields (which are formatted
      in a way that I couldn't figure out how to match in Coccinelle), the
      rest of this patch was generated via the following semantic patch:
      
              // Drop assignment
              @@
              struct intel_crtc *C;
              struct drm_plane_state S;
              @@
              (
              - C->cursor_width = S.crtc_w;
              |
              - C->cursor_height = S.crtc_h;
              )
      
              // Replace usage
              @@
              struct intel_crtc *C;
              expression E;
              @@
              (
              - C->cursor_width
              + C->base.cursor->state->crtc_w
              |
              - C->cursor_height
              + C->base.cursor->state->crtc_h
              |
              - to_intel_crtc(E)->cursor_width
              + E->cursor->state->crtc_w
              |
              - to_intel_crtc(E)->cursor_height
              + E->cursor->state->crtc_h
              )
      
      v2: Rebase
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Joe Konno <joe.konno@linux.intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89346Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3dd512fb
  2. 05 3月, 2015 1 次提交
  3. 26 2月, 2015 1 次提交
    • A
      drm/i915: Removed the read of RP_STATE_CAP from sysfs/debugfs functions · bc4d91f6
      Akash Goel 提交于
      The frequency values(Rp0, Rp1, Rpn) reported by RP_STATE_CAP register
      are stored, initially by the Driver, inside the dev_priv->rps structure.
      Since these values are expected to remain same throughout, there is no real
      need to read this register, on dynamic basis, from certain debugfs/sysfs
      functions and the values can be instead retrieved from the dev_priv->rps
      structure when needed.
      For the i915_frequency_info debugfs interface, the frequency values from the
      RP_STATE_CAP register only should be used, to indicate the actual Hw state,
      since it is principally used for the debugging purpose.
      
      v2: Reverted the changes in i915_frequency_info function, to continue report
          back the frequency values, as per the actual Hw state (Chris)
      Signed-off-by: NAkash Goel <akash.goel@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bc4d91f6
  4. 25 2月, 2015 2 次提交
  5. 24 2月, 2015 2 次提交
    • J
      drm/i915/skl: Add SKL HW status to SSEU status · 7f992aba
      Jeff McGee 提交于
      Add a new section to the 'i915_sseu_status' debugfs entry to
      report the currently enabled counts of slice, subslice, and
      execution units on the device. The count of enabled subslice
      per slice represents the most enabled subslice on any one
      slice for devices where imbalances may exist. Similarly, the
      count of enabled EU per subslice represents the most enabled
      EU on any one subslice.
      
      Collect this device status for Skylake by reading the Gen9
      power gate control ack message registers. Power gate control
      operates on EU in pairs, therefore our reported counts of
      enabled EU can be overestimated by one for each pair in which
      one EU is fused-off.
      Signed-off-by: NJeff McGee <jeff.mcgee@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7f992aba
    • J
      drm/i915/skl: Determine SKL slice/subslice/EU info · 3873218f
      Jeff McGee 提交于
      Read fuse registers to determine the available slice total,
      subslice total, subslice per slice, EU total, and EU per subslice
      counts of the SKL device. The EU per subslice attribute is more
      precisely defined as the maximum EU available on any one subslice,
      since available EU counts may vary across subslices due to fusing.
      Set flags indicating the SKL device's slice/subslice/EU (SSEU)
      power gating capability. Make all values available via debugfs
      entry 'i915_sseu_status'.
      
      v2: Several small clean-ups suggested by Damien. Most notably,
          used smaller types for the new device info fields to reduce
          memory usage and improved the clarity/readability of the
          method used to extract attribute values from the fuse
          registers.
      Signed-off-by: NJeff McGee <jeff.mcgee@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3873218f
  6. 23 2月, 2015 1 次提交
  7. 14 2月, 2015 2 次提交
  8. 09 2月, 2015 1 次提交
  9. 30 1月, 2015 1 次提交
    • M
      drm/i915: Remove nested work in gpu error handling · b8d24a06
      Mika Kuoppala 提交于
      Now when we declare gpu errors only through our own dedicated
      hangcheck workqueue there is no need to have a separate workqueue
      for handling the resetting and waking up the clients as the deadlock
      concerns are no more.
      
      The only exception is i915_debugfs::i915_set_wedged, which triggers
      error handling through process context. However as this is only used through
      test harness it is responsibility for test harness not to introduce hangs
      through both debug interface and through hangcheck mechanism at the same time.
      
      Remove gpu_error.work and let the hangcheck work do the tasks it used to.
      
      v2: Add a big warning sign into i915_debugfs::i915_set_wedged (Chris)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      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>
      b8d24a06
  10. 29 1月, 2015 2 次提交
  11. 27 1月, 2015 10 次提交
    • V
      drm/i915: Use intel_gpu_freq() and intel_freq_opcode() · 7c59a9c1
      Ville Syrjälä 提交于
      Replace all the vlv_gpu_freq(), vlv_freq_opcode(),
      *GT_FREQUENCY_MULTIPLIER, and /GT_FREQUENCY_MULTIPLIER instances
      with intel_gpu_freq() and intel_freq_opcode() calls.
      
      Most of the change was performed with the following semantic patch:
      @@
      expression E;
      @@
      (
      - E * GT_FREQUENCY_MULTIPLIER
      + intel_gpu_freq(dev_priv, E)
      |
      - E *= GT_FREQUENCY_MULTIPLIER
      + E = intel_gpu_freq(dev_priv, E)
      |
      - E /= GT_FREQUENCY_MULTIPLIER
      + E = intel_freq_opcode(dev_priv, E)
      |
      - do_div(E, GT_FREQUENCY_MULTIPLIER)
      + E = intel_freq_opcode(dev_priv, E)
      )
      
      @@
      expression E1, E2;
      @@
      (
      - vlv_gpu_freq(E1, E2)
      + intel_gpu_freq(E1, E2)
      |
      - vlv_freq_opcode(E1, E2)
      + intel_freq_opcode(E1, E2)
      )
      
      @@
      expression E1, E2, E3, E4;
      @@
      (
      - if (IS_VALLEYVIEW(E1)) {
      -  E2 = intel_gpu_freq(E3, E4);
      - } else {
      -  E2 = intel_gpu_freq(E3, E4);
      - }
      + E2 = intel_gpu_freq(E3, E4);
      |
      - if (IS_VALLEYVIEW(E1)) {
      -  E2 = intel_freq_opcode(E3, E4);
      - } else {
      -  E2 = intel_freq_opcode(E3, E4);
      - }
      + E2 = intel_freq_opcode(E3, E4);
      )
      
      One hunk was manually undone as intel_gpu_freq() ended up
      calling itself. Supposedly it would be possible to exclude
      certain functions via !=~, but I couldn't get that to work.
      
      Also the removal of vlv_gpu_freq() and vlv_opcode_freq() compat
      wrappers was done manually.
      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>
      7c59a9c1
    • S
      drm/i915/skl: Adding power domains for AUX controllers · 1407121a
      Satheeshakrishna M 提交于
      Adding new power doamins for AUX controllers
      
      v2: Added new power domains in power_domain_str per Imre's comment
      
      v3: Added AUX power domains to older platforms
      
      v4: Rebase on top of POWER_DOMAIN_PLLS.
      
      v5: Modified to address review comments from Imre
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NSatheeshakrishna M <satheeshakrishna.m@intel.com>
      Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> (v3)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1407121a
    • M
      drm/i915: Rename i915_gen6_forcewake_count_info · f65367b5
      Mika Kuoppala 提交于
      There are multiple forcewake domains in newer architectures.
      Rename 'i915_gen6_forcewake_count_info' debugfs entry to
      'i915_forcewake_domains' to reflect this.
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f65367b5
    • M
      drm/i915: Rename the forcewake get/put functions · 59bad947
      Mika Kuoppala 提交于
      We have multiple forcewake domains now on recent gens. Change the
      function naming to reflect this.
      
      v2: More verbose names (Chris)
      v3: Rebase
      v4: Rebase
      v5: Add documentation for forcewake_get/put
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: Deepak S <deepak.s@linux.intel.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      59bad947
    • M
      drm/i915: Consolidate forcewake code · 05a2fb15
      Mika Kuoppala 提交于
      As we now have forcewake domains, take advantage of it
      by putting the differences in gen fw handling in data rather
      than in code.
      
      In past we have opencoded this quite extensively as the fw handling
      is in the fast path. There has also been a lot of cargo-culted
      copy'n'pasting from older gens to newer ones.
      
      Now when the releasing of the forcewake is done by deferred timer,
      it gives chance to consolidate more. Due to the frequency of actual hw
      access being significantly less.
      
      Take advantage of this and generalize the fw handling code
      as much as possible. But we still aim to keep the forcewake sequence
      particularities for each gen intact. So the access pattern
      to fw engines should remain the same.
      
      v2: - s/old_ack/clear_ack (Chris)
          - s/post_read/posting_read (Chris)
          - less polite commit msg (Chris)
      
      v3: - rebase
          - check and clear wake_count in init
      
      v4: - fix posting reads for gen8 (PRTS)
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: Deepak S <deepak.s@linux.intel.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      05a2fb15
    • C
      drm/i915: Reduce duplicated forcewake logic · b2cff0db
      Chris Wilson 提交于
      Introduce a structure to track the individual forcewake domains and use
      that to eliminate duplicate logic.
      
      v2: - Rebase on latest dinq (Mika)
          - for_each_fw_domain macro (Mika)
          - Handle reset atomically, keeping the timer running (Mika)
          - for_each_fw_domain parameter ordering (Chris)
          - defer timer on new register access (Mika)
      
      v3: - Fix forcewake_reset/get race by waiting pending timers
      
      v4: - cond_resched and verbose warning on timer deletion (Chris)
          - need to run pending timers manually on reset
      
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Acked-by: Deepak S <deepak.s@linux.intel.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b2cff0db
    • C
      drm/i915: Assert that runtime pm is active on user fw access · 6daccb0b
      Chris Wilson 提交于
      On user forcewake access, assert that runtime pm reference is held.
      Fix and cleanup the callsites accordingly.
      
      v2: Remove intel_runtime_pm_get() rebasehap (Deepak)
      
      v3: use drivers own runtime state tracking as pm_runtime_active()
          will return wrong results when we are in resume callchain (Mika)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: Deepak S <deepak.s@linux.intel.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6daccb0b
    • N
      drm/i915: Subsume intel_ctx_submit_request in to drm_i915_gem_request · 6d3d8274
      Nick Hoath 提交于
      Move all remaining elements that were unique to execlists queue items
      in to the associated request.
      
      Issue: VIZ-4274
      
      v2: Rebase. Fixed issue of overzealous freeing of request.
      v3: Removed re-addition of cleanup work queue (found by Daniel Vetter)
      v4: Rebase.
      v5: Actual removal of intel_ctx_submit_request. Update both tail and postfix
      pointer in __i915_add_request (found by Thomas Daniel)
      v6: Removed unrelated changes
      Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Reviewed-by: NThomas Daniel <thomas.daniel@intel.com>
      [danvet: Reformat comment with strange linebreaks.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6d3d8274
    • N
      drm/i915: Removed duplicate members from submit_request · 72f95afa
      Nick Hoath 提交于
      Where there were duplicate variables for the tail, context and ring (engine)
      in the gem request and the execlist queue item, use the one from the request
      and remove the duplicate from the execlist queue item.
      
      Issue: VIZ-4274
      
      v1: Rebase
      v2: Fixed build issues. Keep separate postfix & tail pointers as these are
      used in different ways. Reinserted missing full tail pointer update.
      Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Reviewed-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      72f95afa
    • A
      drm/i915: Make intel_crtc->config a pointer · 6e3c9717
      Ander Conselvan de Oliveira 提交于
      To match the semantics of drm_crtc->state, which this will eventually
      become. The allocation of the memory for config will be fixed in a
      followup patch. By adding the extra _config field to intel_crtc it was
      possible to generate this entire patch with the cocci script below.
      
      @@ @@
      struct intel_crtc {
      ...
      -struct intel_crtc_state config;
      +struct intel_crtc_state _config;
      +struct intel_crtc_state *config;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -memset(&crtc->config, 0, sizeof(crtc->config));
      +memset(crtc->config, 0, sizeof(*crtc->config));
      @@ @@
      __intel_set_mode(...) {
      <...
      -to_intel_crtc(crtc)->config = *pipe_config;
      +(*(to_intel_crtc(crtc)->config)) = *pipe_config;
      ...>
      }
      @@ @@
      intel_crtc_init(...) {
      ...
      WARN_ON(drm_crtc_index(&intel_crtc->base) != intel_crtc->pipe);
      +intel_crtc->config = &intel_crtc->_config;
      return;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -&crtc->config
      +crtc->config
      @@ struct intel_crtc *crtc; identifier member; @@
      -crtc->config.member
      +crtc->config->member
      @@ expression E; @@
      -&(to_intel_crtc(E)->config)
      +to_intel_crtc(E)->config
      @@ expression E; identifier member; @@
      -to_intel_crtc(E)->config.member
      +to_intel_crtc(E)->config->member
      
      v2: Clarify manual changes by splitting them into another patch. (Matt)
          Improve cocci script to generate even more of the changes. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6e3c9717
  12. 15 1月, 2015 1 次提交
  13. 16 12月, 2014 1 次提交
    • B
      drm/i915: Implement a framework for batch buffer pools · 493018dc
      Brad Volkin 提交于
      This adds a small module for managing a pool of batch buffers.
      The only current use case is for the command parser, as described
      in the kerneldoc in the patch. The code is simple, but separating
      it out makes it easier to change the underlying algorithms and to
      extend to future use cases should they arise.
      
      The interface is simple: init to create an empty pool, fini to
      clean it up, get to obtain a new buffer. Note that all buffers are
      expected to be inactive before cleaning up the pool.
      
      Locking is currently based on the caller holding the struct_mutex.
      We already do that in the places where we will use the batch pool
      for the command parser.
      
      v2:
      - s/BUG_ON/WARN_ON/ for locking assertions
      - Remove the cap on pool size
      - Switch from alloc/free to init/fini
      
      v3:
      - Idiomatic looping structure in _fini
      - Correct handling of purged objects
      - Don't return a buffer that's too much larger than needed
      
      v4:
      - Rebased to latest -nightly
      
      v5:
      - Remove _put() function and clean up comments to match
      
      v6:
      - Move purged check inside the loop (danvet, from v4 1/7 feedback)
      
      v7:
      - Use single list instead of two. (Chris W)
      - s/active_list/cache_list
      - Squashed in debug patches (Chris W)
        drm/i915: Add a batch pool debugfs file
      
        It provides some useful information about the buffers in
        the global command parser batch pool.
      
        v2: rebase on global pool instead of per-ring pools
        v3: rebase
      
        drm/i915: Add batch pool details to i915_gem_objects debugfs
      
        To better account for the potentially large memory consumption
        of the batch pool.
      
      v8:
      - Keep cache in LRU order (danvet, from v6 1/5 feedback)
      
      Issue: VIZ-4719
      Signed-off-by: NBrad Volkin <bradley.d.volkin@intel.com>
      Reviewed-By: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      493018dc
  14. 15 12月, 2014 2 次提交
    • T
      drm/i915: Infrastructure for supporting different GGTT views per object · fe14d5f4
      Tvrtko Ursulin 提交于
      Things like reliable GGTT mappings and mirrored 2d-on-3d display will need
      to map objects into the same address space multiple times.
      
      Added a GGTT view concept and linked it with the VMA to distinguish between
      multiple instances per address space.
      
      New objects and GEM functions which do not take this new view as a parameter
      assume the default of zero (I915_GGTT_VIEW_NORMAL) which preserves the
      previous behaviour.
      
      This now means that objects can have multiple VMA entries so the code which
      assumed there will only be one also had to be modified.
      
      Alternative GGTT views are supposed to borrow DMA addresses from obj->pages
      which is DMA mapped on first VMA instantiation and unmapped on the last one
      going away.
      
      v2:
          * Removed per view special casing in i915_gem_ggtt_prepare /
            finish_object in favour of creating and destroying DMA mappings
            on first VMA instantiation and last VMA destruction. (Daniel Vetter)
          * Simplified i915_vma_unbind which does not need to count the GGTT views.
            (Daniel Vetter)
          * Also moved obj->map_and_fenceable reset under the same check.
          * Checkpatch cleanups.
      
      v3:
          * Only retire objects once the last VMA is unbound.
      
      v4:
          * Keep scatter-gather table for alternative views persistent for the
            lifetime of the VMA.
          * Propagate binding errors to callers and handle appropriately.
      
      v5:
          * Explicitly look for normal GGTT view in i915_gem_obj_bound to align
            usage in i915_gem_object_ggtt_unpin. (Michel Thierry)
          * Change to single if statement in i915_gem_obj_to_ggtt. (Michel Thierry)
          * Removed stray semi-colon in i915_gem_object_set_cache_level.
      
      For: VIZ-4544
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      [danvet: Drop hunk from i915_gem_shrink since it's just prettification
      but upsets a __must_check warning.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fe14d5f4
    • D
      drm/i915: Use BUILD_BUG if possible in the i915 WARN_ON · 5f77eeb0
      Daniel Vetter 提交于
      Faster feedback to errors is always better. This is inspired by the
      addition to WARN_ONs to mask/enable helpers for registers to make sure
      callers have the arguments ordered correctly: Pretty much always the
      arguments are static.
      
      We use WARN_ON(1) a lot in default switch statements though where we
      should always handle all cases. So add a new macro specifically for
      that.
      
      The idea to use __builtin_constant_p is from Chris Wilson.
      
      v2: Use the ({}) gcc-ism to avoid the static inline, suggested by
      Dave. My first attempt used __cond as the temp var, which is the same
      used by BUILD_BUG_ON, but with inverted sense. Hilarity ensued, so
      sprinkle i915 into the name.
      
      Also use a temporary variable to only evaluate the condition once,
      suggested by Damien.
      
      v3: It's crazy but apparently 32bit gcc can't compile out the
      BUILD_BUG_ON in a lot of cases and just falls over. I have no idea
      why, but until clue grows just disable this nifty idea on 32bit
      builds. Reported by 0-day builder.
      
      v4: Got it all wrong, apparently its the gcc version. We need 4.9+.
      Now reported by Imre.
      
      v5: Chris suggested to add the case to MISSING_CASE for speedier
      debug.
      
      v6: Even some gcc 4.9 versions don't see through the maze, so give up
      for now. Keep the skeleton and MISSING_CASE stuff though.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      5f77eeb0
  15. 11 12月, 2014 6 次提交
  16. 04 12月, 2014 1 次提交
  17. 03 12月, 2014 4 次提交
    • D
      drm/i915: Remove redundant flip_work->flip_queued_ring · 3a8a946e
      Daniel Vetter 提交于
      Similar to the patch from John which removed obj->ring.
      
      Cc: John Harrison <John.C.Harrison@Intel.com>
      Cc: Thomas Daniel <Thomas.Daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      3a8a946e
    • J
      drm/i915: Remove the now redundant 'obj->ring' · 41c52415
      John Harrison 提交于
      The ring member of the object structure was always updated with the
      last_read_seqno member. Thus with the conversion to last_read_req, obj->ring is
      now a direct copy of obj->last_read_req->ring. This makes it somewhat redundant
      and potentially misleading (especially as there was no comment to explain its
      purpose).
      
      This checkin removes the redundant field. Many uses were simply testing for
      non-null to see if the object is active on the GPU. Some of these have been
      converted to check 'obj->active' instead. Others (where the last_read_req is
      about to be used anyway) have been changed to check obj->last_read_req. The rest
      simply pull the ring out from the request structure and proceed as before.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      41c52415
    • J
      drm/i915: Convert 'i915_seqno_passed' calls into 'i915_gem_request_completed' · 1b5a433a
      John Harrison 提交于
      Almost everywhere that caled i915_seqno_passed() was really asking 'has the
      given seqno popped out of the hardware yet?'. Thus it had to query the current
      hardware seqno and then do a signed delta comparison (which copes with wrapping
      around zero but not with seqno values more than 2GB apart, although the latter
      is unlikely!).
      
      Now that the majority of seqno instances have been replaced with request
      structures, it is possible to convert this test to be request based as well.
      There is now a 'i915_gem_request_completed()' function which takes a request and
      returns true or false as appropriate. Note that this currently just wraps up the
      original _passed() test but a later patch in the series will reduce this to
      simply returning a cached internal value, i.e.:
        _completed(req) { return req->completed; }'
      
      This checkin converts almost all _seqno_passed() calls. The only one left is in
      the semaphore code which still requires seqnos not request structures.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      [danvet: Drop hunk touching the trace_irq code since I've dropped the
      patch which converts that, and resolve resulting conflict.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1b5a433a
    • J
      drm/i915: Convert 'flip_queued_seqno' into 'flip_queued_request' · f06cc1b9
      John Harrison 提交于
      Converted the flip_queued_seqno value to be a request structure as part of the
      on going seqno to request changes. This includes reference counting the request
      being saved away to ensure it can not be retired and freed while the flip code
      is still waiting on it.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      [danvet: Again get rid of the _irq request unref by simply moving that
      into the unpin worker. Doesn't matter when we hang onto the request
      for a bit longer, and in the unpin worker we already grab the
      dev->struct_mutex anyway.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f06cc1b9