1. 30 Apr, 2019 9 commits
  2. 29 Apr, 2019 1 commit
  3. 26 Apr, 2019 25 commits
  4. 25 Apr, 2019 2 commits
  5. 24 Apr, 2019 3 commits
    • Chris Wilson's avatar
      drm/i915: Invert the GEM wakeref hierarchy · 79ffac85
      Chris Wilson authored
      In the current scheme, on submitting a request we take a single global
      GEM wakeref, which trickles down to wake up all GT power domains. This
      is undesirable as we would like to be able to localise our power
      management to the available power domains and to remove the global GEM
      operations from the heart of the driver. (The intent there is to push
      global GEM decisions to the boundary as used by the GEM user interface.)
      
      Now during request construction, each request is responsible via its
      logical context to acquire a wakeref on each power domain it intends to
      utilize. Currently, each request takes a wakeref on the engine(s) and
      the engines themselves take a chipset wakeref. This gives us a
      transition on each engine which we can extend if we want to insert more
      powermangement control (such as soft rc6). The global GEM operations
      that currently require a struct_mutex are reduced to listening to pm
      events from the chipset GT wakeref. As we reduce the struct_mutex
      requirement, these listeners should evaporate.
      
      Perhaps the biggest immediate change is that this removes the
      struct_mutex requirement around GT power management, allowing us greater
      flexibility in request construction. Another important knock-on effect,
      is that by tracking engine usage, we can insert a switch back to the
      kernel context on that engine immediately, avoiding any extra delay or
      inserting global synchronisation barriers. This makes tracking when an
      engine and its associated contexts are idle much easier -- important for
      when we forgo our assumed execution ordering and need idle barriers to
      unpin used contexts. In the process, it means we remove a large chunk of
      code whose only purpose was to switch back to the kernel context.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190424200717.1686-5-chris@chris-wilson.co.uk
      79ffac85
    • Chris Wilson's avatar
      drm/i915: Pass intel_context to i915_request_create() · 2ccdf6a1
      Chris Wilson authored
      Start acquiring the logical intel_context and using that as our primary
      means for request allocation. This is the initial step to allow us to
      avoid requiring struct_mutex for request allocation along the
      perma-pinned kernel context, but it also provides a foundation for
      breaking up the complex request allocation to handle different scenarios
      inside execbuf.
      
      For the purpose of emitting a request from inside retirement (see the
      next patch for engine power management), we also need to lift control
      over the timeline mutex to the caller.
      
      v2: Note that the request carries the active reference upon construction.
      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/20190424200717.1686-4-chris@chris-wilson.co.uk
      2ccdf6a1
    • Chris Wilson's avatar
      drm/i915: Introduce context->enter() and context->exit() · 6eee33e8
      Chris Wilson authored
      We wish to start segregating the power management into different control
      domains, both with respect to the hardware and the user interface. The
      first step is that at the lowest level flow of requests, we want to
      process a context event (and not a global GEM operation). In this patch,
      we introduce the context callbacks that in future patches will be
      redirected to per-engine interfaces leading to global operations as
      required.
      
      The intent is that this will be guarded by the timeline->mutex, except
      that retiring has not quite finished transitioning over from being
      guarded by struct_mutex. So at the moment it is protected by
      struct_mutex with a reminded to switch.
      
      v2: Rename default handlers to intel_context_enter_engine.
      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/20190424200717.1686-3-chris@chris-wilson.co.uk
      6eee33e8