Skip to content
  1. Jan 30, 2019
    • Chris Wilson's avatar
      drm/i915: Replace global breadcrumbs with per-context interrupt tracking · 52c0fdb2
      Chris Wilson authored
      A few years ago, see commit 688e6c72 ("drm/i915: Slaughter the
      thundering i915_wait_request herd"), the issue of handling multiple
      clients waiting in parallel was brought to our attention. The
      requirement was that every client should be woken immediately upon its
      request being signaled, without incurring any cpu overhead.
      
      To handle certain fragility of our hw meant that we could not do a
      simple check inside the irq handler (some generations required almost
      unbounded delays before we could be sure of seqno coherency) and so
      request completion checking required delegation.
      
      Before commit 688e6c72, the solution was simple. Every client
      waiting on a request would be woken on every interrupt and each would do
      a heavyweight check to see if their request was complete. Commit
      688e6c72 introduced an rbtree so that only the earliest waiter on
      the global timeline would woken, and would wake the next and so on.
      (Along with various complications to handle requests being reordered
      along the global timeline, and also a requirement for kthread to provide
      a delegate for fence signaling that had no process context.)
      
      The global rbtree depends on knowing the execution timeline (and global
      seqno). Without knowing that order, we must instead check all contexts
      queued to the HW to see which may have advanced. We trim that list by
      only checking queued contexts that are being waited on, but still we
      keep a list of all active contexts and their active signalers that we
      inspect from inside the irq handler. By moving the waiters onto the fence
      signal list, we can combine the client wakeup with the dma_fence
      signaling (a dramatic reduction in complexity, but does require the HW
      being coherent, the seqno must be visible from the cpu before the
      interrupt is raised - we keep a timer backup just in case).
      
      Having previously fixed all the issues with irq-seqno serialisation (by
      inserting delays onto the GPU after each request instead of random delays
      on the CPU after each interrupt), we can rely on the seqno state to
      perfom direct wakeups from the interrupt handler. This allows us to
      preserve our single context switch behaviour of the current routine,
      with the only downside that we lose the RT priority sorting of wakeups.
      In general, direct wakeup latency of multiple clients is about the same
      (about 10% better in most cases) with a reduction in total CPU time spent
      in the waiter (about 20-50% depending on gen). Average herd behaviour is
      improved, but at the cost of not delegating wakeups on task_prio.
      
      v2: Capture fence signaling state for error state and add comments to
      warm even the most cold of hearts.
      v3: Check if the request is still active before busywaiting
      v4: Reduce the amount of pointer misdirection with list_for_each_safe
      and using a local i915_request variable inside the loops
      v5: Add a missing pluralisation to a purely informative selftest message.
      
      References: 688e6c72
      
       ("drm/i915: Slaughter the thundering i915_wait_request herd")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129205230.19056-2-chris@chris-wilson.co.uk
      52c0fdb2
    • Chris Wilson's avatar
      drm/i915: Remove the intel_engine_notify tracepoint · 3df0bd19
      Chris Wilson authored
      
      
      The global seqno is defunct and so we have no meaningful indicator of
      forward progress for an engine. You need to listen to the request
      signaling tracepoints instead.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129205230.19056-1-chris@chris-wilson.co.uk
      3df0bd19
    • Ville Syrjälä's avatar
      drm/i915/tv: Bypass the vertical filter if possible · 68e94f62
      Ville Syrjälä authored
      
      
      Let's switch the pipe into interlaced mode and switch off
      the TV encoder vertical filter if the pipe vdisplay
      matches the TV YSIZE exactly.
      
      While I didn't measure it I presume this might reduce
      the power consumption a little bit, and the pixel rate
      is halved as the pipe will now fetching in interlaced
      mode rather than in progressive mode (effectively the
      same difference as between IF-ID vs. PF-ID pfit modes
      on more modern hardware) so a bit easier on the memory
      bandwidth.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129141913.5515-2-ville.syrjala@linux.intel.com
      
      
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      68e94f62
    • Ville Syrjälä's avatar
      drm/i915/tv: Fix adjusted_mode dotclock for interlaced modes · addc80f0
      Ville Syrjälä authored
      intel_tv_mode_to_mode() assumes the pipe will be in progressive
      fetch mode, and thus when programming the pipe into interlaced
      mode we have to halve the calculated dotclock to get the correct
      field duration.
      
      This becomes more important when we start to program the pipe
      into interlaced mode on i965gm as we depend on the timestamps
      to get accurate frame counter values. Withot halving the clock
      our guesstimated frame counter would tick at twice the expected
      speed.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Fixes: 690157f0
      
       ("drm/i915/tv: Fix >1024 modes on gen3")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129141913.5515-1-ville.syrjala@linux.intel.com
      
      
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      addc80f0
    • Ville Syrjälä's avatar
      drm: Constify drm_color_lut_check() · 5a3db6f0
      Ville Syrjälä authored
      
      
      drm_color_lut_check() doens't modify the passed in blob so
      let's make it const.
      
      Also s/uint32_t/u32/ while at it.
      
      v2: Reduce line wraps (Sam)
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129170609.5718-1-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      5a3db6f0
    • Chris Wilson's avatar
      drm/i915/execlists: Suppress preempting self · c9a64622
      Chris Wilson authored
      In order to avoid preempting ourselves, we currently refuse to schedule
      the tasklet if we reschedule an inflight context. However, this glosses
      over a few issues such as what happens after a CS completion event and
      we then preempt the newly executing context with itself, or if something
      else causes a tasklet_schedule triggering the same evaluation to
      preempt the active context with itself.
      
      However, when we avoid preempting ELSP[0], we still retain the preemption
      value as it may match a second preemption request within the same time period
      that we need to resolve after the next CS event. However, since we only
      store the maximum preemption priority seen, it may not match the
      subsequent event and so we should double check whether or not we
      actually do need to trigger a preempt-to-idle by comparing the top
      priorities from each queue. Later, this gives us a hook for finer
      control over deciding whether the preempt-to-idle is justified.
      
      The sequence of events where we end up preempting for no avail is:
      
      1. Queue requests/contexts A, B
      2. Priority boost A; no preemption as it is executing, but keep hint
      3. After CS switch, B is less than hint, force preempt-to-idle
      4. Resubmit B after idling
      
      v2: We can simplify a bunch of tests based on the knowledge that PI will
      ensure that earlier requests along the same context will have the highest
      priority.
      v3: Demonstrate the stale preemption hint with a selftest
      
      References: a2bf92e8
      
       ("drm/i915/execlists: Avoid kicking priority on the current context")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129185452.20989-4-chris@chris-wilson.co.uk
      c9a64622
    • Chris Wilson's avatar
      drm/i915: Rename execlists->queue_priority to queue_priority_hint · 4d97cbe0
      Chris Wilson authored
      
      
      After noticing that we trigger preemption events for currently executing
      requests, as well as requests that complete before the preemption and
      attempting to suppress those preemption events, it is wise to not
      consider the queue_priority to be authoritative. As we only track the
      maximum priority seen between dequeue passes, if the maximum priority
      request is no longer available for dequeuing (it completed or is even
      executing on another engine), we have no knowledge of the previous
      queue_priority as it would require us to keep a full history of enqueued
      requests -- but we already have that history in the priolists!
      
      Rename the queue_priority to queue_priority_hint so that we do not
      confuse it as being exactly the maximum priority in the queue, but merely
      an indication that we have seen a new maximum priority value and as such
      we should check whether it should preempt the currently running request.
      
      v2: s/preempt_priority_hint/queue_priority_hint/ as preempt implies it
      being only used for the singular task of preemption and not the wider
      question of waking up due to a change in the queue.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129185452.20989-3-chris@chris-wilson.co.uk
      4d97cbe0
    • Chris Wilson's avatar
      drm/i915: Identify active requests · 85474441
      Chris Wilson authored
      
      
      To allow requests to forgo a common execution timeline, one question we
      need to be able to answer is "is this request running?". To track
      whether a request has started on HW, we can emit a breadcrumb at the
      beginning of the request and check its timeline's HWSP to see if the
      breadcrumb has advanced past the start of this request. (This is in
      contrast to the global timeline where we need only ask if we are on the
      global timeline and if the timeline has advanced past the end of the
      previous request.)
      
      There is still confusion from a preempted request, which has already
      started but relinquished the HW to a high priority request. For the
      common case, this discrepancy should be negligible. However, for
      identification of hung requests, knowing which one was running at the
      time of the hang will be much more important.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129185452.20989-2-chris@chris-wilson.co.uk
      85474441
    • Chris Wilson's avatar
      drm/i915/selftests: Apply a subtest filter · 06039d98
      Chris Wilson authored
      
      
      In bringup on simulated HW even rudimentary tests are slow, and so many
      may fail that we want to be able to filter out the noise to focus on the
      specific problem. Even just the tests groups provided for igt is not
      specific enough, and we would like to isolate one particular subtest
      (and probably subsubtests!). For simplicity, allow the user to provide a
      command line parameter such as
      
      	i915.st_filter=i915_timeline_mock_selftests/igt_sync
      
      to restrict ourselves to only running on subtest. The exact name to use
      is given during a normal run, highlighted as an error if it failed,
      debug otherwise. The test group is optional, and then all subtests are
      compared for an exact match with the filter (most subtests have unique
      names). The filter can be negated, e.g. i915.st_filter=!igt_sync and
      then all tests but those that match will be run. More than one match can
      be supplied separated by a comma, e.g.
      
      	i915.st_filter=igt_vma_create,igt_vma_pin1
      
      to only run those specified, or
      
      	i915.st_filter=!igt_vma_create,!igt_vma_pin1
      
      to run all but those named. Mixing a blacklist and whitelist will only
      execute those subtests matching the whitelist so long as they are
      previously excluded in the blacklist.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129185452.20989-1-chris@chris-wilson.co.uk
      06039d98
    • Rodrigo Vivi's avatar
      Merge drm/drm-next into drm-intel-next-queued · 8716ae72
      Rodrigo Vivi authored
      
      
      A backmerge to unblock gen8+ semaphores.
      
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      8716ae72
    • Ville Syrjälä's avatar
      drm/i915: Fix skl srckey mask bits · 968bf969
      Ville Syrjälä authored
      We're incorrectly masking off the R/V channel enable bit from
      KEYMSK. Fix it up.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Fixes: b2081525
      
       ("drm/i915: Add plane alpha blending support, v2.")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190125183846.28755-1-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      968bf969
  2. Jan 29, 2019
  3. Jan 28, 2019
  4. Jan 27, 2019
  5. Jan 26, 2019