Skip to content

Commit 6f2f7c8

Browse files
committed
Merge tag 'drm-intel-gt-next-2021-10-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
UAPI Changes: - Expose multi-LRC submission interface Similar to the bonded submission interface but simplified. Comes with GuC only implementation for now. See kerneldoc for more details. Userspace changes: intel/media-driver#1252 - Expose logical engine instance to user Needed by the multi-LRC submission interface for GuC Userspace changes: intel/media-driver#1252 Driver Changes: - Fix blank screen booting crashes when CONFIG_CC_OPTIMIZE_FOR_SIZE=y (Hugh) - Add support for multi-LRC submission in the GuC backend (Matt B) - Add extra cache flushing before making pages userspace visible (Matt A, Thomas) - Mark internal GPU object pages dirty so they will be flushed properly (Matt A) - Move remaining debugfs interfaces i915_wedged/i915_forcewake_user into gt (Andi) - Replace the unconditional clflushes with drm_clflush_virt_range() (Ville) - Remove IS_ACTIVE macro completely (Lucas) - Improve kerneldocs for cache_dirty (Matt A) - Add missing includes (Lucas) - Selftest improvements (Matt R, Ran, Matt A) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/YXFmLKoq8Fg9JxSd@jlahtine-mobl.ger.corp.intel.com
2 parents 94ff371 + ab5d964 commit 6f2f7c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3231
-764
lines changed

Documentation/gpu/rfc/i915_parallel_execbuf.h

Lines changed: 0 additions & 122 deletions
This file was deleted.

Documentation/gpu/rfc/i915_scheduler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ Add I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT and
135135
drm_i915_context_engines_parallel_submit to the uAPI to implement this
136136
extension.
137137

138-
.. kernel-doc:: Documentation/gpu/rfc/i915_parallel_execbuf.h
139-
:functions: drm_i915_context_engines_parallel_submit
138+
.. kernel-doc:: include/uapi/drm/i915_drm.h
139+
:functions: i915_context_engines_parallel_submit
140140

141141
Extend execbuf2 IOCTL to support submitting N BBs in a single IOCTL
142142
-------------------------------------------------------------------

drivers/gpu/drm/i915/gem/i915_gem_busy.c

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright © 2014-2016 Intel Corporation
55
*/
66

7+
#include <linux/dma-fence-array.h>
8+
79
#include "gt/intel_engine.h"
810

911
#include "i915_gem_ioctls.h"
@@ -36,7 +38,7 @@ static __always_inline u32 __busy_write_id(u16 id)
3638
}
3739

3840
static __always_inline unsigned int
39-
__busy_set_if_active(const struct dma_fence *fence, u32 (*flag)(u16 id))
41+
__busy_set_if_active(struct dma_fence *fence, u32 (*flag)(u16 id))
4042
{
4143
const struct i915_request *rq;
4244

@@ -46,29 +48,60 @@ __busy_set_if_active(const struct dma_fence *fence, u32 (*flag)(u16 id))
4648
* to eventually flush us, but to minimise latency just ask the
4749
* hardware.
4850
*
49-
* Note we only report on the status of native fences.
51+
* Note we only report on the status of native fences and we currently
52+
* have two native fences:
53+
*
54+
* 1. A composite fence (dma_fence_array) constructed of i915 requests
55+
* created during a parallel submission. In this case we deconstruct the
56+
* composite fence into individual i915 requests and check the status of
57+
* each request.
58+
*
59+
* 2. A single i915 request.
5060
*/
51-
if (!dma_fence_is_i915(fence))
61+
if (dma_fence_is_array(fence)) {
62+
struct dma_fence_array *array = to_dma_fence_array(fence);
63+
struct dma_fence **child = array->fences;
64+
unsigned int nchild = array->num_fences;
65+
66+
do {
67+
struct dma_fence *current_fence = *child++;
68+
69+
/* Not an i915 fence, can't be busy per above */
70+
if (!dma_fence_is_i915(current_fence) ||
71+
!test_bit(I915_FENCE_FLAG_COMPOSITE,
72+
&current_fence->flags)) {
73+
return 0;
74+
}
75+
76+
rq = to_request(current_fence);
77+
if (!i915_request_completed(rq))
78+
return flag(rq->engine->uabi_class);
79+
} while (--nchild);
80+
81+
/* All requests in array complete, not busy */
5282
return 0;
83+
} else {
84+
if (!dma_fence_is_i915(fence))
85+
return 0;
5386

54-
/* opencode to_request() in order to avoid const warnings */
55-
rq = container_of(fence, const struct i915_request, fence);
56-
if (i915_request_completed(rq))
57-
return 0;
87+
rq = to_request(fence);
88+
if (i915_request_completed(rq))
89+
return 0;
5890

59-
/* Beware type-expansion follies! */
60-
BUILD_BUG_ON(!typecheck(u16, rq->engine->uabi_class));
61-
return flag(rq->engine->uabi_class);
91+
/* Beware type-expansion follies! */
92+
BUILD_BUG_ON(!typecheck(u16, rq->engine->uabi_class));
93+
return flag(rq->engine->uabi_class);
94+
}
6295
}
6396

6497
static __always_inline unsigned int
65-
busy_check_reader(const struct dma_fence *fence)
98+
busy_check_reader(struct dma_fence *fence)
6699
{
67100
return __busy_set_if_active(fence, __busy_read_flag);
68101
}
69102

70103
static __always_inline unsigned int
71-
busy_check_writer(const struct dma_fence *fence)
104+
busy_check_writer(struct dma_fence *fence)
72105
{
73106
if (!fence)
74107
return 0;

0 commit comments

Comments
 (0)