1. 13 11月, 2017 1 次提交
  2. 11 11月, 2017 2 次提交
  3. 03 11月, 2017 1 次提交
  4. 06 10月, 2017 1 次提交
  5. 05 10月, 2017 2 次提交
    • C
      drm/i915/scheduler: Support user-defined priorities · ac14fbd4
      Chris Wilson 提交于
      Use a priority stored in the context as the initial value when
      submitting a request. This allows us to change the default priority on a
      per-context basis, allowing different contexts to be favoured with GPU
      time at the expense of lower importance work. The user can adjust the
      context's priority via I915_CONTEXT_PARAM_PRIORITY, with more positive
      values being higher priority (they will be serviced earlier, after their
      dependencies have been resolved). Any prerequisite work for an execbuf
      will have its priority raised to match the new request as required.
      
      Normal users can specify any value in the range of -1023 to 0 [default],
      i.e. they can reduce the priority of their workloads (and temporarily
      boost it back to normal if so desired).
      
      Privileged users can specify any value in the range of -1023 to 1023,
      [default is 0], i.e. they can raise their priority above all overs and
      so potentially starve the system.
      
      Note that the existing schedulers are not fair, nor load balancing, the
      execution is strictly by priority on a first-come, first-served basis,
      and the driver may choose to boost some requests above the range
      available to users.
      
      This priority was originally based around nice(2), but evolved to allow
      clients to adjust their priority within a small range, and allow for a
      privileged high priority range.
      
      For example, this can be used to implement EGL_IMG_context_priority
      https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt
      
      	EGL_CONTEXT_PRIORITY_LEVEL_IMG determines the priority level of
              the context to be created. This attribute is a hint, as an
              implementation may not support multiple contexts at some
              priority levels and system policy may limit access to high
              priority contexts to appropriate system privilege level. The
              default value for EGL_CONTEXT_PRIORITY_LEVEL_IMG is
              EGL_CONTEXT_PRIORITY_MEDIUM_IMG."
      
      so we can map
      
      	PRIORITY_HIGH -> 1023 [privileged, will failback to 0]
      	PRIORITY_MED -> 0 [default]
      	PRIORITY_LOW -> -1023
      
      They also map onto the priorities used by VkQueue (and a VkQueue is
      essentially a timeline, our i915_gem_context under full-ppgtt).
      
      v2: s/CAP_SYS_ADMIN/CAP_SYS_NICE/
      v3: Report min/max user priorities as defines in the uapi, and rebase
      internal priorities on the exposed values.
      
      Testcase: igt/gem_exec_schedule
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-9-chris@chris-wilson.co.uk
      ac14fbd4
    • C
      drm/i915: Expand I915_PARAM_HAS_SCHEDULER into a capability bitmask · bf64e0b0
      Chris Wilson 提交于
      In the next few patches, we wish to enable different features for the
      scheduler, some which may subtlety change ABI (e.g. allow requests to be
      reordered under different circumstances). So we need to make sure
      userspace is cognizant of the changes (if they care), by which we employ
      the usual method of a GETPARAM. We already have an
      I915_PARAM_HAS_SCHEDULER (which notes the existing ability to reorder
      requests to avoid bubbles), and now we wish to extend that to be a
      bitmask to describe the different capabilities implemented.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-7-chris@chris-wilson.co.uk
      bf64e0b0
  6. 18 9月, 2017 1 次提交
  7. 14 9月, 2017 1 次提交
  8. 05 9月, 2017 1 次提交
  9. 15 8月, 2017 1 次提交
  10. 04 8月, 2017 1 次提交
    • L
      drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface · f89823c2
      Lionel Landwerlin 提交于
      The motivation behind this new interface is expose at runtime the
      creation of new OA configs which can be used as part of the i915 perf
      open interface. This will enable the kernel to learn new configs which
      may be experimental, or otherwise not part of the core set currently
      available through the i915 perf interface.
      
      v2: Drop DRM_ERROR for userspace errors (Matthew)
          Add padding to userspace structure (Matthew)
          s/guid/uuid/ (Matthew)
      
      v3: Use u32 instead of int to iterate through registers (Matthew)
      
      v4: Lock access to dynamic config list (Lionel)
      
      v5: by Matthew:
          Fix uninitialized error values
          Fix incorrect unwiding when opening perf stream
          Use kmalloc_array() to store register
          Use uuid_is_valid() to valid config uuids
          Declare ioctls as write only
          Check padding members are set to 0
          by Lionel:
          Return ENOENT rather than EINVAL when trying to remove non
          existing config
      
      v6: by Chris:
          Use ref counts for OA configs
          Store UUID in drm_i915_perf_oa_config rather then using pointer
          Shuffle fields of drm_i915_perf_oa_config to avoid padding
      
      v7: by Chris
          Rename uapi pointers fields to end with '_ptr'
      
      v8: by Andrzej, Marek, Sebastian
          Update register whitelisting
          by Lionel
          Add more register names for documentation
          Allow configuration programming in non-paranoid mode
          Add support for value filter for a couple of registers already
          programmed in other part of the kernel
      
      v9: Documentation fix (Lionel)
          Allow writing WAIT_FOR_RC6_EXIT only on Gen8+ (Andrzej)
      
      v10: Perform read access_ok() on register pointers (Lionel)
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: NAndrzej Datczuk <andrzej.datczuk@intel.com>
      Reviewed-by: NAndrzej Datczuk <andrzej.datczuk@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170803165812.2373-2-lionel.g.landwerlin@intel.com
      f89823c2
  11. 16 6月, 2017 1 次提交
  12. 15 6月, 2017 3 次提交
    • R
      drm/i915/perf: Add OA unit support for Gen 8+ · 19f81df2
      Robert Bragg 提交于
      Enables access to OA unit metrics for BDW, CHV, SKL and BXT which all
      share (more-or-less) the same OA unit design.
      
      Of particular note in comparison to Haswell: some OA unit HW config
      state has become per-context state and as a consequence it is somewhat
      more complicated to manage synchronous state changes from the cpu while
      there's no guarantee of what context (if any) is currently actively
      running on the gpu.
      
      The periodic sampling frequency which can be particularly useful for
      system-wide analysis (as opposed to command stream synchronised
      MI_REPORT_PERF_COUNT commands) is perhaps the most surprising state to
      have become per-context save and restored (while the OABUFFER
      destination is still a shared, system-wide resource).
      
      This support for gen8+ takes care to consider a number of timing
      challenges involved in synchronously updating per-context state
      primarily by programming all config state from the cpu and updating all
      current and saved contexts synchronously while the OA unit is still
      disabled.
      
      The driver intentionally avoids depending on command streamer
      programming to update OA state considering the lack of synchronization
      between the automatic loading of OACTXCONTROL state (that includes the
      periodic sampling state and enable state) on context restore and the
      parsing of any general purpose BB the driver can control. I.e. this
      implementation is careful to avoid the possibility of a context restore
      temporarily enabling any out-of-date periodic sampling state. In
      addition to the risk of transiently-out-of-date state being loaded
      automatically; there are also internal HW latencies involved in the
      loading of MUX configurations which would be difficult to account for
      from the command streamer (and we only want to enable the unit when once
      the MUX configuration is complete).
      
      Since the Gen8+ OA unit design no longer supports clock gating the unit
      off for a single given context (which effectively stopped any progress
      of counters while any other context was running) and instead supports
      tagging OA reports with a context ID for filtering on the CPU, it means
      we can no longer hide the system-wide progress of counters from a
      non-privileged application only interested in metrics for its own
      context. Although we could theoretically try and subtract the progress
      of other contexts before forwarding reports via read() we aren't in a
      position to filter reports captured via MI_REPORT_PERF_COUNT commands.
      As a result, for Gen8+, we always require the
      dev.i915.perf_stream_paranoid to be unset for any access to OA metrics
      if not root.
      
      v5: Drain submitted requests when enabling metric set to ensure no
          lite-restore erases the context image we just updated (Lionel)
      
      v6: In addition to drain, switch to kernel context & update all
          context in place (Chris)
      
      v7: Add missing mutex_unlock() if switching to kernel context fails
          (Matthew)
      
      v8: Simplify OA period/flex-eu-counters programming by using the
          batchbuffer instead of modifying ctx-image (Lionel)
      
      v9: Back to updating the context image (due to erroneous testing,
          batchbuffer programming the OA unit doesn't actually work)
          (Lionel)
          Pin context before updating context image (Chris)
          Drop MMIO programming now that we switch to a kernel context with
          right values in initial context image (Chris)
      
      v10: Just pin_map the contexts we want to modify or let the
           configuration happen on first use (Chris)
      
      v11: Update kernel context OA config through the batchbuffer rather
           than on the fly ctx-image update (Lionel)
      
      v12: Rework OA context registers update again by swithing away from
           user contexts and reconfiguring the kernel context through the
           batchbuffer and updating all the other contexts' context image.
           Also take care to lock slice/subslice configuration when OA is
           on. (Lionel)
      
      v13: Request rpcs updates on all engine when updating the OA config
           (Lionel)
      
      v14: Drop any kind of rpcs management now that we monitor sseu
           configuration changes in a later patch (Lionel)
           Remove usleep after programming the NOA configs on Gen8+, this
           doesn't seem to be needed (Lionel)
      
      v15: Respect coding style for block comments (Chris)
      
      v16: Add missing i915_add_request() in case we fail to emit OA
           configuration (Matthew)
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Matthew Auld <matthew.auld@intel.com> \o/
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      19f81df2
    • R
      drm/i915: expose _SUBSLICE_MASK GETPARM · f5320233
      Robert Bragg 提交于
      Assuming a uniform mask across all slices, this enables userspace to
      determine the specific sub slices can be enabled. This information is
      required, for example, to be able to analyse some OA counter reports
      where the counter configuration depends on the HW sub slice
      configuration.
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      f5320233
    • R
      drm/i915: expose _SLICE_MASK GETPARM · 7fed555c
      Robert Bragg 提交于
      Enables userspace to determine the maximum number of slices that can
      be enabled on the device and also know what specific slices can be
      enabled. This information is required, for example, to be able to
      analyse some OA counter reports where the counter configuration
      depends on the HW slice configuration.
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      7fed555c
  13. 15 4月, 2017 1 次提交
  14. 12 4月, 2017 1 次提交
  15. 28 1月, 2017 2 次提交
  16. 19 1月, 2017 1 次提交
  17. 01 12月, 2016 1 次提交
  18. 22 11月, 2016 2 次提交
    • R
      drm/i915: Enable i915 perf stream for Haswell OA unit · d7965152
      Robert Bragg 提交于
      Gen graphics hardware can be set up to periodically write snapshots of
      performance counters into a circular buffer via its Observation
      Architecture and this patch exposes that capability to userspace via the
      i915 perf interface.
      
      v2:
         Make sure to initialize ->specific_ctx_id when opening, without
         relying on _pin_notify hook, in case ctx already pinned.
      v3:
         Revert back to pinning ctx upfront when opening stream, removing
         need to hook in to pinning and to update OACONTROL on the fly.
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Reviewed-by: NSourab Gupta <sourab.gupta@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161107194957.3385-7-robert@sixbynine.org
      d7965152
    • R
      drm/i915: Add i915 perf infrastructure · eec688e1
      Robert Bragg 提交于
      Adds base i915 perf infrastructure for Gen performance metrics.
      
      This adds a DRM_IOCTL_I915_PERF_OPEN ioctl that takes an array of uint64
      properties to configure a stream of metrics and returns a new fd usable
      with standard VFS system calls including read() to read typed and sized
      records; ioctl() to enable or disable capture and poll() to wait for
      data.
      
      A stream is opened something like:
      
        uint64_t properties[] = {
            /* Single context sampling */
            DRM_I915_PERF_PROP_CTX_HANDLE,        ctx_handle,
      
            /* Include OA reports in samples */
            DRM_I915_PERF_PROP_SAMPLE_OA,         true,
      
            /* OA unit configuration */
            DRM_I915_PERF_PROP_OA_METRICS_SET,    metrics_set_id,
            DRM_I915_PERF_PROP_OA_FORMAT,         report_format,
            DRM_I915_PERF_PROP_OA_EXPONENT,       period_exponent,
         };
         struct drm_i915_perf_open_param parm = {
            .flags = I915_PERF_FLAG_FD_CLOEXEC |
                     I915_PERF_FLAG_FD_NONBLOCK |
                     I915_PERF_FLAG_DISABLED,
            .properties_ptr = (uint64_t)properties,
            .num_properties = sizeof(properties) / 16,
         };
         int fd = drmIoctl(drm_fd, DRM_IOCTL_I915_PERF_OPEN, &param);
      
      Records read all start with a common { type, size } header with
      DRM_I915_PERF_RECORD_SAMPLE being of most interest. Sample records
      contain an extensible number of fields and it's the
      DRM_I915_PERF_PROP_SAMPLE_xyz properties given when opening that
      determine what's included in every sample.
      
      No specific streams are supported yet so any attempt to open a stream
      will return an error.
      
      v2:
          use i915_gem_context_get() - Chris Wilson
      v3:
          update read() interface to avoid passing state struct - Chris Wilson
          fix some rebase fallout, with i915-perf init/deinit
      v4:
          s/DRM_IORW/DRM_IOW/ - Emil Velikov
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Reviewed-by: NSourab Gupta <sourab.gupta@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161107194957.3385-2-robert@sixbynine.org
      eec688e1
  19. 21 11月, 2016 1 次提交
  20. 15 11月, 2016 1 次提交
  21. 26 8月, 2016 1 次提交
  22. 16 8月, 2016 1 次提交
  23. 05 8月, 2016 2 次提交
  24. 20 7月, 2016 1 次提交
  25. 19 7月, 2016 1 次提交
  26. 04 7月, 2016 1 次提交
  27. 01 7月, 2016 1 次提交
  28. 13 5月, 2016 1 次提交
  29. 28 1月, 2016 1 次提交
  30. 21 1月, 2016 1 次提交
  31. 10 12月, 2015 1 次提交
  32. 09 12月, 2015 1 次提交
    • C
      drm/i915: Add soft-pinning API for execbuffer · 506a8e87
      Chris Wilson 提交于
      Userspace can pass in an offset that it presumes the object is located
      at. The kernel will then do its utmost to fit the object into that
      location. The assumption is that userspace is handling its own object
      locations (for example along with full-ppgtt) and that the kernel will
      rarely have to make space for the user's requests.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      
      v2: Fixed incorrect eviction found by Michal Winiarski - fix suggested by Chris
      Wilson.  Fixed incorrect error paths causing crash found by Michal Winiarski.
      (Not published externally)
      
      v3: Rebased because of trivial conflict in object_bind_to_vm.  Fixed eviction
      to allow eviction of soft-pinned objects when another soft-pinned object used
      by a subsequent execbuffer overlaps reported by Michal Winiarski.
      (Not published externally)
      
      v4: Moved soft-pinned objects to the front of ordered_vmas so that they are
      pinned first after an address conflict happens to avoid repeated conflicts in
      rare cases (Suggested by Chris Wilson).  Expanded comment on
      drm_i915_gem_exec_object2.offset to cover this new API.
      
      v5: Added I915_PARAM_HAS_EXEC_SOFTPIN parameter for detecting this capability
      (Kristian). Added check for multiple pinnings on eviction (Akash). Made sure
      buffers are not considered misplaced without the user specifying
      EXEC_OBJECT_SUPPORTS_48B_ADDRESS.  User must assume responsibility for any
      addressing workarounds.  Updated object2.offset field comment again to clarify
      NO_RELOC case (Chris).  checkpatch cleanup.
      
      v6: Trivial rebase on latest drm-intel-nightly
      
      v7: Catch attempts to pin above the max virtual address size and return
      EINVAL (Tvrtko). Decouple EXEC_OBJECT_SUPPORTS_48B_ADDRESS and
      EXEC_OBJECT_PINNED flags, user must pass both flags in any attempt to pin
      something at an offset above 4GB (Chris, Daniel Vetter).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Zou Nanhai <nanhai.zou@intel.com>
      Cc: Kristian Høgsberg <hoegsberg@gmail.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Acked-by: PDT
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449575707-20933-1-git-send-email-thomas.daniel@intel.com
      506a8e87
  33. 18 11月, 2015 1 次提交