Skip to content
Snippets Groups Projects
Select Git revision
  • bc9ebca2daeb132a6375700f41bd65d87794e9c7
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

intel_lrc.c

Blame
  • intel_lrc.c 77.25 KiB
    /*
     * Copyright © 2014 Intel Corporation
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
     * to deal in the Software without restriction, including without limitation
     * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     * and/or sell copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice (including the next
     * paragraph) shall be included in all copies or substantial portions of the
     * Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     * IN THE SOFTWARE.
     *
     * Authors:
     *    Ben Widawsky <ben@bwidawsk.net>
     *    Michel Thierry <michel.thierry@intel.com>
     *    Thomas Daniel <thomas.daniel@intel.com>
     *    Oscar Mateo <oscar.mateo@intel.com>
     *
     */
    
    /**
     * DOC: Logical Rings, Logical Ring Contexts and Execlists
     *
     * Motivation:
     * GEN8 brings an expansion of the HW contexts: "Logical Ring Contexts".
     * These expanded contexts enable a number of new abilities, especially
     * "Execlists" (also implemented in this file).
     *
     * One of the main differences with the legacy HW contexts is that logical
     * ring contexts incorporate many more things to the context's state, like
     * PDPs or ringbuffer control registers:
     *
     * The reason why PDPs are included in the context is straightforward: as
     * PPGTTs (per-process GTTs) are actually per-context, having the PDPs
     * contained there mean you don't need to do a ppgtt->switch_mm yourself,
     * instead, the GPU will do it for you on the context switch.
     *
     * But, what about the ringbuffer control registers (head, tail, etc..)?
     * shouldn't we just need a set of those per engine command streamer? This is
     * where the name "Logical Rings" starts to make sense: by virtualizing the
     * rings, the engine cs shifts to a new "ring buffer" with every context
     * switch. When you want to submit a workload to the GPU you: A) choose your
     * context, B) find its appropriate virtualized ring, C) write commands to it
     * and then, finally, D) tell the GPU to switch to that context.
     *
     * Instead of the legacy MI_SET_CONTEXT, the way you tell the GPU to switch
     * to a contexts is via a context execution list, ergo "Execlists".
     *
     * LRC implementation:
     * Regarding the creation of contexts, we have:
     *
     * - One global default context.
     * - One local default context for each opened fd.
     * - One local extra context for each context create ioctl call.
     *
     * Now that ringbuffers belong per-context (and not per-engine, like before)
     * and that contexts are uniquely tied to a given engine (and not reusable,
     * like before) we need:
     *
     * - One ringbuffer per-engine inside each context.