1. 21 6月, 2016 1 次提交
  2. 14 6月, 2016 6 次提交
  3. 13 6月, 2016 2 次提交
  4. 07 6月, 2016 1 次提交
    • D
      drm/i915/guc: disable GuC submission earlier during GuC (re)load · 29fb72c7
      Dave Gordon 提交于
      When resetting and reloading the GuC, the GuC submission management code
      also needs to destroy and recreate the GuC client(s). Currently this is
      done by a separate call from the GuC loader, but really, it's just an
      internal detail of the submission code. So here we remove the call from
      the loader (which is too late, really, because the GuC has already been
      reloaded at this point) and put it into guc_submission_init() instead.
      This means that any preexisting client is destroyed *before* the GuC
      (re)load and then recreated after, iff the firmware was successfully
      loaded. If the GuC reload fails, we don't recreate the client, so
      fallback to execlists mode (if active) won't leak the client object
      (previously, the now-unusable client would have been left allocated,
      and leaked if the driver were unloaded).
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      29fb72c7
  5. 24 5月, 2016 3 次提交
  6. 23 5月, 2016 4 次提交
    • D
      drm/i915/guc: rework guc_add_workqueue_item() · 0a31afbc
      Dave Gordon 提交于
      Mostly little optimisations and future-proofing against code breakage.
      For instance, if the driver is correctly following the submission
      protocol, the "out of space" condition is impossible, so the previous
      runtime WARN_ON() is promoted to a GEM_BUG_ON() for a more dramatic
      effect in development and less impact in end-user systems.
      
      Similarly we can make alignment checking more stringent and replace
      other WARN_ON() conditions that don't relate to the runtime hardware
      state with either BUILD_BUG_ON() for compile-time-detectable issues, or
      GEM_BUG_ON() for logical "can't happen" errors.
      
      With those changes, we can convert it to void, as suggested by Chris
      Wilson, and update the calling code appropriately.
      
      v2:
          Note that we're now putting the request seqno in the "fence_id"
          field of each GuC-work-item, in case it turns up somewhere useful
          (e.g. in a GuC log) [Tvrtko Ursulin].
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      0a31afbc
    • D
      drm/i915/guc: don't spinwait if the GuC's workqueue is full · 551aaecd
      Dave Gordon 提交于
      Rather than wait to see whether more space becomes available in the GuC
      submission workqueue, we can just return -EAGAIN and let the caller try
      again in a little while. This gets rid of an uninterruptable sleep in
      the polling code :)
      
      We'll also add a counter to the GuC client statistics, to see how often
      we find the WQ full.
      
      v2:
          Flag the likely() code path (Tvtrko Ursulin).
      
      v4:
          Add/update comments about failure counters (Tvtrko Ursulin).
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      551aaecd
    • D
      drm/i915/guc: pass request (not client) to i915_guc_{wq_check_space, submit}() · 7c2c270d
      Dave Gordon 提交于
      The knowledge of how to derive the relevant client from the request
      should be localised within i915_guc_submission.c; the LRC code shouldn't
      have to know about the internal details of the GuC submission process.
      And all the information the GuC code needs should be encapsulated in (or
      reachable from) the request.
      
      v2:
          GEM_BUG_ON() for bad GuC client (Tvrtko Ursulin).
          Add/update kerneldoc explaining check_space/submit protocol
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      7c2c270d
    • D
      drm/i915/guc: add enable_guc_loading parameter · fce91f22
      Dave Gordon 提交于
      Split the function of "enable_guc_submission" into two separate
      options.  The new one ("enable_guc_loading") controls only the
      *fetching and loading* of the GuC firmware image. The existing
      one is redefined to control only the *use* of the GuC for batch
      submission once the firmware is loaded.
      
      In addition, the degree of control has been refined from a simple
      bool to an integer key, allowing several options:
      -1 (default)     whatever the platform default is
       0  DISABLE      don't load/use the GuC
       1  BEST EFFORT  try to load/use the GuC, fallback if not available
       2  REQUIRE      must load/use the GuC, else leave the GPU wedged
      
      The new platform default (as coded here) will be to attempt to
      load the GuC iff the device has a GuC that requires firmware,
      but not yet to use it for submission. A later patch will change
      to enable it if appropriate.
      
      v4:
          Changed some error-message levels, mostly ERROR->INFO, per
          review comments by Tvrtko Ursulin.
      
      v5:
          Dropped one more error message, disabled GuC submission on
          hypothetical firmware-free devices [Tvrtko Ursulin].
      
      v6:
          Logging tidy by Tvrtko Ursulin:
           * Do not log falling back to execlists when wedging the GPU.
           * Do not log fw load errors when load was disabled by user.
           * Pass down some error code from fw load for log message to
             make more sense.
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v5)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Tested-by: NFiedorowicz, Lukasz <lukasz.fiedorowicz@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v5)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Nick Hoath <nicholas.hoath@intel.com> (v6)
      fce91f22
  7. 11 5月, 2016 1 次提交
  8. 28 4月, 2016 1 次提交
  9. 25 4月, 2016 1 次提交
  10. 20 4月, 2016 3 次提交
    • D
      drm/i915/guc: local optimisations and updating comments · 86e06cc0
      Dave Gordon 提交于
      Tidying up guc_init_proc_desc() and adding commentary to the client
      structure after the recent change in GuC page mapping strategy.
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1461078516-28678-1-git-send-email-david.s.gordon@intel.comReviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      86e06cc0
    • A
      drm/i915/guc: drop cached copy of 'wq_head' · a5916e8f
      Alex Dai 提交于
      Now that we keep the GuC client process descriptor permanently mapped,
      we don't really need to keep a local copy of the GuC's work-queue-head.
      So we can simplify the code a little by not doing this.
      Signed-off-by: NAlex Dai <yu.dai@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      a5916e8f
    • D
      drm/i915/guc: keep GuC doorbell & process descriptor mapped in kernel · 0d92a6a4
      Dave Gordon 提交于
      Don't use kmap_atomic() for doorbell & process descriptor access.
      This patch fixes the BUG shown below, where the thread could sleep
      while holding a kmap_atomic mapping. In order not to need to call
      kmap_atomic() in this code path, we now set up a permanent kernel
      mapping of the shared doorbell and process-descriptor page, and
      use that in all doorbell and process-descriptor related code.
      
        BUG: scheduling while atomic: gem_close_race/1941/0x00000002
        Modules linked in: hid_generic usbhid i915 asix usbnet libphy mii
          i2c_algo_bit drm_kms_helper cfbfillrect syscopyarea cfbimgblt
          sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm coretemp i2c_hid
          hid video pinctrl_sunrisepoint pinctrl_intel acpi_pad nls_iso8859_1
          e1000e ptp psmouse pps_core ahci libahci
        CPU: 0 PID: 1941 Comm: gem_close_race Tainted: G     U 4.4.0-160121+ #123
        Hardware name: Intel Corporation Skylake Client platform/Skylake AIO
          DDR3L RVP10, BIOS SKLSE2R1.R00.X100.B01.1509220551 09/22/2015
          0000000000013e40 ffff880166c27a78 ffffffff81280d02 ffff880172c13e40
          ffff880166c27a88 ffffffff810c203a ffff880166c27ac8 ffffffff814ec808
          ffff88016b7c6000 ffff880166c28000 00000000000f4240 0000000000000001
        Call Trace:
          [<ffffffff81280d02>] dump_stack+0x4b/0x79
          [<ffffffff810c203a>] __schedule_bug+0x41/0x4f
          [<ffffffff814ec808>] __schedule+0x5a8/0x690
          [<ffffffff814ec927>] schedule+0x37/0x80
          [<ffffffff814ef3fd>] schedule_hrtimeout_range_clock+0xad/0x130
          [<ffffffff81090be0>] ? hrtimer_init+0x10/0x10
          [<ffffffff814ef3f1>] ?  schedule_hrtimeout_range_clock+0xa1/0x130
          [<ffffffff814ef48e>] schedule_hrtimeout_range+0xe/0x10
          [<ffffffff814eef9b>] usleep_range+0x3b/0x40
          [<ffffffffa01ec109>] i915_guc_wq_check_space+0x119/0x210 [i915]
          [<ffffffffa01da47c>] intel_logical_ring_alloc_request_extras+0x5c/0x70 [i915]
          [<ffffffffa01cdbf1>] i915_gem_request_alloc+0x91/0x170 [i915]
          [<ffffffffa01c1c07>] i915_gem_do_execbuffer.isra.25+0xbc7/0x12a0 [i915]
          [<ffffffffa01cb785>] ?  i915_gem_object_get_pages_gtt+0x225/0x3c0 [i915]
          [<ffffffffa01d1fb6>] ? i915_gem_pwrite_ioctl+0xd6/0x9f0 [i915]
          [<ffffffffa01c2e68>] i915_gem_execbuffer2+0xa8/0x250 [i915]
          [<ffffffffa00f65d8>] drm_ioctl+0x258/0x4f0 [drm]
          [<ffffffffa01c2dc0>] ? i915_gem_execbuffer+0x340/0x340 [i915]
          [<ffffffff8111590d>] do_vfs_ioctl+0x2cd/0x4a0
          [<ffffffff8111eac2>] ? __fget+0x72/0xb0
          [<ffffffff81115b1c>] SyS_ioctl+0x3c/0x70
          [<ffffffff814effd7>] entry_SYSCALL_64_fastpath+0x12/0x6a
        ------------[ cut here ]------------
      
      v4:
        Only tear down doorbell & kunmap() client object if we actually
        succeeded in allocating a client object (Tvrtko Ursulin)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93847Original-version-by: NAlex Dai <yu.dai@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Tvtrko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      0d92a6a4
  11. 24 3月, 2016 2 次提交
  12. 16 3月, 2016 3 次提交
    • T
      drm/i915: More intel_engine_cs renaming · 666796da
      Tvrtko Ursulin 提交于
      Some trivial ones, first pass done with Coccinelle:
      
      @@
      @@
      (
      - I915_NUM_RINGS
      + I915_NUM_ENGINES
      |
      - intel_ring_flag
      + intel_engine_flag
      |
      - for_each_ring
      + for_each_engine
      |
      - i915_gem_request_get_ring
      + i915_gem_request_get_engine
      |
      - intel_ring_idle
      + intel_engine_idle
      |
      - i915_gem_reset_ring_status
      + i915_gem_reset_engine_status
      |
      - i915_gem_reset_ring_cleanup
      + i915_gem_reset_engine_cleanup
      |
      - init_ring_lists
      + init_engine_lists
      )
      
      But that didn't fully work so I cleaned it up with:
      
      for f in *.[hc]; do sed -i -e s/I915_NUM_RINGS/I915_NUM_ENGINES/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_request_get_ring/i915_gem_request_get_engine/ $f; done
      for f in *.[hc]; do sed -i -e s/intel_ring_flag/intel_engine_flag/ $f; done
      for f in *.[hc]; do sed -i -e s/intel_ring_idle/intel_engine_idle/ $f; done
      for f in *.[hc]; do sed -i -e s/init_ring_lists/init_engine_lists/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_reset_ring_cleanup/i915_gem_reset_engine_cleanup/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_reset_ring_status/i915_gem_reset_engine_status/ $f; done
      
      v2: Rebase.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      666796da
    • T
      drm/i915: Rename intel_engine_cs struct members · 4a570db5
      Tvrtko Ursulin 提交于
      below and a couple manual fixups.
      
      @@
      identifier I, J;
      @@
      struct I {
      ...
      - struct intel_engine_cs *J;
      + struct intel_engine_cs *engine;
      ...
      }
      @@
      identifier I, J;
      @@
      struct I {
      ...
      - struct intel_engine_cs J;
      + struct intel_engine_cs engine;
      ...
      }
      @@
      struct drm_i915_private *d;
      @@
      (
      - d->ring
      + d->engine
      )
      @@
      struct i915_execbuffer_params *p;
      @@
      (
      - p->ring
      + p->engine
      )
      @@
      struct intel_ringbuffer *r;
      @@
      (
      - r->ring
      + r->engine
      )
      @@
      struct drm_i915_gem_request *req;
      @@
      (
      - req->ring
      + req->engine
      )
      
      v2: Script missed the tracepoint code - fixed up by hand.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      4a570db5
    • T
      drm/i915: Rename local struct intel_engine_cs variables · e2f80391
      Tvrtko Ursulin 提交于
      Done by the Coccinelle script below plus a manual
      intervention to GEN8_RING_SEMAPHORE_INIT.
      
      @@
      expression E;
      @@
      - struct intel_engine_cs *ring = E;
      + struct intel_engine_cs *engine = E;
      <+...
      - ring
      + engine
      ...+>
      @@
      @@
      - struct intel_engine_cs *ring;
      + struct intel_engine_cs *engine;
      <+...
      - ring
      + engine
      ...+>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      e2f80391
  13. 25 1月, 2016 2 次提交
  14. 21 1月, 2016 1 次提交
  15. 05 1月, 2016 4 次提交
  16. 19 12月, 2015 1 次提交
  17. 12 12月, 2015 1 次提交
    • D
      drm/i915: mark GEM object pages dirty when mapped & written by the CPU · 033908ae
      Dave Gordon 提交于
      In various places, a single page of a (regular) GEM object is mapped into
      CPU address space and updated. In each such case, either the page or the
      the object should be marked dirty, to ensure that the modifications are
      not discarded if the object is evicted under memory pressure.
      
      The typical sequence is:
      	va = kmap_atomic(i915_gem_object_get_page(obj, pageno));
      	*(va+offset) = ...
      	kunmap_atomic(va);
      
      Here we introduce i915_gem_object_get_dirty_page(), which performs the
      same operation as i915_gem_object_get_page() but with the side-effect
      of marking the returned page dirty in the pagecache.  This will ensure
      that if the object is subsequently evicted (due to memory pressure),
      the changes are written to backing store rather than discarded.
      
      Note that it works only for regular (shmfs-backed) GEM objects, but (at
      least for now) those are the only ones that are updated in this way --
      the objects in question are contexts and batchbuffers, which are always
      shmfs-backed.
      
      Separate patches deal with the cases where whole objects are (or may
      be) dirtied.
      
      v3: Mark two more pages dirty in the page-boundary-crossing
          cases of the execbuffer relocation code [Chris Wilson]
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449773486-30822-2-git-send-email-david.s.gordon@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      033908ae
  18. 03 12月, 2015 1 次提交
  19. 27 11月, 2015 1 次提交
  20. 18 11月, 2015 1 次提交
    • V
      drm/i915: Type safe register read/write · f0f59a00
      Ville Syrjälä 提交于
      Make I915_READ and I915_WRITE more type safe by wrapping the register
      offset in a struct. This should eliminate most of the fumbles we've had
      with misplaced parens.
      
      This only takes care of normal mmio registers. We could extend the idea
      to other register types and define each with its own struct. That way
      you wouldn't be able to accidentally pass the wrong thing to a specific
      register access function.
      
      The gpio_reg setup is probably the ugliest thing left. But I figure I'd
      just leave it for now, and wait for some divine inspiration to strike
      before making it nice.
      
      As for the generated code, it's actually a bit better sometimes. Eg.
      looking at i915_irq_handler(), we can see the following change:
        lea    0x70024(%rdx,%rax,1),%r9d
        mov    $0x1,%edx
      - movslq %r9d,%r9
      - mov    %r9,%rsi
      - mov    %r9,-0x58(%rbp)
      - callq  *0xd8(%rbx)
      + mov    %r9d,%esi
      + mov    %r9d,-0x48(%rbp)
       callq  *0xd8(%rbx)
      
      So previously gcc thought the register offset might be signed and
      decided to sign extend it, just in case. The rest appears to be
      mostly just minor shuffling of instructions.
      
      v2: i915_mmio_reg_{offset,equal,valid}() helpers added
          s/_REG/_MMIO/ in the register defines
          mo more switch statements left to worry about
          ring_emit stuff got sorted in a prep patch
          cmd parser, lrc context and w/a batch buildup also in prep patch
          vgpu stuff cleaned up and moved to a prep patch
          all other unrelated changes split out
      v3: Rebased due to BXT DSI/BLC, MOCS, etc.
      v4: Rebased due to churn, s/i915_mmio_reg_t/i915_reg_t/
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1447853606-2751-1-git-send-email-ville.syrjala@linux.intel.com
      f0f59a00