@@ -3043,6 +3043,14 @@ static int eb_request_add(struct i915_execbuffer *eb, struct i915_request *rq,
/* Check that the context wasn't destroyed before submission */
if (likely(!intel_context_is_closed(eb->context))) {
attr = eb->gem_context->sched;
+ /*
+ * Inherit process nice when scheduling user contexts but only
+ * if context has the default priority to avoid touching
+ * contexts where GEM uapi has been used to explicitly lower
+ * or elevate it.
+ */
+ if (attr.priority == I915_CONTEXT_DEFAULT_PRIORITY)
+ attr.priority = -task_nice(current);
} else {
/* Serialise with context_close via the add_to_timeline */
i915_request_set_error_once(rq, -ENOENT);