History

drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE

This reverts commit 88be76cdafc7 ("drm/i915: Allow userspace to specify ringsize on construction"). This API was originally added for OpenCL but the compute-runtime PR has sat open for a year without action so we can still pull it out if we want. I argue we should drop it for three reasons: 1. If the compute-runtime PR has sat open for a year, this clearly isn't that important. 2. It's a very leaky API. Ring size is an implementation detail of the current execlist scheduler and really only makes sense there. It can't apply to the older ring-buffer scheduler on pre-execlist hardware because that's shared across all contexts and it won't apply to the GuC scheduler that's in the pipeline. 3. Having userspace set a ring size in bytes is a bad solution to the problem of having too small a ring. There is no way that userspace has the information to know how to properly set the ring size so it's just going to detect the feature and always set it to the maximum of 512K. This is what the compute-runtime PR does. The scheduler in i915, on the other hand, does have the information to make an informed choice. It could detect if the ring size is a problem and grow it itself. Or, if that's too hard, we could just increase the default size from 16K to 32K or even 64K instead of relying on userspace to do it. Let's drop this API for now and, if someone decides they really care about solving this problem, they can do it properly.

Jason Ekstrand committed 5 years ago

Commit fe4751c1 parent 520dfc85 files · +4 −168Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/drm/i915_drm.h+2−18
@@ -1722,24 +1722,8 @@ struct drm_i915_gem_context_param { · 1721 unmodified lines
1722 */1722 */
1723#define I915_CONTEXT_PARAM_PERSISTENCE 0xb1723#define I915_CONTEXT_PARAM_PERSISTENCE 0xb
1724 1724
1725/*1725/* This API has been removed. On the off chance someone somewhere has
1726 * I915_CONTEXT_PARAM_RINGSIZE:1726 * attempted to use it, never re-use this context param number.
1727 *
1728 * Sets the size of the CS ringbuffer to use for logical ring contexts. This
1729 * applies a limit of how many batches can be queued to HW before the caller
1730 * is blocked due to lack of space for more commands.
1731 *
1732 * Only reliably possible to be set prior to first use, i.e. during
1733 * construction. At any later point, the current execution must be flushed as
1734 * the ring can only be changed while the context is idle. Note, the ringsize
1735 * can be specified as a constructor property, see
1736 * I915_CONTEXT_CREATE_EXT_SETPARAM, but can also be set later if required.
1737 *
1738 * Only applies to the current set of engine and lost when those engines
1739 * are replaced by a new mapping (see I915_CONTEXT_PARAM_ENGINES).
1740 *
1741 * Must be between 4 - 512 KiB, in intervals of page size [4 KiB].
1742 * Default is 16 KiB.
1743 */1727 */
1744#define I915_CONTEXT_PARAM_RINGSIZE 0xc1728#define I915_CONTEXT_PARAM_RINGSIZE 0xc
1745/* Must be kept compact -- no holes and well documented */1729/* Must be kept compact -- no holes and well documented */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t