/* * SPDX-License-Identifier: MIT * * Copyright © 2018 Intel Corporation */ #ifndef _I915_SCHEDULER_TYPES_H_ #define _I915_SCHEDULER_TYPES_H_ #include <linux/list.h> #include "gt/intel_engine_types.h" #include "i915_priolist_types.h" struct drm_i915_private; struct i915_request; struct intel_engine_cs; struct i915_sched_attr { … }; /* * "People assume that time is a strict progression of cause to effect, but * actually, from a nonlinear, non-subjective viewpoint, it's more like a big * ball of wibbly-wobbly, timey-wimey ... stuff." -The Doctor, 2015 * * Requests exist in a complex web of interdependencies. Each request * has to wait for some other request to complete before it is ready to be run * (e.g. we have to wait until the pixels have been rendering into a texture * before we can copy from it). We track the readiness of a request in terms * of fences, but we also need to keep the dependency tree for the lifetime * of the request (beyond the life of an individual fence). We use the tree * at various points to reorder the requests whilst keeping the requests * in order with respect to their various dependencies. * * There is no active component to the "scheduler". As we know the dependency * DAG of each request, we are able to insert it into a sorted queue when it * is ready, and are able to reorder its portion of the graph to accommodate * dynamic priority changes. * * Ok, there is now one active element to the "scheduler" in the backends. * We let a new context run for a small amount of time before re-evaluating * the run order. As we re-evaluate, we maintain the strict ordering of * dependencies, but attempt to rotate the active contexts (the current context * is put to the back of its priority queue, then reshuffling its dependents). * This provides minimal timeslicing and prevents a userspace hog (e.g. * something waiting on a user semaphore [VkEvent]) from denying service to * others. */ struct i915_sched_node { … }; struct i915_dependency { … }; #define for_each_waiter(p__, rq__) … #define for_each_signaler(p__, rq__) … /** * struct i915_sched_engine - scheduler engine * * A schedule engine represents a submission queue with different priority * bands. It contains all the common state (relative to the backend) to queue, * track, and submit a request. * * This object at the moment is quite i915 specific but will transition into a * container for the drm_gpu_scheduler plus a few other variables once the i915 * is integrated with the DRM scheduler. */ struct i915_sched_engine { … }; #endif /* _I915_SCHEDULER_TYPES_H_ */